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

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 +164 -1
  2. package/README.md +1 -1
  3. package/assets-meta.js +149 -0
  4. package/bin/dev.js +16 -1
  5. package/components-package/nps.js +73 -34
  6. package/components-package/postcss.themes.js +5 -2
  7. package/components-package/rollup-plugins/empty-module.js +15 -0
  8. package/components-package/rollup.js +155 -50
  9. package/components-package/wdio.js +100 -64
  10. package/components-package/wdio.sync.js +360 -0
  11. package/icons-collection/nps.js +72 -28
  12. package/lib/copy-and-watch/index.js +122 -0
  13. package/lib/copy-list/index.js +28 -0
  14. package/lib/create-icons/index.js +41 -23
  15. package/lib/create-illustrations/index.js +150 -0
  16. package/lib/create-new-component/index.js +18 -6
  17. package/lib/documentation/index.js +43 -21
  18. package/lib/documentation/templates/template.js +1 -1
  19. package/lib/esm-abs-to-rel/index.js +54 -0
  20. package/lib/generate-json-imports/i18n.js +91 -47
  21. package/lib/generate-json-imports/themes.js +61 -15
  22. package/lib/hash/config.js +10 -0
  23. package/lib/hash/generate.js +19 -0
  24. package/lib/hash/upToDate.js +31 -0
  25. package/lib/hbs2lit/index.js +2 -4
  26. package/lib/hbs2lit/src/compiler.js +8 -7
  27. package/lib/hbs2lit/src/includesReplacer.js +22 -16
  28. package/lib/hbs2lit/src/litVisitor2.js +44 -8
  29. package/lib/hbs2lit/src/svgProcessor.js +3 -3
  30. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +5 -5
  31. package/lib/hbs2ui5/index.js +26 -20
  32. package/lib/i18n/defaults.js +25 -6
  33. package/lib/i18n/toJSON.js +15 -4
  34. package/lib/jsdoc/config.json +1 -1
  35. package/lib/jsdoc/plugin.js +24 -4
  36. package/lib/jsdoc/template/publish.js +11 -2
  37. package/lib/polyfill-placeholder/index.js +5 -0
  38. package/lib/postcss-css-to-esm/index.js +31 -19
  39. package/lib/postcss-css-to-json/index.js +27 -11
  40. package/lib/postcss-new-files/index.js +36 -0
  41. package/lib/replace-global-core/index.js +20 -0
  42. package/lib/scoping/get-all-tags.js +44 -0
  43. package/lib/scoping/lint-src.js +31 -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 +55 -55
  49. package/bin/init-ui5-package.js +0 -3
  50. package/lib/init-package/index.js +0 -119
  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 -6
  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,9 +3,172 @@
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.1.2](https://github.com/SAP/ui5-webcomponents/compare/v1.1.1...v1.1.2) (2022-01-26)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.1.1](https://github.com/SAP/ui5-webcomponents/compare/v1.1.0...v1.1.1) (2022-01-24)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
22
+ # [1.1.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.2...v1.1.0) (2022-01-21)
23
+
24
+
25
+ **Note:** Version bump only for package @ui5/webcomponents-tools
26
+
27
+
28
+
29
+
30
+
31
+ ## [1.0.2](https://github.com/SAP/ui5-webcomponents/compare/v1.0.1...v1.0.2) (2021-11-29)
32
+
33
+ **Note:** Version bump only for package @ui5/webcomponents-tools
34
+
35
+
36
+
37
+
38
+
39
+ ## [1.0.1](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0...v1.0.1) (2021-11-10)
40
+
41
+ **Note:** Version bump only for package @ui5/webcomponents-tools
42
+
43
+
44
+
45
+
46
+
47
+ # [1.0.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.16...v1.0.0) (2021-11-10)
48
+
49
+
50
+ **Note:** Version bump only for package @ui5/webcomponents-tools
51
+
52
+
53
+ # [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)
54
+
55
+
56
+
57
+ ### Features
58
+
59
+ * **tools:** create an npm init script ([#4090](https://github.com/SAP/ui5-webcomponents/issues/4090)) ([5608e04](https://github.com/SAP/ui5-webcomponents/commit/5608e04))
60
+
61
+
62
+
63
+ # [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)
64
+
65
+
66
+ ### Bug Fixes
67
+
68
+ * **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)
69
+
70
+
71
+
72
+
73
+
74
+
75
+ # [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)
76
+
77
+
78
+
79
+
80
+ # [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)
81
+
82
+
83
+ **Note:** Version bump only for package @ui5/webcomponents-tools
84
+
85
+
86
+
87
+
88
+
89
+ # [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)
90
+
91
+ **Note:** Version bump only for package @ui5/webcomponents-tools
92
+
93
+
94
+
95
+
96
+ # [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)
97
+
98
+
99
+ ### Bug Fixes
100
+
101
+ * 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))
102
+
103
+
104
+
105
+
106
+
107
+ # [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)
108
+
109
+
110
+
111
+ # [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)
112
+
113
+
114
+ ### Features
115
+
116
+ * **framework:** dynamic custom elements scoping ([#2091](https://github.com/SAP/ui5-webcomponents/issues/2091)) ([3588542](https://github.com/SAP/ui5-webcomponents/commit/3588542))
117
+ * **framework:** make assets path configurable ([#2214](https://github.com/SAP/ui5-webcomponents/issues/2214)) ([16c46da](https://github.com/SAP/ui5-webcomponents/commit/16c46da))
118
+ * **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))
119
+ * **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)
120
+
121
+
122
+
123
+
124
+
125
+ # [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)
126
+
127
+
128
+ ### Bug Fixes
129
+
130
+ * **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))
131
+ * **tools:** Strip whitespaces around < and > ([#1623](https://github.com/SAP/ui5-webcomponents/issues/1623)) ([0fcda38](https://github.com/SAP/ui5-webcomponents/commit/0fcda38))
132
+ * **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))
133
+ * **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))
134
+ * **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))
135
+
136
+
137
+ ### Features
138
+
139
+ * **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))
140
+ * **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))
141
+
142
+
143
+
144
+
145
+ # [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)
146
+
147
+
148
+ ### Bug Fixes
149
+
150
+ * **build:** escape quotes in translation texts ([#1511](https://github.com/SAP/ui5-webcomponents/issues/1511)) ([ee7f300](https://github.com/SAP/ui5-webcomponents/commit/ee7f300))
151
+
152
+
153
+
154
+
155
+ # [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)
156
+
157
+
158
+ ### Features
159
+
160
+ * **tools:** create an init package script ([#1010](https://github.com/SAP/ui5-webcomponents/issues/1010)) ([d93ab87](https://github.com/SAP/ui5-webcomponents/commit/d93ab87))
161
+
162
+ * **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))
163
+
164
+
165
+
166
+
167
+
168
+
6
169
  # [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
170
 
8
171
 
9
172
  ### Bug Fixes
10
173
 
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))
174
+ * **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
@@ -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 ADDED
@@ -0,0 +1,149 @@
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_exp"
14
+ ]
15
+ },
16
+ "languages": {
17
+ "default": "en",
18
+ "all": [
19
+ "ar",
20
+ "bg",
21
+ "ca",
22
+ "cs",
23
+ "cy",
24
+ "da",
25
+ "de",
26
+ "el",
27
+ "en",
28
+ "en_GB",
29
+ "en_US_sappsd",
30
+ "en_US_saprigi",
31
+ "en_US_saptrc",
32
+ "es",
33
+ "es_MX",
34
+ "et",
35
+ "fi",
36
+ "fr",
37
+ "fr_CA",
38
+ "hi",
39
+ "hr",
40
+ "hu",
41
+ "in",
42
+ "it",
43
+ "iw",
44
+ "ja",
45
+ "kk",
46
+ "ko",
47
+ "lt",
48
+ "lv",
49
+ "ms",
50
+ "nl",
51
+ "no",
52
+ "pl",
53
+ "pt_PT",
54
+ "pt",
55
+ "ro",
56
+ "ru",
57
+ "sh",
58
+ "sk",
59
+ "sl",
60
+ "sv",
61
+ "th",
62
+ "tr",
63
+ "uk",
64
+ "vi",
65
+ "zh_CN",
66
+ "zh_TW"
67
+ ]
68
+ },
69
+ "locales": {
70
+ "default": "en",
71
+ "all": [
72
+ "ar",
73
+ "ar_EG",
74
+ "ar_SA",
75
+ "bg",
76
+ "ca",
77
+ "cs",
78
+ "da",
79
+ "de",
80
+ "de_AT",
81
+ "de_CH",
82
+ "el",
83
+ "el_CY",
84
+ "en",
85
+ "en_AU",
86
+ "en_GB",
87
+ "en_HK",
88
+ "en_IE",
89
+ "en_IN",
90
+ "en_NZ",
91
+ "en_PG",
92
+ "en_SG",
93
+ "en_ZA",
94
+ "es",
95
+ "es_AR",
96
+ "es_BO",
97
+ "es_CL",
98
+ "es_CO",
99
+ "es_MX",
100
+ "es_PE",
101
+ "es_UY",
102
+ "es_VE",
103
+ "et",
104
+ "fa",
105
+ "fi",
106
+ "fr",
107
+ "fr_BE",
108
+ "fr_CA",
109
+ "fr_CH",
110
+ "fr_LU",
111
+ "he",
112
+ "hi",
113
+ "hr",
114
+ "hu",
115
+ "id",
116
+ "it",
117
+ "it_CH",
118
+ "ja",
119
+ "kk",
120
+ "ko",
121
+ "lt",
122
+ "lv",
123
+ "ms",
124
+ "nb",
125
+ "nl",
126
+ "nl_BE",
127
+ "pl",
128
+ "pt",
129
+ "pt_PT",
130
+ "ro",
131
+ "ru",
132
+ "ru_UA",
133
+ "sk",
134
+ "sl",
135
+ "sr",
136
+ "sv",
137
+ "th",
138
+ "tr",
139
+ "uk",
140
+ "vi",
141
+ "zh_CN",
142
+ "zh_HK",
143
+ "zh_SG",
144
+ "zh_TW"
145
+ ]
146
+ }
147
+ };
148
+
149
+ module.exports = assetsMeta;
package/bin/dev.js CHANGED
@@ -2,4 +2,19 @@
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
+ 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
+ }
18
+ }
19
+
20
+ child_process.execSync(`npx nps "${command}"`, {stdio: 'inherit'});
@@ -1,74 +1,113 @@
1
1
  const path = require("path");
2
+ const fs = require("fs");
2
3
 
3
4
  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/**/*.*`);
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;
7
8
 
8
9
  const getScripts = (options) => {
9
10
 
10
- const port = options.port;
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 || [];
14
+
15
+ illustrations = illustrations.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
16
+
17
+ let illustrationsScript = illustrations.join(" && ");
11
18
 
12
19
  const scripts = {
13
- clean: "rimraf dist",
20
+ clean: "rimraf dist && rimraf .port",
14
21
  lint: "eslint . --config config/.eslintrc.js",
15
- prepare: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples",
22
+ lintfix: "eslint . --config config/.eslintrc.js --fix",
23
+ 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"
26
+ },
16
27
  build: {
17
- default: "nps lint prepare build.bundle",
18
- templates: `mkdirp dist/generated/templates && node ${LIB}/hbs2ui5/index.js -d src/ -o dist/generated/templates`,
28
+ default: "nps lint prepare.es5 build.bundle",
29
+ templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
19
30
  styles: {
20
31
  default: "nps build.styles.themes build.styles.components",
21
32
  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/",
33
+ components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
23
34
  },
24
35
  i18n: {
25
36
  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`,
37
+ defaultsjs: `node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
38
+ json: `node "${LIB}/i18n/toJSON.js" src/i18n dist/generated/assets/i18n`,
28
39
  },
29
40
  jsonImports: {
30
41
  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`,
42
+ themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
43
+ i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
33
44
  },
34
45
  bundle: "rollup --config config/rollup.config.js --environment ES5_BUILD",
35
46
  samples: {
36
47
  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
- }
48
+ api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
49
+ docs: `node "${LIB}/documentation/index.js" dist/api.json`,
50
+ },
51
+ illustrations: illustrationsScript
40
52
  },
41
53
  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/`,
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",
56
+ src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
57
+ 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"`
46
61
  },
47
62
  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",
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"',
65
+ src: 'nps "copy.src --watch --safe --skip-initial-copy"',
66
+ 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
+ },
52
72
  styles: {
53
73
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
54
74
  themes: 'nps "build.styles.themes -w"',
55
- components: 'nps "build.styles.components -w"',
75
+ components: {
76
+ default: 'concurrently "nps watch.styles.components.existingFiles" "nps watch.styles.components.newFiles"',
77
+ existingFiles: `nps "build.styles.components -w"`,
78
+ newFiles: `node "${LIB}/postcss-new-files/index.js" --srcFiles="src/themes/*.css"`,
79
+ },
56
80
  },
57
- templates: "chokidar \"src/**/*.hbs\" -c \"nps build.templates\"",
58
- samples: "chokidar \"test/**/*.sample.html\" -c \"nps build.samples\"",
81
+ templates: 'chokidar "src/**/*.hbs" -c "nps build.templates"',
82
+ samples: 'chokidar "test/**/*.sample.html" -c "nps build.samples"',
83
+ i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
59
84
  },
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`,
85
+ dev: {
86
+ default: 'concurrently "nps serve" "nps watch"',
87
+ es5: 'concurrently "nps serve" "nps watch.es5"'
66
88
  },
89
+ start: "nps prepare dev",
90
+ serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
67
91
  test: {
68
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
69
93
  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",
94
+ run: "cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js",
95
+ spec: "wdio run config/wdio.conf.js",
71
96
  },
97
+ startWithScope: "nps scope.prepare scope.dev",
98
+ scope: {
99
+ prepare: "nps scope.lint prepare scope.testPages",
100
+ lint: `node "${LIB}/scoping/lint-src.js"`,
101
+ testPages: {
102
+ 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`,
106
+ },
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
+ }
72
111
  };
73
112
 
74
113
  return scripts;
@@ -3,6 +3,9 @@ const combineSelectors = require('postcss-combine-duplicated-selectors');
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;