@ui5/webcomponents-tools 0.0.0-dff5837d7 → 0.0.0-ec448881d

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 (75) hide show
  1. package/CHANGELOG.md +208 -0
  2. package/README.md +1 -1
  3. package/assets-meta.js +18 -1
  4. package/bin/dev.js +10 -5
  5. package/components-package/nps.js +53 -26
  6. package/components-package/postcss.themes.js +6 -3
  7. package/components-package/rollup-plugins/empty-module.js +15 -0
  8. package/components-package/rollup.js +93 -77
  9. package/components-package/wdio.js +54 -29
  10. package/components-package/wdio.sync.js +360 -0
  11. package/icons-collection/nps.js +47 -9
  12. package/lib/copy-and-watch/index.js +30 -5
  13. package/lib/copy-list/index.js +28 -0
  14. package/lib/create-icons/index.js +82 -54
  15. package/lib/create-illustrations/index.js +161 -0
  16. package/lib/create-new-component/index.js +16 -4
  17. package/lib/documentation/index.js +124 -99
  18. package/lib/documentation/templates/api-properties-section.js +3 -1
  19. package/lib/documentation/templates/template.js +2 -1
  20. package/lib/esm-abs-to-rel/index.js +58 -0
  21. package/lib/generate-json-imports/i18n.js +74 -32
  22. package/lib/generate-json-imports/themes.js +64 -17
  23. package/lib/hbs2lit/src/compiler.js +12 -3
  24. package/lib/hbs2lit/src/includesReplacer.js +5 -5
  25. package/lib/hbs2lit/src/litVisitor2.js +43 -7
  26. package/lib/hbs2lit/src/svgProcessor.js +3 -3
  27. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +5 -5
  28. package/lib/hbs2ui5/index.js +50 -18
  29. package/lib/i18n/defaults.js +49 -57
  30. package/lib/i18n/toJSON.js +13 -12
  31. package/lib/jsdoc/config.json +1 -1
  32. package/lib/jsdoc/plugin.js +33 -4
  33. package/lib/jsdoc/template/publish.js +24 -4
  34. package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
  35. package/lib/postcss-css-to-esm/index.js +19 -16
  36. package/lib/postcss-css-to-json/index.js +20 -11
  37. package/lib/postcss-new-files/index.js +36 -0
  38. package/lib/postcss-p/postcss-p.mjs +11 -0
  39. package/lib/replace-global-core/index.js +25 -0
  40. package/lib/scoping/get-all-tags.js +44 -0
  41. package/lib/scoping/lint-src.js +31 -0
  42. package/lib/scoping/missing-dependencies.js +65 -0
  43. package/lib/scoping/report-tags-usage.js +28 -0
  44. package/lib/scoping/scope-test-pages.js +40 -0
  45. package/lib/serve/index.js +46 -0
  46. package/{components-package → lib/serve}/serve.json +0 -0
  47. package/package-lock.json +48 -0
  48. package/package.json +47 -53
  49. package/bin/init-ui5-package.js +0 -3
  50. package/lib/init-package/index.js +0 -112
  51. package/lib/init-package/resources/.eslintignore +0 -3
  52. package/lib/init-package/resources/bundle.es5.js +0 -25
  53. package/lib/init-package/resources/bundle.esm.js +0 -34
  54. package/lib/init-package/resources/config/.eslintrc.js +0 -1
  55. package/lib/init-package/resources/config/postcss.components/postcss.config.js +0 -1
  56. package/lib/init-package/resources/config/postcss.themes/postcss.config.js +0 -1
  57. package/lib/init-package/resources/config/rollup.config.js +0 -1
  58. package/lib/init-package/resources/config/wdio.conf.js +0 -1
  59. package/lib/init-package/resources/package-scripts.js +0 -11
  60. package/lib/init-package/resources/src/Assets.js +0 -5
  61. package/lib/init-package/resources/src/Demo.hbs +0 -1
  62. package/lib/init-package/resources/src/Demo.js +0 -56
  63. package/lib/init-package/resources/src/i18n/messagebundle.properties +0 -2
  64. package/lib/init-package/resources/src/i18n/messagebundle_de.properties +0 -1
  65. package/lib/init-package/resources/src/i18n/messagebundle_en.properties +0 -1
  66. package/lib/init-package/resources/src/i18n/messagebundle_es.properties +0 -1
  67. package/lib/init-package/resources/src/i18n/messagebundle_fr.properties +0 -1
  68. package/lib/init-package/resources/src/themes/Demo.css +0 -11
  69. package/lib/init-package/resources/src/themes/sap_belize/parameters-bundle.css +0 -3
  70. package/lib/init-package/resources/src/themes/sap_belize_hcb/parameters-bundle.css +0 -3
  71. package/lib/init-package/resources/src/themes/sap_belize_hcw/parameters-bundle.css +0 -3
  72. package/lib/init-package/resources/src/themes/sap_fiori_3/parameters-bundle.css +0 -3
  73. package/lib/init-package/resources/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
  74. package/lib/init-package/resources/test/pages/index.html +0 -51
  75. package/lib/init-package/resources/test/specs/Demo.spec.js +0 -12
package/CHANGELOG.md CHANGED
@@ -3,6 +3,214 @@
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.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **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)
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
26
+
27
+ **Note:** Version bump only for package @ui5/webcomponents-tools
28
+
29
+
30
+
31
+
32
+
33
+ ## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
34
+
35
+ **Note:** Version bump only for package @ui5/webcomponents-tools
36
+
37
+
38
+
39
+
40
+
41
+ ## [1.2.2](https://github.com/SAP/ui5-webcomponents/compare/v1.2.1...v1.2.2) (2022-03-22)
42
+
43
+
44
+ **Note:** Version bump only for package @ui5/webcomponents-tools
45
+
46
+
47
+
48
+
49
+
50
+ ## [1.2.1](https://github.com/SAP/ui5-webcomponents/compare/v1.2.0...v1.2.1) (2022-03-02)
51
+
52
+ **Note:** Version bump only for package @ui5/webcomponents-tools
53
+
54
+
55
+
56
+
57
+
58
+ # [1.2.0](https://github.com/SAP/ui5-webcomponents/compare/v1.1.2...v1.2.0) (2022-02-28)
59
+
60
+
61
+ ### Bug Fixes
62
+
63
+ * correct scoping issues with several components ([#4820](https://github.com/SAP/ui5-webcomponents/issues/4820)) ([621dc20](https://github.com/SAP/ui5-webcomponents/commit/621dc20))
64
+ * display methods in child components API ([#4792](https://github.com/SAP/ui5-webcomponents/issues/4792)) ([1929d08](https://github.com/SAP/ui5-webcomponents/commit/1929d08))
65
+
66
+
67
+ ### Features
68
+
69
+ * **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)
70
+
71
+
72
+
73
+
74
+
75
+ ## [1.1.2](https://github.com/SAP/ui5-webcomponents/compare/v1.1.1...v1.1.2) (2022-01-26)
76
+
77
+ **Note:** Version bump only for package @ui5/webcomponents-tools
78
+
79
+
80
+
81
+
82
+
83
+ ## [1.1.1](https://github.com/SAP/ui5-webcomponents/compare/v1.1.0...v1.1.1) (2022-01-24)
84
+
85
+ **Note:** Version bump only for package @ui5/webcomponents-tools
86
+
87
+
88
+
89
+
90
+
91
+ # [1.1.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.2...v1.1.0) (2022-01-21)
92
+
93
+
94
+ **Note:** Version bump only for package @ui5/webcomponents-tools
95
+
96
+
97
+
98
+
99
+
100
+ ## [1.0.2](https://github.com/SAP/ui5-webcomponents/compare/v1.0.1...v1.0.2) (2021-11-29)
101
+
102
+ **Note:** Version bump only for package @ui5/webcomponents-tools
103
+
104
+
105
+
106
+
107
+
108
+ ## [1.0.1](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0...v1.0.1) (2021-11-10)
109
+
110
+ **Note:** Version bump only for package @ui5/webcomponents-tools
111
+
112
+
113
+
114
+
115
+
116
+ # [1.0.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.16...v1.0.0) (2021-11-10)
117
+
118
+
119
+ **Note:** Version bump only for package @ui5/webcomponents-tools
120
+
121
+
122
+ # [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)
123
+
124
+
125
+
126
+ ### Features
127
+
128
+ * **tools:** create an npm init script ([#4090](https://github.com/SAP/ui5-webcomponents/issues/4090)) ([5608e04](https://github.com/SAP/ui5-webcomponents/commit/5608e04))
129
+
130
+
131
+
132
+ # [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)
133
+
134
+
135
+ ### Bug Fixes
136
+
137
+ * **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)
138
+
139
+
140
+
141
+
142
+
143
+
144
+ # [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)
145
+
146
+
147
+
148
+
149
+ # [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)
150
+
151
+
152
+ **Note:** Version bump only for package @ui5/webcomponents-tools
153
+
154
+
155
+
156
+
157
+
158
+ # [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)
159
+
160
+ **Note:** Version bump only for package @ui5/webcomponents-tools
161
+
162
+
163
+
164
+
165
+ # [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)
166
+
167
+
168
+ ### Bug Fixes
169
+
170
+ * 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))
171
+
172
+
173
+
174
+
175
+
176
+ # [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)
177
+
178
+
179
+
180
+ # [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)
181
+
182
+
183
+ ### Features
184
+
185
+ * **framework:** dynamic custom elements scoping ([#2091](https://github.com/SAP/ui5-webcomponents/issues/2091)) ([3588542](https://github.com/SAP/ui5-webcomponents/commit/3588542))
186
+ * **framework:** make assets path configurable ([#2214](https://github.com/SAP/ui5-webcomponents/issues/2214)) ([16c46da](https://github.com/SAP/ui5-webcomponents/commit/16c46da))
187
+ * **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))
188
+ * **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)
189
+
190
+
191
+
192
+
193
+
194
+ # [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)
195
+
196
+
197
+ ### Bug Fixes
198
+
199
+ * **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))
200
+ * **tools:** Strip whitespaces around < and > ([#1623](https://github.com/SAP/ui5-webcomponents/issues/1623)) ([0fcda38](https://github.com/SAP/ui5-webcomponents/commit/0fcda38))
201
+ * **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))
202
+ * **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))
203
+ * **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))
204
+
205
+
206
+ ### Features
207
+
208
+ * **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))
209
+ * **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))
210
+
211
+
212
+
213
+
6
214
  # [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)
7
215
 
8
216
 
package/README.md CHANGED
@@ -17,7 +17,7 @@ used by other UI5 Web Components packages, such as `main` and `fiori`.
17
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/).
18
18
 
19
19
  ## Contribute
20
- Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/CONTRIBUTING.md).
20
+ Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/master/docs/6-contributing/02-conventions-and-guidelines.md).
21
21
 
22
22
  ## License
23
23
  Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
package/assets-meta.js CHANGED
@@ -6,7 +6,14 @@ const assetsMeta = {
6
6
  "sap_fiori_3_dark",
7
7
  "sap_belize",
8
8
  "sap_belize_hcb",
9
- "sap_belize_hcw"
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"
10
17
  ]
11
18
  },
12
19
  "languages": {
@@ -16,17 +23,25 @@ const assetsMeta = {
16
23
  "bg",
17
24
  "ca",
18
25
  "cs",
26
+ "cy",
19
27
  "da",
20
28
  "de",
21
29
  "el",
22
30
  "en",
31
+ "en_GB",
32
+ "en_US_sappsd",
33
+ "en_US_saprigi",
34
+ "en_US_saptrc",
23
35
  "es",
36
+ "es_MX",
24
37
  "et",
25
38
  "fi",
26
39
  "fr",
40
+ "fr_CA",
27
41
  "hi",
28
42
  "hr",
29
43
  "hu",
44
+ "in",
30
45
  "it",
31
46
  "iw",
32
47
  "ja",
@@ -38,6 +53,7 @@ const assetsMeta = {
38
53
  "nl",
39
54
  "no",
40
55
  "pl",
56
+ "pt_PT",
41
57
  "pt",
42
58
  "ro",
43
59
  "ru",
@@ -120,6 +136,7 @@ const assetsMeta = {
120
136
  "sk",
121
137
  "sl",
122
138
  "sr",
139
+ "sr_Latn",
123
140
  "sv",
124
141
  "th",
125
142
  "tr",
package/bin/dev.js CHANGED
@@ -3,12 +3,17 @@
3
3
  const child_process = require("child_process");
4
4
 
5
5
  let command = process.argv[2];
6
+ const argument = process.argv[3];
6
7
 
7
- // Support for running the test task with a spec parameter
8
- if (command === "test") {
9
- const spec = process.argv[3];
10
- if (spec) {
11
- command = `test.spec --spec ${spec}`;
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
+ 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}`;
12
17
  }
13
18
  }
14
19
 
@@ -1,25 +1,35 @@
1
1
  const path = require("path");
2
+ const fs = require("fs");
2
3
 
3
4
  const LIB = path.join(__dirname, `../lib/`);
4
- const serveConfig = path.join(__dirname, `serve.json`);
5
- const polyfillDir = path.dirname(require.resolve("@webcomponents/webcomponentsjs"));
6
- const polyfillPath = path.join(polyfillDir, "/**/*.*");
5
+ const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
7
6
 
8
7
  const getScripts = (options) => {
9
8
 
10
- const port = options.port;
9
+ const port = options.port || 8080; // preferred port
10
+ const portStep = options.portStep || 1; // step to check for available ports, if preferred port is already used
11
+ let illustrations = options.illustrationsData || [];
12
+
13
+ illustrations = illustrations.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
14
+
15
+ let illustrationsScript = illustrations.join(" && ");
11
16
 
12
17
  const scripts = {
13
- clean: "rimraf dist",
18
+ clean: "rimraf dist && rimraf .port",
14
19
  lint: "eslint . --config config/.eslintrc.js",
15
- prepare: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples",
20
+ lintfix: "eslint . --config config/.eslintrc.js --fix",
21
+ prepare: {
22
+ default: "nps clean prepare.all",
23
+ all: 'concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.samples" "nps build.illustrations"',
24
+ styleRelated: "nps build.styles build.jsonImports",
25
+ },
16
26
  build: {
17
27
  default: "nps lint prepare build.bundle",
18
28
  templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
19
29
  styles: {
20
30
  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/",
31
+ themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
32
+ components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
23
33
  },
24
34
  i18n: {
25
35
  default: "nps build.i18n.defaultsjs build.i18n.json",
@@ -28,48 +38,65 @@ const getScripts = (options) => {
28
38
  },
29
39
  jsonImports: {
30
40
  default: "mkdirp dist/generated/json-imports && nps build.jsonImports.themes build.jsonImports.i18n",
31
- themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/json-imports`,
41
+ themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
32
42
  i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
33
43
  },
34
- bundle: "rollup --config config/rollup.config.js --environment ES5_BUILD",
44
+ bundle: "rollup --config config/rollup.config.js",
35
45
  samples: {
36
46
  default: "nps build.samples.api build.samples.docs",
37
47
  api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
38
48
  docs: `node "${LIB}/documentation/index.js" dist/api.json`,
39
- }
49
+ },
50
+ illustrations: illustrationsScript
40
51
  },
41
52
  copy: {
42
- default: "nps copy.src copy.test copy.webcomponents-polyfill",
43
- src: `node "${LIB}/copy-and-watch/index.js" "src/**/*.js" dist/`,
44
- test: `node "${LIB}/copy-and-watch/index.js" "test/**/*.*" dist/test-resources`,
45
- "webcomponents-polyfill": `node "${LIB}/copy-and-watch/index.js" "${polyfillPath}" dist/webcomponentsjs/`,
53
+ default: "nps copy.src copy.props copy.test",
54
+ src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
55
+ props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
56
+ test: `node "${LIB}/copy-and-watch/index.js" --silent "test/**/*.*" dist/test-resources`,
46
57
  },
47
58
  watch: {
48
- default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles"',
59
+ default: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.bundle" "nps watch.styles" "nps watch.i18n"',
49
60
  src: 'nps "copy.src --watch --safe --skip-initial-copy"',
61
+ props: 'nps "copy.props --watch --safe --skip-initial-copy"',
50
62
  test: 'nps "copy.test --watch --safe --skip-initial-copy"',
51
- bundle: "rollup --config config/rollup.config.js -w --environment ES5_BUILD,DEV",
63
+ bundle: 'rollup --config config/rollup.config.js -w --environment DEV',
52
64
  styles: {
53
65
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
54
66
  themes: 'nps "build.styles.themes -w"',
55
- components: 'nps "build.styles.components -w"',
67
+ components: {
68
+ default: 'concurrently "nps watch.styles.components.existingFiles" "nps watch.styles.components.newFiles"',
69
+ existingFiles: `nps "build.styles.components -w"`,
70
+ newFiles: `node "${LIB}/postcss-new-files/index.js" --srcFiles="src/themes/*.css"`,
71
+ },
56
72
  },
57
- templates: "chokidar \"src/**/*.hbs\" -c \"nps build.templates\"",
58
- samples: "chokidar \"test/**/*.sample.html\" -c \"nps build.samples\"",
73
+ templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
74
+ samples: 'chokidar "test/**/*.sample.html" -c "nps build.samples"',
75
+ i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
59
76
  },
60
77
  dev: 'concurrently "nps serve" "nps watch"',
61
78
  start: "nps prepare dev",
62
- serve: {
63
- default: "nps serve.prepare serve.run",
64
- prepare: `node "${LIB}/copy-and-watch/index.js" "${serveConfig}" dist/`,
65
- run: `serve --no-clipboard -l ${port} dist`,
66
- },
79
+ serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
67
80
  test: {
68
81
  // --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
82
  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",
83
+ run: "cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js",
71
84
  spec: "wdio run config/wdio.conf.js",
72
85
  },
86
+ startWithScope: "nps scope.prepare scope.dev",
87
+ scope: {
88
+ prepare: "nps scope.lint prepare scope.testPages",
89
+ lint: `node "${LIB}/scoping/lint-src.js"`,
90
+ testPages: {
91
+ default: "nps scope.testPages.clean scope.testPages.copy scope.testPages.replace",
92
+ clean: "rimraf dist/test-resources/pages/scoped",
93
+ copy: `node "${LIB}/copy-and-watch/index.js" --silent "dist/test-resources/pages/**/*" dist/test-resources/scoped`,
94
+ replace: `node "${LIB}/scoping/scope-test-pages.js" dist/test-resources/scoped demo`,
95
+ },
96
+ dev: 'concurrently "nps serve" "nps scope.watch"',
97
+ watch: 'concurrently "nps watch.templates" "nps watch.samples" "nps watch.test" "nps watch.src" "nps watch.props" "nps scope.bundle" "nps watch.styles"',
98
+ bundle: 'rollup --config config/rollup.config.js -w --environment DEV,SCOPE'
99
+ }
73
100
  };
74
101
 
75
102
  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,15 @@
1
+ const slash = require("slash");
2
+
3
+ function emptyModulePlugin({ emptyModules }) {
4
+ return {
5
+ name: "ui5-dev-empty-module-plugin",
6
+ load(id) {
7
+ if (emptyModules.some(mod => slash(id).includes(mod))) {
8
+ return `export default ""`;
9
+ }
10
+ return null;
11
+ },
12
+ };
13
+ }
14
+
15
+ module.exports = emptyModulePlugin;