@ui5/webcomponents-tools 0.0.0-deac3098a → 0.0.0-e0658a650
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 +113 -0
- package/README.md +5 -6
- package/bin/dev.js +1 -5
- package/components-package/eslint.js +28 -0
- package/components-package/nps.js +72 -54
- package/components-package/postcss.themes.js +1 -1
- package/components-package/vite.config.js +12 -0
- package/components-package/wdio.js +21 -4
- package/components-package/wdio.sync.js +1 -1
- package/icons-collection/nps.js +1 -7
- package/lib/copy-and-watch/index.js +24 -1
- package/lib/copy-list/index.js +16 -16
- package/lib/create-icons/index.js +101 -72
- package/lib/create-illustrations/index.js +101 -90
- package/lib/create-new-component/index.js +1 -1
- package/lib/dev-server/dev-server.js +66 -0
- package/lib/dev-server/virtual-index-html-plugin.js +52 -0
- package/lib/esm-abs-to-rel/index.js +13 -9
- package/lib/generate-custom-elements-manifest/index.js +369 -0
- package/lib/generate-js-imports/illustrations.js +72 -0
- package/lib/generate-json-imports/i18n.js +38 -31
- package/lib/generate-json-imports/themes.js +31 -24
- package/lib/hbs2lit/src/compiler.js +10 -2
- package/lib/hbs2lit/src/includesReplacer.js +5 -5
- package/lib/hbs2lit/src/litVisitor2.js +46 -8
- package/lib/hbs2ui5/index.js +37 -21
- package/lib/i18n/defaults.js +58 -57
- package/lib/i18n/toJSON.js +12 -11
- package/lib/jsdoc/configTypescript.json +29 -0
- package/lib/jsdoc/plugin.js +32 -0
- package/lib/jsdoc/preprocess.js +60 -0
- package/lib/jsdoc/template/publish.js +9 -1
- package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
- package/lib/postcss-css-to-esm/index.js +13 -1
- package/lib/postcss-css-to-json/index.js +12 -1
- package/lib/postcss-p/postcss-p.mjs +3 -0
- package/lib/replace-global-core/index.js +13 -8
- package/lib/scoping/get-all-tags.js +1 -8
- package/lib/scoping/scope-test-pages.js +1 -1
- package/lib/test-runner/test-runner.js +63 -0
- package/package.json +17 -25
- package/components-package/rollup-plugins/empty-module.js +0 -15
- package/components-package/rollup.js +0 -239
- package/lib/documentation/index.js +0 -165
- 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 -42
- package/lib/documentation/templates/api-slots-section.js +0 -28
- package/lib/documentation/templates/template.js +0 -39
- package/lib/hash/config.js +0 -10
- package/lib/hash/generate.js +0 -19
- package/lib/hash/upToDate.js +0 -31
- package/lib/polyfill-placeholder/index.js +0 -5
- package/lib/serve/index.js +0 -46
- package/lib/serve/serve.json +0 -3
- package/package-lock.json +0 -48
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,119 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.9.1](https://github.com/SAP/ui5-webcomponents/compare/v1.9.0...v1.9.1) (2022-11-10)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **framework:** fix paths for generating illustration imports in nps ([#5997](https://github.com/SAP/ui5-webcomponents/issues/5997)) ([e932f7d](https://github.com/SAP/ui5-webcomponents/commit/e932f7d069ebf10f73219bff7154558b7b0d849e))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [1.9.0](https://github.com/SAP/ui5-webcomponents/compare/v1.8.0...v1.9.0) (2022-10-31)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* **framework:** fix contexts management in hbs-2-lit compiler ([#5958](https://github.com/SAP/ui5-webcomponents/issues/5958)) ([94d1619](https://github.com/SAP/ui5-webcomponents/commit/94d16199ed7dc79b21d99a0637533e93af54c90a)), closes [#4701](https://github.com/SAP/ui5-webcomponents/issues/4701)
|
23
|
+
|
24
|
+
|
25
|
+
### Features
|
26
|
+
|
27
|
+
* **framework:** fetch illustrations on demand ([#5927](https://github.com/SAP/ui5-webcomponents/issues/5927)) ([f8e1033](https://github.com/SAP/ui5-webcomponents/commit/f8e1033643626261dcad8a38f65c325ba9aff99f))
|
28
|
+
* **framework:** generate custom elements manifest ([#5964](https://github.com/SAP/ui5-webcomponents/issues/5964)) ([0d62770](https://github.com/SAP/ui5-webcomponents/commit/0d62770cace54fd9aef73d9632dd06d8a83680e9))
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
# [1.8.0](https://github.com/SAP/ui5-webcomponents/compare/v1.7.1...v1.8.0) (2022-10-03)
|
35
|
+
|
36
|
+
|
37
|
+
### Features
|
38
|
+
|
39
|
+
* **icons:** create type-definitions for icon imports ([#5753](https://github.com/SAP/ui5-webcomponents/issues/5753)) ([2de4a04](https://github.com/SAP/ui5-webcomponents/commit/2de4a045f56e2f166d3e846ff11e6f9d76e98009)), closes [#5747](https://github.com/SAP/ui5-webcomponents/issues/5747) [#5335](https://github.com/SAP/ui5-webcomponents/issues/5335)
|
40
|
+
* **main:** add support for custom SVG icons ([#5865](https://github.com/SAP/ui5-webcomponents/issues/5865)) ([d8b7200](https://github.com/SAP/ui5-webcomponents/commit/d8b7200f30c16d94b7f15ddbdf9808d8efbaa38c))
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
## [1.7.1](https://github.com/SAP/ui5-webcomponents/compare/v1.7.0...v1.7.1) (2022-09-08)
|
47
|
+
|
48
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
# [1.7.0](https://github.com/SAP/ui5-webcomponents/compare/v1.6.0...v1.7.0) (2022-09-02)
|
55
|
+
|
56
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
# [1.6.0](https://github.com/SAP/ui5-webcomponents/compare/v1.5.0...v1.6.0) (2022-07-25)
|
63
|
+
|
64
|
+
|
65
|
+
### Bug Fixes
|
66
|
+
|
67
|
+
* **MultoComboBox:** fix component scoping ([#5553](https://github.com/SAP/ui5-webcomponents/issues/5553)) ([9c26e8e](https://github.com/SAP/ui5-webcomponents/commit/9c26e8e)), closes [#5521](https://github.com/SAP/ui5-webcomponents/issues/5521)
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
# [1.5.0](https://github.com/SAP/ui5-webcomponents/compare/v1.4.0...v1.5.0) (2022-07-03)
|
74
|
+
|
75
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
# [1.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
|
82
|
+
|
83
|
+
|
84
|
+
### Features
|
85
|
+
|
86
|
+
**Note:** Version bump only for package @ui5/webcomponents-icons-tnt
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
|
93
|
+
|
94
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
# [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
|
101
|
+
|
102
|
+
|
103
|
+
### Bug Fixes
|
104
|
+
|
105
|
+
* **localization:** fix js error if "sh" locale set ([#4905](https://github.com/SAP/ui5-webcomponents/issues/4905)) ([979bca2](https://github.com/SAP/ui5-webcomponents/commit/979bca2)), closes [#4904](https://github.com/SAP/ui5-webcomponents/issues/4904)
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
|
112
|
+
|
113
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
6
119
|
## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
|
7
120
|
|
8
121
|
**Note:** Version bump only for package @ui5/webcomponents-tools
|
package/README.md
CHANGED
@@ -1,24 +1,23 @@
|
|
1
|
-

|
2
2
|
|
3
3
|
# UI5 Web Components - Tools
|
4
4
|
|
5
|
-
[](https://travis-ci.org/SAP/ui5-webcomponents)
|
6
5
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
7
6
|
|
8
7
|
Provides libraries, configuration files and build artifacts,
|
9
8
|
used by other UI5 Web Components packages, such as `main` and `fiori`.
|
10
9
|
|
11
10
|
## Resources
|
12
|
-
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/
|
11
|
+
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
13
12
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
14
13
|
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
|
15
14
|
|
16
15
|
## Support
|
17
|
-
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
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://join-ui5-slack.herokuapp.com/).
|
18
17
|
|
19
18
|
## Contribute
|
20
|
-
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
19
|
+
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
21
20
|
|
22
21
|
## License
|
23
22
|
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/
|
23
|
+
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/bin/dev.js
CHANGED
@@ -10,11 +10,7 @@ if (command === "watch") {
|
|
10
10
|
command = `watch.${argument}`;
|
11
11
|
}
|
12
12
|
} else if (command === "test") {
|
13
|
-
|
14
|
-
command = `test.run`;
|
15
|
-
} else if (argument) { // yarn test test/specs/Button.spec.js
|
16
|
-
command = `test.spec --spec ${argument}`;
|
17
|
-
}
|
13
|
+
command = `test ${process.argv.slice(3).join(" ")}`;
|
18
14
|
}
|
19
15
|
|
20
16
|
child_process.execSync(`npx nps "${command}"`, {stdio: 'inherit'});
|
@@ -5,6 +5,34 @@ module.exports = {
|
|
5
5
|
},
|
6
6
|
"root": true,
|
7
7
|
"extends": "airbnb-base",
|
8
|
+
overrides: [{
|
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
|
+
},
|
19
|
+
/**
|
20
|
+
* Typescript Rules
|
21
|
+
*/
|
22
|
+
rules: {
|
23
|
+
"no-shadow": "off",
|
24
|
+
"@typescript-eslint/no-shadow": ["error"],
|
25
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
26
|
+
"@typescript-eslint/no-floating-promises": "off",
|
27
|
+
"@typescript-eslint/no-explicit-any": "off",
|
28
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
29
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
30
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
31
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
32
|
+
"@typescript-eslint/no-empty-function": "off",
|
33
|
+
"lines-between-class-members": "off",
|
34
|
+
}
|
35
|
+
}],
|
8
36
|
"parserOptions": {
|
9
37
|
"ecmaVersion": 2018,
|
10
38
|
"sourceType": "module"
|
@@ -1,31 +1,58 @@
|
|
1
1
|
const path = require("path");
|
2
2
|
const fs = require("fs");
|
3
|
-
|
3
|
+
const resolve = require("resolve");
|
4
4
|
const LIB = path.join(__dirname, `../lib/`);
|
5
|
-
const
|
6
|
-
const polyfillPath = path.join(polyfillDir, "{*.js,*.map,*.md,bundles/**/*.*}");
|
7
|
-
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
5
|
+
const preprocessJSDocScript = resolve.sync("@ui5/webcomponents-tools/lib/jsdoc/preprocess.js");
|
8
6
|
|
9
7
|
const getScripts = (options) => {
|
10
8
|
|
11
|
-
|
12
|
-
const
|
13
|
-
|
9
|
+
// The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
|
10
|
+
const illustrationsData = options.illustrationsData || [];
|
11
|
+
illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
|
12
|
+
const createIllustrationsJSImportsScript = illustrations.join(" && ");
|
13
|
+
|
14
|
+
// The script creates the "dist/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
|
15
|
+
const illustrationDestinationPaths = illustrationsData.map(illustrations => illustrations.destinationPath);
|
16
|
+
const createIllustrationsLoadersScript = options.fioriPackage ? `node ${LIB}/generate-js-imports/illustrations.js ${illustrationDestinationPaths[0]} ${illustrationDestinationPaths[1]} dist/generated/js-imports` : "";
|
17
|
+
const tsCommand = options.typescript ? "tsc" : "";
|
18
|
+
const tsWatchCommand = options.typescript ? "tsc --watch" : "";
|
14
19
|
|
15
|
-
|
20
|
+
let viteConfig;
|
21
|
+
if (fs.existsSync("config/vite.config.js")) {
|
22
|
+
// old project setup where config file is in separate folder
|
23
|
+
viteConfig = "-c config/vite.config.js";
|
24
|
+
} else if (fs.existsSync("vite.config.js")) {
|
25
|
+
// preferred way of custom configuration in root project folder
|
26
|
+
viteConfig = "";
|
27
|
+
} else {
|
28
|
+
// no custom configuration - use default from tools project
|
29
|
+
viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
30
|
+
}
|
16
31
|
|
17
|
-
let
|
32
|
+
let eslintConfig;
|
33
|
+
if (fs.existsSync("config/.eslintrc.js")) {
|
34
|
+
// old project setup where config file is in separate folder
|
35
|
+
eslintConfig = "--config config/.eslintrc.js";
|
36
|
+
} else if (fs.existsSync(".eslintrc.js")) {
|
37
|
+
// preferred way of custom configuration in root project folder
|
38
|
+
eslintConfig = "";
|
39
|
+
} else {
|
40
|
+
// no custom configuration - use default from tools project
|
41
|
+
eslintConfig = `--config "${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}"`;
|
42
|
+
}
|
18
43
|
|
19
44
|
const scripts = {
|
20
|
-
clean:
|
21
|
-
lint:
|
22
|
-
lintfix:
|
45
|
+
clean: 'rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
46
|
+
lint: `eslint . ${eslintConfig}`,
|
47
|
+
lintfix: `eslint . ${eslintConfig}`,
|
23
48
|
prepare: {
|
24
|
-
default: "nps clean
|
25
|
-
|
49
|
+
default: "nps clean prepare.all generateAPI",
|
50
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps typescript" "nps build.illustrations"',
|
51
|
+
styleRelated: "nps build.styles build.jsonImports build.jsImports",
|
26
52
|
},
|
53
|
+
typescript: tsCommand,
|
27
54
|
build: {
|
28
|
-
default: "nps lint prepare
|
55
|
+
default: "nps lint prepare build.bundle",
|
29
56
|
templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
|
30
57
|
styles: {
|
31
58
|
default: "nps build.styles.themes build.styles.components",
|
@@ -42,33 +69,25 @@ const getScripts = (options) => {
|
|
42
69
|
themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
|
43
70
|
i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
|
44
71
|
},
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
|
49
|
-
docs: `node "${LIB}/documentation/index.js" dist/api.json`,
|
72
|
+
jsImports: {
|
73
|
+
default: "mkdirp dist/generated/js-imports && nps build.jsImports.illustrationsLoaders",
|
74
|
+
illustrationsLoaders: createIllustrationsLoadersScript,
|
50
75
|
},
|
51
|
-
|
76
|
+
bundle: `vite build ${viteConfig}`,
|
77
|
+
illustrations: createIllustrationsJSImportsScript,
|
52
78
|
},
|
53
79
|
copy: {
|
54
|
-
default: "nps copy.src copy.props
|
55
|
-
es5: "nps copy.src copy.props copy.test copy.webcomponents-polyfill",
|
80
|
+
default: "nps copy.src copy.props",
|
56
81
|
src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
|
57
82
|
props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
|
58
|
-
test: `node "${LIB}/copy-and-watch/index.js" --silent "test/**/*.*" dist/test-resources`,
|
59
|
-
"webcomponents-polyfill": `node "${LIB}/copy-and-watch/index.js" --silent "${polyfillPath}" dist/webcomponentsjs/`,
|
60
|
-
"webcomponents-polyfill-placeholder": `node "${LIB}/polyfill-placeholder/index.js"`
|
61
83
|
},
|
62
84
|
watch: {
|
63
|
-
default: 'concurrently "nps watch.templates" "nps watch.
|
64
|
-
|
85
|
+
default: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.typescript" "nps watch.styles" "nps watch.i18n" "nps watch.props"',
|
86
|
+
devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
|
65
87
|
src: 'nps "copy.src --watch --safe --skip-initial-copy"',
|
88
|
+
typescript: tsWatchCommand,
|
66
89
|
props: 'nps "copy.props --watch --safe --skip-initial-copy"',
|
67
|
-
|
68
|
-
bundle: {
|
69
|
-
default: 'rollup --config config/rollup.config.js -w --environment DEV,DEPLOY_PUBLIC_PATH:/resources/',
|
70
|
-
es5: 'rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV,DEPLOY_PUBLIC_PATH:/resources/'
|
71
|
-
},
|
90
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
72
91
|
styles: {
|
73
92
|
default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
|
74
93
|
themes: 'nps "build.styles.themes -w"',
|
@@ -79,35 +98,34 @@ const getScripts = (options) => {
|
|
79
98
|
},
|
80
99
|
},
|
81
100
|
templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
|
82
|
-
|
101
|
+
api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"',
|
83
102
|
i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
|
84
103
|
},
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
89
|
-
|
90
|
-
serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
|
91
|
-
test: {
|
92
|
-
// --success first - report the exit code of the test run (first command to finish), as serve is always terminated and has a non-0 exit code
|
93
|
-
default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
|
94
|
-
run: "cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js",
|
95
|
-
spec: "wdio run config/wdio.conf.js",
|
96
|
-
},
|
97
|
-
startWithScope: "nps scope.prepare scope.dev",
|
104
|
+
start: "nps prepare watch.devServer",
|
105
|
+
test: `node "${LIB}/test-runner/test-runner.js"`,
|
106
|
+
"test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
|
107
|
+
"test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
|
108
|
+
startWithScope: "nps scope.prepare scope.watchWithBundle",
|
98
109
|
scope: {
|
99
110
|
prepare: "nps scope.lint prepare scope.testPages",
|
100
111
|
lint: `node "${LIB}/scoping/lint-src.js"`,
|
101
112
|
testPages: {
|
102
113
|
default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
|
103
|
-
clean: "rimraf
|
104
|
-
copy: `node "${LIB}/copy-and-watch/index.js" --silent "
|
105
|
-
replace: `node "${LIB}/scoping/scope-test-pages.js"
|
114
|
+
clean: "rimraf test/pages/scoped",
|
115
|
+
copy: `node "${LIB}/copy-and-watch/index.js" --silent "test/pages/**/*" test/pages/scoped`,
|
116
|
+
replace: `node "${LIB}/scoping/scope-test-pages.js" test/pages/scoped demo`,
|
106
117
|
},
|
107
|
-
|
108
|
-
watch: 'concurrently "nps watch.templates" "nps watch.
|
109
|
-
bundle:
|
110
|
-
}
|
118
|
+
watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
|
119
|
+
watch: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.props" "nps watch.styles"',
|
120
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
121
|
+
},
|
122
|
+
generateAPI: {
|
123
|
+
default: "nps generateAPI.prepare generateAPI.preprocess generateAPI.jsdoc generateAPI.cleanup",
|
124
|
+
prepare: `copy-and-watch "dist/**/*.js" jsdoc-dist/`,
|
125
|
+
preprocess: `node "${preprocessJSDocScript}" jsdoc-dist/`,
|
126
|
+
jsdoc: `jsdoc -c "${LIB}/jsdoc/configTypescript.json"`,
|
127
|
+
cleanup: "rimraf jsdoc-dist/"
|
128
|
+
},
|
111
129
|
};
|
112
130
|
|
113
131
|
return scripts;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
const postcssImport = require('postcss-import');
|
2
|
-
const combineSelectors = require('postcss-combine-duplicated-selectors');
|
2
|
+
const combineSelectors = require('../lib/postcss-combine-duplicated-selectors/index.js');
|
3
3
|
const postcssCSStoJSON = require('../lib/postcss-css-to-json/index.js');
|
4
4
|
const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
|
5
5
|
const cssnano = require('cssnano');
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// vite.config.js
|
2
|
+
const { defineConfig } = require('vite');
|
3
|
+
const virtualIndex = require("../lib/dev-server/virtual-index-html-plugin.js");
|
4
|
+
|
5
|
+
module.exports = defineConfig(async () => {
|
6
|
+
return {
|
7
|
+
build: {
|
8
|
+
emptyOutDir: false,
|
9
|
+
},
|
10
|
+
plugins: [await virtualIndex()],
|
11
|
+
}
|
12
|
+
});
|
@@ -50,7 +50,7 @@ exports.config = {
|
|
50
50
|
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
|
51
51
|
// grid with only 5 firefox instances available you can make sure that not more than
|
52
52
|
// 5 instances get started at a time.
|
53
|
-
maxInstances:
|
53
|
+
maxInstances: 5,
|
54
54
|
//
|
55
55
|
browserName: 'chrome',
|
56
56
|
'goog:chromeOptions': {
|
@@ -82,7 +82,7 @@ exports.config = {
|
|
82
82
|
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
|
83
83
|
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
|
84
84
|
// gets prepended directly.
|
85
|
-
baseUrl:
|
85
|
+
baseUrl: 'http://localhost:4567', // This is important since WDIO 7+ does not accept an empty string for baseUrl
|
86
86
|
path: '',
|
87
87
|
//
|
88
88
|
// Default timeout for all waitFor* commands.
|
@@ -99,7 +99,14 @@ exports.config = {
|
|
99
99
|
// Services take over a specific job you don't want to take care of. They enhance
|
100
100
|
// your test setup with almost no effort. Unlike plugins, they don't add new
|
101
101
|
// commands. Instead, they hook themselves up into the test process.
|
102
|
-
services: ['chromedriver'
|
102
|
+
services: ['chromedriver', 'devtools',
|
103
|
+
['static-server', {
|
104
|
+
folders: [
|
105
|
+
{ mount: '/', path: './dist' },
|
106
|
+
],
|
107
|
+
port: '4567',
|
108
|
+
}],
|
109
|
+
],
|
103
110
|
// options
|
104
111
|
chromeDriverArgs: ['--port=9515'], // default
|
105
112
|
// Framework you want to run your specs with.
|
@@ -316,7 +323,6 @@ exports.config = {
|
|
316
323
|
"click",
|
317
324
|
"doubleClick",
|
318
325
|
"dragAndDrop",
|
319
|
-
"keys",
|
320
326
|
"pause",
|
321
327
|
"removeAttribute", // custom
|
322
328
|
"scrollIntoView",
|
@@ -327,10 +333,21 @@ exports.config = {
|
|
327
333
|
"touchAction",
|
328
334
|
"url",
|
329
335
|
];
|
336
|
+
|
337
|
+
const waitForWithDelay = [
|
338
|
+
"keys",
|
339
|
+
];
|
340
|
+
|
330
341
|
if (waitFor.includes(commandName)) {
|
331
342
|
await browser.executeAsync(function (done) {
|
332
343
|
window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
|
333
344
|
});
|
345
|
+
} else if (waitForWithDelay.includes(commandName)) {
|
346
|
+
await browser.executeAsync(function (done) {
|
347
|
+
setTimeout(() => {
|
348
|
+
window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
|
349
|
+
}, 10);
|
350
|
+
});
|
334
351
|
}
|
335
352
|
},
|
336
353
|
/**
|
@@ -50,7 +50,7 @@ exports.config = {
|
|
50
50
|
// maxInstances can get overwritten per capability. So if you have an in-house Selenium
|
51
51
|
// grid with only 5 firefox instances available you can make sure that not more than
|
52
52
|
// 5 instances get started at a time.
|
53
|
-
maxInstances:
|
53
|
+
maxInstances: 5,
|
54
54
|
//
|
55
55
|
browserName: 'chrome',
|
56
56
|
'goog:chromeOptions': {
|
package/icons-collection/nps.js
CHANGED
@@ -1,9 +1,4 @@
|
|
1
1
|
const path = require("path");
|
2
|
-
const resolve = require("resolve");
|
3
|
-
|
4
|
-
const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
|
5
|
-
const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
|
6
|
-
const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
|
7
2
|
|
8
3
|
const LIB = path.join(__dirname, `../lib/`);
|
9
4
|
|
@@ -51,7 +46,7 @@ const getScripts = (options) => {
|
|
51
46
|
clean: "rimraf dist",
|
52
47
|
copy: copyAssetsCmd,
|
53
48
|
build: {
|
54
|
-
default:
|
49
|
+
default: `nps clean copy build.i18n build.icons build.jsonImports`,
|
55
50
|
i18n: {
|
56
51
|
default: "nps build.i18n.defaultsjs build.i18n.json",
|
57
52
|
defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
|
@@ -63,7 +58,6 @@ const getScripts = (options) => {
|
|
63
58
|
},
|
64
59
|
icons: createJSImportsCmd,
|
65
60
|
},
|
66
|
-
hash: `node "${generateHash}" dist/ hash.txt`,
|
67
61
|
};
|
68
62
|
|
69
63
|
return scripts;
|
@@ -1,9 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
MIT License
|
3
|
+
|
4
|
+
Copyright (c) 2017
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
23
|
+
*/
|
24
|
+
|
1
25
|
const fs = require('fs');
|
2
26
|
const path = require('path');
|
3
27
|
const chokidar = require('chokidar');
|
4
28
|
const glob = require('glob');
|
5
29
|
const globParent = require('glob-parent');
|
6
|
-
require('colors');
|
7
30
|
|
8
31
|
/* CODE */
|
9
32
|
|
package/lib/copy-list/index.js
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
const fs = require("fs");
|
1
|
+
const fs = require("fs").promises;
|
2
2
|
const path = require("path");
|
3
|
-
const mkdirp = require("mkdirp");
|
4
3
|
|
5
4
|
const fileList = process.argv[2];
|
6
5
|
const dest = process.argv[3];
|
7
6
|
const src = "../../node_modules/@openui5/sap.ui.core/src/";
|
8
7
|
|
9
|
-
const
|
10
|
-
|
8
|
+
const generate = async () => {
|
9
|
+
const filesToCopy = (await fs.readFile(fileList)).toString();
|
10
|
+
// console.log(filesToCopy);
|
11
11
|
|
12
|
-
// Support full-line comments starting with # in the used-modules.txt file
|
13
|
-
const shouldCopy = file => file.length && !file.startsWith("#");
|
12
|
+
// Support full-line comments starting with # in the used-modules.txt file
|
13
|
+
const shouldCopy = file => file.length && !file.startsWith("#");
|
14
14
|
|
15
|
-
const trimFile = file => file.trim();
|
15
|
+
const trimFile = file => file.trim();
|
16
16
|
|
17
|
-
filesToCopy.split("\n").map(trimFile).filter(shouldCopy).
|
18
|
-
|
19
|
-
|
17
|
+
return filesToCopy.split("\n").map(trimFile).filter(shouldCopy).map(async moduleName => {
|
18
|
+
const srcPath = path.join(src, moduleName);
|
19
|
+
const destPath = path.join(dest, moduleName);
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
if (err) {
|
24
|
-
throw err;
|
25
|
-
}
|
26
|
-
console.log(`${destPath} created.`);
|
21
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
22
|
+
return fs.copyFile(srcPath, destPath);
|
27
23
|
});
|
24
|
+
};
|
25
|
+
|
26
|
+
generate().then(() => {
|
27
|
+
console.log("Files copied.");
|
28
28
|
});
|