@ui5/webcomponents-tools 0.0.0-4180fe799 → 0.0.0-453158269

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 (36) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/assets-meta.js +4 -0
  3. package/components-package/nps.js +10 -21
  4. package/components-package/postcss.themes.js +1 -1
  5. package/components-package/rollup.js +10 -99
  6. package/components-package/wdio.js +17 -1
  7. package/components-package/wdio.sync.js +16 -0
  8. package/icons-collection/nps.js +1 -7
  9. package/lib/copy-and-watch/index.js +24 -1
  10. package/lib/copy-list/index.js +16 -16
  11. package/lib/create-icons/index.js +82 -72
  12. package/lib/create-illustrations/index.js +107 -41
  13. package/lib/documentation/index.js +119 -116
  14. package/lib/documentation/templates/api-properties-section.js +3 -1
  15. package/lib/documentation/templates/template.js +2 -1
  16. package/lib/esm-abs-to-rel/index.js +13 -9
  17. package/lib/generate-json-imports/i18n.js +38 -31
  18. package/lib/generate-json-imports/themes.js +31 -24
  19. package/lib/hbs2lit/src/compiler.js +12 -3
  20. package/lib/hbs2lit/src/includesReplacer.js +5 -5
  21. package/lib/hbs2ui5/index.js +37 -21
  22. package/lib/i18n/defaults.js +49 -57
  23. package/lib/i18n/toJSON.js +12 -11
  24. package/lib/jsdoc/plugin.js +9 -0
  25. package/lib/jsdoc/template/publish.js +13 -2
  26. package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
  27. package/lib/postcss-p/postcss-p.mjs +11 -0
  28. package/lib/replace-global-core/index.js +13 -8
  29. package/lib/scoping/missing-dependencies.js +65 -0
  30. package/lib/scoping/report-tags-usage.js +28 -0
  31. package/lib/serve/index.js +1 -1
  32. package/package.json +10 -16
  33. package/lib/hash/config.js +0 -10
  34. package/lib/hash/generate.js +0 -19
  35. package/lib/hash/upToDate.js +0 -31
  36. package/lib/polyfill-placeholder/index.js +0 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,143 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
7
+
8
+
9
+ ### Features
10
+
11
+ **Note:** Version bump only for package @ui5/webcomponents-icons-tnt
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
18
+
19
+ **Note:** Version bump only for package @ui5/webcomponents-tools
20
+
21
+
22
+
23
+
24
+
25
+ # [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **localization:** fix js error if "sh" locale set ([#4905](https://github.com/SAP/ui5-webcomponents/issues/4905)) ([979bca2](https://github.com/SAP/ui5-webcomponents/commit/979bca2)), closes [#4904](https://github.com/SAP/ui5-webcomponents/issues/4904)
31
+
32
+
33
+
34
+
35
+
36
+ ## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
37
+
38
+ **Note:** Version bump only for package @ui5/webcomponents-tools
39
+
40
+
41
+
42
+
43
+
44
+ ## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
45
+
46
+ **Note:** Version bump only for package @ui5/webcomponents-tools
47
+
48
+
49
+
50
+
51
+
52
+ ## [1.2.2](https://github.com/SAP/ui5-webcomponents/compare/v1.2.1...v1.2.2) (2022-03-22)
53
+
54
+
55
+ **Note:** Version bump only for package @ui5/webcomponents-tools
56
+
57
+
58
+
59
+
60
+
61
+ ## [1.2.1](https://github.com/SAP/ui5-webcomponents/compare/v1.2.0...v1.2.1) (2022-03-02)
62
+
63
+ **Note:** Version bump only for package @ui5/webcomponents-tools
64
+
65
+
66
+
67
+
68
+
69
+ # [1.2.0](https://github.com/SAP/ui5-webcomponents/compare/v1.1.2...v1.2.0) (2022-02-28)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * correct scoping issues with several components ([#4820](https://github.com/SAP/ui5-webcomponents/issues/4820)) ([621dc20](https://github.com/SAP/ui5-webcomponents/commit/621dc20))
75
+ * display methods in child components API ([#4792](https://github.com/SAP/ui5-webcomponents/issues/4792)) ([1929d08](https://github.com/SAP/ui5-webcomponents/commit/1929d08))
76
+
77
+
78
+ ### Features
79
+
80
+ * **jsdoc:** remove attr name for Object props ([#4680](https://github.com/SAP/ui5-webcomponents/issues/4680)) ([1741bd6](https://github.com/SAP/ui5-webcomponents/commit/1741bd6)), closes [#4674](https://github.com/SAP/ui5-webcomponents/issues/4674)
81
+
82
+
83
+
84
+
85
+
86
+ ## [1.1.2](https://github.com/SAP/ui5-webcomponents/compare/v1.1.1...v1.1.2) (2022-01-26)
87
+
88
+ **Note:** Version bump only for package @ui5/webcomponents-tools
89
+
90
+
91
+
92
+
93
+
94
+ ## [1.1.1](https://github.com/SAP/ui5-webcomponents/compare/v1.1.0...v1.1.1) (2022-01-24)
95
+
96
+ **Note:** Version bump only for package @ui5/webcomponents-tools
97
+
98
+
99
+
100
+
101
+
102
+ # [1.1.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.2...v1.1.0) (2022-01-21)
103
+
104
+
105
+ **Note:** Version bump only for package @ui5/webcomponents-tools
106
+
107
+
108
+
109
+
110
+
111
+ ## [1.0.2](https://github.com/SAP/ui5-webcomponents/compare/v1.0.1...v1.0.2) (2021-11-29)
112
+
113
+ **Note:** Version bump only for package @ui5/webcomponents-tools
114
+
115
+
116
+
117
+
118
+
119
+ ## [1.0.1](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0...v1.0.1) (2021-11-10)
120
+
121
+ **Note:** Version bump only for package @ui5/webcomponents-tools
122
+
123
+
124
+
125
+
126
+
127
+ # [1.0.0](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.16...v1.0.0) (2021-11-10)
128
+
129
+
130
+ **Note:** Version bump only for package @ui5/webcomponents-tools
131
+
132
+
133
+ # [1.0.0-rc.16](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.15...v1.0.0-rc.16) (2021-11-09)
134
+
135
+
136
+
137
+ ### Features
138
+
139
+ * **tools:** create an npm init script ([#4090](https://github.com/SAP/ui5-webcomponents/issues/4090)) ([5608e04](https://github.com/SAP/ui5-webcomponents/commit/5608e04))
140
+
141
+
142
+
6
143
  # [1.0.0-rc.15](https://github.com/SAP/ui5-webcomponents/compare/v1.0.0-rc.14...v1.0.0-rc.15) (2021-07-23)
7
144
 
8
145
 
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",
@@ -2,8 +2,6 @@ const path = require("path");
2
2
  const fs = require("fs");
3
3
 
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
5
  const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
8
6
 
9
7
  const getScripts = (options) => {
@@ -21,15 +19,16 @@ const getScripts = (options) => {
21
19
  lint: "eslint . --config config/.eslintrc.js",
22
20
  lintfix: "eslint . --config config/.eslintrc.js --fix",
23
21
  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"
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",
26
25
  },
27
26
  build: {
28
- default: "nps lint prepare.es5 build.bundle",
27
+ default: "nps lint prepare build.bundle",
29
28
  templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
30
29
  styles: {
31
30
  default: "nps build.styles.themes build.styles.components",
32
- themes: "postcss src/**/parameters-bundle.css --config config/postcss.themes --base src --dir dist/css/",
31
+ themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
33
32
  components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
34
33
  },
35
34
  i18n: {
@@ -42,7 +41,7 @@ const getScripts = (options) => {
42
41
  themes: `node "${LIB}/generate-json-imports/themes.js" dist/generated/assets/themes dist/generated/json-imports`,
43
42
  i18n: `node "${LIB}/generate-json-imports/i18n.js" dist/generated/assets/i18n dist/generated/json-imports`,
44
43
  },
45
- bundle: "rollup --config config/rollup.config.js --environment ES5_BUILD",
44
+ bundle: "rollup --config config/rollup.config.js",
46
45
  samples: {
47
46
  default: "nps build.samples.api build.samples.docs",
48
47
  api: `jsdoc -c "${LIB}/jsdoc/config.json"`,
@@ -51,24 +50,17 @@ const getScripts = (options) => {
51
50
  illustrations: illustrationsScript
52
51
  },
53
52
  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",
53
+ default: "nps copy.src copy.props copy.test",
56
54
  src: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
57
55
  props: `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.properties" dist/`,
58
56
  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
57
  },
62
58
  watch: {
63
59
  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
60
  src: 'nps "copy.src --watch --safe --skip-initial-copy"',
66
61
  props: 'nps "copy.props --watch --safe --skip-initial-copy"',
67
62
  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
- },
63
+ bundle: 'rollup --config config/rollup.config.js -w --environment DEV',
72
64
  styles: {
73
65
  default: 'concurrently "nps watch.styles.themes" "nps watch.styles.components"',
74
66
  themes: 'nps "build.styles.themes -w"',
@@ -82,10 +74,7 @@ const getScripts = (options) => {
82
74
  samples: 'chokidar "test/**/*.sample.html" -c "nps build.samples"',
83
75
  i18n: 'chokidar "src/i18n/messagebundle.properties" -c "nps build.i18n.defaultsjs"'
84
76
  },
85
- dev: {
86
- default: 'concurrently "nps serve" "nps watch"',
87
- es5: 'concurrently "nps serve" "nps watch.es5"'
88
- },
77
+ dev: 'concurrently "nps serve" "nps watch"',
89
78
  start: "nps prepare dev",
90
79
  serve: `node "${LIB}/serve/index.js" --dir="dist/" --port=${port} --portStep=${portStep} --packageName="${packageName}"`,
91
80
  test: {
@@ -106,7 +95,7 @@ const getScripts = (options) => {
106
95
  },
107
96
  dev: 'concurrently "nps serve" "nps scope.watch"',
108
97
  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'
98
+ bundle: 'rollup --config config/rollup.config.js -w --environment DEV,SCOPE'
110
99
  }
111
100
  };
112
101
 
@@ -1,5 +1,5 @@
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');
@@ -1,21 +1,16 @@
1
1
  const process = require("process");
2
2
  const fs = require("fs");
3
3
  const os = require("os");
4
- const { babel } = require("@rollup/plugin-babel");
5
4
  const { nodeResolve } = require("@rollup/plugin-node-resolve");
6
- const url = require("@rollup/plugin-url");
7
5
  const { terser } = require("rollup-plugin-terser");
8
6
  const json = require("@rollup/plugin-json");
9
7
  const replace = require("@rollup/plugin-replace");
10
- const commonjs = require("@rollup/plugin-commonjs");
11
- const colors = require("colors/safe");
12
- const filesize = require("rollup-plugin-filesize");
8
+ const colors = require("cli-color");
13
9
  const livereload = require("rollup-plugin-livereload");
14
10
  const emptyModulePlugin = require("./rollup-plugins/empty-module.js");
15
11
 
16
12
  const packageFile = JSON.parse(fs.readFileSync("./package.json"));
17
13
  const packageName = packageFile.name;
18
- const DEPLOY_PUBLIC_PATH = process.env.DEPLOY_PUBLIC_PATH || "";
19
14
 
20
15
  const warningsToSkip = [{
21
16
  warningCode: "THIS_IS_UNDEFINED",
@@ -72,7 +67,7 @@ function ui5DevReadyMessagePlugin() {
72
67
  };
73
68
  }
74
69
 
75
- const getPlugins = ({ transpile }) => {
70
+ const getPlugins = () => {
76
71
  const plugins = [];
77
72
 
78
73
  if (process.env.DEV) {
@@ -93,59 +88,14 @@ const getPlugins = ({ transpile }) => {
93
88
  }));
94
89
  }
95
90
 
96
- if (!process.env.DEV) {
97
- plugins.push(filesize(
98
- {
99
- reporter(options, bundle, {
100
- minSize, gzipSize, brotliSize, bundleSize,
101
- fileName,
102
- // "showBeforeSizes: release"
103
- lastVersion,
104
- // "showBeforeSizes: "release" or "showBeforeSizes": "build"
105
- bundleSizeBefore, brotliSizeBefore, minSizeBefore, gzipSizeBefore,
106
- }) {
107
- // If a promise is returned, it will be awaited before rendering.
108
- return `${fileName.padEnd(35)} ${minSize} / gzipped: ${gzipSize}`;
109
- },
110
- },
111
-
112
- ));
113
- }
114
-
115
- const publicPath = DEPLOY_PUBLIC_PATH;
116
-
117
91
  plugins.push(ui5DevImportCheckerPlugin());
118
92
 
119
- if (!transpile) {
120
- plugins.push(json({
121
- include: [
122
- /.*assets\/.*\.json/,
123
- ],
124
- namedExports: false,
125
- }));
126
- }
127
-
128
- if (transpile) {
129
- plugins.push(url({
130
- limit: 0,
131
- include: [
132
- /.*assets\/.*\.json/,
133
- ],
134
- emitFiles: true,
135
- fileName: "[name].[hash][extname]",
136
- publicPath,
137
- }));
138
- }
139
-
140
- if (transpile) {
141
- plugins.push(commonjs());
142
- plugins.push(babel({
143
- presets: ["@babel/preset-env"],
144
- exclude: /node_modules\/(?!(lit-html|@ui5\/webcomponents))/, // exclude all node_modules/ except lit-html and all starting with @ui5/webcomponents
145
- sourcemap: false,
146
- babelHelpers: "bundled",
147
- }));
148
- }
93
+ plugins.push(json({
94
+ include: [
95
+ /.*assets\/.*\.json/,
96
+ ],
97
+ namedExports: false,
98
+ }));
149
99
 
150
100
  plugins.push(nodeResolve());
151
101
 
@@ -155,7 +105,7 @@ const getPlugins = ({ transpile }) => {
155
105
  }));
156
106
  }
157
107
 
158
- const es6DevMain = process.env.DEV && !transpile && packageName === "@ui5/webcomponents";
108
+ const es6DevMain = process.env.DEV && packageName === "@ui5/webcomponents";
159
109
  if (es6DevMain && os.platform() !== "win32") {
160
110
  plugins.push(livereload({
161
111
  watch: [
@@ -181,58 +131,19 @@ const getES6Config = (input = "bundle.esm.js") => {
181
131
  format: "esm",
182
132
  sourcemap: true,
183
133
  },
184
- moduleContext: id => {
185
- if (typeof id === "string" && id.includes("url-search-params-polyfill")) {
186
- // suppress the rollup error for this module as it uses this in the global scope correctly even without changing the context here
187
- return "window";
188
- }
189
- },
190
- watch: {
191
- clearScreen: false,
192
- },
193
- plugins: getPlugins({ transpile: false }),
194
- onwarn: onwarn,
195
- }];
196
- };
197
-
198
- const getES5Config = (input = "bundle.es5.js") => {
199
- return [{
200
- input,
201
- output: {
202
- dir: "dist/resources",
203
- format: "iife",
204
- inlineDynamicImports: true,
205
- name: "sap-ui-webcomponents-bundle",
206
- extend: "true", // Whether or not to extend the global variable defined by the name option in umd or iife formats.
207
- sourcemap: true,
208
- },
209
- moduleContext: id => {
210
- if (id.includes("url-search-params-polyfill")) {
211
- // suppress the rollup error for this module as it uses this in the global scope correctly even without changing the context here
212
- return "window";
213
- }
214
- },
215
134
  watch: {
216
135
  clearScreen: false,
217
136
  },
218
- plugins: getPlugins({ transpile: true }),
137
+ plugins: getPlugins(),
219
138
  onwarn: onwarn,
220
139
  }];
221
140
  };
222
141
 
223
142
  let config = getES6Config();
224
143
 
225
- if (process.env.ES5_BUILD && fs.existsSync("bundle.es5.js")) {
226
- config = config.concat(getES5Config());
227
- }
228
-
229
144
  if (process.env.SCOPE) {
230
145
  if (fs.existsSync("bundle.scoped.esm.js")) {
231
146
  config = config.concat(getES6Config("bundle.scoped.esm.js"));
232
-
233
- if (fs.existsSync("bundle.scoped.es5.js") && process.env.ES5_BUILD) {
234
- config = config.concat(getES5Config("bundle.scoped.es5.js"));
235
- }
236
147
  }
237
148
  }
238
149
 
@@ -99,7 +99,7 @@ exports.config = {
99
99
  // Services take over a specific job you don't want to take care of. They enhance
100
100
  // your test setup with almost no effort. Unlike plugins, they don't add new
101
101
  // commands. Instead, they hook themselves up into the test process.
102
- services: ['chromedriver'],
102
+ services: ['chromedriver', 'devtools'],
103
103
  // options
104
104
  chromeDriverArgs: ['--port=9515'], // default
105
105
  // Framework you want to run your specs with.
@@ -168,6 +168,21 @@ exports.config = {
168
168
  }, this);
169
169
  }, true);
170
170
 
171
+ await browser.addCommand("isFocusedDeepElement", async function (element) {
172
+ return browser.executeAsync(function (elem, element, done) {
173
+ let activeElement = document.activeElement;
174
+
175
+ while (activeElement.shadowRoot) {
176
+ if (activeElement.shadowRoot.activeElement) {
177
+ activeElement = activeElement.shadowRoot.activeElement;
178
+ } else {
179
+ break;
180
+ }
181
+ }
182
+ done(element === activeElement);
183
+ }, this, element);
184
+ }, true);
185
+
171
186
  await browser.addCommand("setProperty", async function(property, value) {
172
187
  return browser.executeAsync((elem, property, value, done) => {
173
188
  elem[property] = value;
@@ -230,6 +245,7 @@ exports.config = {
230
245
  "isExisting",
231
246
  "isFocused",
232
247
  "isFocusedDeep", // custom
248
+ "isFocusedDeepElement", // custom
233
249
  "shadow$",
234
250
  "shadow$$",
235
251
  ];
@@ -168,6 +168,21 @@ exports.config = {
168
168
  }, this);
169
169
  }, true);
170
170
 
171
+ browser.addCommand("isFocusedDeepElement", function (element) {
172
+ return browser.execute(function (elem, element, done) {
173
+ let activeElement = document.activeElement;
174
+
175
+ while (activeElement.shadowRoot) {
176
+ if (activeElement.shadowRoot.activeElement) {
177
+ activeElement = activeElement.shadowRoot.activeElement;
178
+ } else {
179
+ break;
180
+ }
181
+ }
182
+ done(element === activeElement);
183
+ }, this, element);
184
+ }, true);
185
+
171
186
  browser.addCommand("setProperty", function(property, value) {
172
187
  return browser.execute((elem, property, value) => {
173
188
  return elem[property] = value;
@@ -223,6 +238,7 @@ exports.config = {
223
238
  "isExisting",
224
239
  "isFocused",
225
240
  "isFocusedDeep", // custom
241
+ "isFocusedDeepElement", // custom
226
242
  "shadow$",
227
243
  "shadow$$",
228
244
  ];
@@ -1,9 +1,4 @@
1
1
  const path = require("path");
2
- const resolve = require("resolve");
3
-
4
- const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
5
- const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
6
- const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
7
2
 
8
3
  const LIB = path.join(__dirname, `../lib/`);
9
4
 
@@ -51,7 +46,7 @@ const getScripts = (options) => {
51
46
  clean: "rimraf dist",
52
47
  copy: copyAssetsCmd,
53
48
  build: {
54
- default: `${UP_TO_DATE} || nps clean copy build.i18n build.icons build.jsonImports hash`,
49
+ default: `nps clean copy build.i18n build.icons build.jsonImports`,
55
50
  i18n: {
56
51
  default: "nps build.i18n.defaultsjs build.i18n.json",
57
52
  defaultsjs: `mkdirp dist/generated/i18n && node "${LIB}/i18n/defaults.js" src/i18n dist/generated/i18n`,
@@ -63,7 +58,6 @@ const getScripts = (options) => {
63
58
  },
64
59
  icons: createJSImportsCmd,
65
60
  },
66
- hash: `node "${generateHash}" dist/ hash.txt`,
67
61
  };
68
62
 
69
63
  return scripts;
@@ -1,9 +1,32 @@
1
+ /*
2
+ MIT License
3
+
4
+ Copyright (c) 2017
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+ */
24
+
1
25
  const fs = require('fs');
2
26
  const path = require('path');
3
27
  const chokidar = require('chokidar');
4
28
  const glob = require('glob');
5
29
  const globParent = require('glob-parent');
6
- require('colors');
7
30
 
8
31
  /* CODE */
9
32
 
@@ -1,28 +1,28 @@
1
- const fs = require("fs");
1
+ const fs = require("fs").promises;
2
2
  const path = require("path");
3
- const mkdirp = require("mkdirp");
4
3
 
5
4
  const fileList = process.argv[2];
6
5
  const dest = process.argv[3];
7
6
  const src = "../../node_modules/@openui5/sap.ui.core/src/";
8
7
 
9
- const filesToCopy = fs.readFileSync(fileList).toString();
10
- // console.log(filesToCopy);
8
+ const generate = async () => {
9
+ const filesToCopy = (await fs.readFile(fileList)).toString();
10
+ // console.log(filesToCopy);
11
11
 
12
- // Support full-line comments starting with # in the used-modules.txt file
13
- const shouldCopy = file => file.length && !file.startsWith("#");
12
+ // Support full-line comments starting with # in the used-modules.txt file
13
+ const shouldCopy = file => file.length && !file.startsWith("#");
14
14
 
15
- const trimFile = file => file.trim();
15
+ const trimFile = file => file.trim();
16
16
 
17
- filesToCopy.split("\n").map(trimFile).filter(shouldCopy).forEach(async moduleName => {
18
- const srcPath = path.join(src, moduleName);
19
- const destPath = path.join(dest, moduleName);
17
+ return filesToCopy.split("\n").map(trimFile).filter(shouldCopy).map(async moduleName => {
18
+ const srcPath = path.join(src, moduleName);
19
+ const destPath = path.join(dest, moduleName);
20
20
 
21
- await mkdirp(path.dirname(destPath));
22
- fs.copyFile(srcPath, destPath, (err) => {
23
- if (err) {
24
- throw err;
25
- }
26
- console.log(`${destPath} created.`);
21
+ await fs.mkdir(path.dirname(destPath), { recursive: true });
22
+ return fs.copyFile(srcPath, destPath);
27
23
  });
24
+ };
25
+
26
+ generate().then(() => {
27
+ console.log("Files copied.");
28
28
  });