@ui5/webcomponents-tools 0.0.0-dff5837d7 → 0.0.0-e03cd01f3
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 +2415 -0
- package/LICENSE.txt +201 -0
- package/README.md +7 -10
- package/assets-meta.js +23 -5
- package/bin/dev.js +8 -6
- package/bin/ui5nps.js +274 -0
- package/components-package/eslint.js +66 -2
- package/components-package/nps.js +147 -49
- package/components-package/postcss.components.js +1 -21
- package/components-package/postcss.themes.js +1 -23
- package/components-package/vite.config.js +9 -0
- package/components-package/wdio.js +118 -41
- package/icons-collection/nps.js +64 -12
- package/lib/amd-to-es6/index.js +107 -0
- package/lib/amd-to-es6/no-remaining-require.js +33 -0
- package/lib/cem/cem.js +12 -0
- package/lib/cem/custom-elements-manifest.config.mjs +550 -0
- package/lib/cem/event.mjs +168 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/cli.js +128 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/package.json +59 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/browser-entrypoint.js +23 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/create.js +117 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/arrow-function.js +26 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/class-jsdoc.js +157 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/classes.js +20 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createArrowFunction.js +17 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createAttribute.js +24 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createClass.js +301 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createClassField.js +26 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createFunctionLike.js +73 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createMixin.js +33 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/createVariable.js +22 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/handlers.js +338 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/custom-elements-define-calls.js +90 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/exports.js +156 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/function-like.js +24 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/mixins.js +29 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/reexported-wrapped-mixin-exports.js +84 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/analyse-phase/variables.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/collect-phase/collect-imports.js +101 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst/catalyst.js +11 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst/controller.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst-major-2/catalyst.js +11 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/catalyst-major-2/controller.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/decorators/attr.js +53 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/decorators/custom-element-decorator.js +36 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/fast/fast.js +7 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/lit.js +13 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/member-denylist.js +21 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/method-denylist.js +20 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/property-decorator.js +94 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/static-properties.js +121 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/lit/utils.js +66 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/framework-plugins/stencil/stencil.js +129 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/index.js +80 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/link-phase/cleanup-classes.js +25 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/link-phase/field-denylist.js +22 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/link-phase/method-denylist.js +25 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/apply-inheritance.js +78 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/is-custom-element.js +34 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/link-class-to-tagname.js +27 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/remove-unexported-declarations.js +23 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/features/post-processing/resolve-initializers.js +52 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/ast-helpers.js +186 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/cli-helpers.js +164 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/exports.js +44 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/find-external-manifests.js +67 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/imports.js +25 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/index.js +71 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/jsdoc.js +19 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/manifest-helpers.js +194 -0
- package/lib/cem/patch/@custom-elements-manifest/analyzer/src/utils/mixins.js +112 -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 +76 -0
- package/lib/chokidar/chokidar.js +28 -0
- package/lib/copy-and-watch/index.js +128 -95
- package/lib/copy-list/index.js +34 -0
- package/lib/create-icons/index.js +131 -54
- package/lib/create-illustrations/index.js +204 -0
- package/lib/create-new-component/Component.js +74 -0
- package/lib/create-new-component/ComponentTemplate.js +12 -0
- package/lib/create-new-component/index.js +66 -93
- package/lib/css-processors/css-processor-components.mjs +92 -0
- package/lib/css-processors/css-processor-themes.mjs +102 -0
- package/lib/css-processors/scope-variables.mjs +49 -0
- package/lib/css-processors/shared.mjs +46 -0
- package/lib/dev-server/custom-hot-update-plugin.js +39 -0
- package/lib/dev-server/dev-server.mjs +78 -0
- package/lib/dev-server/virtual-index-html-plugin.js +56 -0
- package/lib/eslint/eslint.js +44 -0
- package/lib/generate-js-imports/illustrations.js +85 -0
- package/lib/generate-json-imports/i18n.js +73 -38
- package/lib/generate-json-imports/themes.js +58 -20
- package/lib/hbs2lit/src/compiler.js +24 -4
- package/lib/hbs2lit/src/includesReplacer.js +5 -5
- package/lib/hbs2lit/src/litVisitor2.js +125 -26
- package/lib/hbs2lit/src/svgProcessor.js +12 -5
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +40 -7
- package/lib/hbs2ui5/index.js +68 -19
- package/lib/i18n/defaults.js +74 -60
- package/lib/i18n/toJSON.js +46 -19
- package/lib/icons-hash/icons-hash.mjs +149 -0
- package/lib/postcss-combine-duplicated-selectors/index.js +185 -0
- package/lib/remove-dev-mode/remove-dev-mode.mjs +51 -0
- package/lib/rimraf/rimraf.js +31 -0
- package/lib/scoping/get-all-tags.js +44 -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 +79 -0
- package/lib/vite-bundler/vite-bundler.mjs +35 -0
- package/package.json +62 -58
- package/tsconfig.json +18 -0
- package/bin/init-ui5-package.js +0 -3
- package/components-package/rollup.js +0 -134
- package/components-package/serve.json +0 -3
- package/lib/documentation/index.js +0 -143
- package/lib/documentation/templates/api-component-since.js +0 -3
- package/lib/documentation/templates/api-css-variables-section.js +0 -24
- package/lib/documentation/templates/api-events-section.js +0 -35
- package/lib/documentation/templates/api-methods-section.js +0 -26
- package/lib/documentation/templates/api-properties-section.js +0 -40
- package/lib/documentation/templates/api-slots-section.js +0 -28
- package/lib/documentation/templates/template.js +0 -38
- package/lib/init-package/index.js +0 -112
- package/lib/init-package/resources/.eslintignore +0 -3
- package/lib/init-package/resources/bundle.es5.js +0 -25
- package/lib/init-package/resources/bundle.esm.js +0 -34
- package/lib/init-package/resources/config/.eslintrc.js +0 -1
- package/lib/init-package/resources/config/postcss.components/postcss.config.js +0 -1
- package/lib/init-package/resources/config/postcss.themes/postcss.config.js +0 -1
- package/lib/init-package/resources/config/rollup.config.js +0 -1
- package/lib/init-package/resources/config/wdio.conf.js +0 -1
- package/lib/init-package/resources/package-scripts.js +0 -11
- package/lib/init-package/resources/src/Assets.js +0 -5
- package/lib/init-package/resources/src/Demo.hbs +0 -1
- package/lib/init-package/resources/src/Demo.js +0 -56
- package/lib/init-package/resources/src/i18n/messagebundle.properties +0 -2
- package/lib/init-package/resources/src/i18n/messagebundle_de.properties +0 -1
- package/lib/init-package/resources/src/i18n/messagebundle_en.properties +0 -1
- package/lib/init-package/resources/src/i18n/messagebundle_es.properties +0 -1
- package/lib/init-package/resources/src/i18n/messagebundle_fr.properties +0 -1
- package/lib/init-package/resources/src/themes/Demo.css +0 -11
- package/lib/init-package/resources/src/themes/sap_belize/parameters-bundle.css +0 -3
- package/lib/init-package/resources/src/themes/sap_belize_hcb/parameters-bundle.css +0 -3
- package/lib/init-package/resources/src/themes/sap_belize_hcw/parameters-bundle.css +0 -3
- package/lib/init-package/resources/src/themes/sap_fiori_3/parameters-bundle.css +0 -3
- package/lib/init-package/resources/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
- package/lib/init-package/resources/test/pages/index.html +0 -51
- package/lib/init-package/resources/test/specs/Demo.spec.js +0 -12
- package/lib/jsdoc/config.json +0 -29
- package/lib/jsdoc/plugin.js +0 -2407
- package/lib/jsdoc/template/publish.js +0 -4092
- package/lib/postcss-css-to-esm/index.js +0 -42
- package/lib/postcss-css-to-json/index.js +0 -27
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns eslint rules specific to typescript files
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
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
|
+
}
|
|
62
|
+
|
|
1
63
|
module.exports = {
|
|
2
64
|
"env": {
|
|
3
65
|
"browser": true,
|
|
@@ -5,6 +67,7 @@ module.exports = {
|
|
|
5
67
|
},
|
|
6
68
|
"root": true,
|
|
7
69
|
"extends": "airbnb-base",
|
|
70
|
+
"overrides": tsMode ? getTsModeOverrides() : [],
|
|
8
71
|
"parserOptions": {
|
|
9
72
|
"ecmaVersion": 2018,
|
|
10
73
|
"sourceType": "module"
|
|
@@ -47,6 +110,7 @@ module.exports = {
|
|
|
47
110
|
"curly": [2, "all"],
|
|
48
111
|
// "default-case": 1, // removed for UI5 WebComponents
|
|
49
112
|
"import/extensions": ["error", "always"], // override for UI5 WebComponents
|
|
113
|
+
"import/order": "off",
|
|
50
114
|
"no-alert": 2,
|
|
51
115
|
"no-caller": 2,
|
|
52
116
|
"no-div-regex": 2,
|
|
@@ -88,7 +152,7 @@ module.exports = {
|
|
|
88
152
|
"no-shadow-restricted-names": 2,
|
|
89
153
|
"no-undef-init": 2,
|
|
90
154
|
"no-undef": 2,
|
|
91
|
-
"no-unused-vars": [2, {"vars":"all", "args":"none"}],
|
|
155
|
+
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
|
|
92
156
|
|
|
93
157
|
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
|
|
94
158
|
"camelcase": [1, { "properties": "never" }], // added for UI5 WebComponents
|
|
@@ -104,7 +168,7 @@ module.exports = {
|
|
|
104
168
|
"no-new-object": 2,
|
|
105
169
|
"no-spaced-func": 2,
|
|
106
170
|
"quote-props": [2, "as-needed", { "keywords": true, "unnecessary": false }],
|
|
107
|
-
"semi-spacing": [1, {"before": false, "after": true}],
|
|
171
|
+
"semi-spacing": [1, { "before": false, "after": true }],
|
|
108
172
|
"semi": 2,
|
|
109
173
|
"keyword-spacing": 2,
|
|
110
174
|
"space-infix-ops": 2,
|
|
@@ -1,74 +1,172 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
-
|
|
2
|
+
const fs = require("fs");
|
|
3
3
|
const LIB = path.join(__dirname, `../lib/`);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
4
|
+
let websiteBaseUrl = "/";
|
|
5
|
+
|
|
6
|
+
const isPreview = !!process.env.PR_NUMBER;
|
|
7
|
+
const getPreviewBaseUrl = () => {
|
|
8
|
+
if (process.env.DEPLOYMENT_TYPE === "netlify_preview") {
|
|
9
|
+
return "/";
|
|
10
|
+
}
|
|
11
|
+
return `/webcomponents/pr-${process.env.PR_NUMBER}/`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (process.env.DEPLOY) {
|
|
15
|
+
websiteBaseUrl = "/webcomponents/";
|
|
16
|
+
} else if (process.env.DEPLOY_NIGHTLY) {
|
|
17
|
+
websiteBaseUrl = "/webcomponents/nightly/";
|
|
18
|
+
} else if (isPreview) {
|
|
19
|
+
websiteBaseUrl = getPreviewBaseUrl();
|
|
20
|
+
}
|
|
7
21
|
|
|
8
22
|
const getScripts = (options) => {
|
|
23
|
+
// The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
|
|
24
|
+
const illustrationsData = options.illustrationsData || [];
|
|
25
|
+
const createIllustrationsJSImportsScript = {
|
|
26
|
+
default: `ui5nps-p ${illustrationsData.map(illustrations => `build.illustrations.build-${illustrations.set}-${illustrations.collection}`).join(" ")}` // concurently,
|
|
27
|
+
}
|
|
28
|
+
illustrationsData.forEach((illustration) => {
|
|
29
|
+
createIllustrationsJSImportsScript[`build-${illustration.set}-${illustration.collection}`] = `ui5nps-script "${LIB}create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath} ${illustration.collection}`
|
|
30
|
+
});
|
|
31
|
+
// The script creates the "src/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
|
|
32
|
+
const createIllustrationsLoadersScript = {
|
|
33
|
+
default: `ui5nps-p ${illustrationsData.map(illustrations => `build.jsImports.illustrationsLoaders.generate-${illustrations.set}-${illustrations.collection}`).join(" ")}` // concurently,
|
|
34
|
+
}
|
|
35
|
+
illustrationsData.forEach((illustrations) => {
|
|
36
|
+
createIllustrationsLoadersScript[`generate-${illustrations.set}-${illustrations.collection}`] = `ui5nps-script ${LIB}generate-js-imports/illustrations.js ${illustrations.path} ${illustrations.dynamicImports.outputFile} ${illustrations.set} ${illustrations.collection} ${illustrations.dynamicImports.location} ${illustrations.dynamicImports.filterOut.join(",")}`
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
const tsOption = !!(!options.legacy || options.jsx);
|
|
41
|
+
const tsCommandOld = tsOption ? "tsc" : "";
|
|
42
|
+
let tsWatchCommandStandalone = tsOption ? "tsc --watch" : "";
|
|
43
|
+
// this command is only used for standalone projects. monorepo projects get their watch from vite, so opt-out here
|
|
44
|
+
if (options.noWatchTS) {
|
|
45
|
+
tsWatchCommandStandalone = "";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (tsOption) {
|
|
49
|
+
try {
|
|
50
|
+
require("typescript");
|
|
51
|
+
} catch (e) {
|
|
52
|
+
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.`);
|
|
53
|
+
process.exit(e.code);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
9
56
|
|
|
10
|
-
|
|
57
|
+
let viteConfig;
|
|
58
|
+
if (fs.existsSync("config/vite.config.js")) {
|
|
59
|
+
// old project setup where config file is in separate folder
|
|
60
|
+
viteConfig = "-c config/vite.config.js";
|
|
61
|
+
} else if (fs.existsSync("vite.config.js")) {
|
|
62
|
+
// preferred way of custom configuration in root project folder
|
|
63
|
+
viteConfig = "";
|
|
64
|
+
} else {
|
|
65
|
+
// no custom configuration - use default from tools project
|
|
66
|
+
viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
|
67
|
+
}
|
|
11
68
|
|
|
12
69
|
const scripts = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
70
|
+
__ui5envs: {
|
|
71
|
+
UI5_CEM_MODE: options.dev,
|
|
72
|
+
UI5_TS: `${tsOption}`,
|
|
73
|
+
CYPRESS_COVERAGE: !!(options.internal?.cypress_code_coverage),
|
|
74
|
+
},
|
|
75
|
+
clean: {
|
|
76
|
+
"default": "ui5nps clean.generated clean.dist scope.testPages.clean",
|
|
77
|
+
"generated": `ui5nps-script "${LIB}/rimraf/rimraf.js src/generated`,
|
|
78
|
+
"dist": `ui5nps-script "${LIB}/rimraf/rimraf.js dist`,
|
|
79
|
+
},
|
|
80
|
+
lint: `ui5nps-script "${LIB}eslint/eslint.js"`,
|
|
81
|
+
lintfix: `ui5nps-script "${LIB}eslint/eslint.js" --fix`,
|
|
82
|
+
generate: {
|
|
83
|
+
default: `ui5nps prepare.all`,
|
|
84
|
+
all: `ui5nps-p build.templates build.i18n prepare.styleRelated copyProps build.illustrations`, // concurently
|
|
85
|
+
styleRelated: "ui5nps build.styles build.jsonImports build.jsImports",
|
|
86
|
+
},
|
|
87
|
+
prepare: {
|
|
88
|
+
default: `ui5nps clean prepare.all copy copyProps prepare.typescript generateAPI`,
|
|
89
|
+
all: `ui5nps-p build.templates build.i18n prepare.styleRelated build.illustrations`, // concurently
|
|
90
|
+
styleRelated: "ui5nps build.styles build.jsonImports build.jsImports",
|
|
91
|
+
typescript: tsCommandOld,
|
|
92
|
+
},
|
|
16
93
|
build: {
|
|
17
|
-
default: "
|
|
18
|
-
templates:
|
|
94
|
+
default: "ui5nps prepare lint build.bundle", // build.bundle2
|
|
95
|
+
templates: options.legacy ? `node "${LIB}hbs2ui5/index.js" -d src/ -o src/generated/templates` : "",
|
|
19
96
|
styles: {
|
|
20
|
-
default:
|
|
21
|
-
themes: "
|
|
22
|
-
|
|
97
|
+
default: `ui5nps-p build.styles.themes build.styles.components`, // concurently
|
|
98
|
+
themes: `ui5nps-script "${LIB}css-processors/css-processor-themes.mjs"`,
|
|
99
|
+
themesWithWatch: `ui5nps-script "${LIB}css-processors/css-processor-themes.mjs" -w`,
|
|
100
|
+
components: `ui5nps-script "${LIB}css-processors/css-processor-components.mjs"`,
|
|
101
|
+
componentsWithWatch: `ui5nps-script "${LIB}css-processors/css-processor-components.mjs" -w`,
|
|
23
102
|
},
|
|
24
103
|
i18n: {
|
|
25
|
-
default: "
|
|
26
|
-
defaultsjs: `
|
|
27
|
-
json: `
|
|
104
|
+
default: "ui5nps build.i18n.defaultsjs build.i18n.json",
|
|
105
|
+
defaultsjs: `ui5nps-script "${LIB}i18n/defaults.js" src/i18n src/generated/i18n`,
|
|
106
|
+
json: `ui5nps-script "${LIB}i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
|
|
28
107
|
},
|
|
29
108
|
jsonImports: {
|
|
30
|
-
default: "
|
|
31
|
-
themes: `
|
|
32
|
-
i18n: `
|
|
109
|
+
default: "ui5nps build.jsonImports.themes build.jsonImports.i18n",
|
|
110
|
+
themes: `ui5nps-script "${LIB}generate-json-imports/themes.js" src/themes src/generated/json-imports`,
|
|
111
|
+
i18n: `ui5nps-script "${LIB}generate-json-imports/i18n.js" src/i18n src/generated/json-imports`,
|
|
112
|
+
},
|
|
113
|
+
jsImports: {
|
|
114
|
+
default: "ui5nps build.jsImports.illustrationsLoaders",
|
|
115
|
+
illustrationsLoaders: createIllustrationsLoadersScript,
|
|
33
116
|
},
|
|
34
|
-
bundle: "
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
|
|
38
|
-
docs: `node "${LIB}/documentation/index.js" dist/api.json`,
|
|
39
|
-
}
|
|
117
|
+
bundle: `ui5nps-script "${LIB}vite-bundler/vite-bundler.mjs" ${viteConfig} --mode testing --base ${websiteBaseUrl}`,
|
|
118
|
+
bundle2: ``,
|
|
119
|
+
illustrations: createIllustrationsJSImportsScript,
|
|
40
120
|
},
|
|
121
|
+
copyProps: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/`,
|
|
122
|
+
copyPropsWithWatch: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/ --watch --safe --skip-initial-copy`,
|
|
123
|
+
copySrcWithWatch: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/ --watch --safe --skip-initial-copy`,
|
|
41
124
|
copy: {
|
|
42
|
-
default: "
|
|
43
|
-
src: `
|
|
44
|
-
|
|
45
|
-
"webcomponents-polyfill": `node "${LIB}/copy-and-watch/index.js" "${polyfillPath}" dist/webcomponentsjs/`,
|
|
125
|
+
default: options.legacy ? "ui5nps copy.src copy.props" : "",
|
|
126
|
+
src: options.legacy ? `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/` : "",
|
|
127
|
+
props: options.legacy ? `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/` : "",
|
|
46
128
|
},
|
|
47
129
|
watch: {
|
|
48
|
-
default:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
130
|
+
default: `ui5nps-p watch.templates watch.typescript watch.src watch.styles watch.i18n watch.props`, // concurently
|
|
131
|
+
devServer: 'ui5nps-p watch.default watch.bundle', // concurently
|
|
132
|
+
src: options.legacy ? 'ui5nps copySrcWithWatch' : "",
|
|
133
|
+
typescript: tsWatchCommandStandalone,
|
|
134
|
+
props: 'ui5nps copyPropsWithWatch',
|
|
135
|
+
bundle: `ui5nps-script ${LIB}dev-server/dev-server.mjs ${viteConfig}`,
|
|
52
136
|
styles: {
|
|
53
|
-
default: '
|
|
54
|
-
themes: '
|
|
55
|
-
components:
|
|
137
|
+
default: 'ui5nps-p watch.styles.themes watch.styles.components', // concurently
|
|
138
|
+
themes: 'ui5nps build.styles.themesWithWatch',
|
|
139
|
+
components: `ui5nps build.styles.componentsWithWatch`,
|
|
56
140
|
},
|
|
57
|
-
templates: "chokidar
|
|
58
|
-
|
|
141
|
+
templates: options.legacy ? `ui5nps-script "${LIB}chokidar/chokidar.js" "src/**/*.hbs" "ui5nps build.templates"` : "",
|
|
142
|
+
i18n: `ui5nps-script "${LIB}chokidar/chokidar.js" "src/i18n/messagebundle.properties" "ui5nps build.i18n.defaultsjs"`
|
|
59
143
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
144
|
+
start: "ui5nps prepare watch.devServer",
|
|
145
|
+
test: `ui5nps-script "${LIB}/test-runner/test-runner.js"`,
|
|
146
|
+
"test-cy-ci": `cypress run --component --browser chrome`,
|
|
147
|
+
"test-cy-ci-suite-1": `cypress run --component --browser chrome --spec "**/specs/[A-C]*.cy.{js,jsx,ts,tsx},**/specs/[^D-Z]*.cy.{js,jsx,ts,tsx}"`,
|
|
148
|
+
"test-cy-ci-suite-2": `cypress run --component --browser chrome --spec "**/specs/[D-L]*.cy.{js,jsx,ts,tsx}"`,
|
|
149
|
+
"test-cy-ci-suite-3": `cypress run --component --browser chrome --spec "**/specs/[M-S]*.cy.{js,jsx,ts,tsx}"`,
|
|
150
|
+
"test-cy-ci-suite-4": `cypress run --component --browser chrome --spec "**/specs/[T-Z]*.cy.{js,jsx,ts,tsx}"`,
|
|
151
|
+
"test-cy-open": `cypress open --component --browser chrome`,
|
|
152
|
+
startWithScope: "ui5nps scope.prepare scope.watchWithBundle",
|
|
153
|
+
scope: {
|
|
154
|
+
prepare: "ui5nps scope.lint scope.testPages",
|
|
155
|
+
lint: `ui5nps-script "${LIB}scoping/lint-src.js"`,
|
|
156
|
+
testPages: {
|
|
157
|
+
default: "ui5nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
|
|
158
|
+
"clean": `ui5nps-script "${LIB}/rimraf/rimraf.js test/pages/scoped`,
|
|
159
|
+
copy: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "test/pages/**/*" test/pages/scoped`,
|
|
160
|
+
replace: `ui5nps-script "${LIB}scoping/scope-test-pages.js" test/pages/scoped demo`,
|
|
161
|
+
},
|
|
162
|
+
watchWithBundle: 'ui5nps-p scope.watch scope.bundle', // concurently
|
|
163
|
+
watch: 'ui5nps-p watch.templates watch.props watch.styles', // concurently
|
|
164
|
+
bundle: `ui5nps-script ${LIB}dev-server/dev-server.mjs ${viteConfig}`,
|
|
66
165
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
spec: "wdio run config/wdio.conf.js",
|
|
166
|
+
generateAPI: {
|
|
167
|
+
default: tsOption ? "ui5nps generateAPI.generateCEM generateAPI.validateCEM" : "",
|
|
168
|
+
generateCEM: `ui5nps-script "${LIB}cem/cem.js" analyze --config "${LIB}cem/custom-elements-manifest.config.mjs"`,
|
|
169
|
+
validateCEM: `ui5nps-script "${LIB}cem/validate.js"`,
|
|
72
170
|
},
|
|
73
171
|
};
|
|
74
172
|
|
|
@@ -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 = {};
|