@ui5/webcomponents-tools 1.3.1 → 1.4.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+
6
17
  ## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
7
18
 
8
19
  **Note:** Version bump only for package @ui5/webcomponents-tools
@@ -18,7 +18,11 @@ const getScripts = (options) => {
18
18
  clean: "rimraf dist && rimraf .port",
19
19
  lint: "eslint . --config config/.eslintrc.js",
20
20
  lintfix: "eslint . --config config/.eslintrc.js --fix",
21
- prepare: "nps clean build.templates build.styles build.i18n build.jsonImports copy build.samples build.illustrations",
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
+ },
22
26
  build: {
23
27
  default: "nps lint prepare build.bundle",
24
28
  templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
@@ -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.
@@ -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;
@@ -27,7 +27,6 @@ const path = require('path');
27
27
  const chokidar = require('chokidar');
28
28
  const glob = require('glob');
29
29
  const globParent = require('glob-parent');
30
- require('colors');
31
30
 
32
31
  /* CODE */
33
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
  });
@@ -1,72 +1,82 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const mkdirp = require("mkdirp");
4
-
5
- const collectionName = process.argv[2] || "SAP-icons";
6
- const collectionVersion = process.argv[3];
7
- const srcFile = collectionVersion ? path.normalize(`src/${collectionVersion}/${collectionName}.json`) : path.normalize(`src/${collectionName}.json`);
8
- const destDir = collectionVersion ? path.normalize(`dist/${collectionVersion}/`) : path.normalize("dist/");
9
-
10
- mkdirp.sync(destDir);
11
-
12
- const iconTemplate = (name, pathData, ltr, collection, packageName) => `import { registerIcon } from "@ui5/webcomponents-base/dist/asset-registries/Icons.js";
13
-
14
- const name = "${name}";
15
- const pathData = "${pathData}";
16
- const ltr = ${ltr};
17
- const collection = "${collection}";
18
- const packageName = "${packageName}";
19
-
20
- registerIcon(name, { pathData, ltr, collection, packageName });
21
-
22
- export default { pathData };`;
23
-
24
-
25
- const iconAccTemplate = (name, pathData, ltr, accData, collection, packageName) => `import { registerIcon } from "@ui5/webcomponents-base/dist/asset-registries/Icons.js";
26
- import { ${accData.key} } from "../generated/i18n/i18n-defaults.js";
27
-
28
- const name = "${name}";
29
- const pathData = "${pathData}";
30
- const ltr = ${ltr};
31
- const accData = ${accData.key};
32
- const collection = "${collection}";
33
- const packageName = "${packageName}";
34
-
35
- registerIcon(name, { pathData, ltr, accData, collection, packageName });
36
-
37
- export default { pathData, accData };`;
38
-
39
-
40
-
41
- const collectionTemplate = (name) => `import { isThemeFamily } from "@ui5/webcomponents-base/dist/config/Theme.js";
42
- import pathDataV4 from "./v5/${name}.js";
43
- import pathDataV5 from "./v4/${name}.js";
44
- const pathData = isThemeFamily("sap_horizon") ? pathDataV5 : pathDataV4;
45
- export default { pathData };`;
46
-
47
-
48
- const svgTemplate = (pathData) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
49
- <path d="${pathData}"/>
50
- </svg>`;
51
-
52
- const createIcons = (file) => {
53
- const json = JSON.parse(fs.readFileSync(file));
54
-
55
- for (let name in json.data) {
56
- const iconData = json.data[name];
57
- const pathData = iconData.path;
58
- const ltr = !!iconData.ltr;
59
- const acc = iconData.acc;
60
-
61
- const content = acc ? iconAccTemplate(name, pathData, ltr, acc, json.collection, json.packageName) : iconTemplate(name, pathData, ltr, json.collection, json.packageName);
62
-
63
- fs.writeFileSync(path.join(destDir, `${name}.js`), content);
64
- fs.writeFileSync(path.join(destDir, `${name}.svg`), svgTemplate(pathData));
65
-
66
- if (json.version) {
67
- fs.writeFileSync(path.join(path.normalize("dist/"), `${name}.js`), collectionTemplate(name));
68
- }
69
- }
70
- };
71
-
72
- createIcons(srcFile);
1
+ const fs = require("fs").promises;
2
+ const path = require("path");
3
+
4
+ const collectionName = process.argv[2] || "SAP-icons";
5
+ const collectionVersion = process.argv[3];
6
+ const srcFile = collectionVersion ? path.normalize(`src/${collectionVersion}/${collectionName}.json`) : path.normalize(`src/${collectionName}.json`);
7
+ const destDir = collectionVersion ? path.normalize(`dist/${collectionVersion}/`) : path.normalize("dist/");
8
+
9
+ const iconTemplate = (name, pathData, ltr, collection, packageName) => `import { registerIcon } from "@ui5/webcomponents-base/dist/asset-registries/Icons.js";
10
+
11
+ const name = "${name}";
12
+ const pathData = "${pathData}";
13
+ const ltr = ${ltr};
14
+ const accData = null;
15
+ const collection = "${collection}";
16
+ const packageName = "${packageName}";
17
+
18
+ registerIcon(name, { pathData, ltr, collection, packageName });
19
+
20
+ export default "${name}";
21
+ export { pathData, ltr, accData };`;
22
+
23
+
24
+ const iconAccTemplate = (name, pathData, ltr, accData, collection, packageName) => `import { registerIcon } from "@ui5/webcomponents-base/dist/asset-registries/Icons.js";
25
+ import { ${accData.key} } from "../generated/i18n/i18n-defaults.js";
26
+
27
+ const name = "${name}";
28
+ const pathData = "${pathData}";
29
+ const ltr = ${ltr};
30
+ const accData = ${accData.key};
31
+ const collection = "${collection}";
32
+ const packageName = "${packageName}";
33
+
34
+ registerIcon(name, { pathData, ltr, accData, collection, packageName });
35
+
36
+ export default "${name}";
37
+ export { pathData, ltr, accData };`;
38
+
39
+
40
+
41
+ const collectionTemplate = (name) => `import { isThemeFamily } from "@ui5/webcomponents-base/dist/config/Theme.js";
42
+ import {pathData as pathDataV5, ltr, accData} from "./v5/${name}.js";
43
+ import {pathData as pathDataV4} from "./v4/${name}.js";
44
+
45
+ const pathData = isThemeFamily("sap_horizon") ? pathDataV5 : pathDataV4;
46
+
47
+ export default "${name}";
48
+ export { pathData, ltr, accData };`;
49
+
50
+
51
+ const svgTemplate = (pathData) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
52
+ <path d="${pathData}"/>
53
+ </svg>`;
54
+
55
+ const createIcons = async (file) => {
56
+ await fs.mkdir(destDir, { recursive: true });
57
+
58
+ const json = JSON.parse(await fs.readFile(file));
59
+
60
+ const promises = [];
61
+ for (let name in json.data) {
62
+ const iconData = json.data[name];
63
+ const pathData = iconData.path;
64
+ const ltr = !!iconData.ltr;
65
+ const acc = iconData.acc;
66
+
67
+ const content = acc ? iconAccTemplate(name, pathData, ltr, acc, json.collection, json.packageName) : iconTemplate(name, pathData, ltr, json.collection, json.packageName);
68
+
69
+ promises.push(fs.writeFile(path.join(destDir, `${name}.js`), content));
70
+ promises.push(fs.writeFile(path.join(destDir, `${name}.svg`), svgTemplate(pathData)));
71
+
72
+ if (json.version) {
73
+ promises.push(fs.writeFile(path.join(path.normalize("dist/"), `${name}.js`), collectionTemplate(name)));
74
+ }
75
+ }
76
+
77
+ return Promise.all(promises);
78
+ };
79
+
80
+ createIcons(srcFile).then(() => {
81
+ console.log("Icons created.");
82
+ });
@@ -1,87 +1,90 @@
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
  if (process.argv.length < 7) {
6
- return;
5
+ throw new Error("Not enough arguments");
7
6
  }
8
7
 
9
- const ORIGINAL_TEXTS = {
10
- UnableToLoad: "UnableToLoad",
11
- UnableToUpload: "UnableToUpload",
12
- NoActivities: "NoActivities",
13
- BeforeSearch: "BeforeSearch",
14
- NoSearchResults: "NoSearchResults",
15
- NoEntries: "NoEntries",
16
- NoData: "NoData",
17
- NoNotifications: "NoNotifications",
18
- BalloonSky: "BalloonSky",
19
- SuccessScreen: "SuccessScreen",
20
- NoMail: "NoMail",
21
- NoSavedItems: "NoSavedItems",
22
- NoTasks: "NoTasks"
23
- };
24
-
25
- const FALLBACK_TEXTS = {
26
- ReloadScreen: ORIGINAL_TEXTS.UnableToLoad,
27
- Connection: ORIGINAL_TEXTS.UnableToLoad,
28
- ErrorScreen: ORIGINAL_TEXTS.UnableToUpload,
29
- EmptyCalendar: ORIGINAL_TEXTS.NoActivities,
30
- SearchEarth: ORIGINAL_TEXTS.BeforeSearch,
31
- SearchFolder: ORIGINAL_TEXTS.NoSearchResults,
32
- EmptyList: ORIGINAL_TEXTS.NoEntries,
33
- Tent: ORIGINAL_TEXTS.NoData,
34
- SleepingBell: ORIGINAL_TEXTS.NoNotifications,
35
- SimpleBalloon: ORIGINAL_TEXTS.BalloonSky,
36
- SimpleBell: ORIGINAL_TEXTS.NoNotifications,
37
- SimpleCalendar: ORIGINAL_TEXTS.NoActivities,
38
- SimpleCheckMark: ORIGINAL_TEXTS.SuccessScreen,
39
- SimpleConnection: ORIGINAL_TEXTS.UnableToLoad,
40
- SimpleEmptyDoc: ORIGINAL_TEXTS.NoData,
41
- SimpleEmptyList: ORIGINAL_TEXTS.NoEntries,
42
- SimpleError: ORIGINAL_TEXTS.UnableToUpload,
43
- SimpleMagnifier: ORIGINAL_TEXTS.BeforeSearch,
44
- SimpleMail: ORIGINAL_TEXTS.NoMail,
45
- SimpleNoSavedItems: ORIGINAL_TEXTS.NoSavedItems,
46
- SimpleNotFoundMagnifier: ORIGINAL_TEXTS.NoSearchResults,
47
- SimpleReload: ORIGINAL_TEXTS.UnableToLoad,
48
- SimpleTask: ORIGINAL_TEXTS.NoTasks,
49
- SuccessBalloon: ORIGINAL_TEXTS.BalloonSky,
50
- SuccessCheckMark: ORIGINAL_TEXTS.SuccessScreen,
51
- SuccessHighFive: ORIGINAL_TEXTS.BalloonSky
52
- };
53
-
54
- const srcPath = process.argv[2];
55
- const defaultText = process.argv[3] === "true";
56
- const illustrationsPrefix = process.argv[4];
57
- const illustrationSet = process.argv[5];
58
- const destPath = process.argv[6];
59
- const fileNamePattern = new RegExp(`${illustrationsPrefix}-.+-(.+).svg`);
8
+ const generate = async () => {
9
+
10
+ const ORIGINAL_TEXTS = {
11
+ UnableToLoad: "UnableToLoad",
12
+ UnableToUpload: "UnableToUpload",
13
+ NoActivities: "NoActivities",
14
+ BeforeSearch: "BeforeSearch",
15
+ NoSearchResults: "NoSearchResults",
16
+ NoEntries: "NoEntries",
17
+ NoData: "NoData",
18
+ NoNotifications: "NoNotifications",
19
+ BalloonSky: "BalloonSky",
20
+ SuccessScreen: "SuccessScreen",
21
+ NoMail: "NoMail",
22
+ NoSavedItems: "NoSavedItems",
23
+ NoTasks: "NoTasks"
24
+ };
25
+
26
+ const FALLBACK_TEXTS = {
27
+ ReloadScreen: ORIGINAL_TEXTS.UnableToLoad,
28
+ Connection: ORIGINAL_TEXTS.UnableToLoad,
29
+ ErrorScreen: ORIGINAL_TEXTS.UnableToUpload,
30
+ EmptyCalendar: ORIGINAL_TEXTS.NoActivities,
31
+ SearchEarth: ORIGINAL_TEXTS.BeforeSearch,
32
+ SearchFolder: ORIGINAL_TEXTS.NoSearchResults,
33
+ EmptyList: ORIGINAL_TEXTS.NoEntries,
34
+ Tent: ORIGINAL_TEXTS.NoData,
35
+ SleepingBell: ORIGINAL_TEXTS.NoNotifications,
36
+ SimpleBalloon: ORIGINAL_TEXTS.BalloonSky,
37
+ SimpleBell: ORIGINAL_TEXTS.NoNotifications,
38
+ SimpleCalendar: ORIGINAL_TEXTS.NoActivities,
39
+ SimpleCheckMark: ORIGINAL_TEXTS.SuccessScreen,
40
+ SimpleConnection: ORIGINAL_TEXTS.UnableToLoad,
41
+ SimpleEmptyDoc: ORIGINAL_TEXTS.NoData,
42
+ SimpleEmptyList: ORIGINAL_TEXTS.NoEntries,
43
+ SimpleError: ORIGINAL_TEXTS.UnableToUpload,
44
+ SimpleMagnifier: ORIGINAL_TEXTS.BeforeSearch,
45
+ SimpleMail: ORIGINAL_TEXTS.NoMail,
46
+ SimpleNoSavedItems: ORIGINAL_TEXTS.NoSavedItems,
47
+ SimpleNotFoundMagnifier: ORIGINAL_TEXTS.NoSearchResults,
48
+ SimpleReload: ORIGINAL_TEXTS.UnableToLoad,
49
+ SimpleTask: ORIGINAL_TEXTS.NoTasks,
50
+ SuccessBalloon: ORIGINAL_TEXTS.BalloonSky,
51
+ SuccessCheckMark: ORIGINAL_TEXTS.SuccessScreen,
52
+ SuccessHighFive: ORIGINAL_TEXTS.BalloonSky
53
+ };
54
+
55
+ const srcPath = process.argv[2];
56
+ const defaultText = process.argv[3] === "true";
57
+ const illustrationsPrefix = process.argv[4];
58
+ const illustrationSet = process.argv[5];
59
+ const destPath = process.argv[6];
60
+ const fileNamePattern = new RegExp(`${illustrationsPrefix}-.+-(.+).svg`);
60
61
  // collect each illustration name because each one should have Sample.js file
61
- const fileNames = new Set();
62
-
63
- const svgImportTemplate = svgContent => { return `export default \`${svgContent}\`;`};
64
- const svgToJs = fileName => {
65
- const svg = fs.readFileSync(path.join(srcPath, fileName), { encoding: "utf-8" });
66
- const fileContent = svgImportTemplate(svg);
67
- fileName = fileName.replace(/\.svg$/, ".js");
68
-
69
- fs.writeFileSync(path.join(destPath, fileName), fileContent);
70
- };
71
- const illustrationImportTemplate = illustrationName => {
72
- let illustrationNameForTranslation = illustrationName;
73
-
74
- if (defaultText) {
75
- if (FALLBACK_TEXTS[illustrationNameForTranslation]) {
76
- illustrationNameForTranslation = FALLBACK_TEXTS[illustrationNameForTranslation];
77
- } else if (illustrationName.indexOf("_v") !== -1) {
78
- illustrationNameForTranslation = illustrationNameForTranslation.substr(0, illustrationNameForTranslation.indexOf('_v'));
62
+ const fileNames = new Set();
63
+
64
+ const svgImportTemplate = svgContent => {
65
+ return `export default \`${svgContent}\`;`
66
+ };
67
+ const svgToJs = async fileName => {
68
+ const svg = await fs.readFile(path.join(srcPath, fileName), {encoding: "utf-8"});
69
+ const fileContent = svgImportTemplate(svg);
70
+ fileName = fileName.replace(/\.svg$/, ".js");
71
+
72
+ return fs.writeFile(path.join(destPath, fileName), fileContent);
73
+ };
74
+ const illustrationImportTemplate = illustrationName => {
75
+ let illustrationNameForTranslation = illustrationName;
76
+
77
+ if (defaultText) {
78
+ if (FALLBACK_TEXTS[illustrationNameForTranslation]) {
79
+ illustrationNameForTranslation = FALLBACK_TEXTS[illustrationNameForTranslation];
80
+ } else if (illustrationName.indexOf("_v") !== -1) {
81
+ illustrationNameForTranslation = illustrationNameForTranslation.substr(0, illustrationNameForTranslation.indexOf('_v'));
82
+ }
79
83
  }
80
- }
81
84
 
82
- const illustrationNameUpperCase = illustrationNameForTranslation.toUpperCase();
83
-
84
- return defaultText ? `import { registerIllustration } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
85
+ const illustrationNameUpperCase = illustrationNameForTranslation.toUpperCase();
86
+
87
+ return defaultText ? `import { registerIllustration } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
85
88
  import dialogSvg from "./${illustrationsPrefix}-Dialog-${illustrationName}.js";
86
89
  import sceneSvg from "./${illustrationsPrefix}-Scene-${illustrationName}.js";
87
90
  import spotSvg from "./${illustrationsPrefix}-Spot-${illustrationName}.js";
@@ -109,7 +112,7 @@ export {
109
112
  sceneSvg,
110
113
  spotSvg,
111
114
  };` :
112
- `import { registerIllustration } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
115
+ `import { registerIllustration } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
113
116
  import dialogSvg from "./${illustrationsPrefix}-Dialog-${illustrationName}.js";
114
117
  import sceneSvg from "./${illustrationsPrefix}-Scene-${illustrationName}.js";
115
118
  import spotSvg from "./${illustrationsPrefix}-Spot-${illustrationName}.js";
@@ -129,22 +132,30 @@ export {
129
132
  sceneSvg,
130
133
  spotSvg,
131
134
  };`
132
- };
135
+ };
136
+
137
+ await fs.mkdir(destPath, { recursive: true });
133
138
 
134
- mkdirp.sync(destPath);
139
+ const illustrationFileNames = await fs.readdir(path.normalize(srcPath));
135
140
 
136
- const illustrationFileNames = fs.readdirSync(path.normalize(srcPath));
141
+ // convert SVG to JS imports
142
+ const promises = [];
143
+ illustrationFileNames.forEach(illustration => {
144
+ if (fileNamePattern.test(illustration)) {
145
+ let [fileName, illustrationName] = illustration.match(fileNamePattern);
137
146
 
138
- // convert SVG to JS imports
139
- illustrationFileNames.forEach(illustration => {
140
- if (fileNamePattern.test(illustration)) {
141
- let [fileName, illustrationName] = illustration.match(fileNamePattern);
147
+ promises.push(svgToJs(fileName));
148
+ fileNames.add(illustrationName);
149
+ }
150
+ });
142
151
 
143
- svgToJs(fileName);
144
- fileNames.add(illustrationName);
152
+ for (let illustrationName of fileNames) {
153
+ promises.push(fs.writeFile(path.join(destPath, `${illustrationName}.js`), illustrationImportTemplate(illustrationName)));
145
154
  }
146
- });
147
155
 
148
- for (let illustrationName of fileNames) {
149
- fs.writeFileSync(path.join(destPath, `${illustrationName}.js`), illustrationImportTemplate(illustrationName));
150
- }
156
+ return Promise.all(promises);
157
+ };
158
+
159
+ generate().then(() => {
160
+ console.log("Illustrations generated.");
161
+ });