@ui5/webcomponents-tools 0.0.0-d0bcf47c7 → 0.0.0-d473b9686
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/CHANGELOG.md +1410 -1
- package/README.md +6 -6
- package/assets-meta.js +158 -0
- package/bin/dev.js +12 -1
- package/components-package/eslint.js +36 -0
- package/components-package/nps.js +122 -46
- package/components-package/postcss.components.js +1 -21
- package/components-package/postcss.themes.js +1 -23
- package/components-package/vite.config.js +13 -0
- package/components-package/wdio.js +152 -65
- package/icons-collection/nps.js +71 -28
- package/lib/amd-to-es6/index.js +102 -0
- package/lib/amd-to-es6/no-remaining-require.js +33 -0
- package/lib/cem/custom-elements-manifest.config.mjs +501 -0
- package/lib/cem/event.mjs +131 -0
- package/lib/cem/schema-internal.json +1357 -0
- package/lib/cem/schema.json +1098 -0
- package/lib/cem/types-internal.d.ts +796 -0
- package/lib/cem/types.d.ts +736 -0
- package/lib/cem/utils.mjs +384 -0
- package/lib/cem/validate.js +70 -0
- package/lib/copy-and-watch/index.js +145 -0
- package/lib/copy-list/index.js +28 -0
- package/lib/create-icons/index.js +126 -0
- package/lib/create-illustrations/index.js +182 -0
- package/lib/create-new-component/index.js +114 -0
- package/lib/create-new-component/tsFileContentTemplate.js +71 -0
- package/lib/css-processors/css-processor-component-styles.mjs +48 -0
- package/lib/css-processors/css-processor-components.mjs +77 -0
- package/lib/css-processors/css-processor-themes.mjs +79 -0
- package/lib/css-processors/scope-variables.mjs +49 -0
- package/lib/css-processors/shared.mjs +76 -0
- package/lib/dev-server/custom-hot-update-plugin.js +39 -0
- package/lib/dev-server/dev-server.js +66 -0
- package/lib/dev-server/ssr-dom-shim-loader.js +26 -0
- package/lib/dev-server/virtual-index-html-plugin.js +52 -0
- package/lib/generate-js-imports/illustrations.js +86 -0
- package/lib/generate-json-imports/i18n.js +71 -0
- package/lib/generate-json-imports/themes.js +58 -0
- package/lib/hbs2lit/index.js +3 -0
- package/lib/hbs2lit/src/compiler.js +60 -0
- package/lib/hbs2lit/src/extendedAttributeMapping.js +12 -0
- package/lib/hbs2lit/src/includesReplacer.js +31 -0
- package/lib/hbs2lit/src/litVisitor2.js +278 -0
- package/lib/hbs2lit/src/partials2.js +51 -0
- package/lib/hbs2lit/src/partialsVisitor.js +187 -0
- package/lib/hbs2lit/src/svgProcessor.js +76 -0
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +40 -0
- package/lib/hbs2ui5/index.js +119 -0
- package/lib/i18n/defaults.js +82 -0
- package/lib/i18n/toJSON.js +43 -0
- package/lib/postcss-combine-duplicated-selectors/index.js +185 -0
- package/lib/remove-dev-mode/remove-dev-mode.mjs +37 -0
- package/lib/scoping/get-all-tags.js +37 -0
- package/lib/scoping/lint-src.js +32 -0
- package/lib/scoping/missing-dependencies.js +65 -0
- package/lib/scoping/report-tags-usage.js +28 -0
- package/lib/scoping/scope-test-pages.js +41 -0
- package/lib/test-runner/test-runner.js +71 -0
- package/package.json +56 -55
- package/bin/init-ui5-package.js +0 -3
- package/package-lock.json +0 -9994
package/README.md
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-

|
2
|
+
|
2
3
|
|
3
4
|
# UI5 Web Components - Tools
|
4
5
|
|
5
|
-
[](https://travis-ci.org/SAP/ui5-webcomponents)
|
6
6
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
7
7
|
|
8
8
|
Provides libraries, configuration files and build artifacts,
|
9
9
|
used by other UI5 Web Components packages, such as `main` and `fiori`.
|
10
10
|
|
11
11
|
## Resources
|
12
|
-
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/
|
12
|
+
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
13
13
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
14
14
|
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
|
15
15
|
|
16
16
|
## Support
|
17
|
-
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
17
|
+
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/).
|
18
18
|
|
19
19
|
## Contribute
|
20
|
-
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
20
|
+
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
21
21
|
|
22
22
|
## License
|
23
23
|
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
|
24
|
-
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/
|
24
|
+
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/main/LICENSE.txt) file.
|
package/assets-meta.js
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
const assetsMeta = {
|
2
|
+
"themes": {
|
3
|
+
"default": "sap_horizon",
|
4
|
+
"all": [
|
5
|
+
"sap_fiori_3",
|
6
|
+
"sap_fiori_3_dark",
|
7
|
+
"sap_fiori_3_hcb",
|
8
|
+
"sap_fiori_3_hcw",
|
9
|
+
"sap_horizon",
|
10
|
+
"sap_horizon_dark",
|
11
|
+
"sap_horizon_hcb",
|
12
|
+
"sap_horizon_hcw",
|
13
|
+
"sap_horizon_exp",
|
14
|
+
"sap_horizon_dark_exp",
|
15
|
+
"sap_horizon_hcb_exp",
|
16
|
+
"sap_horizon_hcw_exp",
|
17
|
+
],
|
18
|
+
},
|
19
|
+
"languages": {
|
20
|
+
"default": "en",
|
21
|
+
"all": [
|
22
|
+
"ar",
|
23
|
+
"bg",
|
24
|
+
"ca",
|
25
|
+
"cnr",
|
26
|
+
"cs",
|
27
|
+
"cy",
|
28
|
+
"da",
|
29
|
+
"de",
|
30
|
+
"el",
|
31
|
+
"en",
|
32
|
+
"en_GB",
|
33
|
+
"en_US_sappsd",
|
34
|
+
"en_US_saprigi",
|
35
|
+
"en_US_saptrc",
|
36
|
+
"es",
|
37
|
+
"es_MX",
|
38
|
+
"et",
|
39
|
+
"fi",
|
40
|
+
"fr",
|
41
|
+
"fr_CA",
|
42
|
+
"hi",
|
43
|
+
"hr",
|
44
|
+
"hu",
|
45
|
+
"in",
|
46
|
+
"it",
|
47
|
+
"iw",
|
48
|
+
"ja",
|
49
|
+
"kk",
|
50
|
+
"ko",
|
51
|
+
"lt",
|
52
|
+
"lv",
|
53
|
+
"mk",
|
54
|
+
"ms",
|
55
|
+
"nl",
|
56
|
+
"no",
|
57
|
+
"pl",
|
58
|
+
"pt_PT",
|
59
|
+
"pt",
|
60
|
+
"ro",
|
61
|
+
"ru",
|
62
|
+
"sh",
|
63
|
+
"sk",
|
64
|
+
"sl",
|
65
|
+
"sr",
|
66
|
+
"sv",
|
67
|
+
"th",
|
68
|
+
"tr",
|
69
|
+
"uk",
|
70
|
+
"vi",
|
71
|
+
"zh_CN",
|
72
|
+
"zh_TW"
|
73
|
+
]
|
74
|
+
},
|
75
|
+
"locales": {
|
76
|
+
"default": "en",
|
77
|
+
"all": [
|
78
|
+
"ar",
|
79
|
+
"ar_EG",
|
80
|
+
"ar_SA",
|
81
|
+
"bg",
|
82
|
+
"ca",
|
83
|
+
"cnr",
|
84
|
+
"cs",
|
85
|
+
"da",
|
86
|
+
"de",
|
87
|
+
"de_AT",
|
88
|
+
"de_CH",
|
89
|
+
"el",
|
90
|
+
"el_CY",
|
91
|
+
"en",
|
92
|
+
"en_AU",
|
93
|
+
"en_GB",
|
94
|
+
"en_HK",
|
95
|
+
"en_IE",
|
96
|
+
"en_IN",
|
97
|
+
"en_NZ",
|
98
|
+
"en_PG",
|
99
|
+
"en_SG",
|
100
|
+
"en_ZA",
|
101
|
+
"es",
|
102
|
+
"es_AR",
|
103
|
+
"es_BO",
|
104
|
+
"es_CL",
|
105
|
+
"es_CO",
|
106
|
+
"es_MX",
|
107
|
+
"es_PE",
|
108
|
+
"es_UY",
|
109
|
+
"es_VE",
|
110
|
+
"et",
|
111
|
+
"fa",
|
112
|
+
"fi",
|
113
|
+
"fr",
|
114
|
+
"fr_BE",
|
115
|
+
"fr_CA",
|
116
|
+
"fr_CH",
|
117
|
+
"fr_LU",
|
118
|
+
"he",
|
119
|
+
"hi",
|
120
|
+
"hr",
|
121
|
+
"hu",
|
122
|
+
"id",
|
123
|
+
"it",
|
124
|
+
"it_CH",
|
125
|
+
"ja",
|
126
|
+
"kk",
|
127
|
+
"ko",
|
128
|
+
"lt",
|
129
|
+
"lv",
|
130
|
+
"ms",
|
131
|
+
"mk",
|
132
|
+
"nb",
|
133
|
+
"nl",
|
134
|
+
"nl_BE",
|
135
|
+
"pl",
|
136
|
+
"pt",
|
137
|
+
"pt_PT",
|
138
|
+
"ro",
|
139
|
+
"ru",
|
140
|
+
"ru_UA",
|
141
|
+
"sk",
|
142
|
+
"sl",
|
143
|
+
"sr",
|
144
|
+
"sr_Latn",
|
145
|
+
"sv",
|
146
|
+
"th",
|
147
|
+
"tr",
|
148
|
+
"uk",
|
149
|
+
"vi",
|
150
|
+
"zh_CN",
|
151
|
+
"zh_HK",
|
152
|
+
"zh_SG",
|
153
|
+
"zh_TW"
|
154
|
+
]
|
155
|
+
}
|
156
|
+
};
|
157
|
+
|
158
|
+
module.exports = assetsMeta;
|
package/bin/dev.js
CHANGED
@@ -2,4 +2,15 @@
|
|
2
2
|
|
3
3
|
const child_process = require("child_process");
|
4
4
|
|
5
|
-
|
5
|
+
let command = process.argv[2];
|
6
|
+
const argument = process.argv[3];
|
7
|
+
|
8
|
+
if (command === "watch") {
|
9
|
+
if (["src", "test", "bundles", "styles", "templates", "samples"].includes(argument)) {
|
10
|
+
command = `watch.${argument}`;
|
11
|
+
}
|
12
|
+
} else if (command === "test") {
|
13
|
+
command = `test ${process.argv.slice(3).join(" ")}`;
|
14
|
+
}
|
15
|
+
|
16
|
+
child_process.execSync(`npx nps "${command}"`, {stdio: 'inherit'});
|
@@ -1,3 +1,38 @@
|
|
1
|
+
const fs = require("fs");
|
2
|
+
const path = require("path");
|
3
|
+
const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Typescript Rules
|
7
|
+
*/
|
8
|
+
const overrides = tsMode ? [{
|
9
|
+
files: ["*.ts"],
|
10
|
+
parser: "@typescript-eslint/parser",
|
11
|
+
plugins: ["@typescript-eslint"],
|
12
|
+
extends: [
|
13
|
+
"plugin:@typescript-eslint/recommended",
|
14
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
15
|
+
],
|
16
|
+
parserOptions: {
|
17
|
+
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"],
|
18
|
+
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
|
19
|
+
},
|
20
|
+
rules: {
|
21
|
+
"no-shadow": "off",
|
22
|
+
"@typescript-eslint/no-shadow": ["error"],
|
23
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
24
|
+
"@typescript-eslint/no-floating-promises": "off",
|
25
|
+
"@typescript-eslint/no-explicit-any": "off",
|
26
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
27
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
28
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
29
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
30
|
+
"@typescript-eslint/no-empty-function": "off",
|
31
|
+
"@typescript-eslint/no-empty-interface": "off",
|
32
|
+
"lines-between-class-members": "off",
|
33
|
+
}
|
34
|
+
}] : [];
|
35
|
+
|
1
36
|
module.exports = {
|
2
37
|
"env": {
|
3
38
|
"browser": true,
|
@@ -5,6 +40,7 @@ module.exports = {
|
|
5
40
|
},
|
6
41
|
"root": true,
|
7
42
|
"extends": "airbnb-base",
|
43
|
+
overrides,
|
8
44
|
"parserOptions": {
|
9
45
|
"ecmaVersion": 2018,
|
10
46
|
"sourceType": "module"
|
@@ -1,73 +1,149 @@
|
|
1
1
|
const path = require("path");
|
2
|
-
|
2
|
+
const fs = require("fs");
|
3
3
|
const LIB = path.join(__dirname, `../lib/`);
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
let websiteBaseUrl = "/";
|
5
|
+
|
6
|
+
if (process.env.DEPOY) {
|
7
|
+
websiteBaseUrl = "/ui5-webcomponents/";
|
8
|
+
} else if (process.env.DEPLOY_NIGHTLY) {
|
9
|
+
websiteBaseUrl = "/ui5-webcomponents/nightly/";
|
10
|
+
}
|
7
11
|
|
8
12
|
const getScripts = (options) => {
|
9
13
|
|
10
|
-
|
14
|
+
// The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
|
15
|
+
const illustrationsData = options.illustrationsData || [];
|
16
|
+
const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath} ${illustration.collection}`);
|
17
|
+
const createIllustrationsJSImportsScript = illustrations.join(" && ");
|
18
|
+
|
19
|
+
// The script creates the "src/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
|
20
|
+
const createIllustrationsLoadersScript = illustrationsData.map(illustrations => `node ${LIB}/generate-js-imports/illustrations.js ${illustrations.destinationPath} ${illustrations.dynamicImports.outputFile} ${illustrations.set} ${illustrations.collection} ${illustrations.dynamicImports.location} ${illustrations.dynamicImports.filterOut.join(" ")}`).join(" && ");
|
21
|
+
|
22
|
+
const tsOption = !options.legacy;
|
23
|
+
const tsCommandOld = tsOption ? "tsc" : "";
|
24
|
+
let tsWatchCommandStandalone = tsOption ? "tsc --watch" : "";
|
25
|
+
// this command is only used for standalone projects. monorepo projects get their watch from vite, so opt-out here
|
26
|
+
if (options.noWatchTS) {
|
27
|
+
tsWatchCommandStandalone = "";
|
28
|
+
}
|
29
|
+
const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : "";
|
30
|
+
|
31
|
+
if (tsOption) {
|
32
|
+
try {
|
33
|
+
require("typescript");
|
34
|
+
} catch(e) {
|
35
|
+
console.error(`TypeScript is not found. Try to install it by running \`npm install --save-dev typescript\` if you are using npm or by running \`yarn add --dev typescript\` if you are using yarn.`);
|
36
|
+
process.exit(e.code);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
let viteConfig;
|
41
|
+
if (fs.existsSync("config/vite.config.js")) {
|
42
|
+
// old project setup where config file is in separate folder
|
43
|
+
viteConfig = "-c config/vite.config.js";
|
44
|
+
} else if (fs.existsSync("vite.config.js")) {
|
45
|
+
// preferred way of custom configuration in root project folder
|
46
|
+
viteConfig = "";
|
47
|
+
} else {
|
48
|
+
// no custom configuration - use default from tools project
|
49
|
+
viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
50
|
+
}
|
51
|
+
|
52
|
+
let eslintConfig;
|
53
|
+
if (fs.existsSync(".eslintrc.js") || fs.existsSync(".eslintrc.cjs")) {
|
54
|
+
// preferred way of custom configuration in root project folder
|
55
|
+
eslintConfig = "";
|
56
|
+
} else {
|
57
|
+
// no custom configuration - use default from tools project
|
58
|
+
eslintConfig = `--config "${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}"`;
|
59
|
+
}
|
11
60
|
|
12
61
|
const scripts = {
|
13
|
-
clean:
|
14
|
-
lint:
|
15
|
-
|
62
|
+
clean: 'rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
63
|
+
lint: `eslint . ${eslintConfig}`,
|
64
|
+
lintfix: `eslint . ${eslintConfig} --fix`,
|
65
|
+
generate: {
|
66
|
+
default: `${tsCrossEnv} nps prepare.all`,
|
67
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"',
|
68
|
+
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
69
|
+
},
|
70
|
+
prepare: {
|
71
|
+
default: `${tsCrossEnv} nps clean prepare.all copy prepare.typescript generateAPI`,
|
72
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps build.illustrations"',
|
73
|
+
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
74
|
+
typescript: tsCommandOld,
|
75
|
+
},
|
16
76
|
build: {
|
17
|
-
default: "nps lint
|
18
|
-
templates: `mkdirp
|
77
|
+
default: "nps prepare lint build.bundle", // build.bundle2
|
78
|
+
templates: `mkdirp src/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`,
|
19
79
|
styles: {
|
20
|
-
default: "nps build.styles.themes build.styles.components"
|
21
|
-
themes: "
|
22
|
-
components: "
|
80
|
+
default: `concurrently "nps build.styles.themes" "nps build.styles.components" "nps build.styles.componentStyles"`,
|
81
|
+
themes: `node "${LIB}/css-processors/css-processor-themes.mjs"`,
|
82
|
+
components: `node "${LIB}/css-processors/css-processor-components.mjs"`,
|
83
|
+
componentStyles: `node "${LIB}/css-processors/css-processor-component-styles.mjs"`,
|
23
84
|
},
|
24
85
|
i18n: {
|
25
86
|
default: "nps build.i18n.defaultsjs build.i18n.json",
|
26
|
-
defaultsjs: `
|
27
|
-
json: `
|
87
|
+
defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
|
88
|
+
json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
28
89
|
},
|
29
90
|
jsonImports: {
|
30
|
-
default: "mkdirp
|
31
|
-
themes: `node ${LIB}/generate-json-imports/themes.js`,
|
32
|
-
i18n: `node ${LIB}/generate-json-imports/i18n.js`,
|
91
|
+
default: "mkdirp src/generated/json-imports && nps build.jsonImports.themes build.jsonImports.i18n",
|
92
|
+
themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes src/generated/json-imports`,
|
93
|
+
i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n src/generated/json-imports`,
|
33
94
|
},
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
95
|
+
jsImports: {
|
96
|
+
default: "mkdirp src/generated/js-imports && nps build.jsImports.illustrationsLoaders",
|
97
|
+
illustrationsLoaders: createIllustrationsLoadersScript,
|
98
|
+
},
|
99
|
+
bundle: `vite build ${viteConfig} --mode testing --base ${websiteBaseUrl}`,
|
100
|
+
bundle2: ``,
|
101
|
+
illustrations: createIllustrationsJSImportsScript,
|
40
102
|
},
|
41
103
|
copy: {
|
42
|
-
default: "nps copy.src copy.
|
43
|
-
src: "copy-and-watch
|
44
|
-
|
45
|
-
|
104
|
+
default: "nps copy.src copy.props",
|
105
|
+
src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/`,
|
106
|
+
// srcGenerated2: `node "${LIB}/copy-and-watch/index.js" --silent "src/generated/**/*.{js,json}" dist/generated/`,
|
107
|
+
props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
|
46
108
|
},
|
47
109
|
watch: {
|
48
|
-
default:
|
49
|
-
|
50
|
-
|
51
|
-
|
110
|
+
default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.typescript" "nps watch.src" "nps watch.styles" "nps watch.i18n" "nps watch.props"`,
|
111
|
+
devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
|
112
|
+
src: 'nps "copy.src --watch --safe --skip-initial-copy"',
|
113
|
+
typescript: tsWatchCommandStandalone,
|
114
|
+
props: 'nps "copy.props --watch --safe --skip-initial-copy"',
|
115
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
52
116
|
styles: {
|
53
|
-
default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
|
117
|
+
default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components" "nps watch.styles.componentStyles" ',
|
54
118
|
themes: 'nps "build.styles.themes -w"',
|
55
|
-
components:
|
119
|
+
components: `nps "build.styles.components -w"`,
|
120
|
+
componentStyles: `nps "build.styles.componentStyles -w"`,
|
56
121
|
},
|
57
|
-
templates:
|
58
|
-
|
122
|
+
templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
|
123
|
+
i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
|
59
124
|
},
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
125
|
+
start: "nps prepare watch.devServer",
|
126
|
+
test: `node "${LIB}/test-runner/test-runner.js"`,
|
127
|
+
"test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
|
128
|
+
"test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
|
129
|
+
startWithScope: "nps scope.prepare scope.watchWithBundle",
|
130
|
+
scope: {
|
131
|
+
prepare: "nps scope.lint scope.testPages",
|
132
|
+
lint: `node "${LIB}/scoping/lint-src.js"`,
|
133
|
+
testPages: {
|
134
|
+
default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
|
135
|
+
clean: "rimraf test/pages/scoped",
|
136
|
+
copy: `node "${LIB}/copy-and-watch/index.js" --silent "test/pages/**/*" test/pages/scoped`,
|
137
|
+
replace: `node "${LIB}/scoping/scope-test-pages.js" test/pages/scoped demo`,
|
138
|
+
},
|
139
|
+
watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
|
140
|
+
watch: 'concurrently "nps watch.templates" "nps watch.src" "nps watch.props" "nps watch.styles"',
|
141
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
66
142
|
},
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
143
|
+
generateAPI: {
|
144
|
+
default: tsOption ? "nps generateAPI.generateCEM generateAPI.validateCEM" : "",
|
145
|
+
generateCEM: `cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs" ${ options.dev ? "--dev" : "" }`,
|
146
|
+
validateCEM: `node "${LIB}/cem/validate.js" ${ options.dev ? "--dev" : "" }`,
|
71
147
|
},
|
72
148
|
};
|
73
149
|
|
@@ -1,21 +1 @@
|
|
1
|
-
|
2
|
-
const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
|
3
|
-
const cssnano = require('cssnano');
|
4
|
-
const fs = require("fs");
|
5
|
-
|
6
|
-
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
7
|
-
|
8
|
-
module.exports = {
|
9
|
-
plugins: [
|
10
|
-
postcssImport(),
|
11
|
-
cssnano({
|
12
|
-
preset: [
|
13
|
-
'default', {
|
14
|
-
mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
|
15
|
-
mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
|
16
|
-
},
|
17
|
-
]
|
18
|
-
}),
|
19
|
-
postcssCSStoESM({toReplace: 'src', includeDefaultTheme: true, packageName}),
|
20
|
-
]
|
21
|
-
};
|
1
|
+
module.exports = {}
|
@@ -1,23 +1 @@
|
|
1
|
-
|
2
|
-
const combineSelectors = require('postcss-combine-duplicated-selectors');
|
3
|
-
const postcssCSStoJSON = require('../lib/postcss-css-to-json/index.js');
|
4
|
-
const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
|
5
|
-
const cssnano = require('cssnano');
|
6
|
-
|
7
|
-
module.exports = {
|
8
|
-
plugins: [
|
9
|
-
postcssImport(),
|
10
|
-
combineSelectors({
|
11
|
-
removeDuplicatedProperties: true
|
12
|
-
}),
|
13
|
-
cssnano({
|
14
|
-
preset: [
|
15
|
-
'default', {
|
16
|
-
mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
|
17
|
-
},
|
18
|
-
]
|
19
|
-
},),
|
20
|
-
postcssCSStoJSON({toReplace: 'src'}),
|
21
|
-
postcssCSStoESM({toReplace: 'src'}),
|
22
|
-
]
|
23
|
-
};
|
1
|
+
module.exports = {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// vite.config.js
|
2
|
+
import { defineConfig } from 'vite';
|
3
|
+
import virtualIndex from '../lib/dev-server/virtual-index-html-plugin.js';
|
4
|
+
|
5
|
+
export default defineConfig(async () => {
|
6
|
+
const data = await virtualIndex();
|
7
|
+
return {
|
8
|
+
build: {
|
9
|
+
emptyOutDir: false,
|
10
|
+
},
|
11
|
+
plugins: [data],
|
12
|
+
}
|
13
|
+
})
|