@ui5/webcomponents-tools 0.0.0-8db0ce01a → 0.0.0-998083e44
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 +168 -0
- package/README.md +5 -6
- package/assets-meta.js +7 -1
- package/bin/dev.js +1 -5
- package/components-package/nps.js +55 -51
- package/components-package/postcss.themes.js +6 -3
- package/components-package/vite.config.js +12 -0
- package/components-package/wdio.js +71 -29
- package/components-package/wdio.sync.js +360 -0
- package/icons-collection/nps.js +41 -13
- package/lib/copy-and-watch/index.js +24 -1
- package/lib/copy-list/index.js +28 -0
- package/lib/create-icons/index.js +82 -58
- package/lib/create-illustrations/index.js +161 -0
- package/lib/create-new-component/index.js +12 -4
- 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 +58 -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 +12 -3
- package/lib/hbs2lit/src/includesReplacer.js +5 -5
- package/lib/hbs2lit/src/litVisitor2.js +31 -6
- package/lib/hbs2lit/src/svgProcessor.js +3 -3
- package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +4 -11
- package/lib/hbs2ui5/index.js +37 -21
- package/lib/i18n/defaults.js +49 -57
- package/lib/i18n/toJSON.js +12 -11
- package/lib/jsdoc/plugin.js +9 -0
- package/lib/jsdoc/template/publish.js +13 -2
- package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
- package/lib/postcss-css-to-esm/index.js +16 -4
- package/lib/postcss-css-to-json/index.js +18 -2
- package/lib/postcss-p/postcss-p.mjs +14 -0
- package/lib/replace-global-core/index.js +25 -0
- package/lib/scoping/lint-src.js +1 -1
- package/lib/scoping/missing-dependencies.js +65 -0
- package/lib/scoping/report-tags-usage.js +28 -0
- package/lib/scoping/scope-test-pages.js +1 -1
- package/lib/test-runner/test-runner.js +63 -0
- package/package.json +26 -41
- package/bin/init-ui5-package.js +0 -3
- package/components-package/rollup.js +0 -195
- 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 -40
- package/lib/documentation/templates/api-slots-section.js +0 -28
- package/lib/documentation/templates/template.js +0 -38
- package/lib/hash/config.js +0 -10
- package/lib/hash/generate.js +0 -19
- package/lib/hash/upToDate.js +0 -31
- package/lib/init-package/index.js +0 -123
- 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 -31
- 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/MyFirstComponent.hbs +0 -1
- package/lib/init-package/resources/src/MyFirstComponent.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/MyFirstComponent.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/src/themes/sap_fiori_3_hcb/parameters-bundle.css +0 -3
- package/lib/init-package/resources/src/themes/sap_fiori_3_hcw/parameters-bundle.css +0 -3
- package/lib/init-package/resources/test/pages/index.html +0 -56
- package/lib/init-package/resources/test/specs/Demo.spec.js +0 -12
- 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,174 @@
|
|
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.6.0](https://github.com/SAP/ui5-webcomponents/compare/v1.5.0...v1.6.0) (2022-07-25)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **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)
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [1.5.0](https://github.com/SAP/ui5-webcomponents/compare/v1.4.0...v1.5.0) (2022-07-03)
|
18
|
+
|
19
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
# [1.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
|
26
|
+
|
27
|
+
|
28
|
+
### Features
|
29
|
+
|
30
|
+
**Note:** Version bump only for package @ui5/webcomponents-icons-tnt
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
|
37
|
+
|
38
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
# [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
|
45
|
+
|
46
|
+
|
47
|
+
### Bug Fixes
|
48
|
+
|
49
|
+
* **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)
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
|
56
|
+
|
57
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
|
64
|
+
|
65
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
## [1.2.2](https://github.com/SAP/ui5-webcomponents/compare/v1.2.1...v1.2.2) (2022-03-22)
|
72
|
+
|
73
|
+
|
74
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
## [1.2.1](https://github.com/SAP/ui5-webcomponents/compare/v1.2.0...v1.2.1) (2022-03-02)
|
81
|
+
|
82
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
# [1.2.0](https://github.com/SAP/ui5-webcomponents/compare/v1.1.2...v1.2.0) (2022-02-28)
|
89
|
+
|
90
|
+
|
91
|
+
### Bug Fixes
|
92
|
+
|
93
|
+
* correct scoping issues with several components ([#4820](https://github.com/SAP/ui5-webcomponents/issues/4820)) ([621dc20](https://github.com/SAP/ui5-webcomponents/commit/621dc20))
|
94
|
+
* display methods in child components API ([#4792](https://github.com/SAP/ui5-webcomponents/issues/4792)) ([1929d08](https://github.com/SAP/ui5-webcomponents/commit/1929d08))
|
95
|
+
|
96
|
+
|
97
|
+
### Features
|
98
|
+
|
99
|
+
* **jsdoc:** remove attr name for Object props ([#4680](https://github.com/SAP/ui5-webcomponents/issues/4680)) ([1741bd6](https://github.com/SAP/ui5-webcomponents/commit/1741bd6)), closes [#4674](https://github.com/SAP/ui5-webcomponents/issues/4674)
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
## [1.1.2](https://github.com/SAP/ui5-webcomponents/compare/v1.1.1...v1.1.2) (2022-01-26)
|
106
|
+
|
107
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
## [1.1.1](https://github.com/SAP/ui5-webcomponents/compare/v1.1.0...v1.1.1) (2022-01-24)
|
114
|
+
|
115
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# [1.1.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.2...v1.1.0) (2022-01-21)
|
122
|
+
|
123
|
+
|
124
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
## [1.0.2](https://github.com/SAP/ui5-webcomponents/compare/v1.0.1...v1.0.2) (2021-11-29)
|
131
|
+
|
132
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
## [1.0.1](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0...v1.0.1) (2021-11-10)
|
139
|
+
|
140
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
# [1.0.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.16...v1.0.0) (2021-11-10)
|
147
|
+
|
148
|
+
|
149
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
150
|
+
|
151
|
+
|
152
|
+
# [1.0.0-rc.16](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.15...v1.0.0-rc.16) (2021-11-09)
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
### Features
|
157
|
+
|
158
|
+
* **tools:** create an npm init script ([#4090](https://github.com/SAP/ui5-webcomponents/issues/4090)) ([5608e04](https://github.com/SAP/ui5-webcomponents/commit/5608e04))
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
# [1.0.0-rc.15](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.14...v1.0.0-rc.15) (2021-07-23)
|
163
|
+
|
164
|
+
|
165
|
+
### Bug Fixes
|
166
|
+
|
167
|
+
* **tools:** fix build error on MacOS 11 from rollup-plugin-terser ([#3347](https://github.com/SAP/ui5-webcomponents/issues/3347)) ([59892c4](https://github.com/SAP/ui5-webcomponents/commit/59892c4)), closes [#2515](https://github.com/SAP/ui5-webcomponents/issues/2515)
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
6
174
|
# [1.0.0-rc.14](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.13...v1.0.0-rc.14) (2021-04-01)
|
7
175
|
|
8
176
|
|
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/assets-meta.js
CHANGED
@@ -8,7 +8,12 @@ const assetsMeta = {
|
|
8
8
|
"sap_belize_hcb",
|
9
9
|
"sap_belize_hcw",
|
10
10
|
"sap_fiori_3_hcb",
|
11
|
-
"sap_fiori_3_hcw"
|
11
|
+
"sap_fiori_3_hcw",
|
12
|
+
"sap_horizon",
|
13
|
+
"sap_horizon_dark",
|
14
|
+
"sap_horizon_hcb",
|
15
|
+
"sap_horizon_hcw",
|
16
|
+
"sap_horizon_exp"
|
12
17
|
]
|
13
18
|
},
|
14
19
|
"languages": {
|
@@ -131,6 +136,7 @@ const assetsMeta = {
|
|
131
136
|
"sk",
|
132
137
|
"sl",
|
133
138
|
"sr",
|
139
|
+
"sr_Latn",
|
134
140
|
"sv",
|
135
141
|
"th",
|
136
142
|
"tr",
|
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'});
|
@@ -1,30 +1,53 @@
|
|
1
1
|
const path = require("path");
|
2
2
|
const fs = require("fs");
|
3
|
-
|
4
3
|
const LIB = path.join(__dirname, `../lib/`);
|
5
|
-
|
6
|
-
const polyfillPath = path.join(polyfillDir, "{*.js,*.map,*.md,bundles/**/*.*}");
|
7
|
-
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
4
|
+
|
8
5
|
|
9
6
|
const getScripts = (options) => {
|
10
7
|
|
11
|
-
|
12
|
-
|
8
|
+
let illustrations = options.illustrationsData || [];
|
9
|
+
illustrations = illustrations.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
|
10
|
+
let illustrationsScript = illustrations.join(" && ");
|
11
|
+
|
12
|
+
let viteConfig;
|
13
|
+
if (fs.existsSync("config/vite.config.js")) {
|
14
|
+
// old project setup where config file is in separate folder
|
15
|
+
viteConfig = "-c config/vite.config.js";
|
16
|
+
} else if (fs.existsSync("vite.config.js")) {
|
17
|
+
// preferred way of custom configuration in root project folder
|
18
|
+
viteConfig = "";
|
19
|
+
} else {
|
20
|
+
// no custom configuration - use default from tools project
|
21
|
+
viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
|
22
|
+
}
|
13
23
|
|
24
|
+
let eslintConfig;
|
25
|
+
if (fs.existsSync("config/.eslintrc.js")) {
|
26
|
+
// old project setup where config file is in separate folder
|
27
|
+
eslintConfig = "--config config/.eslintrc.js";
|
28
|
+
} else if (fs.existsSync(".eslintrc.js")) {
|
29
|
+
// preferred way of custom configuration in root project folder
|
30
|
+
eslintConfig = "";
|
31
|
+
} else {
|
32
|
+
// no custom configuration - use default from tools project
|
33
|
+
eslintConfig = `--config "${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}"`;
|
34
|
+
}
|
35
|
+
|
14
36
|
const scripts = {
|
15
|
-
clean:
|
16
|
-
lint:
|
17
|
-
lintfix:
|
37
|
+
clean: 'rimraf dist && rimraf .port && nps "scope.testPages.clean"',
|
38
|
+
lint: `eslint . ${eslintConfig}`,
|
39
|
+
lintfix: `eslint . ${eslintConfig}`,
|
18
40
|
prepare: {
|
19
|
-
default: "nps clean
|
20
|
-
|
41
|
+
default: "nps clean prepare.all",
|
42
|
+
all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.api" "nps build.illustrations"',
|
43
|
+
styleRelated: "nps build.styles build.jsonImports",
|
21
44
|
},
|
22
45
|
build: {
|
23
|
-
default: "nps lint prepare
|
46
|
+
default: "nps lint prepare build.bundle",
|
24
47
|
templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
|
25
48
|
styles: {
|
26
49
|
default: "nps build.styles.themes build.styles.components",
|
27
|
-
themes: "postcss
|
50
|
+
themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
|
28
51
|
components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
|
29
52
|
},
|
30
53
|
i18n: {
|
@@ -37,32 +60,21 @@ const getScripts = (options) => {
|
|
37
60
|
themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
|
38
61
|
i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
|
39
62
|
},
|
40
|
-
bundle:
|
41
|
-
|
42
|
-
|
43
|
-
api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
|
44
|
-
docs: `node "${LIB}/documentation/index.js" dist/api.json`,
|
45
|
-
}
|
63
|
+
bundle: `vite build ${viteConfig}`,
|
64
|
+
api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
|
65
|
+
illustrations: illustrationsScript
|
46
66
|
},
|
47
67
|
copy: {
|
48
|
-
default: "nps copy.src copy.props
|
49
|
-
es5: "nps copy.src copy.props copy.test copy.webcomponents-polyfill",
|
68
|
+
default: "nps copy.src copy.props",
|
50
69
|
src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
|
51
70
|
props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
|
52
|
-
test: `node "${LIB}/copy-and-watch/index.js" --silent "test/**/*.*" dist/test-resources`,
|
53
|
-
"webcomponents-polyfill": `node "${LIB}/copy-and-watch/index.js" --silent "${polyfillPath}" dist/webcomponentsjs/`,
|
54
|
-
"webcomponents-polyfill-placeholder": `node ${LIB}/polyfill-placeholder/index.js`
|
55
71
|
},
|
56
72
|
watch: {
|
57
|
-
default: 'concurrently "nps watch.templates" "nps watch.
|
58
|
-
|
73
|
+
default: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.styles" "nps watch.i18n" "nps watch.props"',
|
74
|
+
devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
|
59
75
|
src: 'nps "copy.src --watch --safe --skip-initial-copy"',
|
60
76
|
props: 'nps "copy.props --watch --safe --skip-initial-copy"',
|
61
|
-
|
62
|
-
bundle: {
|
63
|
-
default: 'rollup --config config/rollup.config.js -w --environment DEV,DEPLOY_PUBLIC_PATH:/resources/',
|
64
|
-
es5: 'rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV,DEPLOY_PUBLIC_PATH:/resources/'
|
65
|
-
},
|
77
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
66
78
|
styles: {
|
67
79
|
default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
|
68
80
|
themes: 'nps "build.styles.themes -w"',
|
@@ -73,34 +85,26 @@ const getScripts = (options) => {
|
|
73
85
|
},
|
74
86
|
},
|
75
87
|
templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
|
76
|
-
|
88
|
+
api: 'chokidar "test/**/*.sample.html" -c "nps build.api"',
|
77
89
|
i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
|
78
90
|
},
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
}
|
83
|
-
|
84
|
-
serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
|
85
|
-
test: {
|
86
|
-
// --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
|
87
|
-
default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
|
88
|
-
run: "cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js",
|
89
|
-
spec: "wdio run config/wdio.conf.js",
|
90
|
-
},
|
91
|
-
startWithScope: "nps scope.prepare scope.dev",
|
91
|
+
start: "nps prepare watch.devServer",
|
92
|
+
test: `node "${LIB}/test-runner/test-runner.js"`,
|
93
|
+
"test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
|
94
|
+
"test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
|
95
|
+
startWithScope: "nps scope.prepare scope.watchWithBundle",
|
92
96
|
scope: {
|
93
97
|
prepare: "nps scope.lint prepare scope.testPages",
|
94
98
|
lint: `node "${LIB}/scoping/lint-src.js"`,
|
95
99
|
testPages: {
|
96
100
|
default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
|
97
|
-
clean: "rimraf
|
98
|
-
copy: `node "${LIB}/copy-and-watch/index.js" --silent "
|
99
|
-
replace: `node "${LIB}/scoping/scope-test-pages.js"
|
101
|
+
clean: "rimraf test/pages/scoped",
|
102
|
+
copy: `node "${LIB}/copy-and-watch/index.js" --silent "test/pages/**/*" test/pages/scoped`,
|
103
|
+
replace: `node "${LIB}/scoping/scope-test-pages.js" test/pages/scoped demo`,
|
100
104
|
},
|
101
|
-
|
102
|
-
watch: 'concurrently "nps watch.templates" "nps watch.
|
103
|
-
bundle:
|
105
|
+
watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
|
106
|
+
watch: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.props" "nps watch.styles"',
|
107
|
+
bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
|
104
108
|
}
|
105
109
|
};
|
106
110
|
|
@@ -1,8 +1,11 @@
|
|
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');
|
6
|
+
const fs = require("fs");
|
7
|
+
|
8
|
+
const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
|
6
9
|
|
7
10
|
module.exports = {
|
8
11
|
plugins: [
|
@@ -17,7 +20,7 @@ module.exports = {
|
|
17
20
|
},
|
18
21
|
]
|
19
22
|
},),
|
20
|
-
postcssCSStoJSON({toReplace: 'src'}),
|
21
|
-
postcssCSStoESM({toReplace: 'src'}),
|
23
|
+
postcssCSStoJSON({toReplace: 'src', packageName}),
|
24
|
+
postcssCSStoESM({toReplace: 'src', packageName}),
|
22
25
|
]
|
23
26
|
};
|
@@ -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.
|
@@ -152,9 +159,9 @@ exports.config = {
|
|
152
159
|
* @param {Array.<Object>} capabilities list of capabilities details
|
153
160
|
* @param {Array.<String>} specs List of spec file paths that are to be run
|
154
161
|
*/
|
155
|
-
before: function (capabilities, specs) {
|
156
|
-
browser.addCommand("isFocusedDeep", function () {
|
157
|
-
return browser.
|
162
|
+
before: async function (capabilities, specs) {
|
163
|
+
await browser.addCommand("isFocusedDeep", async function () {
|
164
|
+
return browser.executeAsync(function (elem, done) {
|
158
165
|
let activeElement = document.activeElement;
|
159
166
|
|
160
167
|
while (activeElement.shadowRoot) {
|
@@ -164,47 +171,69 @@ exports.config = {
|
|
164
171
|
break;
|
165
172
|
}
|
166
173
|
}
|
167
|
-
|
174
|
+
done(elem === activeElement);
|
168
175
|
}, this);
|
169
176
|
}, true);
|
170
177
|
|
171
|
-
browser.addCommand("
|
172
|
-
return browser.
|
173
|
-
|
178
|
+
await browser.addCommand("isFocusedDeepElement", async function (element) {
|
179
|
+
return browser.executeAsync(function (elem, element, done) {
|
180
|
+
let activeElement = document.activeElement;
|
181
|
+
|
182
|
+
while (activeElement.shadowRoot) {
|
183
|
+
if (activeElement.shadowRoot.activeElement) {
|
184
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
185
|
+
} else {
|
186
|
+
break;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
done(element === activeElement);
|
190
|
+
}, this, element);
|
191
|
+
}, true);
|
192
|
+
|
193
|
+
await browser.addCommand("setProperty", async function(property, value) {
|
194
|
+
return browser.executeAsync((elem, property, value, done) => {
|
195
|
+
elem[property] = value;
|
196
|
+
done();
|
174
197
|
}, this, property, value);
|
175
198
|
}, true);
|
176
199
|
|
177
|
-
browser.addCommand("setAttribute", function(attribute, value) {
|
178
|
-
return browser.
|
179
|
-
|
200
|
+
await browser.addCommand("setAttribute", async function(attribute, value) {
|
201
|
+
return browser.executeAsync((elem, attribute, value, done) => {
|
202
|
+
elem.setAttribute(attribute, value);
|
203
|
+
done();
|
180
204
|
}, this, attribute, value);
|
181
205
|
}, true);
|
182
206
|
|
183
|
-
browser.addCommand("removeAttribute", function(attribute) {
|
184
|
-
return browser.
|
185
|
-
|
207
|
+
await browser.addCommand("removeAttribute", async function(attribute) {
|
208
|
+
return browser.executeAsync((elem, attribute, done) => {
|
209
|
+
elem.removeAttribute(attribute);
|
210
|
+
done();
|
186
211
|
}, this, attribute);
|
187
212
|
}, true);
|
188
213
|
|
189
|
-
browser.addCommand("hasClass", function(className) {
|
190
|
-
return browser.
|
191
|
-
|
214
|
+
await browser.addCommand("hasClass", async function(className) {
|
215
|
+
return browser.executeAsync((elem, className, done) => {
|
216
|
+
done(elem.classList.contains(className));
|
192
217
|
}, this, className);
|
193
218
|
}, true);
|
194
219
|
|
195
|
-
browser.addCommand("getStaticAreaItemClassName", function(selector) {
|
196
|
-
return browser.
|
220
|
+
await browser.addCommand("getStaticAreaItemClassName", async function(selector) {
|
221
|
+
return browser.executeAsync(async (selector, done) => {
|
197
222
|
const staticAreaItem = await document.querySelector(selector).getStaticAreaItemDomRef();
|
198
|
-
|
223
|
+
done(staticAreaItem.host.classList[0]);
|
199
224
|
}, selector);
|
200
225
|
}, false);
|
226
|
+
|
227
|
+
await browser.addLocatorStrategy('activeElement', (selector) => {
|
228
|
+
return document.querySelector(selector).shadowRoot.activeElement;
|
229
|
+
});
|
201
230
|
},
|
202
231
|
/**
|
203
232
|
* Runs before a WebdriverIO command gets executed.
|
204
233
|
* @param {String} commandName hook command name
|
205
234
|
* @param {Array} args arguments that command would receive
|
206
235
|
*/
|
207
|
-
beforeCommand: function (commandName, args) {
|
236
|
+
beforeCommand: async function (commandName, args) {
|
208
237
|
const waitFor = [
|
209
238
|
"$",
|
210
239
|
"$$",
|
@@ -223,11 +252,12 @@ exports.config = {
|
|
223
252
|
"isExisting",
|
224
253
|
"isFocused",
|
225
254
|
"isFocusedDeep", // custom
|
255
|
+
"isFocusedDeepElement", // custom
|
226
256
|
"shadow$",
|
227
257
|
"shadow$$",
|
228
258
|
];
|
229
259
|
if (waitFor.includes(commandName)) {
|
230
|
-
browser.executeAsync(function (done) {
|
260
|
+
await browser.executeAsync(function (done) {
|
231
261
|
window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
|
232
262
|
});
|
233
263
|
}
|
@@ -277,12 +307,13 @@ exports.config = {
|
|
277
307
|
* @param {Number} result 0 - command success, 1 - command error
|
278
308
|
* @param {Object} error error object if any
|
279
309
|
*/
|
280
|
-
afterCommand: function (commandName, args, result, error) {
|
310
|
+
afterCommand: async function (commandName, args, result, error) {
|
281
311
|
|
282
312
|
// url -> set configuration first
|
283
313
|
if (commandName === "url" && !args[0].includes("do-not-change-configuration")) {
|
284
|
-
browser.
|
314
|
+
await browser.executeAsync(function(done) {
|
285
315
|
window["sap-ui-webcomponents-bundle"].configuration.setNoConflict(true);
|
316
|
+
done();
|
286
317
|
});
|
287
318
|
}
|
288
319
|
|
@@ -292,20 +323,31 @@ exports.config = {
|
|
292
323
|
"click",
|
293
324
|
"doubleClick",
|
294
325
|
"dragAndDrop",
|
295
|
-
"keys",
|
296
326
|
"pause",
|
297
327
|
"removeAttribute", // custom
|
328
|
+
"scrollIntoView",
|
298
329
|
"setAttribute", // custom
|
299
330
|
"setProperty", // custom
|
300
331
|
"setValue",
|
301
332
|
"setWindowSize",
|
302
333
|
"touchAction",
|
303
|
-
"url"
|
334
|
+
"url",
|
304
335
|
];
|
336
|
+
|
337
|
+
const waitForWithDelay = [
|
338
|
+
"keys",
|
339
|
+
];
|
340
|
+
|
305
341
|
if (waitFor.includes(commandName)) {
|
306
|
-
browser.executeAsync(function (done) {
|
342
|
+
await browser.executeAsync(function (done) {
|
307
343
|
window["sap-ui-webcomponents-bundle"].renderFinished().then(done);
|
308
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
|
+
});
|
309
351
|
}
|
310
352
|
},
|
311
353
|
/**
|