Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit 2674fa3

Browse files
committed
initial import from shadycss
0 parents  commit 2674fa3

12 files changed

+1207
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
apply-shim.min.* binary

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
bower_components

apply-shim.min.js

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apply-shim.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "shadycss",
3+
"main": "shadycss.min.js",
4+
"authors": [
5+
"The Polymer Authors"
6+
],
7+
"license": "BSD-3-Clause",
8+
"keywords": [
9+
"webcomponents"
10+
],
11+
"homepage": "https://github.com/webcomponents/shadycss",
12+
"ignore": [
13+
"**/.*",
14+
"node_modules",
15+
"bower_components",
16+
"test",
17+
"tests"
18+
],
19+
"dependencies": {
20+
"custom-elements": "webcomponents/custom-elements#master"
21+
},
22+
"devDependencies": {
23+
"web-component-tester": "^4.3.5",
24+
"webcomponentsjs": "webcomponents/webcomponentsjs#v1"
25+
}
26+
}

gulpfile.js

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/**
2+
* @license
3+
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4+
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5+
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6+
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7+
* Code distributed by Google as part of the polymer project is also
8+
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9+
*/
10+
11+
'use strict';
12+
13+
/* eslint-env node */
14+
/* eslint-disable no-console */
15+
16+
const gulp = require('gulp');
17+
const sourcemaps = require('gulp-sourcemaps');
18+
const del = require('del');
19+
const rename = require('gulp-rename');
20+
const rollup = require('rollup-stream');
21+
const buffer = require('vinyl-buffer');
22+
const source = require('vinyl-source-stream');
23+
const closure = require('google-closure-compiler').gulp();
24+
const size = require('gulp-size');
25+
const runseq = require('run-sequence');
26+
27+
const modules = [
28+
'css-parse',
29+
'custom-style-element',
30+
'make-element',
31+
'svg-in-shadow'
32+
];
33+
34+
const moduleTasks = modules.map((m) => {
35+
gulp.task(`test-module-${m}`, () => {
36+
return rollup({
37+
entry: `tests/module/${m}.js`,
38+
format: 'iife',
39+
moduleName: m
40+
})
41+
.pipe(source(`${m}.js`, 'tests/module'))
42+
.pipe(gulp.dest('./tests/module/generated'))
43+
});
44+
return `test-module-${m}`;
45+
});
46+
47+
gulp.task('clean-test-modules', () => del(['tests/module/generated']));
48+
49+
gulp.task('test-modules', (cb) => {
50+
runseq('clean-test-modules', moduleTasks, cb);
51+
});
52+
53+
gulp.task('default', ['closure']);
54+
55+
gulp.task('closure', () => {
56+
return gulp.src('src/*.js')
57+
.pipe(sourcemaps.init())
58+
.pipe(closure({
59+
new_type_inf: true,
60+
compilation_level: 'ADVANCED',
61+
language_in: 'ES6_STRICT',
62+
language_out: 'ES5_STRICT',
63+
output_wrapper: '(function(){\n%output%\n}).call(self)',
64+
js_output_file: 'apply-shim.min.js',
65+
entry_point: '/src/apply-shim.js',
66+
dependency_mode: 'STRICT',
67+
warning_level: 'VERBOSE',
68+
rewrite_polyfills: false,
69+
// externs: ['externs/shadycss-externs.js']
70+
// formatting: 'PRETTY_PRINT'
71+
}))
72+
.pipe(size({showFiles: true, showTotal: false, gzip: true}))
73+
.pipe(sourcemaps.write('.'))
74+
.pipe(gulp.dest('.'))
75+
});
76+
77+
gulp.task('debug', () => {
78+
return rollup({
79+
entry: 'src/apply-shim.js',
80+
format: 'iife',
81+
moduleName: 'applyshim',
82+
sourceMap: true
83+
})
84+
.pipe(source('apply-shim.js', 'src'))
85+
.pipe(buffer())
86+
.pipe(sourcemaps.init({loadMaps: true}))
87+
.pipe(rename('apply-shim.min.js'))
88+
.pipe(size({showFiles: true, showTotal: false, gzip: true}))
89+
.pipe(sourcemaps.write('.'))
90+
.pipe(gulp.dest('./'))
91+
});

package.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "@webcomponents/apply-shim",
3+
"version": "0.0.1",
4+
"description": "Shim for CSS @apply",
5+
"main": "apply-shim.min.js",
6+
"directories": {
7+
"test": "tests"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/webcomponents/apply-shim.git"
12+
},
13+
"author": "The Polymer Authors",
14+
"license": "BSD-3-Clause",
15+
"bugs": {
16+
"url": "https://github.com/webcomponents/apply-shim/issues"
17+
},
18+
"scripts": {
19+
"build": "gulp",
20+
"lint": "eslint src test",
21+
"test": "npm run lint && gulp test-modules && wct"
22+
},
23+
"homepage": "http://webcomponents.org",
24+
"devDependencies": {
25+
"del": "^2.2.2",
26+
"eslint": "^3.4.0",
27+
"eslint-plugin-html": "^2.0.0",
28+
"google-closure-compiler": "^20170124.0.0",
29+
"gulp": "^3.8.8",
30+
"gulp-rename": "^1.2.2",
31+
"gulp-size": "^2.1.0",
32+
"gulp-sourcemaps": "^2.4.0",
33+
"rollup-stream": "^1.14.0",
34+
"run-sequence": "^1.2.2",
35+
"vinyl-buffer": "^1.0.0",
36+
"vinyl-source-stream": "^1.1.0",
37+
"web-component-tester": "^6.0.0-prerelease.4"
38+
}
39+
}

0 commit comments

Comments
 (0)