Skip to content

Commit

Permalink
feat: add cem analyzer
Browse files Browse the repository at this point in the history
closes #48
  • Loading branch information
bennypowers committed Aug 18, 2021
1 parent 2096f4a commit a630f99
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/generators/building-rollup-ts/templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"build": "rimraf dist && tsc && rollup -c rollup.config.js",
"build": "rimraf dist && tsc && rollup -c rollup.config.js && <%= scriptRunCommand %> analyze",
"start:build": "web-dev-server --root-dir dist --app-index index.html --open"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/building-rollup/templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"build": "rimraf dist && rollup -c rollup.config.js",
"build": "rimraf dist && rollup -c rollup.config.js && <%= scriptRunCommand %> analyze",
"start:build": "web-dev-server --root-dir dist --app-index index.html --open"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/generators/common-repo/templates/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
/dist/
/out-tsc/

storybook-static
storybook-static
custom-elements.json
9 changes: 8 additions & 1 deletion src/generators/common-repo/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"version": "0.0.0",
"description": "Webcomponent <%= tagName %> following open-wc recommendations",
"author": "<%= tagName %>",
"license": "MIT"
"license": "MIT",
"customElements": "custom-elements.json",
"scripts": {
"analyze": "cem analyze"
},
"devDependencies": {
"@custom-elements-manifest/analyzer": "^0.4.17"
}
}
4 changes: 2 additions & 2 deletions src/generators/demoing-storybook-ts/templates/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"scripts": {
"storybook": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
"storybook:build": "tsc && build-storybook"
"storybook": "tsc && <%= scriptRunCommand %> analyze && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
"storybook:build": "tsc && <%= scriptRunCommand %> analyze && build-storybook"
},
"devDependencies": {
"@web/dev-server-storybook": "next"
Expand Down
4 changes: 2 additions & 2 deletions src/generators/demoing-storybook/templates/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"scripts": {
"storybook": "web-dev-server -c .storybook/server.mjs",
"storybook:build": "build-storybook"
"storybook": "<%= scriptRunCommand %> analyze && web-dev-server -c .storybook/server.mjs",
"storybook:build": "<%= scriptRunCommand %> analyze && build-storybook"
},
"devDependencies": {
"@web/dev-server-storybook": "next"
Expand Down
4 changes: 2 additions & 2 deletions src/generators/wc-lit-element-ts/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"scripts": {
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
"build": "tsc",
"prepublish": "tsc"
"build": "tsc && <%= scriptRunCommand %> analyze",
"prepublish": "tsc && <%= scriptRunCommand %> analyze"
},
"dependencies": {
"lit": "^2.0.0-rc.2"
Expand Down
2 changes: 2 additions & 0 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,6 @@ describe('create', function create() {
expect(errorCountTotal, 'error count').to.equal(0, prettyOutput);
expect(warningCountTotal, 'warning count').to.equal(0, prettyOutput);
});

it('')
});

0 comments on commit a630f99

Please sign in to comment.