@blockquote/create-wc 1.99.0 → 1.101.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/README.md +4 -7
- package/package.json +8 -8
- package/src/app/executeViaOptions.js +2 -2
- package/src/app/gatherMixins.js +6 -6
- package/src/app/index.js +6 -6
- package/src/common-linting/index.js +3 -3
- package/src/common-linting/templates/package.json +10 -10
- package/src/common-repo/index.js +8 -8
- package/src/common-repo/templates/eslint.config.js +1 -0
- package/src/common-repo/templates/gitignore +1 -0
- package/src/common-repo/templates/package.json +5 -5
- package/src/common-repo/templates/prettierignore +1 -0
- package/src/common-testing-wtr/index.js +2 -2
- package/src/create.js +3 -3
- package/src/testing/index.js +6 -6
- package/src/testing-ts/index.js +6 -6
- package/src/testing-wtr/index.js +3 -3
- package/src/testing-wtr-ts/index.js +3 -3
- package/src/wc-lit-element/index.js +12 -15
- package/src/wc-lit-element/templates/static/demo/index.html +1 -1
- package/src/wc-lit-element-ts/index.js +13 -16
- package/src/wc-lit-element-ts/templates/package.json +2 -2
- package/src/wc-lit-element-ts/templates/static/demo/index.html +1 -1
- package/src/wc-lit-element-ts/templates/tsconfig.json +13 -8
package/README.md
CHANGED
|
@@ -67,9 +67,9 @@ npm run format
|
|
|
67
67
|
### web-test-runner.config
|
|
68
68
|
|
|
69
69
|
```js
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
70
|
+
import {playwrightLauncher} from '@web/test-runner-playwright';
|
|
71
|
+
import {defaultReporter, summaryReporter} from '@web/test-runner';
|
|
72
|
+
import {coverageTableReporter} from '@blockquote/coverage-table-reporter';
|
|
73
73
|
|
|
74
74
|
const filteredLogs = ['in dev mode'];
|
|
75
75
|
const outDir = process.env.OUTDIR || '.';
|
|
@@ -77,10 +77,7 @@ const outDir = process.env.OUTDIR || '.';
|
|
|
77
77
|
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
78
78
|
files: [`${outDir}/test/**/*.test.js`],
|
|
79
79
|
nodeResolve: true,
|
|
80
|
-
browsers: [
|
|
81
|
-
playwrightLauncher({ product: 'chromium' }),
|
|
82
|
-
playwrightLauncher({ product: 'webkit' }),
|
|
83
|
-
],
|
|
80
|
+
browsers: [playwrightLauncher({product: 'chromium'}), playwrightLauncher({product: 'webkit'})],
|
|
84
81
|
concurrentBrowsers: 2,
|
|
85
82
|
concurrency: 1,
|
|
86
83
|
reporters: [summaryReporter({}), defaultReporter(), coverageTableReporter()],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockquote/create-wc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.101.0",
|
|
4
4
|
"description": "Web component with Lit scaffolding - Extending Open Web Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"LitElement",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"start": "node ./src/create.js"
|
|
34
34
|
},
|
|
35
35
|
"prettier": {
|
|
36
|
-
"arrowParens": "avoid",
|
|
37
36
|
"bracketSameLine": true,
|
|
38
37
|
"htmlWhitespaceSensitivity": "ignore",
|
|
39
|
-
"printWidth": 100,
|
|
40
38
|
"singleQuote": true,
|
|
41
|
-
"
|
|
39
|
+
"bracketSpacing": false,
|
|
40
|
+
"trailingComma": "es5",
|
|
41
|
+
"printWidth": 100,
|
|
42
42
|
"overrides": [
|
|
43
43
|
{
|
|
44
44
|
"files": "*.{scss,css}",
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@open-wc/create": "^0.38.
|
|
53
|
+
"@open-wc/create": "^0.38.151",
|
|
54
54
|
"chalk": "^5.3.0",
|
|
55
|
-
"command-line-args": "^
|
|
55
|
+
"command-line-args": "^6.0.0",
|
|
56
56
|
"prompts": "^2.4.2",
|
|
57
|
-
"semver": "^7.6.
|
|
57
|
+
"semver": "^7.6.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@open-wc/eslint-config": "^12.0.3",
|
|
61
61
|
"eslint": "^8.57.0",
|
|
62
62
|
"eslint-config-prettier": "^9.1.0",
|
|
63
|
-
"prettier": "^3.3.
|
|
63
|
+
"prettier": "^3.3.3"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=14.15.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {executeMixinGenerator} from '@open-wc/create/dist/core.js';
|
|
2
|
+
import {gatherMixins} from './gatherMixins.js';
|
|
3
3
|
import Generator from '../Generator.js';
|
|
4
4
|
|
|
5
5
|
export async function executeViaOptions(options) {
|
package/src/app/gatherMixins.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// js
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {CommonLintingMixin} from '../common-linting/index.js';
|
|
3
|
+
import {CommonTestingWtrMixin} from '../common-testing-wtr/index.js';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import {WcLitElementPackageMixin} from '../wc-lit-element/index.js';
|
|
6
|
+
import {TestingMixin, TestingScaffoldMixin} from '../testing/index.js';
|
|
7
7
|
|
|
8
8
|
// ts
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import {TsWcLitElementPackageMixin} from '../wc-lit-element-ts/index.js';
|
|
10
|
+
import {TsTestingMixin, TsTestingScaffoldMixin} from '../testing-ts/index.js';
|
|
11
11
|
|
|
12
12
|
export function gatherMixins(options) {
|
|
13
13
|
const mixins = [];
|
package/src/app/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import prompts from 'prompts';
|
|
3
3
|
// import commandLineArgs from 'command-line-args';
|
|
4
|
-
import {
|
|
4
|
+
import {executeMixinGenerator} from '@open-wc/create/dist/core.js';
|
|
5
5
|
|
|
6
6
|
import header from './header.js';
|
|
7
|
-
import {
|
|
7
|
+
import {gatherMixins} from './gatherMixins.js';
|
|
8
8
|
import Generator from '../Generator.js';
|
|
9
9
|
|
|
10
10
|
export const AppMixin = (subclass) =>
|
|
@@ -34,8 +34,8 @@ export const AppMixin = (subclass) =>
|
|
|
34
34
|
name: 'nameSpaceSelect',
|
|
35
35
|
message: 'Would you like to use namespace (without @)?',
|
|
36
36
|
choices: [
|
|
37
|
-
{
|
|
38
|
-
{
|
|
37
|
+
{title: 'Yes', value: 'true'},
|
|
38
|
+
{title: 'No', value: 'false'},
|
|
39
39
|
],
|
|
40
40
|
},
|
|
41
41
|
{
|
|
@@ -49,8 +49,8 @@ export const AppMixin = (subclass) =>
|
|
|
49
49
|
name: 'typescript',
|
|
50
50
|
message: 'Would you like to use typescript?',
|
|
51
51
|
choices: [
|
|
52
|
-
{
|
|
53
|
-
{
|
|
52
|
+
{title: 'No', value: 'false'},
|
|
53
|
+
{title: 'Yes', value: 'true'},
|
|
54
54
|
],
|
|
55
55
|
},
|
|
56
56
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {fileURLToPath} from 'url';
|
|
3
|
+
import {dirname} from 'path';
|
|
4
4
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = dirname(__filename);
|
|
@@ -12,7 +12,7 @@ export const CommonLintingMixin = (subclass) =>
|
|
|
12
12
|
// extend package.json
|
|
13
13
|
this.copyTemplateJsonInto(
|
|
14
14
|
`${__dirname}/templates/package.json`,
|
|
15
|
-
this.destinationPath('package.json')
|
|
15
|
+
this.destinationPath('package.json')
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"prettier": {
|
|
24
|
-
"arrowParens": "avoid",
|
|
25
|
-
"printWidth": 100,
|
|
26
24
|
"singleQuote": true,
|
|
27
|
-
"
|
|
25
|
+
"bracketSpacing": false,
|
|
26
|
+
"trailingComma": "es5",
|
|
27
|
+
"printWidth": 100,
|
|
28
28
|
"overrides": [
|
|
29
29
|
{
|
|
30
30
|
"files": "*.{scss,css}",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@open-wc/eslint-config": "^12.0.3",
|
|
49
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
50
|
-
"@html-eslint/parser": "^0.
|
|
49
|
+
"@html-eslint/eslint-plugin": "^0.26.0",
|
|
50
|
+
"@html-eslint/parser": "^0.26.0",
|
|
51
51
|
"eslint": "^8.57.0",
|
|
52
52
|
"eslint-config-prettier": "^9.1.0",
|
|
53
|
-
"typescript-eslint": "^
|
|
54
|
-
"husky": "^9.
|
|
55
|
-
"lint-staged": "^15.2.
|
|
56
|
-
"prettier": "^3.3.
|
|
57
|
-
"stylelint": "^16.
|
|
53
|
+
"typescript-eslint": "^8.3.0",
|
|
54
|
+
"husky": "^9.1.5",
|
|
55
|
+
"lint-staged": "^15.2.10",
|
|
56
|
+
"prettier": "^3.3.3",
|
|
57
|
+
"stylelint": "^16.9.0",
|
|
58
58
|
"stylelint-config-standard-scss": "^13.1.0"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/src/common-repo/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import path, {
|
|
1
|
+
import {fileURLToPath} from 'url';
|
|
2
|
+
import path, {dirname} from 'path';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -16,17 +16,17 @@ export const CommonRepoMixin = (subclass) =>
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
await super.execute();
|
|
19
|
-
const {
|
|
19
|
+
const {tagName} = this.templateData;
|
|
20
20
|
|
|
21
21
|
this.copyTemplateJsonInto(
|
|
22
22
|
`${__dirname}/templates/package.json`,
|
|
23
|
-
this.destinationPath('package.json')
|
|
23
|
+
this.destinationPath('package.json')
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
// write & rename el scss template
|
|
27
27
|
this.copyTemplate(
|
|
28
28
|
`${__dirname}/templates/styles/my-el.scss`,
|
|
29
|
-
this.destinationPath(`src/styles/${tagName}.scss`)
|
|
29
|
+
this.destinationPath(`src/styles/${tagName}.scss`)
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
// write and rename .gitignore
|
|
@@ -35,12 +35,12 @@ export const CommonRepoMixin = (subclass) =>
|
|
|
35
35
|
// write and rename .prettierignore
|
|
36
36
|
this.copyTemplate(
|
|
37
37
|
`${__dirname}/templates/prettierignore`,
|
|
38
|
-
this.destinationPath(`.prettierignore`)
|
|
38
|
+
this.destinationPath(`.prettierignore`)
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
this.copyTemplate(
|
|
42
42
|
`${__dirname}/templates/eslint.config.js`,
|
|
43
|
-
this.destinationPath(`eslint.config.js
|
|
43
|
+
this.destinationPath(`eslint.config.js`)
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
// copy all other files
|
|
@@ -50,7 +50,7 @@ export const CommonRepoMixin = (subclass) =>
|
|
|
50
50
|
async end() {
|
|
51
51
|
await super.end();
|
|
52
52
|
|
|
53
|
-
const {
|
|
53
|
+
const {destinationPath} = this.options;
|
|
54
54
|
|
|
55
55
|
if (destinationPath) {
|
|
56
56
|
const huskyPreCommit = path.join(this.options.destinationPath, '.husky/pre-commit');
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prepare": "husky"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"lit": "^3.
|
|
25
|
+
"lit": "^3.2.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@blockquote/cem-to-markdown-readme": "^1.0.0",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"@blockquote/rollup-plugin-externalize-source-dependencies": "^1.0.0",
|
|
31
31
|
"@blockquote/rollup-plugin-total-bundlesize": "^2.1.2",
|
|
32
32
|
"@blockquote/sass-style-template": "^3.0.3",
|
|
33
|
-
"@custom-elements-manifest/analyzer": "^0.10.
|
|
33
|
+
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
34
34
|
"@open-wc/testing": "^4.0.0",
|
|
35
35
|
"@types/mocha": "^10.0.7",
|
|
36
|
-
"@web/test-runner": "^0.18.
|
|
36
|
+
"@web/test-runner": "^0.18.3",
|
|
37
37
|
"@web/test-runner-playwright": "^0.11.0",
|
|
38
38
|
"@web/rollup-plugin-html": "^2.3.0",
|
|
39
39
|
"concurrently": "^8.2.2",
|
|
40
|
-
"sort-package-json": "^2.10.
|
|
40
|
+
"sort-package-json": "^2.10.1",
|
|
41
41
|
"ts-lit-plugin": "^2.0.2",
|
|
42
|
-
"vite": "^5.
|
|
42
|
+
"vite": "^5.4.2"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {fileURLToPath} from 'url';
|
|
3
|
+
import {dirname} from 'path';
|
|
4
4
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = dirname(__filename);
|
package/src/create.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import semver from 'semver';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
|
-
import {
|
|
7
|
+
import {executeMixinGenerator} from '@open-wc/create/dist/core.js';
|
|
8
8
|
import Generator from './Generator.js';
|
|
9
|
-
import {
|
|
9
|
+
import {AppMixin} from './app/index.js';
|
|
10
10
|
|
|
11
11
|
(async () => {
|
|
12
12
|
try {
|
|
@@ -14,7 +14,7 @@ import { AppMixin } from './app/index.js';
|
|
|
14
14
|
await executeMixinGenerator([AppMixin], {}, Generator);
|
|
15
15
|
} else {
|
|
16
16
|
console.log(
|
|
17
|
-
chalk.bgRed('\nUh oh! Looks like you dont have Node v14.15.0 or higher installed!\n')
|
|
17
|
+
chalk.bgRed('\nUh oh! Looks like you dont have Node v14.15.0 or higher installed!\n')
|
|
18
18
|
);
|
|
19
19
|
console.log(`You can do this by going to ${chalk.underline.blue(`https://nodejs.org/`)}
|
|
20
20
|
|
package/src/testing/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import {fileURLToPath} from 'url';
|
|
3
|
+
import {dirname} from 'path';
|
|
4
|
+
import {TestingWebTestRunnerMixin} from '../testing-wtr/index.js';
|
|
5
5
|
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = dirname(__filename);
|
|
@@ -12,7 +12,7 @@ export const TestingMixin = (subclass) =>
|
|
|
12
12
|
await super.execute();
|
|
13
13
|
this.copyTemplateJsonInto(
|
|
14
14
|
`${__dirname}/templates/package.json`,
|
|
15
|
-
this.destinationPath('package.json')
|
|
15
|
+
this.destinationPath('package.json')
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -22,10 +22,10 @@ export const TestingScaffoldMixin = (subclass) =>
|
|
|
22
22
|
async execute() {
|
|
23
23
|
await super.execute();
|
|
24
24
|
|
|
25
|
-
const {
|
|
25
|
+
const {tagName} = this.templateData;
|
|
26
26
|
this.copyTemplate(
|
|
27
27
|
`${__dirname}/templates/my-el.test.js`,
|
|
28
|
-
this.destinationPath(`test/${tagName}.test.js`)
|
|
28
|
+
this.destinationPath(`test/${tagName}.test.js`)
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
};
|
package/src/testing-ts/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import {fileURLToPath} from 'url';
|
|
3
|
+
import {dirname} from 'path';
|
|
4
|
+
import {TsTestingWebTestRunnerMixin} from '../testing-wtr-ts/index.js';
|
|
5
5
|
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = dirname(__filename);
|
|
@@ -13,7 +13,7 @@ export const TsTestingMixin = (subclass) =>
|
|
|
13
13
|
|
|
14
14
|
this.copyTemplateJsonInto(
|
|
15
15
|
`${__dirname}/templates/package.json`,
|
|
16
|
-
this.destinationPath('package.json')
|
|
16
|
+
this.destinationPath('package.json')
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
@@ -23,10 +23,10 @@ export const TsTestingScaffoldMixin = (subclass) =>
|
|
|
23
23
|
async execute() {
|
|
24
24
|
await super.execute();
|
|
25
25
|
|
|
26
|
-
const {
|
|
26
|
+
const {tagName} = this.templateData;
|
|
27
27
|
this.copyTemplate(
|
|
28
28
|
`${__dirname}/templates/my-el.test.ts`,
|
|
29
|
-
this.destinationPath(`test/${tagName}.test.ts`)
|
|
29
|
+
this.destinationPath(`test/${tagName}.test.ts`)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
};
|
package/src/testing-wtr/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {fileURLToPath} from 'url';
|
|
2
|
+
import {dirname} from 'path';
|
|
3
3
|
|
|
4
4
|
const __filename = fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = dirname(__filename);
|
|
@@ -11,7 +11,7 @@ export const TestingWebTestRunnerMixin = (subclass) =>
|
|
|
11
11
|
|
|
12
12
|
this.copyTemplateJsonInto(
|
|
13
13
|
`${__dirname}/templates/package.json`,
|
|
14
|
-
this.destinationPath('package.json')
|
|
14
|
+
this.destinationPath('package.json')
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
// await this.copyTemplates(`${__dirname}/templates/static/**/*`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {fileURLToPath} from 'url';
|
|
2
|
+
import {dirname} from 'path';
|
|
3
3
|
|
|
4
4
|
const __filename = fileURLToPath(import.meta.url);
|
|
5
5
|
const __dirname = dirname(__filename);
|
|
@@ -11,7 +11,7 @@ export const TsTestingWebTestRunnerMixin = (subclass) =>
|
|
|
11
11
|
|
|
12
12
|
this.copyTemplateJsonInto(
|
|
13
13
|
`${__dirname}/templates/package.json`,
|
|
14
|
-
this.destinationPath('package.json')
|
|
14
|
+
this.destinationPath('package.json')
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
// await this.copyTemplates(`${__dirname}/templates/static/**/*`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import {fileURLToPath} from 'url';
|
|
3
|
+
import {join, dirname} from 'path';
|
|
4
|
+
import {processTemplate, readFileFromPath} from '@open-wc/create/dist/core.js';
|
|
5
|
+
import {CommonRepoMixin} from '../common-repo/index.js';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = dirname(__filename);
|
|
@@ -11,7 +11,7 @@ const compose = (...fns) =>
|
|
|
11
11
|
fns.reduce(
|
|
12
12
|
(f, g) =>
|
|
13
13
|
(...args) =>
|
|
14
|
-
f(g(...args))
|
|
14
|
+
f(g(...args))
|
|
15
15
|
);
|
|
16
16
|
const safeReduce = (f, initial) => (xs) => (Array.isArray(xs) ? xs.reduce(f, initial) : xs);
|
|
17
17
|
|
|
@@ -35,30 +35,27 @@ export const WcLitElementMixin = (subclass) =>
|
|
|
35
35
|
this.templateData.featureReadmes = safeFeatureReadme(this.options.features);
|
|
36
36
|
|
|
37
37
|
await super.execute();
|
|
38
|
-
const {
|
|
38
|
+
const {tagName, className} = this.templateData;
|
|
39
39
|
|
|
40
40
|
// write & rename index template
|
|
41
|
-
this.copyTemplate(
|
|
42
|
-
`${__dirname}/templates/index.js`,
|
|
43
|
-
this.destinationPath(`src/index.js`),
|
|
44
|
-
);
|
|
41
|
+
this.copyTemplate(`${__dirname}/templates/index.js`, this.destinationPath(`src/index.js`));
|
|
45
42
|
|
|
46
43
|
// write & rename el class template
|
|
47
44
|
this.copyTemplate(
|
|
48
45
|
`${__dirname}/templates/MyEl.js`,
|
|
49
|
-
this.destinationPath(`src/${className}.js`)
|
|
46
|
+
this.destinationPath(`src/${className}.js`)
|
|
50
47
|
);
|
|
51
48
|
|
|
52
49
|
// write & rename el styles template
|
|
53
50
|
this.copyTemplate(
|
|
54
51
|
`${__dirname}/templates/styles/my-el-styles.css.js`,
|
|
55
|
-
this.destinationPath(`src/styles/${tagName}-styles.css.js`)
|
|
52
|
+
this.destinationPath(`src/styles/${tagName}-styles.css.js`)
|
|
56
53
|
);
|
|
57
54
|
|
|
58
55
|
// write & rename el registration template
|
|
59
56
|
this.copyTemplate(
|
|
60
57
|
`${__dirname}/templates/my-el.js`,
|
|
61
|
-
this.destinationPath(`define/${tagName}.js`)
|
|
58
|
+
this.destinationPath(`define/${tagName}.js`)
|
|
62
59
|
);
|
|
63
60
|
|
|
64
61
|
await this.copyTemplates(`${__dirname}/templates/static/**/*`);
|
|
@@ -72,11 +69,11 @@ export const WcLitElementPackageMixin = (subclass) =>
|
|
|
72
69
|
// write & rename package.json
|
|
73
70
|
this.copyTemplateJsonInto(
|
|
74
71
|
`${__dirname}/templates/package.json`,
|
|
75
|
-
this.destinationPath('package.json')
|
|
72
|
+
this.destinationPath('package.json')
|
|
76
73
|
);
|
|
77
74
|
this.copyTemplate(
|
|
78
75
|
`${__dirname}/templates/custom-elements.json`,
|
|
79
|
-
this.destinationPath('custom-elements.json')
|
|
76
|
+
this.destinationPath('custom-elements.json')
|
|
80
77
|
);
|
|
81
78
|
}
|
|
82
79
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<title>Demo - <%= tagName %></title>
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<link rel="icon" href="favicon.svg" sizes="any" type="image/svg+xml"
|
|
7
|
+
<link rel="icon" href="favicon.svg" sizes="any" type="image/svg+xml" />
|
|
8
8
|
<meta name="description" content="<%= tagName %>" />
|
|
9
9
|
<style>
|
|
10
10
|
html,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import {fileURLToPath} from 'url';
|
|
3
|
+
import {join, dirname} from 'path';
|
|
4
|
+
import {processTemplate, readFileFromPath} from '@open-wc/create/dist/core.js';
|
|
5
|
+
import {CommonRepoMixin} from '../common-repo/index.js';
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = dirname(__filename);
|
|
@@ -11,7 +11,7 @@ const compose = (...fns) =>
|
|
|
11
11
|
fns.reduce(
|
|
12
12
|
(f, g) =>
|
|
13
13
|
(...args) =>
|
|
14
|
-
f(g(...args))
|
|
14
|
+
f(g(...args))
|
|
15
15
|
);
|
|
16
16
|
const safeReduce = (f, initial) => (xs) => (Array.isArray(xs) ? xs.reduce(f, initial) : xs);
|
|
17
17
|
|
|
@@ -35,30 +35,27 @@ export const TsWcLitElementMixin = (subclass) =>
|
|
|
35
35
|
this.templateData.featureReadmes = safeFeatureReadme(this.options.features);
|
|
36
36
|
|
|
37
37
|
await super.execute();
|
|
38
|
-
const {
|
|
38
|
+
const {tagName, className} = this.templateData;
|
|
39
39
|
|
|
40
40
|
// write & rename index template
|
|
41
|
-
this.copyTemplate(
|
|
42
|
-
`${__dirname}/templates/index.ts`,
|
|
43
|
-
this.destinationPath(`src/index.ts`),
|
|
44
|
-
);
|
|
41
|
+
this.copyTemplate(`${__dirname}/templates/index.ts`, this.destinationPath(`src/index.ts`));
|
|
45
42
|
|
|
46
43
|
// write & rename el class template
|
|
47
44
|
this.copyTemplate(
|
|
48
45
|
`${__dirname}/templates/MyEl.ts`,
|
|
49
|
-
this.destinationPath(`src/${className}.ts`)
|
|
46
|
+
this.destinationPath(`src/${className}.ts`)
|
|
50
47
|
);
|
|
51
48
|
|
|
52
49
|
// write & rename el styles template
|
|
53
50
|
this.copyTemplate(
|
|
54
51
|
`${__dirname}/templates/styles/my-el-styles.css.ts`,
|
|
55
|
-
this.destinationPath(`src/styles/${tagName}-styles.css.ts`)
|
|
52
|
+
this.destinationPath(`src/styles/${tagName}-styles.css.ts`)
|
|
56
53
|
);
|
|
57
54
|
|
|
58
55
|
// write & rename el registration template
|
|
59
56
|
this.copyTemplate(
|
|
60
57
|
`${__dirname}/templates/my-el.ts`,
|
|
61
|
-
this.destinationPath(`define/${tagName}.ts`)
|
|
58
|
+
this.destinationPath(`define/${tagName}.ts`)
|
|
62
59
|
);
|
|
63
60
|
|
|
64
61
|
await this.copyTemplates(`${__dirname}/templates/static/**/*`);
|
|
@@ -72,15 +69,15 @@ export const TsWcLitElementPackageMixin = (subclass) =>
|
|
|
72
69
|
// write & rename package.json
|
|
73
70
|
this.copyTemplateJsonInto(
|
|
74
71
|
`${__dirname}/templates/package.json`,
|
|
75
|
-
this.destinationPath('package.json')
|
|
72
|
+
this.destinationPath('package.json')
|
|
76
73
|
);
|
|
77
74
|
this.copyTemplate(
|
|
78
75
|
`${__dirname}/templates/custom-elements.json`,
|
|
79
|
-
this.destinationPath('custom-elements.json')
|
|
76
|
+
this.destinationPath('custom-elements.json')
|
|
80
77
|
);
|
|
81
78
|
this.copyTemplate(
|
|
82
79
|
`${__dirname}/templates/tsconfig.json`,
|
|
83
|
-
this.destinationPath('tsconfig.json')
|
|
80
|
+
this.destinationPath('tsconfig.json')
|
|
84
81
|
);
|
|
85
82
|
}
|
|
86
83
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<title>Demo - <%= tagName %></title>
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<link rel="icon" href="favicon.svg" sizes="any" type="image/svg+xml"
|
|
7
|
+
<link rel="icon" href="favicon.svg" sizes="any" type="image/svg+xml" />
|
|
8
8
|
<meta name="description" content="<%= tagName %>" />
|
|
9
9
|
<style>
|
|
10
10
|
html,
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"incremental": true,
|
|
4
|
+
"composite": true,
|
|
5
|
+
"target": "ES2022",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
5
7
|
"experimentalDecorators": true,
|
|
6
|
-
"module": "
|
|
7
|
-
"moduleResolution": "
|
|
8
|
-
"
|
|
8
|
+
"module": "ES2022",
|
|
9
|
+
"moduleResolution": "Bundler",
|
|
10
|
+
"resolvePackageJsonExports": true,
|
|
11
|
+
"resolvePackageJsonImports": true,
|
|
9
12
|
"resolveJsonModule": true,
|
|
13
|
+
"allowArbitraryExtensions": true,
|
|
10
14
|
"declaration": true,
|
|
11
15
|
"declarationMap": true,
|
|
12
16
|
"sourceMap": true,
|
|
13
17
|
"outDir": "./dist",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
18
|
+
"stripInternal": true,
|
|
19
|
+
"verbatimModuleSyntax": true,
|
|
20
|
+
"esModuleInterop": true,
|
|
17
21
|
"forceConsistentCasingInFileNames": true,
|
|
18
22
|
"strict": true,
|
|
19
23
|
"noImplicitAny": true,
|
|
@@ -21,6 +25,7 @@
|
|
|
21
25
|
"noUnusedLocals": true,
|
|
22
26
|
"noUnusedParameters": true,
|
|
23
27
|
"noImplicitReturns": true,
|
|
28
|
+
"useDefineForClassFields": false,
|
|
24
29
|
"noFallthroughCasesInSwitch": true,
|
|
25
30
|
"noImplicitOverride": true,
|
|
26
31
|
"plugins": [
|