@ui5/webcomponents-tools 0.0.0-9c26e8e4f → 0.0.0-9ed6f23c6

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 (34) hide show
  1. package/CHANGELOG.md +348 -0
  2. package/components-package/eslint.js +34 -0
  3. package/components-package/nps.js +54 -23
  4. package/components-package/postcss.components.js +13 -13
  5. package/components-package/postcss.themes.js +39 -15
  6. package/components-package/vite.config.js +6 -5
  7. package/components-package/wdio.js +400 -386
  8. package/components-package/wdio.sync.js +9 -1
  9. package/icons-collection/nps.js +8 -5
  10. package/lib/copy-list/index.js +2 -2
  11. package/lib/create-icons/index.js +52 -10
  12. package/lib/create-new-component/index.js +71 -104
  13. package/lib/create-new-component/jsFileContentTemplate.js +73 -0
  14. package/lib/create-new-component/tsFileContentTemplate.js +80 -0
  15. package/lib/dev-server/virtual-index-html-plugin.js +2 -2
  16. package/lib/esm-abs-to-rel/index.js +1 -1
  17. package/lib/generate-custom-elements-manifest/index.js +327 -0
  18. package/lib/generate-js-imports/illustrations.js +72 -0
  19. package/lib/hbs2lit/src/compiler.js +16 -5
  20. package/lib/hbs2lit/src/litVisitor2.js +85 -22
  21. package/lib/hbs2lit/src/svgProcessor.js +12 -5
  22. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +32 -4
  23. package/lib/hbs2ui5/index.js +21 -4
  24. package/lib/i18n/defaults.js +18 -2
  25. package/lib/i18n/toJSON.js +1 -1
  26. package/lib/jsdoc/configTypescript.json +29 -0
  27. package/lib/jsdoc/plugin.js +32 -0
  28. package/lib/jsdoc/preprocess.js +146 -0
  29. package/lib/jsdoc/template/publish.js +9 -1
  30. package/lib/postcss-css-to-esm/index.js +40 -7
  31. package/lib/replace-global-core/index.js +1 -1
  32. package/lib/scoping/get-all-tags.js +1 -8
  33. package/lib/test-runner/test-runner.js +10 -2
  34. package/package.json +14 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,354 @@
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.15.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.1...v1.15.0-rc.2) (2023-06-22)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.15.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.0...v1.15.0-rc.1) (2023-06-15)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ # [1.15.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0...v1.15.0-rc.0) (2023-06-08)
27
+
28
+ **Note:** Version bump only for package @ui5/webcomponents-tools
29
+
30
+
31
+
32
+
33
+
34
+ # [1.14.0](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.2...v1.14.0) (2023-06-01)
35
+
36
+ **Note:** Version bump only for package @ui5/webcomponents-tools
37
+
38
+
39
+
40
+
41
+
42
+ # [1.14.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.1...v1.14.0-rc.2) (2023-06-01)
43
+
44
+ **Note:** Version bump only for package @ui5/webcomponents-tools
45
+
46
+
47
+
48
+
49
+
50
+ # [1.14.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.0...v1.14.0-rc.1) (2023-05-25)
51
+
52
+ **Note:** Version bump only for package @ui5/webcomponents-tools
53
+
54
+
55
+
56
+
57
+
58
+ # [1.14.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.2...v1.14.0-rc.0) (2023-05-18)
59
+
60
+ **Note:** Version bump only for package @ui5/webcomponents-tools
61
+
62
+
63
+
64
+
65
+
66
+ ## [1.13.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.5...v1.13.1) (2023-05-11)
67
+
68
+ **Note:** Version bump only for package @ui5/webcomponents-tools
69
+
70
+
71
+
72
+
73
+
74
+ # [1.13.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.4...v1.13.0-rc.5) (2023-05-11)
75
+
76
+
77
+ ### Bug Fixes
78
+
79
+ * **create-webcomponents-package:** fix package creation issues with test and lint ([#6976](https://github.com/SAP/ui5-webcomponents/issues/6976)) ([dd70f3a](https://github.com/SAP/ui5-webcomponents/commit/dd70f3aa8ef70b592f1d4e0f3f9894c6280fb1bf))
80
+
81
+
82
+
83
+
84
+
85
+ # [1.13.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.3...v1.13.0-rc.4) (2023-05-04)
86
+
87
+
88
+ ### Features
89
+
90
+ * generate TS from HBS templates ([#6558](https://github.com/SAP/ui5-webcomponents/issues/6558)) ([02611b2](https://github.com/SAP/ui5-webcomponents/commit/02611b2e24b2c2a06129b8e60a8bc680d9501e39))
91
+
92
+
93
+
94
+
95
+
96
+ # [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)
97
+
98
+ **Note:** Version bump only for package @ui5/webcomponents-tools
99
+
100
+
101
+
102
+
103
+
104
+ # [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)
105
+
106
+ **Note:** Version bump only for package @ui5/webcomponents-tools
107
+
108
+
109
+
110
+
111
+
112
+ # [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)
113
+
114
+
115
+ ### Bug Fixes
116
+
117
+ * **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))
118
+
119
+
120
+
121
+
122
+
123
+ # [1.13.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0...v1.13.0-rc.0) (2023-04-06)
124
+
125
+ **Note:** Version bump only for package @ui5/webcomponents-tools
126
+
127
+
128
+
129
+
130
+
131
+ # [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
132
+
133
+
134
+ ### Bug Fixes
135
+
136
+ * **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)
137
+
138
+
139
+
140
+
141
+
142
+ # [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)
143
+
144
+ **Note:** Version bump only for package @ui5/webcomponents-tools
145
+
146
+
147
+
148
+
149
+
150
+ # [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)
151
+
152
+
153
+ ### Bug Fixes
154
+
155
+ * 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))
156
+
157
+
158
+
159
+
160
+
161
+ # [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)
162
+
163
+ **Note:** Version bump only for package @ui5/webcomponents-tools
164
+
165
+
166
+
167
+
168
+
169
+ # [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
170
+
171
+
172
+ ### Features
173
+
174
+ * 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))
175
+
176
+
177
+
178
+
179
+
180
+ # [1.11.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.4...v1.11.0) (2023-03-06)
181
+
182
+ **Note:** Version bump only for package @ui5/webcomponents-tools
183
+
184
+
185
+
186
+
187
+
188
+ # [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)
189
+
190
+ **Note:** Version bump only for package @ui5/webcomponents-tools
191
+
192
+
193
+
194
+
195
+
196
+ # [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)
197
+
198
+
199
+ ### Features
200
+
201
+ * **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)
202
+
203
+
204
+
205
+
206
+
207
+ # [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)
208
+
209
+ **Note:** Version bump only for package @ui5/webcomponents-tools
210
+
211
+
212
+
213
+
214
+
215
+ # [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)
216
+
217
+ **Note:** Version bump only for package @ui5/webcomponents-tools
218
+
219
+
220
+
221
+
222
+
223
+ # [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)
224
+
225
+ **Note:** Version bump only for package @ui5/webcomponents-tools
226
+
227
+
228
+
229
+
230
+
231
+ ## [1.10.4-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4-rc.0) (2023-01-26)
232
+
233
+ **Note:** Version bump only for package @ui5/webcomponents-tools
234
+
235
+
236
+
237
+
238
+
239
+ ## [1.10.3](https://github.com/SAP/ui5-webcomponents/compare/v1.10.2...v1.10.3) (2023-01-25)
240
+
241
+ **Note:** Version bump only for package @ui5/webcomponents-tools
242
+
243
+
244
+
245
+
246
+
247
+ ## [1.10.2](https://github.com/SAP/ui5-webcomponents/compare/v1.10.1...v1.10.2) (2023-01-25)
248
+
249
+ **Note:** Version bump only for package ui5-webcomponents
250
+
251
+ ## [1.10.1](https://github.com/SAP/ui5-webcomponents/compare/v0.0.0-7b49a7ff1...v1.10.1) (2023-01-24)
252
+
253
+ **Note:** Version bump only for package @ui5/webcomponents-tools
254
+
255
+
256
+
257
+
258
+
259
+ # [1.10.0](https://github.com/SAP/ui5-webcomponents/compare/v1.9.3...v1.10.0) (2023-01-20)
260
+
261
+
262
+ ### Bug Fixes
263
+
264
+ * **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))
265
+
266
+
267
+ ### Features
268
+
269
+ * enable TS in main, fiori ([#6064](https://github.com/SAP/ui5-webcomponents/issues/6064)) ([0b56130](https://github.com/SAP/ui5-webcomponents/commit/0b561307b93b8af465dc5bee67650069ee138f7f))
270
+ * 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))
271
+ * support decorators for custom elements metadata ([#6072](https://github.com/SAP/ui5-webcomponents/issues/6072)) ([fc9ee6e](https://github.com/SAP/ui5-webcomponents/commit/fc9ee6e2af10b4315fde072a50ab37efa180c809))
272
+ * **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)
273
+ * use Typescript for the `base` package ([#5982](https://github.com/SAP/ui5-webcomponents/issues/5982)) ([bd184d8](https://github.com/SAP/ui5-webcomponents/commit/bd184d81a4218328bc7bf04baf2bc1f69a361679))
274
+
275
+
276
+
277
+
278
+
279
+ ## [1.9.3](https://github.com/SAP/ui5-webcomponents/compare/v1.9.2...v1.9.3) (2022-12-16)
280
+
281
+ **Note:** Version bump only for package @ui5/webcomponents-tools
282
+
283
+
284
+
285
+
286
+
287
+ ## [1.9.1](https://github.com/SAP/ui5-webcomponents/compare/v1.9.0...v1.9.1) (2022-11-10)
288
+
289
+
290
+ ### Bug Fixes
291
+
292
+ * **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))
293
+
294
+
295
+
296
+
297
+
298
+ # [1.9.0](https://github.com/SAP/ui5-webcomponents/compare/v1.8.0...v1.9.0) (2022-10-31)
299
+
300
+
301
+ ### Bug Fixes
302
+
303
+ * **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)
304
+
305
+
306
+ ### Features
307
+
308
+ * **framework:** fetch illustrations on demand ([#5927](https://github.com/SAP/ui5-webcomponents/issues/5927)) ([f8e1033](https://github.com/SAP/ui5-webcomponents/commit/f8e1033643626261dcad8a38f65c325ba9aff99f))
309
+ * **framework:** generate custom elements manifest ([#5964](https://github.com/SAP/ui5-webcomponents/issues/5964)) ([0d62770](https://github.com/SAP/ui5-webcomponents/commit/0d62770cace54fd9aef73d9632dd06d8a83680e9))
310
+
311
+
312
+
313
+
314
+
315
+ # [1.8.0](https://github.com/SAP/ui5-webcomponents/compare/v1.7.1...v1.8.0) (2022-10-03)
316
+
317
+
318
+ ### Features
319
+
320
+ * **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)
321
+ * **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))
322
+
323
+
324
+
325
+
326
+
327
+ ## [1.7.1](https://github.com/SAP/ui5-webcomponents/compare/v1.7.0...v1.7.1) (2022-09-08)
328
+
329
+ **Note:** Version bump only for package @ui5/webcomponents-tools
330
+
331
+
332
+
333
+
334
+
335
+ # [1.7.0](https://github.com/SAP/ui5-webcomponents/compare/v1.6.0...v1.7.0) (2022-09-02)
336
+
337
+ **Note:** Version bump only for package @ui5/webcomponents-tools
338
+
339
+
340
+
341
+
342
+
343
+ # [1.6.0](https://github.com/SAP/ui5-webcomponents/compare/v1.5.0...v1.6.0) (2022-07-25)
344
+
345
+
346
+ ### Bug Fixes
347
+
348
+ * **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)
349
+
350
+
351
+
352
+
353
+
6
354
  # [1.5.0](https://github.com/SAP/ui5-webcomponents/compare/v1.4.0...v1.5.0) (2022-07-03)
7
355
 
8
356
  **Note:** Version bump only for package @ui5/webcomponents-tools
@@ -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,13 +1,33 @@
1
1
  const path = require("path");
2
2
  const fs = require("fs");
3
+ const resolve = require("resolve");
3
4
  const LIB = path.join(__dirname, `../lib/`);
4
-
5
+ const preprocessJSDocScript = resolve.sync("@ui5/webcomponents-tools/lib/jsdoc/preprocess.js");
5
6
 
6
7
  const getScripts = (options) => {
7
8
 
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(" && ");
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";
22
+
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
+ }
11
31
 
12
32
  let viteConfig;
13
33
  if (fs.existsSync("config/vite.config.js")) {
@@ -22,37 +42,35 @@ const getScripts = (options) => {
22
42
  }
23
43
 
24
44
  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")) {
45
+ if (fs.existsSync(".eslintrc.js") || fs.existsSync(".eslintrc.cjs")) {
29
46
  // preferred way of custom configuration in root project folder
30
47
  eslintConfig = "";
31
48
  } else {
32
49
  // no custom configuration - use default from tools project
33
50
  eslintConfig = `--config "${require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")}"`;
34
51
  }
35
-
52
+
36
53
  const scripts = {
37
- clean: 'rimraf dist && rimraf .port && nps "scope.testPages.clean"',
54
+ clean: 'rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"',
38
55
  lint: `eslint . ${eslintConfig}`,
39
- lintfix: `eslint . ${eslintConfig}`,
56
+ lintfix: `eslint . ${eslintConfig} --fix`,
40
57
  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",
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",
44
61
  },
62
+ typescript: tsCommand,
45
63
  build: {
46
- default: "nps lint prepare build.bundle",
47
- templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
64
+ default: "nps prepare lint build.bundle",
65
+ templates: `mkdirp dist/generated/templates && ${tsCrossEnv} node "${LIB}/hbs2ui5/index.js" -d src/ -o src/generated/templates`,
48
66
  styles: {
49
- default: "nps build.styles.themes build.styles.components",
67
+ default: `nps build.styles.themes build.styles.components ${copySrcGenerated}`,
50
68
  themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
51
69
  components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
52
70
  },
53
71
  i18n: {
54
72
  default: "nps build.i18n.defaultsjs build.i18n.json",
55
- defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
73
+ defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n src/generated/i18n`,
56
74
  json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
57
75
  },
58
76
  jsonImports: {
@@ -60,19 +78,24 @@ const getScripts = (options) => {
60
78
  themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
61
79
  i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
62
80
  },
81
+ jsImports: {
82
+ default: "mkdirp dist/generated/js-imports && nps build.jsImports.illustrationsLoaders",
83
+ illustrationsLoaders: createIllustrationsLoadersScript,
84
+ },
63
85
  bundle: `vite build ${viteConfig}`,
64
- api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
65
- illustrations: illustrationsScript
86
+ illustrations: createIllustrationsJSImportsScript,
66
87
  },
67
88
  copy: {
68
89
  default: "nps copy.src copy.props",
69
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/`,
70
92
  props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
71
93
  },
72
94
  watch: {
73
- default: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.styles" "nps watch.i18n" "nps watch.props"',
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"`,
74
96
  devServer: 'concurrently "nps watch.default" "nps watch.bundle"',
75
97
  src: 'nps "copy.src --watch --safe --skip-initial-copy"',
98
+ typescript: tsWatchCommand,
76
99
  props: 'nps "copy.props --watch --safe --skip-initial-copy"',
77
100
  bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
78
101
  styles: {
@@ -85,7 +108,7 @@ const getScripts = (options) => {
85
108
  },
86
109
  },
87
110
  templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
88
- api: 'chokidar "test/**/*.sample.html" -c "nps build.api"',
111
+ api: 'chokidar "test/**/*.sample.html" -c "nps generateAPI"',
89
112
  i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
90
113
  },
91
114
  start: "nps prepare watch.devServer",
@@ -105,7 +128,15 @@ const getScripts = (options) => {
105
128
  watchWithBundle: 'concurrently "nps scope.watch" "nps scope.bundle" ',
106
129
  watch: 'concurrently "nps watch.templates" "nps watch.api" "nps watch.src" "nps watch.props" "nps watch.styles"',
107
130
  bundle: `node ${LIB}/dev-server/dev-server.js ${viteConfig}`,
108
- }
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
+ },
109
140
  };
110
141
 
111
142
  return scripts;
@@ -6,16 +6,16 @@ const fs = require("fs");
6
6
  const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
7
7
 
8
8
  module.exports = {
9
- plugins: [
10
- postcssImport(),
11
- cssnano({
12
- preset: [
13
- 'default', {
14
- mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
15
- mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
16
- },
17
- ]
18
- }),
19
- postcssCSStoESM({toReplace: 'src', includeDefaultTheme: true, packageName}),
20
- ]
21
- };
9
+ plugins: [
10
+ postcssImport(),
11
+ cssnano({
12
+ preset: [
13
+ 'default', {
14
+ mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
15
+ mergeRules: false, // https://github.com/cssnano/cssnano/issues/730
16
+ },
17
+ ]
18
+ }),
19
+ postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName }),
20
+ ]
21
+ }
@@ -3,24 +3,48 @@ const combineSelectors = require('../lib/postcss-combine-duplicated-selectors/in
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 modifySelectors = require("modify-selectors");
6
7
  const fs = require("fs");
7
8
 
8
9
  const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
10
+ const selectors = [".sapUiSizeCompact", ".ui5-content-density-compact", "[data-ui5-compact-size]", "[dir=\"rtl\"]", "[dir=\"ltr\"]"];
9
11
 
10
12
  module.exports = {
11
- plugins: [
12
- postcssImport(),
13
- combineSelectors({
14
- removeDuplicatedProperties: true
15
- }),
16
- cssnano({
17
- preset: [
18
- 'default', {
19
- mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
20
- },
21
- ]
22
- },),
23
- postcssCSStoJSON({toReplace: 'src', packageName}),
24
- postcssCSStoESM({toReplace: 'src', packageName}),
25
- ]
13
+ plugins: [
14
+ postcssImport(),
15
+ combineSelectors({
16
+ removeDuplicatedProperties: true
17
+ }),
18
+ cssnano({
19
+ preset: [
20
+ 'default', {
21
+ mergeLonghand: false, // https://github.com/cssnano/cssnano/issues/675
22
+ },
23
+ ]
24
+ },),
25
+ modifySelectors({
26
+ enable: true,
27
+ suffix: [
28
+ {
29
+ match: '*',
30
+ with: '[_ui5host]', // Add suffix to each selector in the file (:root => :root [_ui5host])
31
+ },
32
+ ],
33
+ }),
34
+ modifySelectors({
35
+ enable: true,
36
+ modify: [
37
+ {
38
+ match: (selector) => {
39
+ return selectors.some($ => selector.startsWith($));
40
+ },
41
+ with: (selector) => {
42
+ return `${selector.replace(" ", "")}, ${selector}`;
43
+ },
44
+ },
45
+ ]
46
+ }),
47
+ postcssCSStoJSON({ toReplace: 'src', packageName }),
48
+ postcssCSStoESM({ toReplace: 'src', packageName }),
49
+ ]
26
50
  };
@@ -1,12 +1,13 @@
1
1
  // vite.config.js
2
- const { defineConfig } = require('vite');
3
- const virtualIndex = require("../lib/dev-server/virtual-index-html-plugin.js");
2
+ import { defineConfig } from 'vite';
3
+ import virtualIndex from '../lib/dev-server/virtual-index-html-plugin.js';
4
4
 
5
- module.exports = defineConfig(async () => {
5
+ export default defineConfig(async () => {
6
+ const data = await virtualIndex();
6
7
  return {
7
8
  build: {
8
9
  emptyOutDir: false,
9
10
  },
10
- plugins: [await virtualIndex()],
11
+ plugins: [data],
11
12
  }
12
- });
13
+ })