@blockquote/create-wc 1.40.0 → 1.60.0

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.40.0",
3
+ "version": "1.60.0",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "LitElement",
@@ -39,13 +39,6 @@
39
39
  "parserOptions": {
40
40
  "ecmaVersion": "latest"
41
41
  },
42
- "plugins": [
43
- "log-filenames"
44
- ],
45
- "extends": [
46
- "@open-wc",
47
- "prettier"
48
- ],
49
42
  "rules": {
50
43
  "class-methods-use-this": "off",
51
44
  "no-unused-expressions": [
@@ -91,7 +84,6 @@
91
84
  "@open-wc/eslint-config": "^12.0.0",
92
85
  "eslint": "^8.49.0",
93
86
  "eslint-config-prettier": "^9.0.0",
94
- "eslint-plugin-log-filenames": "^1.0.6",
95
87
  "husky": "^8.0.3",
96
88
  "lint-staged": "^14.0.1",
97
89
  "prettier": "^3.0.3",
@@ -34,8 +34,9 @@
34
34
  "@web/rollup-plugin-html": "^2.0.1",
35
35
  "concurrently": "^8.2.1",
36
36
  "rollup-plugin-copy": "^3.5.0",
37
- "vite": "^4.4.9",
38
- "sort-package-json": "^2.5.1"
37
+ "sort-package-json": "^2.6.0",
38
+ "ts-lit-plugin": "^2.0.0-pre.1",
39
+ "vite": "^4.4.9"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
@@ -28,10 +28,13 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
28
28
  /** Amount of test files per browser to test concurrently */
29
29
  concurrency: 1,
30
30
 
31
- reporters: [summaryReporter(), defaultReporter(), coverageTableReporter()],
31
+ reporters: [summaryReporter({}), defaultReporter(), coverageTableReporter()],
32
+
33
+ preserveSymlinks: true,
32
34
 
33
35
  coverage: true,
34
36
  coverageConfig: {
37
+ // https://github.com/istanbuljs/v8-to-istanbul#ignoring-uncovered-lines
35
38
  reportDir: `${outDir}/test/coverage`,
36
39
  reporters: ['lcov', 'lcovonly', 'json'],
37
40
  threshold: {
@@ -44,6 +47,7 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
44
47
  },
45
48
 
46
49
  testFramework: {
50
+ // https://mochajs.org/api/mocha
47
51
  config: {
48
52
  ui: 'tdd',
49
53
  timeout: 4000
@@ -1 +1,8 @@
1
- {}
1
+ {
2
+ "eslintConfig": {
3
+ "extends": [
4
+ "@open-wc",
5
+ "prettier"
6
+ ]
7
+ }
8
+ }
@@ -4,6 +4,11 @@
4
4
  "plugins": [
5
5
  "@typescript-eslint"
6
6
  ],
7
+ "extends": [
8
+ "@open-wc",
9
+ "plugin:@typescript-eslint/recommended",
10
+ "prettier"
11
+ ],
7
12
  "rules": {
8
13
  "indent": [
9
14
  "error",
@@ -15,10 +20,15 @@
15
20
  ]
16
21
  }
17
22
  ],
18
- "no-unused-vars": "off",
19
- "@typescript-eslint/no-unused-vars": [
20
- "error"
21
- ]
23
+ "@typescript-eslint/ban-types": "off",
24
+ "@typescript-eslint/explicit-function-return-type": "off",
25
+ "@typescript-eslint/explicit-module-boundary-types": "off",
26
+ "@typescript-eslint/no-array-constructor": "error",
27
+ "@typescript-eslint/no-empty-function": "off",
28
+ "@typescript-eslint/no-explicit-any": "error",
29
+ "@typescript-eslint/no-loss-of-precision": "error",
30
+ "@typescript-eslint/no-namespace": "error",
31
+ "@typescript-eslint/no-non-null-assertion": "off"
22
32
  }
23
33
  },
24
34
  "devDependencies": {
@@ -1,15 +1,17 @@
1
- import { html, fixture, assert, fixtureCleanup } from '@open-wc/testing';
2
-
1
+ import { html, fixture, assert, expect, fixtureCleanup } from '@open-wc/testing';
3
2
  import '../define/<%= tagName %>.js';
4
3
 
5
4
  suite('<%= className %>', () => {
5
+ /**
6
+ * @type {import('../index').<%= className %>}
7
+ */
6
8
  let el;
7
9
 
8
10
  teardown(() => fixtureCleanup());
9
11
 
10
12
  suite('Default', () => {
11
13
  setup(async () => {
12
- el = await fixture(html` <<%= tagName %>>light-dom</<%= tagName %>> `);
14
+ el = await fixture(html`<<%= tagName %>>light-dom</<%= tagName %>>`);
13
15
  await el.updateComplete;
14
16
  });
15
17
 
@@ -20,11 +22,11 @@ suite('<%= className %>', () => {
20
22
 
21
23
  suite('Semantic Dom and a11y', () => {
22
24
  test('SHADOW DOM - Structure test', async () => {
23
- await assert.shadowDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
25
+ await expect(el).shadowDom.to.equalSnapshot();
24
26
  });
25
27
 
26
28
  test('LIGHT DOM - Structure test', async () => {
27
- await assert.lightDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
29
+ await expect(el).lightDom.to.equalSnapshot();
28
30
  });
29
31
  test('a11y', async () => {
30
32
  await assert.isAccessible(el);
@@ -34,19 +36,19 @@ suite('<%= className %>', () => {
34
36
 
35
37
  suite('Events ', () => {
36
38
  setup(async () => {
37
- el = await fixture(html` <<%= tagName %>></<%= tagName %>> `);
39
+ el = await fixture(html`<<%= tagName %>></<%= tagName %>>`);
38
40
  await el.updateComplete;
39
41
  });
40
42
 
41
43
  test('increases the counter on button click', () => {
42
- el.shadowRoot.querySelector('button').click();
44
+ el.shadowRoot?.querySelector('button')?.click();
43
45
  assert.equal(el.counter, 6);
44
46
  });
45
47
  });
46
48
 
47
49
  suite('Override ', () => {
48
50
  setup(async () => {
49
- el = await fixture(html` <<%= tagName %> heading="attribute heading"></<%= tagName %>> `);
51
+ el = await fixture(html`<<%= tagName %> heading="attribute heading"></<%= tagName %>>`);
50
52
  await el.updateComplete;
51
53
  });
52
54
 
@@ -1,7 +1,5 @@
1
- import { html, fixture, assert, fixtureCleanup } from '@open-wc/testing';
2
-
1
+ import { html, fixture, assert, expect, fixtureCleanup } from '@open-wc/testing';
3
2
  import { <%= className %> } from '../src/<%= className %>.js';
4
-
5
3
  import '../define/<%= tagName %>.js';
6
4
 
7
5
  suite('<%= className %>', () => {
@@ -11,7 +9,7 @@ suite('<%= className %>', () => {
11
9
 
12
10
  suite('Default', () => {
13
11
  setup(async () => {
14
- el = (await fixture(html` <<%= tagName %>>light-dom</<%= tagName %>> `)) as <%= className %>;
12
+ el = (await fixture(html`<<%= tagName %>>light-dom</<%= tagName %>>`));
15
13
  await el.updateComplete;
16
14
  });
17
15
 
@@ -22,11 +20,11 @@ suite('<%= className %>', () => {
22
20
 
23
21
  suite('Semantic Dom and a11y', () => {
24
22
  test('SHADOW DOM - Structure test', async () => {
25
- await assert.shadowDom.equalSnapshot(el);
23
+ await expect(el).shadowDom.to.equalSnapshot();
26
24
  });
27
25
 
28
26
  test('LIGHT DOM - Structure test', async () => {
29
- await assert.lightDom.equalSnapshot(el);
27
+ await expect(el).lightDom.to.equalSnapshot();
30
28
  });
31
29
  test('a11y', async () => {
32
30
  await assert.isAccessible(el);
@@ -36,7 +34,7 @@ suite('<%= className %>', () => {
36
34
 
37
35
  suite('Events ', () => {
38
36
  setup(async () => {
39
- el = (await fixture(html` <<%= tagName %>></<%= tagName %>> `)) as <%= className %>;
37
+ el = (await fixture(html`<<%= tagName %>></<%= tagName %>>`));
40
38
  await el.updateComplete;
41
39
  });
42
40
 
@@ -50,7 +48,7 @@ suite('<%= className %>', () => {
50
48
  suite('Override ', () => {
51
49
  setup(async () => {
52
50
  el = (await fixture(
53
- html` <<%= tagName %> heading="attribute heading"></<%= tagName %>> `)) as <%= className %>;
51
+ html`<<%= tagName %> heading="attribute heading"></<%= tagName %>>`));
54
52
  await el.updateComplete;
55
53
  });
56
54
 
@@ -7,22 +7,28 @@ import { styles } from './styles/<%= tagName %>-styles.css.js';
7
7
  * ## `<<%= tagName %>>`
8
8
  * An example element.
9
9
  *
10
+ * @attr heading
11
+ * @attr counter
10
12
  * @fires counterchange - Indicates when the count changes
11
13
  * @slot - This element has a slot
12
14
  */
13
15
  export class <%= className %> extends LitElement {
16
+ /**
17
+ * @override
18
+ */
14
19
  static styles = [styles];
15
20
 
21
+ /**
22
+ * @override
23
+ */
16
24
  static properties = {
17
25
  /**
18
26
  * The heading to say "Hello" to.
19
- * @type {string}
20
27
  */
21
28
  heading: { type: String },
22
29
 
23
30
  /**
24
31
  * The number of times the button has been clicked.
25
- * @type {number}
26
32
  */
27
33
  counter: { type: Number },
28
34
  };
@@ -33,6 +39,9 @@ export class <%= className %> extends LitElement {
33
39
  this.counter = 5;
34
40
  }
35
41
 
42
+ /**
43
+ * @override
44
+ */
36
45
  render() {
37
46
  return html`
38
47
  <h1>${this.sayHello(this.heading)}!</h1>
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2021",
4
+ "lib": ["es2021", "DOM", "DOM.Iterable"],
5
+ "module": "es2020",
6
+ "moduleResolution": "node",
7
+ "allowJs": true,
8
+ "declaration": true,
9
+ "emitDeclarationOnly": false,
10
+ "noEmit": true,
11
+ "checkJs": true,
12
+ "strict": false,
13
+ "noImplicitThis": true,
14
+ "noImplicitOverride": true,
15
+ "alwaysStrict": true,
16
+ "allowSyntheticDefaultImports": true,
17
+
18
+ "plugins": [
19
+ {
20
+ "name": "ts-lit-plugin",
21
+ "rules": {
22
+ "no-unknown-slot": "warning",
23
+ "no-unknown-attribute": "warning",
24
+ "no-unknown-property": "warning",
25
+ "no-unknown-event": "warning"
26
+ }
27
+ }
28
+ ]
29
+ },
30
+ "include": ["src/**/*.js", "define/**/*.js", "test/*.js", "./index.js"]
31
+ }
@@ -4,7 +4,7 @@
4
4
  "lib": ["es2021", "DOM", "DOM.Iterable"],
5
5
  "experimentalDecorators": true,
6
6
  "module": "es2020",
7
- "moduleResolution": "bundler",
7
+ "moduleResolution": "node",
8
8
  "rootDirs": ["./src", "./define", ".test/"],
9
9
  "resolveJsonModule": true,
10
10
  "declaration": true,
@@ -23,7 +23,17 @@
23
23
  "noImplicitReturns": true,
24
24
  "noFallthroughCasesInSwitch": true,
25
25
  "noImplicitOverride": true,
26
- "skipLibCheck": true
26
+ "plugins": [
27
+ {
28
+ "name": "ts-lit-plugin",
29
+ "rules": {
30
+ "no-unknown-slot": "warning",
31
+ "no-unknown-attribute": "warning",
32
+ "no-unknown-property": "warning",
33
+ "no-unknown-event": "warning"
34
+ }
35
+ }
36
+ ]
27
37
  },
28
38
  "include": ["src/**/*.ts", "define/**/*.ts", "test/**/*.ts", "./index.ts", "types/**/*.d.ts"]
29
39
  }