@ui5/webcomponents-tools 0.0.0-e463d2345 → 0.0.0-e58530409

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +244 -1
  2. package/README.md +5 -6
  3. package/assets-meta.js +153 -0
  4. package/bin/dev.js +12 -1
  5. package/components-package/nps.js +81 -44
  6. package/components-package/postcss.themes.js +6 -3
  7. package/components-package/vite.config.js +12 -0
  8. package/components-package/wdio.js +118 -65
  9. package/components-package/wdio.sync.js +360 -0
  10. package/icons-collection/nps.js +66 -28
  11. package/lib/copy-and-watch/index.js +145 -0
  12. package/lib/copy-list/index.js +28 -0
  13. package/lib/create-icons/index.js +82 -50
  14. package/lib/create-illustrations/index.js +161 -0
  15. package/lib/create-new-component/index.js +18 -6
  16. package/lib/dev-server/dev-server.js +66 -0
  17. package/lib/dev-server/virtual-index-html-plugin.js +52 -0
  18. package/lib/esm-abs-to-rel/index.js +58 -0
  19. package/lib/generate-json-imports/i18n.js +98 -47
  20. package/lib/generate-json-imports/themes.js +71 -16
  21. package/lib/hbs2lit/index.js +2 -4
  22. package/lib/hbs2lit/src/compiler.js +18 -8
  23. package/lib/hbs2lit/src/includesReplacer.js +23 -17
  24. package/lib/hbs2lit/src/litVisitor2.js +57 -11
  25. package/lib/hbs2lit/src/svgProcessor.js +3 -3
  26. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +5 -5
  27. package/lib/hbs2ui5/index.js +52 -30
  28. package/lib/i18n/defaults.js +63 -52
  29. package/lib/i18n/toJSON.js +25 -13
  30. package/lib/jsdoc/config.json +1 -1
  31. package/lib/jsdoc/plugin.js +33 -4
  32. package/lib/jsdoc/template/publish.js +24 -4
  33. package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
  34. package/lib/postcss-css-to-esm/index.js +45 -21
  35. package/lib/postcss-css-to-json/index.js +38 -11
  36. package/lib/postcss-new-files/index.js +36 -0
  37. package/lib/postcss-p/postcss-p.mjs +14 -0
  38. package/lib/replace-global-core/index.js +25 -0
  39. package/lib/scoping/get-all-tags.js +44 -0
  40. package/lib/scoping/lint-src.js +31 -0
  41. package/lib/scoping/missing-dependencies.js +65 -0
  42. package/lib/scoping/report-tags-usage.js +28 -0
  43. package/lib/scoping/scope-test-pages.js +40 -0
  44. package/lib/test-runner/test-runner.js +63 -0
  45. package/package.json +46 -55
  46. package/bin/init-ui5-package.js +0 -3
  47. package/components-package/rollup.js +0 -134
  48. package/components-package/serve.json +0 -3
  49. package/lib/documentation/index.js +0 -143
  50. package/lib/documentation/templates/api-component-since.js +0 -3
  51. package/lib/documentation/templates/api-css-variables-section.js +0 -24
  52. package/lib/documentation/templates/api-events-section.js +0 -35
  53. package/lib/documentation/templates/api-methods-section.js +0 -26
  54. package/lib/documentation/templates/api-properties-section.js +0 -40
  55. package/lib/documentation/templates/api-slots-section.js +0 -28
  56. package/lib/documentation/templates/template.js +0 -38
  57. package/lib/init-package/index.js +0 -119
  58. package/lib/init-package/resources/.eslintignore +0 -3
  59. package/lib/init-package/resources/bundle.es5.js +0 -25
  60. package/lib/init-package/resources/bundle.esm.js +0 -34
  61. package/lib/init-package/resources/config/.eslintrc.js +0 -1
  62. package/lib/init-package/resources/config/postcss.components/postcss.config.js +0 -1
  63. package/lib/init-package/resources/config/postcss.themes/postcss.config.js +0 -1
  64. package/lib/init-package/resources/config/rollup.config.js +0 -1
  65. package/lib/init-package/resources/config/wdio.conf.js +0 -1
  66. package/lib/init-package/resources/package-scripts.js +0 -11
  67. package/lib/init-package/resources/src/Assets.js +0 -6
  68. package/lib/init-package/resources/src/Demo.hbs +0 -1
  69. package/lib/init-package/resources/src/Demo.js +0 -57
  70. package/lib/init-package/resources/src/i18n/messagebundle.properties +0 -2
  71. package/lib/init-package/resources/src/i18n/messagebundle_de.properties +0 -1
  72. package/lib/init-package/resources/src/i18n/messagebundle_en.properties +0 -1
  73. package/lib/init-package/resources/src/i18n/messagebundle_es.properties +0 -1
  74. package/lib/init-package/resources/src/i18n/messagebundle_fr.properties +0 -1
  75. package/lib/init-package/resources/src/themes/Demo.css +0 -11
  76. package/lib/init-package/resources/src/themes/sap_belize/parameters-bundle.css +0 -3
  77. package/lib/init-package/resources/src/themes/sap_belize_hcb/parameters-bundle.css +0 -3
  78. package/lib/init-package/resources/src/themes/sap_fiori_3/parameters-bundle.css +0 -3
  79. package/lib/init-package/resources/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
  80. package/lib/init-package/resources/test/pages/index.html +0 -51
  81. package/lib/init-package/resources/test/specs/Demo.spec.js +0 -12
package/CHANGELOG.md CHANGED
@@ -3,9 +3,252 @@
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.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
7
+
8
+
9
+ ### Features
10
+
11
+ **Note:** Version bump only for package @ui5/webcomponents-icons-tnt
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
18
+
19
+ **Note:** Version bump only for package @ui5/webcomponents-tools
20
+
21
+
22
+
23
+
24
+
25
+ # [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **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)
31
+
32
+
33
+
34
+
35
+
36
+ ## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
37
+
38
+ **Note:** Version bump only for package @ui5/webcomponents-tools
39
+
40
+
41
+
42
+
43
+
44
+ ## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
45
+
46
+ **Note:** Version bump only for package @ui5/webcomponents-tools
47
+
48
+
49
+
50
+
51
+
52
+ ## [1.2.2](https://github.com/SAP/ui5-webcomponents/compare/v1.2.1...v1.2.2) (2022-03-22)
53
+
54
+
55
+ **Note:** Version bump only for package @ui5/webcomponents-tools
56
+
57
+
58
+
59
+
60
+
61
+ ## [1.2.1](https://github.com/SAP/ui5-webcomponents/compare/v1.2.0...v1.2.1) (2022-03-02)
62
+
63
+ **Note:** Version bump only for package @ui5/webcomponents-tools
64
+
65
+
66
+
67
+
68
+
69
+ # [1.2.0](https://github.com/SAP/ui5-webcomponents/compare/v1.1.2...v1.2.0) (2022-02-28)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * correct scoping issues with several components ([#4820](https://github.com/SAP/ui5-webcomponents/issues/4820)) ([621dc20](https://github.com/SAP/ui5-webcomponents/commit/621dc20))
75
+ * display methods in child components API ([#4792](https://github.com/SAP/ui5-webcomponents/issues/4792)) ([1929d08](https://github.com/SAP/ui5-webcomponents/commit/1929d08))
76
+
77
+
78
+ ### Features
79
+
80
+ * **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)
81
+
82
+
83
+
84
+
85
+
86
+ ## [1.1.2](https://github.com/SAP/ui5-webcomponents/compare/v1.1.1...v1.1.2) (2022-01-26)
87
+
88
+ **Note:** Version bump only for package @ui5/webcomponents-tools
89
+
90
+
91
+
92
+
93
+
94
+ ## [1.1.1](https://github.com/SAP/ui5-webcomponents/compare/v1.1.0...v1.1.1) (2022-01-24)
95
+
96
+ **Note:** Version bump only for package @ui5/webcomponents-tools
97
+
98
+
99
+
100
+
101
+
102
+ # [1.1.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.2...v1.1.0) (2022-01-21)
103
+
104
+
105
+ **Note:** Version bump only for package @ui5/webcomponents-tools
106
+
107
+
108
+
109
+
110
+
111
+ ## [1.0.2](https://github.com/SAP/ui5-webcomponents/compare/v1.0.1...v1.0.2) (2021-11-29)
112
+
113
+ **Note:** Version bump only for package @ui5/webcomponents-tools
114
+
115
+
116
+
117
+
118
+
119
+ ## [1.0.1](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0...v1.0.1) (2021-11-10)
120
+
121
+ **Note:** Version bump only for package @ui5/webcomponents-tools
122
+
123
+
124
+
125
+
126
+
127
+ # [1.0.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.16...v1.0.0) (2021-11-10)
128
+
129
+
130
+ **Note:** Version bump only for package @ui5/webcomponents-tools
131
+
132
+
133
+ # [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)
134
+
135
+
136
+
137
+ ### Features
138
+
139
+ * **tools:** create an npm init script ([#4090](https://github.com/SAP/ui5-webcomponents/issues/4090)) ([5608e04](https://github.com/SAP/ui5-webcomponents/commit/5608e04))
140
+
141
+
142
+
143
+ # [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)
144
+
145
+
146
+ ### Bug Fixes
147
+
148
+ * **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)
149
+
150
+
151
+
152
+
153
+
154
+
155
+ # [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)
156
+
157
+
158
+
159
+
160
+ # [1.0.0-rc.13](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.12...v1.0.0-rc.13) (2021-03-26)
161
+
162
+
163
+ **Note:** Version bump only for package @ui5/webcomponents-tools
164
+
165
+
166
+
167
+
168
+
169
+ # [1.0.0-rc.12](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.11...v1.0.0-rc.12) (2021-02-18)
170
+
171
+ **Note:** Version bump only for package @ui5/webcomponents-tools
172
+
173
+
174
+
175
+
176
+ # [1.0.0-rc.11](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.10...v1.0.0-rc.11) (2020-12-21)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * build error on MacOS 11 from rollup-plugin-terser ([#2515](https://github.com/SAP/ui5-webcomponents/issues/2515)) ([0629fac](https://github.com/SAP/ui5-webcomponents/commit/0629fac))
182
+
183
+
184
+
185
+
186
+
187
+ # [1.0.0-rc.10](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.9...v1.0.0-rc.10) (2020-11-12)
188
+
189
+
190
+
191
+ # [1.0.0-rc.9](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.8...v1.0.0-rc.9) (2020-10-08)
192
+
193
+
194
+ ### Features
195
+
196
+ * **framework:** dynamic custom elements scoping ([#2091](https://github.com/SAP/ui5-webcomponents/issues/2091)) ([3588542](https://github.com/SAP/ui5-webcomponents/commit/3588542))
197
+ * **framework:** make assets path configurable ([#2214](https://github.com/SAP/ui5-webcomponents/issues/2214)) ([16c46da](https://github.com/SAP/ui5-webcomponents/commit/16c46da))
198
+ * **tools:** ES5 build supports dynamic imports (inlined) ([#2063](https://github.com/SAP/ui5-webcomponents/issues/2063)) ([3fe5cac](https://github.com/SAP/ui5-webcomponents/commit/3fe5cac))
199
+ * **tools:** process HBS files in nested directories ([#2067](https://github.com/SAP/ui5-webcomponents/issues/2067)) ([13f1d2a](https://github.com/SAP/ui5-webcomponents/commit/13f1d2a)), closes [#2065](https://github.com/SAP/ui5-webcomponents/issues/2065)
200
+
201
+
202
+
203
+
204
+
205
+ # [1.0.0-rc.8](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.7...v1.0.0-rc.8) (2020-07-30)
206
+
207
+
208
+ ### Bug Fixes
209
+
210
+ * **tools:** Remove white spaces from hbs parser ([#1613](https://github.com/SAP/ui5-webcomponents/issues/1613)) ([ec5a9cf](https://github.com/SAP/ui5-webcomponents/commit/ec5a9cf))
211
+ * **tools:** Strip whitespaces around < and > ([#1623](https://github.com/SAP/ui5-webcomponents/issues/1623)) ([0fcda38](https://github.com/SAP/ui5-webcomponents/commit/0fcda38))
212
+ * **tools:** Enables 3 or more levels of inheritance with templates ([#1593](https://github.com/SAP/ui5-webcomponents/issues/1593)) ([2a426dd](https://github.com/SAP/ui5-webcomponents/commit/2a426dd))
213
+ * **tools:** Building third-party packages no longer fails ([#1994](https://github.com/SAP/ui5-webcomponents/issues/1994)) ([07aebfa](https://github.com/SAP/ui5-webcomponents/commit/07aebfa))
214
+ * **tools:** Polyfill copied correctly in all scenarios ([#1783](https://github.com/SAP/ui5-webcomponents/issues/1783)) ([a04f483](https://github.com/SAP/ui5-webcomponents/commit/a04f483))
215
+
216
+
217
+ ### Features
218
+
219
+ * **tools:** Add more commands to package.json ([#1908](https://github.com/SAP/ui5-webcomponents/issues/1908)) ([b0551b3](https://github.com/SAP/ui5-webcomponents/commit/b0551b3))
220
+ * **tools:** Templates can be imported from node_modules/ ([#1860](https://github.com/SAP/ui5-webcomponents/issues/1860)) ([6fa5847](https://github.com/SAP/ui5-webcomponents/commit/6fa5847))
221
+
222
+
223
+
224
+
225
+ # [1.0.0-rc.7](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.6...v1.0.0-rc.7) (2020-04-30)
226
+
227
+
228
+ ### Bug Fixes
229
+
230
+ * **build:** escape quotes in translation texts ([#1511](https://github.com/SAP/ui5-webcomponents/issues/1511)) ([ee7f300](https://github.com/SAP/ui5-webcomponents/commit/ee7f300))
231
+
232
+
233
+
234
+
235
+ # [1.0.0-rc.6](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.5...v1.0.0-rc.6) (2020-03-27)
236
+
237
+
238
+ ### Features
239
+
240
+ * **tools:** create an init package script ([#1010](https://github.com/SAP/ui5-webcomponents/issues/1010)) ([d93ab87](https://github.com/SAP/ui5-webcomponents/commit/d93ab87))
241
+
242
+ * **tools:** add docs to create-ui5-script ([#987](https://github.com/SAP/ui5-webcomponents/issues/987)) ([f0f5ec5](https://github.com/SAP/ui5-webcomponents/commit/f0f5ec5))
243
+
244
+
245
+
246
+
247
+
248
+
6
249
  # [1.0.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.4...v1.0.0-rc.5) (2019-12-02)
7
250
 
8
251
 
9
252
  ### Bug Fixes
10
253
 
11
- * **JS Doc** show correct since version in the playground ([#983](https://github.com/SAP/ui5-webcomponents/issues/983)) ([3051d76](https://github.com/SAP/ui5-webcomponents/commit/3051d76))
254
+ * **JS Doc** show correct since version in the playground ([#983](https://github.com/SAP/ui5-webcomponents/issues/983)) ([3051d76](https://github.com/SAP/ui5-webcomponents/commit/3051d76))
package/README.md CHANGED
@@ -1,24 +1,23 @@
1
- ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/master/docs/images/UI5_logo_wide.png)
1
+ ![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/main/docs/images/UI5_logo_wide.png)
2
2
 
3
3
  # UI5 Web Components - Tools
4
4
 
5
- [![Travis CI Build Status](https://travis-ci.org/SAP/ui5-webcomponents.svg?branch=master)](https://travis-ci.org/SAP/ui5-webcomponents)
6
5
  [![npm Package Version](https://badge.fury.io/js/%40ui5%2Fwebcomponents.svg)](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/master/README.md)
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/master/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/).
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/master/CONTRIBUTING.md).
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/master/LICENSE.txt) file.
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 ADDED
@@ -0,0 +1,153 @@
1
+ const assetsMeta = {
2
+ "themes": {
3
+ "default": "sap_fiori_3",
4
+ "all": [
5
+ "sap_fiori_3",
6
+ "sap_fiori_3_dark",
7
+ "sap_belize",
8
+ "sap_belize_hcb",
9
+ "sap_belize_hcw",
10
+ "sap_fiori_3_hcb",
11
+ "sap_fiori_3_hcw",
12
+ "sap_horizon",
13
+ "sap_horizon_dark",
14
+ "sap_horizon_hcb",
15
+ "sap_horizon_hcw",
16
+ "sap_horizon_exp"
17
+ ]
18
+ },
19
+ "languages": {
20
+ "default": "en",
21
+ "all": [
22
+ "ar",
23
+ "bg",
24
+ "ca",
25
+ "cs",
26
+ "cy",
27
+ "da",
28
+ "de",
29
+ "el",
30
+ "en",
31
+ "en_GB",
32
+ "en_US_sappsd",
33
+ "en_US_saprigi",
34
+ "en_US_saptrc",
35
+ "es",
36
+ "es_MX",
37
+ "et",
38
+ "fi",
39
+ "fr",
40
+ "fr_CA",
41
+ "hi",
42
+ "hr",
43
+ "hu",
44
+ "in",
45
+ "it",
46
+ "iw",
47
+ "ja",
48
+ "kk",
49
+ "ko",
50
+ "lt",
51
+ "lv",
52
+ "ms",
53
+ "nl",
54
+ "no",
55
+ "pl",
56
+ "pt_PT",
57
+ "pt",
58
+ "ro",
59
+ "ru",
60
+ "sh",
61
+ "sk",
62
+ "sl",
63
+ "sv",
64
+ "th",
65
+ "tr",
66
+ "uk",
67
+ "vi",
68
+ "zh_CN",
69
+ "zh_TW"
70
+ ]
71
+ },
72
+ "locales": {
73
+ "default": "en",
74
+ "all": [
75
+ "ar",
76
+ "ar_EG",
77
+ "ar_SA",
78
+ "bg",
79
+ "ca",
80
+ "cs",
81
+ "da",
82
+ "de",
83
+ "de_AT",
84
+ "de_CH",
85
+ "el",
86
+ "el_CY",
87
+ "en",
88
+ "en_AU",
89
+ "en_GB",
90
+ "en_HK",
91
+ "en_IE",
92
+ "en_IN",
93
+ "en_NZ",
94
+ "en_PG",
95
+ "en_SG",
96
+ "en_ZA",
97
+ "es",
98
+ "es_AR",
99
+ "es_BO",
100
+ "es_CL",
101
+ "es_CO",
102
+ "es_MX",
103
+ "es_PE",
104
+ "es_UY",
105
+ "es_VE",
106
+ "et",
107
+ "fa",
108
+ "fi",
109
+ "fr",
110
+ "fr_BE",
111
+ "fr_CA",
112
+ "fr_CH",
113
+ "fr_LU",
114
+ "he",
115
+ "hi",
116
+ "hr",
117
+ "hu",
118
+ "id",
119
+ "it",
120
+ "it_CH",
121
+ "ja",
122
+ "kk",
123
+ "ko",
124
+ "lt",
125
+ "lv",
126
+ "ms",
127
+ "nb",
128
+ "nl",
129
+ "nl_BE",
130
+ "pl",
131
+ "pt",
132
+ "pt_PT",
133
+ "ro",
134
+ "ru",
135
+ "ru_UA",
136
+ "sk",
137
+ "sl",
138
+ "sr",
139
+ "sr_Latn",
140
+ "sv",
141
+ "th",
142
+ "tr",
143
+ "uk",
144
+ "vi",
145
+ "zh_CN",
146
+ "zh_HK",
147
+ "zh_SG",
148
+ "zh_TW"
149
+ ]
150
+ }
151
+ };
152
+
153
+ module.exports = assetsMeta;
package/bin/dev.js CHANGED
@@ -2,4 +2,15 @@
2
2
 
3
3
  const child_process = require("child_process");
4
4
 
5
- child_process.execSync(`npx nps ${process.argv[2]}`, {stdio: 'inherit'});
5
+ let command = process.argv[2];
6
+ const argument = process.argv[3];
7
+
8
+ if (command === "watch") {
9
+ if (["src", "test", "bundles", "styles", "templates", "samples"].includes(argument)) {
10
+ command = `watch.${argument}`;
11
+ }
12
+ } else if (command === "test") {
13
+ command = `test ${process.argv.slice(3).join(" ")}`;
14
+ }
15
+
16
+ child_process.execSync(`npx nps "${command}"`, {stdio: 'inherit'});
@@ -1,74 +1,111 @@
1
1
  const path = require("path");
2
-
2
+ const fs = require("fs");
3
3
  const LIB = path.join(__dirname, `../lib/`);
4
- const NODE_MODULES_PATH = path.join(__dirname, `../../../node_modules/`);
5
- const serveConfig = path.join(__dirname, `serve.json`);
6
- const polyfillPath = path.join(NODE_MODULES_PATH, `/@webcomponents/webcomponentsjs/**/*.*`);
4
+
7
5
 
8
6
  const getScripts = (options) => {
9
7
 
10
- const port = options.port;
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
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
+ }
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
+
12
36
  const scripts = {
13
- clean: "rimraf dist",
14
- lint: "eslint . --config config/.eslintrc.js",
15
- prepare: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples",
37
+ clean: 'rimraf dist && rimraf .port && nps "scope.testPages.clean"',
38
+ lint: `eslint . ${eslintConfig}`,
39
+ lintfix: `eslint . ${eslintConfig}`,
40
+ prepare: {
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",
44
+ },
16
45
  build: {
17
46
  default: "nps lint prepare build.bundle",
18
- templates: `mkdirp dist/generated/templates && node ${LIB}/hbs2ui5/index.js -d src/ -o dist/generated/templates`,
47
+ templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
19
48
  styles: {
20
49
  default: "nps build.styles.themes build.styles.components",
21
- themes: "postcss src/**/parameters-bundle.css --config config/postcss.themes --base src --dir dist/css/",
22
- components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/",
50
+ themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
51
+ components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
23
52
  },
24
53
  i18n: {
25
54
  default: "nps build.i18n.defaultsjs build.i18n.json",
26
- defaultsjs: `mkdirp dist/generated/i18n && node ${LIB}/i18n/defaults.js src/i18n dist/generated/i18n`,
27
- json: `mkdirp dist/generated/assets/i18n && node ${LIB}/i18n/toJSON.js src/i18n dist/generated/assets/i18n`,
55
+ defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
56
+ json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
28
57
  },
29
58
  jsonImports: {
30
59
  default: "mkdirp dist/generated/json-imports && nps build.jsonImports.themes build.jsonImports.i18n",
31
- themes: `node ${LIB}/generate-json-imports/themes.js`,
32
- i18n: `node ${LIB}/generate-json-imports/i18n.js`,
60
+ themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
61
+ i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
33
62
  },
34
- bundle: "rollup --config config/rollup.config.js --environment ES5_BUILD",
35
- samples: {
36
- default: "nps build.samples.api build.samples.docs",
37
- api: `jsdoc -c ${LIB}/jsdoc/config.json`,
38
- docs: `node ${LIB}/documentation/index.js dist/api.json`,
39
- }
63
+ bundle: `vite build ${viteConfig}`,
64
+ api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
65
+ illustrations: illustrationsScript
40
66
  },
41
67
  copy: {
42
- default: "nps copy.src copy.test copy.webcomponents-polyfill",
43
- src: "copy-and-watch \"src/**/*.js\" dist/",
44
- test: "copy-and-watch \"test/**/*.*\" dist/test-resources",
45
- "webcomponents-polyfill": `copy-and-watch "${polyfillPath}" dist/webcomponentsjs/`,
68
+ default: "nps copy.src copy.props",
69
+ src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
70
+ props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
46
71
  },
47
72
  watch: {
48
- default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles"',
49
- src: 'nps "copy.src --watch --skip-initial-copy"',
50
- test: 'nps "copy.test --watch --skip-initial-copy"',
51
- bundle: "rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV",
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"',
75
+ src: 'nps "copy.src --watch --safe --skip-initial-copy"',
76
+ props: 'nps "copy.props --watch --safe --skip-initial-copy"',
77
+ bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
52
78
  styles: {
53
79
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
54
80
  themes: 'nps "build.styles.themes -w"',
55
- components: 'nps "build.styles.components -w"',
81
+ components: {
82
+ default: 'concurrently "nps watch.styles.components.existingFiles" "nps watch.styles.components.newFiles"',
83
+ existingFiles: `nps "build.styles.components -w"`,
84
+ newFiles: `node "${LIB}/postcss-new-files/index.js" --srcFiles="src/themes/*.css"`,
85
+ },
56
86
  },
57
- templates: "chokidar \"src/**/*.hbs\" -c \"nps build.templates\"",
58
- samples: "chokidar \"test/**/*.sample.html\" -c \"nps build.samples\"",
59
- },
60
- dev: 'concurrently "nps serve" "nps watch"',
61
- start: "nps prepare dev",
62
- serve: {
63
- default: "nps serve.prepare serve.run",
64
- prepare: `copy-and-watch "${serveConfig}" dist/`,
65
- run: `serve --no-clipboard -l ${port} dist`,
66
- },
67
- test: {
68
- // --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
69
- default: 'concurrently "nps serve" "nps test.run" --kill-others --success first',
70
- run: "cross-env WDIO_LOG_LEVEL=error FORCE_COLOR=0 wdio config/wdio.conf.js",
87
+ templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
88
+ api: 'chokidar "test/**/*.sample.html" -c "nps build.api"',
89
+ i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
71
90
  },
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",
96
+ scope: {
97
+ prepare: "nps scope.lint prepare scope.testPages",
98
+ lint: `node "${LIB}/scoping/lint-src.js"`,
99
+ testPages: {
100
+ default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
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`,
104
+ },
105
+ watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
106
+ watch: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.test" "nps watch.src" "nps watch.props" "nps watch.styles"',
107
+ bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
108
+ }
72
109
  };
73
110
 
74
111
  return scripts;
@@ -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
+ });