@ui5/webcomponents-tools 0.0.0-cf069fb29 → 0.0.0-d010d8832

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 (64) hide show
  1. package/CHANGELOG.md +346 -0
  2. package/README.md +5 -6
  3. package/assets-meta.js +4 -0
  4. package/bin/dev.js +1 -5
  5. package/components-package/eslint.js +34 -0
  6. package/components-package/nps.js +86 -57
  7. package/components-package/postcss.components.js +13 -13
  8. package/components-package/postcss.themes.js +16 -16
  9. package/components-package/vite.config.js +13 -0
  10. package/components-package/wdio.js +393 -369
  11. package/components-package/wdio.sync.js +1 -1
  12. package/icons-collection/nps.js +6 -9
  13. package/lib/copy-and-watch/index.js +24 -1
  14. package/lib/copy-list/index.js +17 -17
  15. package/lib/create-icons/index.js +124 -72
  16. package/lib/create-illustrations/index.js +101 -90
  17. package/lib/create-new-component/index.js +72 -104
  18. package/lib/create-new-component/jsFileContentTemplate.js +77 -0
  19. package/lib/create-new-component/tsFileContentTemplate.js +84 -0
  20. package/lib/dev-server/dev-server.js +66 -0
  21. package/lib/dev-server/virtual-index-html-plugin.js +52 -0
  22. package/lib/esm-abs-to-rel/index.js +13 -9
  23. package/lib/generate-custom-elements-manifest/index.js +327 -0
  24. package/lib/generate-js-imports/illustrations.js +72 -0
  25. package/lib/generate-json-imports/i18n.js +38 -31
  26. package/lib/generate-json-imports/themes.js +31 -24
  27. package/lib/hbs2lit/src/compiler.js +20 -3
  28. package/lib/hbs2lit/src/includesReplacer.js +5 -5
  29. package/lib/hbs2lit/src/litVisitor2.js +46 -8
  30. package/lib/hbs2ui5/index.js +37 -21
  31. package/lib/i18n/defaults.js +65 -57
  32. package/lib/i18n/toJSON.js +12 -11
  33. package/lib/jsdoc/configTypescript.json +29 -0
  34. package/lib/jsdoc/plugin.js +41 -0
  35. package/lib/jsdoc/preprocess.js +146 -0
  36. package/lib/jsdoc/template/publish.js +21 -2
  37. package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
  38. package/lib/postcss-css-to-esm/index.js +51 -6
  39. package/lib/postcss-css-to-json/index.js +12 -1
  40. package/lib/postcss-p/postcss-p.mjs +14 -0
  41. package/lib/replace-global-core/index.js +13 -8
  42. package/lib/scoping/get-all-tags.js +1 -8
  43. package/lib/scoping/missing-dependencies.js +65 -0
  44. package/lib/scoping/report-tags-usage.js +28 -0
  45. package/lib/scoping/scope-test-pages.js +1 -1
  46. package/lib/test-runner/test-runner.js +71 -0
  47. package/package.json +26 -26
  48. package/components-package/rollup-plugins/empty-module.js +0 -15
  49. package/components-package/rollup.js +0 -239
  50. package/lib/documentation/index.js +0 -165
  51. package/lib/documentation/templates/api-component-since.js +0 -3
  52. package/lib/documentation/templates/api-css-variables-section.js +0 -24
  53. package/lib/documentation/templates/api-events-section.js +0 -35
  54. package/lib/documentation/templates/api-methods-section.js +0 -26
  55. package/lib/documentation/templates/api-properties-section.js +0 -40
  56. package/lib/documentation/templates/api-slots-section.js +0 -28
  57. package/lib/documentation/templates/template.js +0 -38
  58. package/lib/hash/config.js +0 -10
  59. package/lib/hash/generate.js +0 -19
  60. package/lib/hash/upToDate.js +0 -31
  61. package/lib/polyfill-placeholder/index.js +0 -5
  62. package/lib/serve/index.js +0 -46
  63. package/lib/serve/serve.json +0 -3
  64. package/package-lock.json +0 -48
package/CHANGELOG.md CHANGED
@@ -3,6 +3,352 @@
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.13.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.2...v1.13.0-rc.3) (2023-04-27)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.13.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.1...v1.13.0-rc.2) (2023-04-20)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
22
+ # [1.13.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.0...v1.13.0-rc.1) (2023-04-13)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **framework:** correct fileName in component CSS import ([#6900](https://github.com/SAP/ui5-webcomponents/issues/6900)) ([4d950c5](https://github.com/SAP/ui5-webcomponents/commit/4d950c5ea3bee0e3b629e5797693ecf41a2cdfd3))
28
+
29
+
30
+
31
+
32
+
33
+ # [1.13.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0...v1.13.0-rc.0) (2023-04-06)
34
+
35
+ **Note:** Version bump only for package @ui5/webcomponents-tools
36
+
37
+
38
+
39
+
40
+
41
+ # [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * **theming:** fix icons version display for custom themes (built via the ThemeDesigner) ([#6815](https://github.com/SAP/ui5-webcomponents/issues/6815)) ([63ff800](https://github.com/SAP/ui5-webcomponents/commit/63ff8007889a66efae074fc6b4dbcb1b7ea36713)), closes [#6758](https://github.com/SAP/ui5-webcomponents/issues/6758)
47
+
48
+
49
+
50
+
51
+
52
+ # [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
53
+
54
+ **Note:** Version bump only for package @ui5/webcomponents-tools
55
+
56
+
57
+
58
+
59
+
60
+ # [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * fix eslint for JS 3rd party projects ([#6725](https://github.com/SAP/ui5-webcomponents/issues/6725)) ([215a888](https://github.com/SAP/ui5-webcomponents/commit/215a888b006e46d431edd6324812b9d39249aef4))
66
+
67
+
68
+
69
+
70
+
71
+ # [1.12.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.0...v1.12.0-rc.1) (2023-03-16)
72
+
73
+ **Note:** Version bump only for package @ui5/webcomponents-tools
74
+
75
+
76
+
77
+
78
+
79
+ # [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
80
+
81
+
82
+ ### Features
83
+
84
+ * enhance create-ui5-element command to create component in TS ([#6609](https://github.com/SAP/ui5-webcomponents/issues/6609)) ([d870065](https://github.com/SAP/ui5-webcomponents/commit/d8700650a4e5991862e2076cc2c93482011c4c90))
85
+
86
+
87
+
88
+
89
+
90
+ # [1.11.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.4...v1.11.0) (2023-03-06)
91
+
92
+ **Note:** Version bump only for package @ui5/webcomponents-tools
93
+
94
+
95
+
96
+
97
+
98
+ # [1.11.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.3...v1.11.0-rc.4) (2023-03-02)
99
+
100
+ **Note:** Version bump only for package @ui5/webcomponents-tools
101
+
102
+
103
+
104
+
105
+
106
+ # [1.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.2...v1.11.0-rc.3) (2023-02-23)
107
+
108
+
109
+ ### Features
110
+
111
+ * **playground:** next playground with storybook ([#5831](https://github.com/SAP/ui5-webcomponents/issues/5831)) ([79274c8](https://github.com/SAP/ui5-webcomponents/commit/79274c8e442cf5854a7fe6327f25aaed04312103)), closes [#5898](https://github.com/SAP/ui5-webcomponents/issues/5898)
112
+
113
+
114
+
115
+
116
+
117
+ # [1.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.1...v1.11.0-rc.2) (2023-02-16)
118
+
119
+ **Note:** Version bump only for package @ui5/webcomponents-tools
120
+
121
+
122
+
123
+
124
+
125
+ # [1.11.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.0...v1.11.0-rc.1) (2023-02-09)
126
+
127
+ **Note:** Version bump only for package @ui5/webcomponents-tools
128
+
129
+
130
+
131
+
132
+
133
+ # [1.11.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.4-rc.0...v1.11.0-rc.0) (2023-02-02)
134
+
135
+ **Note:** Version bump only for package @ui5/webcomponents-tools
136
+
137
+
138
+
139
+
140
+
141
+ ## [1.10.4-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4-rc.0) (2023-01-26)
142
+
143
+ **Note:** Version bump only for package @ui5/webcomponents-tools
144
+
145
+
146
+
147
+
148
+
149
+ ## [1.10.3](https://github.com/SAP/ui5-webcomponents/compare/v1.10.2...v1.10.3) (2023-01-25)
150
+
151
+ **Note:** Version bump only for package @ui5/webcomponents-tools
152
+
153
+
154
+
155
+
156
+
157
+ ## [1.10.2](https://github.com/SAP/ui5-webcomponents/compare/v1.10.1...v1.10.2) (2023-01-25)
158
+
159
+ **Note:** Version bump only for package ui5-webcomponents
160
+
161
+ ## [1.10.1](https://github.com/SAP/ui5-webcomponents/compare/v0.0.0-7b49a7ff1...v1.10.1) (2023-01-24)
162
+
163
+ **Note:** Version bump only for package @ui5/webcomponents-tools
164
+
165
+
166
+
167
+
168
+
169
+ # [1.10.0](https://github.com/SAP/ui5-webcomponents/compare/v1.9.3...v1.10.0) (2023-01-20)
170
+
171
+
172
+ ### Bug Fixes
173
+
174
+ * **infra:** set Content-Type header on testsuite ([#6108](https://github.com/SAP/ui5-webcomponents/issues/6108)) ([fae3f91](https://github.com/SAP/ui5-webcomponents/commit/fae3f91975ab1dad7135bea2227f61986eff403f))
175
+
176
+
177
+ ### Features
178
+
179
+ * enable TS in main, fiori ([#6064](https://github.com/SAP/ui5-webcomponents/issues/6064)) ([0b56130](https://github.com/SAP/ui5-webcomponents/commit/0b561307b93b8af465dc5bee67650069ee138f7f))
180
+ * migrate illustrated-message component to TS, small refactor ([#6195](https://github.com/SAP/ui5-webcomponents/issues/6195)) ([046c779](https://github.com/SAP/ui5-webcomponents/commit/046c779f654648172619dd720c0d90342ec78fb9))
181
+ * support decorators for custom elements metadata ([#6072](https://github.com/SAP/ui5-webcomponents/issues/6072)) ([fc9ee6e](https://github.com/SAP/ui5-webcomponents/commit/fc9ee6e2af10b4315fde072a50ab37efa180c809))
182
+ * **ui5-button, ui5-date-picker, ui5-calendar:** migrate to TS ([#6173](https://github.com/SAP/ui5-webcomponents/issues/6173)) ([7232ca0](https://github.com/SAP/ui5-webcomponents/commit/7232ca08f286c5dde10080373fb62247f1acf7b7)), closes [#6080](https://github.com/SAP/ui5-webcomponents/issues/6080)
183
+ * use Typescript for the `base` package ([#5982](https://github.com/SAP/ui5-webcomponents/issues/5982)) ([bd184d8](https://github.com/SAP/ui5-webcomponents/commit/bd184d81a4218328bc7bf04baf2bc1f69a361679))
184
+
185
+
186
+
187
+
188
+
189
+ ## [1.9.3](https://github.com/SAP/ui5-webcomponents/compare/v1.9.2...v1.9.3) (2022-12-16)
190
+
191
+ **Note:** Version bump only for package @ui5/webcomponents-tools
192
+
193
+
194
+
195
+
196
+
197
+ ## [1.9.1](https://github.com/SAP/ui5-webcomponents/compare/v1.9.0...v1.9.1) (2022-11-10)
198
+
199
+
200
+ ### Bug Fixes
201
+
202
+ * **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))
203
+
204
+
205
+
206
+
207
+
208
+ # [1.9.0](https://github.com/SAP/ui5-webcomponents/compare/v1.8.0...v1.9.0) (2022-10-31)
209
+
210
+
211
+ ### Bug Fixes
212
+
213
+ * **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)
214
+
215
+
216
+ ### Features
217
+
218
+ * **framework:** fetch illustrations on demand ([#5927](https://github.com/SAP/ui5-webcomponents/issues/5927)) ([f8e1033](https://github.com/SAP/ui5-webcomponents/commit/f8e1033643626261dcad8a38f65c325ba9aff99f))
219
+ * **framework:** generate custom elements manifest ([#5964](https://github.com/SAP/ui5-webcomponents/issues/5964)) ([0d62770](https://github.com/SAP/ui5-webcomponents/commit/0d62770cace54fd9aef73d9632dd06d8a83680e9))
220
+
221
+
222
+
223
+
224
+
225
+ # [1.8.0](https://github.com/SAP/ui5-webcomponents/compare/v1.7.1...v1.8.0) (2022-10-03)
226
+
227
+
228
+ ### Features
229
+
230
+ * **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)
231
+ * **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))
232
+
233
+
234
+
235
+
236
+
237
+ ## [1.7.1](https://github.com/SAP/ui5-webcomponents/compare/v1.7.0...v1.7.1) (2022-09-08)
238
+
239
+ **Note:** Version bump only for package @ui5/webcomponents-tools
240
+
241
+
242
+
243
+
244
+
245
+ # [1.7.0](https://github.com/SAP/ui5-webcomponents/compare/v1.6.0...v1.7.0) (2022-09-02)
246
+
247
+ **Note:** Version bump only for package @ui5/webcomponents-tools
248
+
249
+
250
+
251
+
252
+
253
+ # [1.6.0](https://github.com/SAP/ui5-webcomponents/compare/v1.5.0...v1.6.0) (2022-07-25)
254
+
255
+
256
+ ### Bug Fixes
257
+
258
+ * **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)
259
+
260
+
261
+
262
+
263
+
264
+ # [1.5.0](https://github.com/SAP/ui5-webcomponents/compare/v1.4.0...v1.5.0) (2022-07-03)
265
+
266
+ **Note:** Version bump only for package @ui5/webcomponents-tools
267
+
268
+
269
+
270
+
271
+
272
+ # [1.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
273
+
274
+
275
+ ### Features
276
+
277
+ **Note:** Version bump only for package @ui5/webcomponents-icons-tnt
278
+
279
+
280
+
281
+
282
+
283
+ ## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
284
+
285
+ **Note:** Version bump only for package @ui5/webcomponents-tools
286
+
287
+
288
+
289
+
290
+
291
+ # [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
292
+
293
+
294
+ ### Bug Fixes
295
+
296
+ * **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)
297
+
298
+
299
+
300
+
301
+
302
+ ## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
303
+
304
+ **Note:** Version bump only for package @ui5/webcomponents-tools
305
+
306
+
307
+
308
+
309
+
310
+ ## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
311
+
312
+ **Note:** Version bump only for package @ui5/webcomponents-tools
313
+
314
+
315
+
316
+
317
+
318
+ ## [1.2.2](https://github.com/SAP/ui5-webcomponents/compare/v1.2.1...v1.2.2) (2022-03-22)
319
+
320
+
321
+ **Note:** Version bump only for package @ui5/webcomponents-tools
322
+
323
+
324
+
325
+
326
+
327
+ ## [1.2.1](https://github.com/SAP/ui5-webcomponents/compare/v1.2.0...v1.2.1) (2022-03-02)
328
+
329
+ **Note:** Version bump only for package @ui5/webcomponents-tools
330
+
331
+
332
+
333
+
334
+
335
+ # [1.2.0](https://github.com/SAP/ui5-webcomponents/compare/v1.1.2...v1.2.0) (2022-02-28)
336
+
337
+
338
+ ### Bug Fixes
339
+
340
+ * correct scoping issues with several components ([#4820](https://github.com/SAP/ui5-webcomponents/issues/4820)) ([621dc20](https://github.com/SAP/ui5-webcomponents/commit/621dc20))
341
+ * display methods in child components API ([#4792](https://github.com/SAP/ui5-webcomponents/issues/4792)) ([1929d08](https://github.com/SAP/ui5-webcomponents/commit/1929d08))
342
+
343
+
344
+ ### Features
345
+
346
+ * **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)
347
+
348
+
349
+
350
+
351
+
6
352
  ## [1.1.2](https://github.com/SAP/ui5-webcomponents/compare/v1.1.1...v1.1.2) (2022-01-26)
7
353
 
8
354
  **Note:** Version bump only for package @ui5/webcomponents-tools
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/docs/6-contributing/02-conventions-and-guidelines.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 CHANGED
@@ -10,6 +10,9 @@ const assetsMeta = {
10
10
  "sap_fiori_3_hcb",
11
11
  "sap_fiori_3_hcw",
12
12
  "sap_horizon",
13
+ "sap_horizon_dark",
14
+ "sap_horizon_hcb",
15
+ "sap_horizon_hcw",
13
16
  "sap_horizon_exp"
14
17
  ]
15
18
  },
@@ -133,6 +136,7 @@ const assetsMeta = {
133
136
  "sk",
134
137
  "sl",
135
138
  "sr",
139
+ "sr_Latn",
136
140
  "sv",
137
141
  "th",
138
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
- if (argument === "--no-server") { // yarn test --no-server
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,3 +1,36 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const tsMode = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
4
+
5
+ /**
6
+ * Typescript Rules
7
+ */
8
+ const overrides = tsMode ? [{
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
+ rules: {
20
+ "no-shadow": "off",
21
+ "@typescript-eslint/no-shadow": ["error"],
22
+ "@typescript-eslint/no-unsafe-member-access": "off",
23
+ "@typescript-eslint/no-floating-promises": "off",
24
+ "@typescript-eslint/no-explicit-any": "off",
25
+ "@typescript-eslint/no-unsafe-assignment": "off",
26
+ "@typescript-eslint/ban-ts-comment": "off",
27
+ "@typescript-eslint/no-unsafe-call": "off",
28
+ "@typescript-eslint/no-non-null-assertion": "off",
29
+ "@typescript-eslint/no-empty-function": "off",
30
+ "lines-between-class-members": "off",
31
+ }
32
+ }] : [];
33
+
1
34
  module.exports = {
2
35
  "env": {
3
36
  "browser": true,
@@ -5,6 +38,7 @@ module.exports = {
5
38
  },
6
39
  "root": true,
7
40
  "extends": "airbnb-base",
41
+ overrides,
8
42
  "parserOptions": {
9
43
  "ecmaVersion": 2018,
10
44
  "sourceType": "module"
@@ -1,40 +1,76 @@
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 polyfillDir = path.dirname(require.resolve("@webcomponents/webcomponentsjs"));
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
- const port = options.port || 8080; // preferred port
12
- const portStep = options.portStep || 1; // step to check for available ports, if preferred port is already used
13
- let illustrations = options.illustrationsData || [];
9
+ // The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
10
+ const illustrationsData = options.illustrationsData || [];
11
+ const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
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 tsOption = options.typescript;
18
+ const tsCommand = tsOption ? "tsc" : "";
19
+ const tsWatchCommand = tsOption ? "tsc --watch" : "";
20
+ const tsCrossEnv = tsOption ? "cross-env UI5_TS=true" : "";
21
+ const copySrcGenerated = tsOption ? "" : "copy.srcGenerated";
14
22
 
15
- illustrations = illustrations.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
23
+ if (tsOption) {
24
+ try {
25
+ require("typescript");
26
+ } catch(e) {
27
+ console.error(`TypeScript is not found. Try to install it by running \`npm install --save-dev typescript\` if you are using npm or by running \`yarn add --dev typescript\` if you are using yarn.`);
28
+ process.exit(e.code);
29
+ }
30
+ }
16
31
 
17
- let illustrationsScript = illustrations.join(" && ");
32
+ let viteConfig;
33
+ if (fs.existsSync("config/vite.config.js")) {
34
+ // old project setup where config file is in separate folder
35
+ viteConfig = "-c config/vite.config.js";
36
+ } else if (fs.existsSync("vite.config.js")) {
37
+ // preferred way of custom configuration in root project folder
38
+ viteConfig = "";
39
+ } else {
40
+ // no custom configuration - use default from tools project
41
+ viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
42
+ }
43
+
44
+ let eslintConfig;
45
+ if (fs.existsSync(".eslintrc.js") || fs.existsSync(".eslintrc.cjs")) {
46
+ // preferred way of custom configuration in root project folder
47
+ eslintConfig = "";
48
+ } else {
49
+ // no custom configuration - use default from tools project
50
+ eslintConfig = `--config "${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}"`;
51
+ }
18
52
 
19
53
  const scripts = {
20
- clean: "rimraf dist && rimraf .port",
21
- lint: "eslint . --config config/.eslintrc.js",
22
- lintfix: "eslint . --config config/.eslintrc.js --fix",
54
+ clean: 'rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
55
+ lint: `eslint . ${eslintConfig}`,
56
+ lintfix: `eslint . ${eslintConfig} --fix`,
23
57
  prepare: {
24
- default: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples build.illustrations",
25
- es5: "nps clean build.templates build.styles build.i18n build.jsonImports copy.es5 build.samples build.illustrations"
58
+ default: `${tsCrossEnv} nps clean prepare.all typescript generateAPI`,
59
+ all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"',
60
+ styleRelated: "nps build.styles build.jsonImports build.jsImports",
26
61
  },
62
+ typescript: tsCommand,
27
63
  build: {
28
- default: "nps lint prepare.es5 build.bundle",
64
+ default: "nps prepare lint build.bundle",
29
65
  templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
30
66
  styles: {
31
- default: "nps build.styles.themes build.styles.components",
32
- themes: "postcss src/**/parameters-bundle.css --config config/postcss.themes --base src --dir dist/css/",
67
+ default: `nps build.styles.themes build.styles.components ${copySrcGenerated}`,
68
+ themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
33
69
  components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
34
70
  },
35
71
  i18n: {
36
72
  default: "nps build.i18n.defaultsjs build.i18n.json",
37
- defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
73
+ defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
38
74
  json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
39
75
  },
40
76
  jsonImports: {
@@ -42,33 +78,26 @@ const getScripts = (options) => {
42
78
  themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
43
79
  i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
44
80
  },
45
- bundle: "rollup --config config/rollup.config.js --environment ES5_BUILD",
46
- samples: {
47
- default: "nps build.samples.api build.samples.docs",
48
- api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
49
- docs: `node "${LIB}/documentation/index.js" dist/api.json`,
81
+ jsImports: {
82
+ default: "mkdirp dist/generated/js-imports && nps build.jsImports.illustrationsLoaders",
83
+ illustrationsLoaders: createIllustrationsLoadersScript,
50
84
  },
51
- illustrations: illustrationsScript
85
+ bundle: `vite build ${viteConfig}`,
86
+ illustrations: createIllustrationsJSImportsScript,
52
87
  },
53
88
  copy: {
54
- default: "nps copy.src copy.props copy.test copy.webcomponents-polyfill-placeholder",
55
- es5: "nps copy.src copy.props copy.test copy.webcomponents-polyfill",
89
+ default: "nps copy.src copy.props",
56
90
  src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
91
+ srcGenerated: `node "${LIB}/copy-and-watch/index.js" --silent "src/generated/**/*.js" dist/generated/`,
57
92
  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
93
  },
62
94
  watch: {
63
- default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles" "nps watch.i18n"',
64
- es5: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle.es5" "nps watch.styles" "nps watch.i18n"',
95
+ default: `${tsCrossEnv} concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.typescript" "nps watch.styles" "nps watch.i18n" "nps watch.props"`,
96
+ devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
65
97
  src: 'nps "copy.src --watch --safe --skip-initial-copy"',
98
+ typescript: tsWatchCommand,
66
99
  props: 'nps "copy.props --watch --safe --skip-initial-copy"',
67
- test: 'nps "copy.test --watch --safe --skip-initial-copy"',
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
- },
100
+ bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
72
101
  styles: {
73
102
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
74
103
  themes: 'nps "build.styles.themes -w"',
@@ -79,35 +108,35 @@ const getScripts = (options) => {
79
108
  },
80
109
  },
81
110
  templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
82
- samples: 'chokidar "test/**/*.sample.html" -c "nps build.samples"',
111
+ api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"',
83
112
  i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
84
113
  },
85
- dev: {
86
- default: 'concurrently "nps serve" "nps watch"',
87
- es5: 'concurrently "nps serve" "nps watch.es5"'
88
- },
89
- start: "nps prepare dev",
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",
114
+ start: "nps prepare watch.devServer",
115
+ test: `node "${LIB}/test-runner/test-runner.js"`,
116
+ "test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
117
+ "test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
118
+ startWithScope: "nps scope.prepare scope.watchWithBundle",
98
119
  scope: {
99
120
  prepare: "nps scope.lint prepare scope.testPages",
100
121
  lint: `node "${LIB}/scoping/lint-src.js"`,
101
122
  testPages: {
102
123
  default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
103
- clean: "rimraf dist/test-resources/pages/scoped",
104
- copy: `node "${LIB}/copy-and-watch/index.js" --silent "dist/test-resources/pages/**/*" dist/test-resources/scoped`,
105
- replace: `node "${LIB}/scoping/scope-test-pages.js" dist/test-resources/scoped demo`,
124
+ clean: "rimraf test/pages/scoped",
125
+ copy: `node "${LIB}/copy-and-watch/index.js" --silent "test/pages/**/*" test/pages/scoped`,
126
+ replace: `node "${LIB}/scoping/scope-test-pages.js" test/pages/scoped demo`,
106
127
  },
107
- dev: 'concurrently "nps serve" "nps scope.watch"',
108
- watch: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.props" "nps scope.bundle" "nps watch.styles"',
109
- bundle: 'rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV,SCOPE'
110
- }
128
+ watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
129
+ watch: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.props" "nps watch.styles"',
130
+ bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
131
+ },
132
+ generateAPI: {
133
+ default: "nps generateAPI.prepare generateAPI.preprocess generateAPI.jsdoc generateAPI.cleanup generateAPI.prepareManifest",
134
+ prepare: `node "${LIB}/copy-and-watch/index.js" --silent "dist/**/*.js" jsdoc-dist/`,
135
+ prepareManifest: `node "${LIB}/generate-custom-elements-manifest/index.js" dist dist`,
136
+ preprocess: `node "${preprocessJSDocScript}" jsdoc-dist/ src`,
137
+ jsdoc: `jsdoc -c "${LIB}/jsdoc/configTypescript.json"`,
138
+ cleanup: "rimraf jsdoc-dist/"
139
+ },
111
140
  };
112
141
 
113
142
  return scripts;