@blockquote/create-wc 1.6.2 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockquote/create-wc",
3
- "version": "1.6.2",
3
+ "version": "1.6.6",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "LitElement",
@@ -1,14 +1,21 @@
1
1
  {
2
+ "scripts": {
3
+ "format": "npm run format:eslint && npm run format:prettier && npm run format:stylelint",
4
+ "format:eslint": "eslint \"**/*.{js,ts,html}\" --fix --ignore-path .eslintignore",
5
+ "format:prettier": "prettier \"**/*.{js,ts,json,html,md}\" --write --ignore-path .eslintignore",
6
+ "format:stylelint": "stylelint \"**/*.{scss,css}\" --fix --allow-empty-input --ignore-path .eslintignore",
7
+ "lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:stylelint",
8
+ "lint:eslint": "eslint \"**/*.{js,ts,html}\" --ignore-path .eslintignore",
9
+ "lint:prettier": "prettier \"**/*.{js,ts,json,html,md}\" --check --ignore-path .eslintignore",
10
+ "lint:stylelint": "stylelint \"**/*.{scss,css}\" --allow-empty-input --ignore-path .eslintignore"
11
+ },
2
12
  "husky": {
3
13
  "hooks": {
4
14
  "pre-commit": "lint-staged"
5
15
  }
6
16
  },
7
17
  "lint-staged": {
8
- "index.*": [
9
- "npm run format:eslint"
10
- ],
11
- "{src,define,test}/**/*.{js,ts,json,html}": [
18
+ "**/*.{js,ts,html}": [
12
19
  "npm run format:eslint"
13
20
  ],
14
21
  "**/*.{js,ts,json,html,md}": [
@@ -18,13 +25,21 @@
18
25
  "npm run format:stylelint"
19
26
  ]
20
27
  },
28
+ "prettier": {
29
+ "arrowParens": "avoid",
30
+ "printWidth": 100,
31
+ "singleQuote": true,
32
+ "trailingComma": "all"
33
+ },
21
34
  "eslintConfig": {
35
+ "plugins": [
36
+ "log-filenames"
37
+ ],
22
38
  "extends": [
23
39
  "prettier",
24
40
  "@open-wc"
25
41
  ],
26
42
  "rules": {
27
- "import/no-unresolved": "off",
28
43
  "class-methods-use-this": "off",
29
44
  "object-curly-newline": "off",
30
45
  "import/extensions": [
@@ -33,34 +48,36 @@
33
48
  {
34
49
  "ignorePackages": true
35
50
  }
36
- ]
51
+ ],
52
+ "import/no-extraneous-dependencies": [
53
+ "error",
54
+ {
55
+ "devDependencies": [
56
+ "**/test/**/*.{js,ts}",
57
+ "**/*.config.{js,mjs,cjs}",
58
+ "**/*.conf.{js,mjs,cjs}"
59
+ ]
60
+ }
61
+ ],
62
+ "import/no-unresolved": "off",
63
+ "import/prefer-default-export": "off"
37
64
  }
38
65
  },
39
- "prettier": {
40
- "arrowParens": "avoid",
41
- "singleQuote": true,
42
- "trailingComma": "all"
43
- },
44
66
  "stylelint": {
45
- "extends": "stylelint-config-standard-scss"
46
- },
47
- "scripts": {
48
- "format": "npm run format:eslint && npm run format:prettier && npm run format:stylelint",
49
- "format:eslint": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\" --fix --ignore-path .gitignore",
50
- "format:prettier": "prettier \"**/*.{js,ts,json,html,md}\" --write --ignore-path .gitignore",
51
- "format:stylelint": "stylelint --fix --allow-empty-input --ignore-path .gitignore \"**/*.{scss,css}\"",
52
- "lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:stylelint",
53
- "lint:eslint": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\" --ignore-path .gitignore",
54
- "lint:prettier": "prettier \"**/*.{js,ts,json,html,md}\" --check --ignore-path .gitignore",
55
- "lint:stylelint": "stylelint --allow-empty-input --ignore-path .gitignore \"**/*.{scss,css}\""
67
+ "extends": "stylelint-config-standard-scss",
68
+ "rules": {
69
+ "custom-property-pattern": null,
70
+ "max-line-length": null
71
+ }
56
72
  },
57
73
  "devDependencies": {
58
- "eslint": "^8.0.0",
59
74
  "@open-wc/eslint-config": "^7.0.0",
75
+ "eslint": "^8.0.0",
76
+ "eslint-config-prettier": "^8.3.0",
77
+ "eslint-plugin-log-filenames": "^1.0.4",
60
78
  "husky": "^4.3.8",
61
79
  "lint-staged": "^12.0.0",
62
80
  "prettier": "^2.4.1",
63
- "eslint-config-prettier": "^8.3.0",
64
81
  "stylelint": "^14.0.0",
65
82
  "stylelint-config-standard-scss": "^3.0.0"
66
83
  }
@@ -22,8 +22,8 @@ export const CommonRepoMixin = (subclass) =>
22
22
  this.destinationPath('package.json'),
23
23
  );
24
24
 
25
- // write & rename el scss template
26
- this.copyTemplate(
25
+ // write & rename el scss template
26
+ this.copyTemplate(
27
27
  `${__dirname}/templates/styles/MyEl.scss`,
28
28
  this.destinationPath(`src/styles/${className}.scss`),
29
29
  );
@@ -31,6 +31,9 @@ export const CommonRepoMixin = (subclass) =>
31
31
  // write and rename .gitignore
32
32
  this.copyTemplate(`${__dirname}/templates/gitignore`, this.destinationPath(`.gitignore`));
33
33
 
34
+ // write and rename .gitignore
35
+ this.copyTemplate(`${__dirname}/templates/eslintignore`, this.destinationPath(`.eslintignore`));
36
+
34
37
  // copy all other files
35
38
  await this.copyTemplates(`${__dirname}/templates/static/**/*`);
36
39
  }
@@ -0,0 +1,41 @@
1
+ ## editors
2
+ /.idea
3
+ /.vscode
4
+ /*.code-workspace
5
+
6
+ ## system files
7
+ .DS_Store
8
+
9
+ ## npm/yarn
10
+ node_modules
11
+ npm-debug.log
12
+ *-debug.log
13
+ yarn-error.log
14
+
15
+ ## testing
16
+ coverage
17
+ **/coverage/
18
+ reports
19
+ __snapshots__
20
+ screenshots/.current
21
+ screenshots/.diff
22
+
23
+
24
+ ## build
25
+ *.config.js
26
+ _site
27
+ dist
28
+ dev
29
+ build
30
+ .tmp
31
+ *.tgz
32
+ *.tsbuildinfo
33
+ storybook-static
34
+ ## end gitignore
35
+
36
+ ## specific eslintignore
37
+ package-lock.json
38
+ *.min.js
39
+ *-styles.js
40
+ *-styles.ts
41
+ CHANGELOG.md
@@ -1,41 +1,33 @@
1
1
  ## editors
2
2
  /.idea
3
3
  /.vscode
4
+ /*.code-workspace
4
5
 
5
6
  ## system files
6
7
  .DS_Store
7
8
 
8
- ## npm
9
- /node_modules/
10
- /npm-debug.log
9
+ ## npm/yarn
10
+ node_modules
11
+ npm-debug.log
11
12
  *-debug.log
13
+ yarn-error.log
12
14
 
13
15
  ## testing
14
- /coverage/
16
+ coverage
15
17
  **/coverage/
16
- /reports/
18
+ reports
17
19
  __snapshots__
20
+ screenshots/.current
21
+ screenshots/.diff
18
22
 
19
- ## temp folders
20
- /.tmp/
21
23
 
22
24
  ## build
23
25
  *.config.js
24
- /_site/
25
- /dist/
26
- /dev/
27
- /build/
28
- /out-tsc/
29
- *.min.js
30
- *-styles.js
31
- **/*/CHANGELOG.md
26
+ _site
27
+ dist
28
+ dev
29
+ build
30
+ .tmp
31
+ *.tgz
32
+ *.tsbuildinfo
32
33
  storybook-static
33
-
34
- /packages/*/node_modules
35
- /packages/*/package-lock.json
36
- /packages/*/build
37
- /packages/*/dev
38
- /packages/*/dist
39
- /packages/*/.gitignore
40
- /packages/*/.editorconfig
41
- /packages/*/Jenkinsfile
@@ -33,7 +33,7 @@
33
33
  "@web/rollup-plugin-html": "^1.10.1",
34
34
  "@webcomponents/shadycss": "^1.11.0",
35
35
  "@webcomponents/webcomponentsjs": "^2.6.0",
36
- "concurrently": "^6.4.0",
36
+ "concurrently": "^7.0.0",
37
37
  "rollup-plugin-copy": "^3.4.0",
38
38
  "rollup-plugin-summary": "^1.3.0",
39
39
  "rollup-plugin-minify-html-literals": "^1.2.6",
@@ -57,26 +57,6 @@ const copyConfig = {
57
57
  */
58
58
 
59
59
  export default defineConfig({
60
- plugins: [
61
- pluginHtml({
62
- transformHtml: [
63
- html =>
64
- html.replace(
65
- '<meta charset="utf-8">',
66
- `<meta charset="utf-8">
67
- <script src="./web_modules/@ungap/global-this/index.js"></script>
68
- <script src="./web_modules/tiny-array-flat-polyfill/tiny-array-flat-polyfill.min.js"></script>
69
- <script src="./web_modules/lit/polyfill-support.js"></script>
70
- <script src="./web_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
71
- <script src="./web_modules/@webcomponents/shadycss/custom-style-interface.min.js"></script>`,
72
- ),
73
- ],
74
- }),
75
-
76
- minifyHTML(minifyHTMLLiteralsConfig),
77
- copy(copyConfig),
78
- summary(),
79
- ],
80
60
  build: {
81
61
  target: ['edge18'],
82
62
  outDir: 'dev',
@@ -86,6 +66,25 @@ export default defineConfig({
86
66
  dir: 'dev/',
87
67
  format: 'es',
88
68
  },
69
+ plugins: [
70
+ pluginHtml({
71
+ transformHtml: [
72
+ html =>
73
+ html.replace(
74
+ '<meta charset="utf-8">',
75
+ `<meta charset="utf-8">
76
+ <script src="./web_modules/@ungap/global-this/index.js"></script>
77
+ <script src="./web_modules/tiny-array-flat-polyfill/tiny-array-flat-polyfill.min.js"></script>
78
+ <script src="./web_modules/lit/polyfill-support.js"></script>
79
+ <script src="./web_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
80
+ <script src="./web_modules/@webcomponents/shadycss/custom-style-interface.min.js"></script>`,
81
+ ),
82
+ ],
83
+ }),
84
+ minifyHTML(minifyHTMLLiteralsConfig),
85
+ copy(copyConfig),
86
+ summary(),
87
+ ],
89
88
  },
90
89
  },
91
90
  });
@@ -12,5 +12,4 @@
12
12
  *::before,
13
13
  *::after {
14
14
  box-sizing: inherit;
15
- white-space: nowrap;
16
15
  }
@@ -1,17 +1,28 @@
1
1
  {
2
- "devDependencies": {
3
- "@typescript-eslint/parser": "^5.0.0",
4
- "@typescript-eslint/eslint-plugin": "^5.0.0"
5
- },
6
2
  "eslintConfig": {
7
3
  "parser": "@typescript-eslint/parser",
8
4
  "plugins": [
9
5
  "@typescript-eslint"
10
6
  ],
11
7
  "rules": {
12
- "indent": ["error", 2, { "SwitchCase": 1, "ignoredNodes": ["PropertyDefinition"] }],
8
+ "indent": [
9
+ "error",
10
+ 2,
11
+ {
12
+ "SwitchCase": 1,
13
+ "ignoredNodes": [
14
+ "PropertyDefinition"
15
+ ]
16
+ }
17
+ ],
13
18
  "no-unused-vars": "off",
14
- "@typescript-eslint/no-unused-vars": ["error"]
19
+ "@typescript-eslint/no-unused-vars": [
20
+ "error"
21
+ ]
15
22
  }
23
+ },
24
+ "devDependencies": {
25
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
26
+ "@typescript-eslint/parser": "^5.0.0"
16
27
  }
17
28
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@open-wc/testing": "next",
4
- "@web/test-runner": "next"
3
+ "@open-wc/testing": "^3.0.3",
4
+ "@web/test-runner": "^0.13.23",
5
+ "@web/test-runner-playwright": "^0.8.8"
5
6
  }
6
7
  }
@@ -43,9 +43,7 @@ export class <%= className %> extends LitElement {
43
43
 
44
44
  _onClick() {
45
45
  this.counter += 1;
46
- this.dispatchEvent(
47
- new CustomEvent('counter-changed', { detail: this.counter }),
48
- );
46
+ this.dispatchEvent(new CustomEvent('counter-changed', { detail: this.counter }));
49
47
  }
50
48
 
51
49
  /**
@@ -8,9 +8,9 @@
8
8
  "!/**/*.scss"
9
9
  ],
10
10
  "scripts": {
11
- "start:wds": "concurrently -k -r \"npm:sass:watch\" \"npm:wds\"",
12
- "wds": "web-dev-server",
11
+ "build": "echo \"This is not a TypeScript project, so no need to build.\"",
13
12
  "sass:watch": "sass-style-template",
14
- "build": "echo \"This is not a TypeScript project, so no need to build.\""
13
+ "start:wds": "concurrently -k -r \"npm:sass:watch\" \"npm:wds\"",
14
+ "wds": "web-dev-server"
15
15
  }
16
16
  }
@@ -1,6 +1,8 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
+ <title>Demo <%= tagName %></title>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
4
6
  <meta charset="utf-8" />
5
7
  <style>
6
8
  body {
@@ -17,10 +19,10 @@
17
19
 
18
20
  const heading = 'World!';
19
21
  render(
20
- html`<pe-pe
22
+ html`<<%= tagName %>
21
23
  @counter-changed="${ev => console.log('==>', ev.detail)}"
22
24
  .heading=${heading}
23
- >some light-dom</pe-pe
25
+ >some light-dom</<%= tagName %>
24
26
  >`,
25
27
  document.querySelector('#demo'),
26
28
  );
@@ -32,7 +32,7 @@ export class <%= className %> extends LitElement {
32
32
 
33
33
  private _onClick() {
34
34
  this.counter += 1;
35
- this.dispatchEvent(new CustomEvent('counter-changed'));
35
+ this.dispatchEvent(new CustomEvent('counter-changed', { detail: this.counter }));
36
36
  }
37
37
 
38
38
  /**
@@ -1,4 +1,8 @@
1
1
  {
2
+ "exports": {
3
+ ".": "./dist/index.js",
4
+ "./<%= tagName %>.js": "./dist/define/<%= tagName %>.js"
5
+ },
2
6
  "main": "dist/index.js",
3
7
  "module": "dist/index.js",
4
8
  "files": [
@@ -6,19 +10,15 @@
6
10
  "/dist/index.*",
7
11
  "!/dist/test/"
8
12
  ],
9
- "exports": {
10
- ".": "./dist/index.js",
11
- "./<%= tagName %>.js": "./dist/define/<%= tagName %>.js"
12
- },
13
13
  "scripts": {
14
- "start:wds": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"npm:sass:watch\" \"npm:wds\"",
15
- "wds": "web-dev-server",
16
- "sass:watch": "sass-style-template -j ts",
17
14
  "build": "npm run build:tsc && npm run dev:vite",
18
- "build:tsc": "tsc"
15
+ "build:tsc": "tsc",
16
+ "sass:watch": "sass-style-template -j ts",
17
+ "start:wds": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"npm:sass:watch\" \"npm:wds\"",
18
+ "wds": "web-dev-server"
19
19
  },
20
20
  "devDependencies": {
21
- "typescript": "^4.4.4",
22
- "tslib": "^2.3.1"
21
+ "tslib": "^2.3.1",
22
+ "typescript": "^4.4.4"
23
23
  }
24
24
  }
@@ -1,6 +1,8 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
+ <title>Demo <%= tagName %></title>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
4
6
  <meta charset="utf-8" />
5
7
  <style>
6
8
  body {
@@ -17,7 +19,11 @@
17
19
 
18
20
  const heading = 'World!';
19
21
  render(
20
- html`<<%= tagName %> .heading=${heading}>some light-dom</<%= tagName %>>`,
22
+ html`<<%= tagName %>
23
+ @counter-changed="${ev => console.log('==>', ev.detail)}"
24
+ .heading=${heading}
25
+ >some light-dom</<%= tagName %>
26
+ >`,
21
27
  document.querySelector('#demo'),
22
28
  );
23
29
  </script>
@@ -23,5 +23,5 @@
23
23
  "noImplicitOverride": true
24
24
  },
25
25
  "include": ["src/**/*.ts", "define/**/*.ts", "test/**/*.ts", "./index.ts"],
26
- "exclude": []
26
+ "exclude": ["node_modules"]
27
27
  }