@ui5/webcomponents-tools 0.0.0-d1315d658 → 0.0.0-d160e83dd
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 +1272 -0
- package/README.md +3 -5
- package/assets-meta.js +11 -10
- package/components-package/eslint.js +59 -29
- package/components-package/nps.js +77 -48
- package/components-package/postcss.components.js +1 -21
- package/components-package/postcss.themes.js +1 -50
- package/components-package/vite.config.js +7 -11
- package/components-package/wdio.js +415 -400
- package/icons-collection/nps.js +7 -5
- 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 +547 -0
- package/lib/cem/event.mjs +168 -0
- package/lib/cem/schema-internal.json +1422 -0
- package/lib/cem/schema.json +1098 -0
- package/lib/cem/types-internal.d.ts +808 -0
- package/lib/cem/types.d.ts +736 -0
- package/lib/cem/utils.mjs +423 -0
- package/lib/cem/validate.js +67 -0
- package/lib/create-icons/index.js +13 -10
- package/lib/create-illustrations/index.js +51 -30
- package/lib/create-new-component/{tsFileContentTemplate.js → Component.js} +15 -21
- package/lib/create-new-component/ComponentTemplate.js +12 -0
- package/lib/create-new-component/index.js +10 -18
- package/lib/css-processors/css-processor-components.mjs +77 -0
- package/lib/css-processors/css-processor-themes.mjs +74 -0
- package/lib/css-processors/scope-variables.mjs +49 -0
- package/lib/css-processors/shared.mjs +56 -0
- package/lib/dev-server/custom-hot-update-plugin.js +39 -0
- package/lib/dev-server/{dev-server.js → dev-server.mjs} +4 -4
- package/lib/dev-server/virtual-index-html-plugin.js +24 -20
- package/lib/generate-js-imports/illustrations.js +78 -64
- package/lib/generate-json-imports/i18n.js +45 -61
- package/lib/generate-json-imports/themes.js +16 -33
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +12 -7
- package/lib/hbs2ui5/index.js +3 -3
- package/lib/i18n/defaults.js +3 -2
- package/lib/postcss-combine-duplicated-selectors/index.js +12 -5
- package/lib/remove-dev-mode/remove-dev-mode.mjs +37 -0
- package/lib/scoping/get-all-tags.js +10 -3
- package/lib/scoping/lint-src.js +8 -7
- package/lib/scoping/scope-test-pages.js +2 -1
- package/package.json +16 -13
- package/tsconfig.json +18 -0
- package/components-package/wdio.sync.js +0 -368
- package/lib/create-new-component/jsFileContentTemplate.js +0 -73
- package/lib/esm-abs-to-rel/index.js +0 -58
- package/lib/generate-custom-elements-manifest/index.js +0 -327
- package/lib/jsdoc/config.json +0 -29
- package/lib/jsdoc/configTypescript.json +0 -29
- package/lib/jsdoc/plugin.js +0 -2468
- package/lib/jsdoc/preprocess.js +0 -146
- package/lib/jsdoc/template/publish.js +0 -4120
- package/lib/postcss-css-to-esm/index.js +0 -90
- package/lib/postcss-css-to-json/index.js +0 -47
- package/lib/postcss-new-files/index.js +0 -36
- package/lib/postcss-p/postcss-p.mjs +0 -14
- package/lib/replace-global-core/index.js +0 -25
package/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
UI5 Web Components - Tools
|
4
2
|
|
5
3
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
6
4
|
|
@@ -10,10 +8,10 @@ used by other UI5 Web Components packages, such as `main` and `fiori`.
|
|
10
8
|
## Resources
|
11
9
|
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
12
10
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
13
|
-
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/
|
11
|
+
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/play/)
|
14
12
|
|
15
13
|
## Support
|
16
|
-
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://
|
14
|
+
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/).
|
17
15
|
|
18
16
|
## Contribute
|
19
17
|
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
package/assets-meta.js
CHANGED
@@ -1,20 +1,16 @@
|
|
1
1
|
const assetsMeta = {
|
2
2
|
"themes": {
|
3
|
-
"default": "
|
3
|
+
"default": "sap_horizon",
|
4
4
|
"all": [
|
5
5
|
"sap_fiori_3",
|
6
6
|
"sap_fiori_3_dark",
|
7
|
-
"sap_belize",
|
8
|
-
"sap_belize_hcb",
|
9
|
-
"sap_belize_hcw",
|
10
7
|
"sap_fiori_3_hcb",
|
11
8
|
"sap_fiori_3_hcw",
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
]
|
9
|
+
"sap_horizon",
|
10
|
+
"sap_horizon_dark",
|
11
|
+
"sap_horizon_hcb",
|
12
|
+
"sap_horizon_hcw",
|
13
|
+
],
|
18
14
|
},
|
19
15
|
"languages": {
|
20
16
|
"default": "en",
|
@@ -22,6 +18,7 @@ const assetsMeta = {
|
|
22
18
|
"ar",
|
23
19
|
"bg",
|
24
20
|
"ca",
|
21
|
+
"cnr",
|
25
22
|
"cs",
|
26
23
|
"cy",
|
27
24
|
"da",
|
@@ -49,6 +46,7 @@ const assetsMeta = {
|
|
49
46
|
"ko",
|
50
47
|
"lt",
|
51
48
|
"lv",
|
49
|
+
"mk",
|
52
50
|
"ms",
|
53
51
|
"nl",
|
54
52
|
"no",
|
@@ -60,6 +58,7 @@ const assetsMeta = {
|
|
60
58
|
"sh",
|
61
59
|
"sk",
|
62
60
|
"sl",
|
61
|
+
"sr",
|
63
62
|
"sv",
|
64
63
|
"th",
|
65
64
|
"tr",
|
@@ -77,6 +76,7 @@ const assetsMeta = {
|
|
77
76
|
"ar_SA",
|
78
77
|
"bg",
|
79
78
|
"ca",
|
79
|
+
"cnr",
|
80
80
|
"cs",
|
81
81
|
"da",
|
82
82
|
"de",
|
@@ -124,6 +124,7 @@ const assetsMeta = {
|
|
124
124
|
"lt",
|
125
125
|
"lv",
|
126
126
|
"ms",
|
127
|
+
"mk",
|
127
128
|
"nb",
|
128
129
|
"nl",
|
129
130
|
"nl_BE",
|
@@ -3,33 +3,62 @@ const path = require("path");
|
|
3
3
|
const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
|
4
4
|
|
5
5
|
/**
|
6
|
-
*
|
6
|
+
* Returns eslint rules specific to typescript files
|
7
|
+
* @returns
|
7
8
|
*/
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
9
|
+
const getTsModeOverrides = () => {
|
10
|
+
const tsConfiguration = {
|
11
|
+
files: ["*.ts"],
|
12
|
+
parser: "@typescript-eslint/parser",
|
13
|
+
plugins: ["@typescript-eslint"],
|
14
|
+
extends: [
|
15
|
+
"plugin:@typescript-eslint/recommended",
|
16
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
17
|
+
],
|
18
|
+
parserOptions: {
|
19
|
+
"project": [
|
20
|
+
"./tsconfig.json"
|
21
|
+
],
|
22
|
+
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
|
23
|
+
},
|
24
|
+
rules: {
|
25
|
+
"no-shadow": "off",
|
26
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
27
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
28
|
+
"@typescript-eslint/no-shadow": ["error"],
|
29
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
30
|
+
"@typescript-eslint/no-floating-promises": "off",
|
31
|
+
"@typescript-eslint/no-explicit-any": "off",
|
32
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
33
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
34
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
35
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
36
|
+
"@typescript-eslint/no-empty-function": "off",
|
37
|
+
"@typescript-eslint/no-empty-interface": "off",
|
38
|
+
"lines-between-class-members": "off",
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
const tsxConfiguration = JSON.parse(JSON.stringify(tsConfiguration));
|
43
|
+
tsxConfiguration.files = ["*.tsx"];
|
44
|
+
tsxConfiguration.plugins.push("jsx-no-leaked-values");
|
45
|
+
tsxConfiguration.rules = {
|
46
|
+
...tsxConfiguration.rules,
|
47
|
+
"jsx-no-leaked-values/jsx-no-leaked-values": "error",
|
48
|
+
"@typescript-eslint/unbound-method": "off", // to be able to attach on* listeners
|
49
|
+
"@typescript-eslint/no-misused-promises": "off", // to be able to have async event listeners
|
50
|
+
"operator-linebreak": "off",
|
51
|
+
"no-nested-ternary": "off",
|
52
|
+
"implicit-arrow-linebreak": "off",
|
53
|
+
"function-paren-newline": "off",
|
54
|
+
"comma-dangle": "off"
|
55
|
+
};
|
56
|
+
|
57
|
+
return [
|
58
|
+
tsConfiguration,
|
59
|
+
tsxConfiguration
|
60
|
+
];
|
61
|
+
}
|
33
62
|
|
34
63
|
module.exports = {
|
35
64
|
"env": {
|
@@ -38,7 +67,7 @@ module.exports = {
|
|
38
67
|
},
|
39
68
|
"root": true,
|
40
69
|
"extends": "airbnb-base",
|
41
|
-
overrides,
|
70
|
+
"overrides": tsMode ? getTsModeOverrides() : [],
|
42
71
|
"parserOptions": {
|
43
72
|
"ecmaVersion": 2018,
|
44
73
|
"sourceType": "module"
|
@@ -81,6 +110,7 @@ module.exports = {
|
|
81
110
|
"curly": [2, "all"],
|
82
111
|
// "default-case": 1, // removed for UI5 WebComponents
|
83
112
|
"import/extensions": ["error", "always"], // override for UI5 WebComponents
|
113
|
+
"import/order": "off",
|
84
114
|
"no-alert": 2,
|
85
115
|
"no-caller": 2,
|
86
116
|
"no-div-regex": 2,
|
@@ -122,7 +152,7 @@ module.exports = {
|
|
122
152
|
"no-shadow-restricted-names": 2,
|
123
153
|
"no-undef-init": 2,
|
124
154
|
"no-undef": 2,
|
125
|
-
"no-unused-vars": [2, {"vars":"all", "args":"none"}],
|
155
|
+
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
|
126
156
|
|
127
157
|
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
|
128
158
|
"camelcase": [1, { "properties": "never" }], // added for UI5 WebComponents
|
@@ -138,7 +168,7 @@ module.exports = {
|
|
138
168
|
"no-new-object": 2,
|
139
169
|
"no-spaced-func": 2,
|
140
170
|
"quote-props": [2, "as-needed", { "keywords": true, "unnecessary": false }],
|
141
|
-
"semi-spacing": [1, {"before": false, "after": true}],
|
171
|
+
"semi-spacing": [1, { "before": false, "after": true }],
|
142
172
|
"semi": 2,
|
143
173
|
"keyword-spacing": 2,
|
144
174
|
"space-infix-ops": 2,
|
@@ -1,29 +1,56 @@
|
|
1
1
|
const path = require("path");
|
2
2
|
const fs = require("fs");
|
3
|
-
const resolve = require("resolve");
|
4
3
|
const LIB = path.join(__dirname, `../lib/`);
|
5
|
-
|
4
|
+
let websiteBaseUrl = "/";
|
5
|
+
|
6
|
+
if (process.env.DEPLOY) {
|
7
|
+
websiteBaseUrl = "/ui5-webcomponents/";
|
8
|
+
} else if (process.env.DEPLOY_NIGHTLY) {
|
9
|
+
websiteBaseUrl = "/ui5-webcomponents/nightly/";
|
10
|
+
}
|
11
|
+
|
12
|
+
const cypressEnvVariables = (options, predefinedVars) => {
|
13
|
+
let variables = [];
|
14
|
+
const { cypress_code_coverage, cypress_acc_tests } = options.internal ?? {};
|
15
|
+
|
16
|
+
// Handle environment variables like TEST_SUITE
|
17
|
+
if (predefinedVars) {
|
18
|
+
variables = [...predefinedVars];
|
19
|
+
}
|
20
|
+
|
21
|
+
// The coverage task is always registered and requires an explicit variable whether to generate a report or not
|
22
|
+
variables.push(`CYPRESS_COVERAGE=${!!cypress_code_coverage}`);
|
23
|
+
|
24
|
+
if (cypress_acc_tests) {
|
25
|
+
variables.push("CYPRESS_UI5_ACC=true");
|
26
|
+
}
|
27
|
+
|
28
|
+
return variables.length ? `cross-env ${variables.join(" ")}` : "";
|
29
|
+
}
|
6
30
|
|
7
31
|
const getScripts = (options) => {
|
8
32
|
|
9
33
|
// The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
|
10
34
|
const illustrationsData = options.illustrationsData || [];
|
11
|
-
const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
|
35
|
+
const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath} ${illustration.collection}`);
|
12
36
|
const createIllustrationsJSImportsScript = illustrations.join(" && ");
|
13
37
|
|
14
|
-
// The script creates the "
|
15
|
-
const
|
16
|
-
|
17
|
-
const tsOption = options.
|
18
|
-
const
|
19
|
-
|
38
|
+
// The script creates the "src/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
|
39
|
+
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(" && ");
|
40
|
+
|
41
|
+
const tsOption = !options.legacy || options.jsx;
|
42
|
+
const tsCommandOld = tsOption ? "tsc" : "";
|
43
|
+
let tsWatchCommandStandalone = tsOption ? "tsc --watch" : "";
|
44
|
+
// this command is only used for standalone projects. monorepo projects get their watch from vite, so opt-out here
|
45
|
+
if (options.noWatchTS) {
|
46
|
+
tsWatchCommandStandalone = "";
|
47
|
+
}
|
20
48
|
const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : "";
|
21
|
-
const copySrcGenerated = tsOption ? "" : "copy.srcGenerated";
|
22
49
|
|
23
50
|
if (tsOption) {
|
24
51
|
try {
|
25
52
|
require("typescript");
|
26
|
-
} catch(e) {
|
53
|
+
} catch (e) {
|
27
54
|
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.`);
|
28
55
|
process.exit(e.code);
|
29
56
|
}
|
@@ -51,22 +78,27 @@ const getScripts = (options) => {
|
|
51
78
|
}
|
52
79
|
|
53
80
|
const scripts = {
|
54
|
-
clean: 'rimraf
|
81
|
+
clean: 'rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
55
82
|
lint: `eslint . ${eslintConfig}`,
|
56
83
|
lintfix: `eslint . ${eslintConfig} --fix`,
|
84
|
+
generate: {
|
85
|
+
default: `${tsCrossEnv} nps prepare.all`,
|
86
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copyProps" "nps build.illustrations"',
|
87
|
+
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
88
|
+
},
|
57
89
|
prepare: {
|
58
|
-
default: `${tsCrossEnv} nps clean prepare.all typescript generateAPI`,
|
59
|
-
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps
|
90
|
+
default: `${tsCrossEnv} nps clean prepare.all ${options.legacy ? "copy" : ""} copyProps prepare.typescript generateAPI`,
|
91
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps build.illustrations"',
|
60
92
|
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
93
|
+
typescript: tsCommandOld,
|
61
94
|
},
|
62
|
-
typescript: tsCommand,
|
63
95
|
build: {
|
64
|
-
default: "nps prepare lint build.bundle",
|
65
|
-
templates: `mkdirp
|
96
|
+
default: "nps prepare lint build.bundle", // build.bundle2
|
97
|
+
templates: `mkdirp src/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`,
|
66
98
|
styles: {
|
67
|
-
default: `nps build.styles.themes build.styles.components
|
68
|
-
themes: `node "${LIB}/
|
69
|
-
components: "
|
99
|
+
default: `concurrently "nps build.styles.themes" "nps build.styles.components"`,
|
100
|
+
themes: `node "${LIB}/css-processors/css-processor-themes.mjs"`,
|
101
|
+
components: `node "${LIB}/css-processors/css-processor-components.mjs"`,
|
70
102
|
},
|
71
103
|
i18n: {
|
72
104
|
default: "nps build.i18n.defaultsjs build.i18n.json",
|
@@ -74,50 +106,50 @@ const getScripts = (options) => {
|
|
74
106
|
json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
75
107
|
},
|
76
108
|
jsonImports: {
|
77
|
-
default: "mkdirp
|
78
|
-
themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes
|
79
|
-
i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n
|
109
|
+
default: "mkdirp src/generated/json-imports && nps build.jsonImports.themes build.jsonImports.i18n",
|
110
|
+
themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes src/generated/json-imports`,
|
111
|
+
i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n src/generated/json-imports`,
|
80
112
|
},
|
81
113
|
jsImports: {
|
82
|
-
default: "mkdirp
|
114
|
+
default: "mkdirp src/generated/js-imports && nps build.jsImports.illustrationsLoaders",
|
83
115
|
illustrationsLoaders: createIllustrationsLoadersScript,
|
84
116
|
},
|
85
|
-
bundle: `vite build ${viteConfig}`,
|
117
|
+
bundle: `vite build ${viteConfig} --mode testing --base ${websiteBaseUrl}`,
|
118
|
+
bundle2: ``,
|
86
119
|
illustrations: createIllustrationsJSImportsScript,
|
87
120
|
},
|
121
|
+
copyProps: `node "${LIB}/copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/`,
|
88
122
|
copy: {
|
89
123
|
default: "nps copy.src copy.props",
|
90
|
-
src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
|
91
|
-
|
92
|
-
props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
|
124
|
+
src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/`,
|
125
|
+
props: `node "${LIB}/copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/`,
|
93
126
|
},
|
94
127
|
watch: {
|
95
|
-
default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.
|
128
|
+
default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.typescript" ${options.legacy ? '"nps watch.src"' : ""} "nps watch.styles" "nps watch.i18n" "nps watch.props"`,
|
96
129
|
devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
|
97
130
|
src: 'nps "copy.src --watch --safe --skip-initial-copy"',
|
98
|
-
typescript:
|
99
|
-
props: 'nps "
|
100
|
-
bundle: `node ${LIB}/dev-server/dev-server.
|
131
|
+
typescript: tsWatchCommandStandalone,
|
132
|
+
props: 'nps "copyProps --watch --safe --skip-initial-copy"',
|
133
|
+
bundle: `node ${LIB}/dev-server/dev-server.mjs ${viteConfig}`,
|
101
134
|
styles: {
|
102
135
|
default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
|
103
136
|
themes: 'nps "build.styles.themes -w"',
|
104
|
-
components:
|
105
|
-
default: 'concurrently "nps watch.styles.components.existingFiles" "nps watch.styles.components.newFiles"',
|
106
|
-
existingFiles: `nps "build.styles.components -w"`,
|
107
|
-
newFiles: `node "${LIB}/postcss-new-files/index.js" --srcFiles="src/themes/*.css"`,
|
108
|
-
},
|
137
|
+
components: `nps "build.styles.components -w"`,
|
109
138
|
},
|
110
|
-
templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
|
111
|
-
api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"',
|
139
|
+
templates: 'chokidar "src/**/*.hbs" -i "src/generated" -c "nps build.templates"',
|
112
140
|
i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
|
113
141
|
},
|
114
142
|
start: "nps prepare watch.devServer",
|
115
143
|
test: `node "${LIB}/test-runner/test-runner.js"`,
|
144
|
+
"test-cy-ci": `${cypressEnvVariables(options)} yarn cypress run --component --browser chrome`,
|
145
|
+
"test-cy-ci-suite-1": `${cypressEnvVariables(options, ["TEST_SUITE=SUITE1"])} yarn cypress run --component --browser chrome`,
|
146
|
+
"test-cy-ci-suite-2": `${cypressEnvVariables(options, ["TEST_SUITE=SUITE2"])} yarn cypress run --component --browser chrome`,
|
147
|
+
"test-cy-open": `${cypressEnvVariables(options)} yarn cypress open --component --browser chrome`,
|
116
148
|
"test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
|
117
149
|
"test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
|
118
150
|
startWithScope: "nps scope.prepare scope.watchWithBundle",
|
119
151
|
scope: {
|
120
|
-
prepare: "nps scope.lint
|
152
|
+
prepare: "nps scope.lint scope.testPages",
|
121
153
|
lint: `node "${LIB}/scoping/lint-src.js"`,
|
122
154
|
testPages: {
|
123
155
|
default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
|
@@ -126,16 +158,13 @@ const getScripts = (options) => {
|
|
126
158
|
replace: `node "${LIB}/scoping/scope-test-pages.js" test/pages/scoped demo`,
|
127
159
|
},
|
128
160
|
watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
|
129
|
-
watch: 'concurrently "nps watch.templates" "nps watch.
|
130
|
-
bundle: `node ${LIB}/dev-server/dev-server.
|
161
|
+
watch: 'concurrently "nps watch.templates" "nps watch.props" "nps watch.styles"',
|
162
|
+
bundle: `node ${LIB}/dev-server/dev-server.mjs ${viteConfig}`,
|
131
163
|
},
|
132
164
|
generateAPI: {
|
133
|
-
default: "nps generateAPI.
|
134
|
-
|
135
|
-
|
136
|
-
preprocess: `node "${preprocessJSDocScript}" jsdoc-dist/ src`,
|
137
|
-
jsdoc: `jsdoc -c "${LIB}/jsdoc/configTypescript.json"`,
|
138
|
-
cleanup: "rimraf jsdoc-dist/"
|
165
|
+
default: tsOption ? "nps generateAPI.generateCEM generateAPI.validateCEM" : "",
|
166
|
+
generateCEM: `${options.dev ? "cross-env UI5_CEM_MODE='dev'" : ""} cem analyze --config "${LIB}/cem/custom-elements-manifest.config.mjs"`,
|
167
|
+
validateCEM: `${options.dev ? "cross-env UI5_CEM_MODE='dev'" : ""} node "${LIB}/cem/validate.js"`,
|
139
168
|
},
|
140
169
|
};
|
141
170
|
|
@@ -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,50 +1 @@
|
|
1
|
-
|
2
|
-
const combineSelectors = require('../lib/postcss-combine-duplicated-selectors/index.js');
|
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
|
-
const modifySelectors = require("modify-selectors");
|
7
|
-
const fs = require("fs");
|
8
|
-
|
9
|
-
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
10
|
-
const selectors = [".sapUiSizeCompact", ".ui5-content-density-compact", "[data-ui5-compact-size]", "[dir=\"rtl\"]", "[dir=\"ltr\"]"];
|
11
|
-
|
12
|
-
module.exports = {
|
13
|
-
plugins: [
|
14
|
-
postcssImport(),
|
15
|
-
combineSelectors({
|
16
|
-
removeDuplicatedProperties: true
|
17
|
-
}),
|
18
|
-
cssnano({
|
19
|
-
preset: [
|
20
|
-
'default', {
|
21
|
-
mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
|
22
|
-
},
|
23
|
-
]
|
24
|
-
},),
|
25
|
-
modifySelectors({
|
26
|
-
enable: true,
|
27
|
-
suffix: [
|
28
|
-
{
|
29
|
-
match: '*',
|
30
|
-
with: '[_ui5host]', // Add suffix to each selector in the file (:root => :root [_ui5host])
|
31
|
-
},
|
32
|
-
],
|
33
|
-
}),
|
34
|
-
modifySelectors({
|
35
|
-
enable: true,
|
36
|
-
modify: [
|
37
|
-
{
|
38
|
-
match: (selector) => {
|
39
|
-
return selectors.some($ => selector.startsWith($));
|
40
|
-
},
|
41
|
-
with: (selector) => {
|
42
|
-
return `${selector.replace(" ", "")}, ${selector}`;
|
43
|
-
},
|
44
|
-
},
|
45
|
-
]
|
46
|
-
}),
|
47
|
-
postcssCSStoJSON({ toReplace: 'src', packageName }),
|
48
|
-
postcssCSStoESM({ toReplace: 'src', packageName }),
|
49
|
-
]
|
50
|
-
};
|
1
|
+
module.exports = {};
|
@@ -1,13 +1,9 @@
|
|
1
1
|
// vite.config.js
|
2
|
-
|
3
|
-
import virtualIndex from '../lib/dev-server/virtual-index-html-plugin.js';
|
2
|
+
const virtualIndex = require('../lib/dev-server/virtual-index-html-plugin.js');
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
plugins: [data],
|
12
|
-
}
|
13
|
-
})
|
4
|
+
module.exports = {
|
5
|
+
build: {
|
6
|
+
emptyOutDir: false,
|
7
|
+
},
|
8
|
+
plugins: [virtualIndex()],
|
9
|
+
};
|