Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Drop esm module for a bundle of shadycss
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Sep 12, 2018
1 parent 61c832a commit c9b31bb
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib/polymer-styling.js
lib/bundled-shadycss.js
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
bower_components
node_modules
test/shadow
test/shady
test/webcomponentsjs
.vscode
example
node_modules
tests/generated
lib/bundled-shadycss.js
8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

28 changes: 28 additions & 0 deletions dev/shadycss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**!
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* @fileoverview
*
* A library that bundles all the parts of ShadyCSS that polymer-css-build
* needs.
*/

import * as StyleUtil from '@webcomponents/shadycss/src/style-util.js';
import * as CssParse from '@webcomponents/shadycss/src/css-parse.js';

export {default as StyleTransformer} from '@webcomponents/shadycss/src/style-transformer.js';
export {default as ApplyShim} from '@webcomponents/shadycss/src/apply-shim.js';
export {scopingAttribute as ShadyUnscopedAttribute} from '@webcomponents/shadycss/src/unscoped-style-handler.js';

export {StyleUtil, CssParse};
8 changes: 1 addition & 7 deletions lib/shadycss-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* Load ShadyCSS
*/
function loadShadyCSS(nativeShadow) {
/* enable ES Modules from @webcomponents/shadycss */
require = require('esm')(module); //eslint-disable-line no-global-assign

/**
* Boilerplate for using ShadyCSS in a Node context
*/
Expand All @@ -27,10 +24,7 @@ function loadShadyCSS(nativeShadow) {
}
};

const StyleTransformer = require('@webcomponents/shadycss/src/style-transformer.js').default;
const StyleUtil = require('@webcomponents/shadycss/src/style-util.js');
const ApplyShim = require('@webcomponents/shadycss/src/apply-shim.js').default;
const CssParse = require('@webcomponents/shadycss/src/css-parse.js');
const {StyleTransformer, StyleUtil, ApplyShim, CssParse} = require('./bundled-shadycss.js');

/**
* Apply Shim uses a dynamically create DOM element
Expand Down
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,28 @@
"polymer-css-build": "bin/polymer-css-build"
},
"scripts": {
"lint": "eslint **/*.js",
"lint": "eslintG **/*.js",
"prepare-tests": "./tests/prepare-tests.sh",
"test": "npm run lint && npm run prepare-tests && wct"
"test": "npm run lint && npm run prepare-tests && wct",
"bundle": "rollup -c rollup.config.js"
},
"author": "The Polymer Authors",
"license": "BSD-3-Clause",
"devDependencies": {
"@webcomponents/shadycss": "^1.5.0",
"babel-eslint": "^8.2.6",
"bower": "^1.8.4",
"eslint": "^4.19.1",
"eslint-plugin-html": "^4.0.5",
"rollup": "^0.65.2",
"rollup-plugin-node-resolve": "^3.4.0",
"wct-browser-legacy": "^1.0.1",
"web-component-tester": "^6.7.1"
},
"dependencies": {
"@webcomponents/shadycss": "^1.3.5",
"command-line-args": "^5.0.2",
"command-line-usage": "^5.0.5",
"dom5": "^3.0.1",
"esm": "^3.0.72",
"polymer-analyzer": "2.7 - 3"
},
"directories": {
Expand All @@ -43,5 +45,14 @@
"bugs": {
"url": "https://github.com/PolymerLabs/polymer-css-build/issues"
},
"homepage": "https://github.com/PolymerLabs/polymer-css-build#readme"
"homepage": "https://github.com/PolymerLabs/polymer-css-build#readme",
"files": [
"package.json",
"index.js",
"README",
"CHANGELOG.md",
"LICENSE",
"bin/*",
"lib/*"
]
}
25 changes: 25 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
import resolve from 'rollup-plugin-node-resolve';

export default {
input: 'dev/shadycss.js',
output: {
file: 'lib/bundled-shadycss.js',
format: 'cjs'
},
plugins: [
resolve()
]
};

0 comments on commit c9b31bb

Please sign in to comment.