@blockquote/create-wc 1.6.5 → 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.5",
3
+ "version": "1.6.6",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "LitElement",
@@ -1,4 +1,14 @@
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"
@@ -15,6 +25,12 @@
15
25
  "npm run format:stylelint"
16
26
  ]
17
27
  },
28
+ "prettier": {
29
+ "arrowParens": "avoid",
30
+ "printWidth": 100,
31
+ "singleQuote": true,
32
+ "trailingComma": "all"
33
+ },
18
34
  "eslintConfig": {
19
35
  "plugins": [
20
36
  "log-filenames"
@@ -24,7 +40,6 @@
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,26 +48,27 @@
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 \"**/*.{js,ts,html}\" --fix --ignore-path .eslintignore",
50
- "format:prettier": "prettier \"**/*.{js,ts,json,html,md}\" --write --ignore-path .eslintignore",
51
- "format:stylelint": "stylelint \"**/*.{scss,css}\" --fix --allow-empty-input --ignore-path .eslintignore",
52
- "lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:stylelint",
53
- "lint:eslint": "eslint \"**/*.{js,ts,html}\" --ignore-path .eslintignore",
54
- "lint:prettier": "prettier \"**/*.{js,ts,json,html,md}\" --check --ignore-path .eslintignore",
55
- "lint:stylelint": "stylelint \"**/*.{scss,css}\" --allow-empty-input --ignore-path .eslintignore"
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
74
  "@open-wc/eslint-config": "^7.0.0",
@@ -1,44 +1,41 @@
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/
26
+ _site
27
+ dist
28
+ dev
29
+ build
30
+ .tmp
31
+ *.tgz
32
+ *.tsbuildinfo
29
33
  storybook-static
30
-
31
- /packages/*/node_modules
32
- /packages/*/package-lock.json
33
- /packages/*/_site
34
- /packages/*/dist
35
- /packages/*/dev
36
- /packages/*/build
37
- /packages/*/Jenkinsfile
38
34
  ## end gitignore
39
35
 
40
36
  ## specific eslintignore
41
37
  package-lock.json
42
38
  *.min.js
43
39
  *-styles.js
40
+ *-styles.ts
44
41
  CHANGELOG.md
@@ -1,37 +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/
26
+ _site
27
+ dist
28
+ dev
29
+ build
30
+ .tmp
31
+ *.tgz
32
+ *.tsbuildinfo
29
33
  storybook-static
30
-
31
- /packages/*/node_modules
32
- /packages/*/package-lock.json
33
- /packages/*/_site
34
- /packages/*/dist
35
- /packages/*/dev
36
- /packages/*/build
37
- /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
  });
@@ -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
  }