@ui5/webcomponents-tools 0.0.0-cb061e041 → 0.0.0-ce98ce2bb

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,174 @@
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.17.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.1...v1.17.0-rc.2) (2023-08-24)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.17.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.0...v1.17.0-rc.1) (2023-08-17)
15
+
16
+
17
+ ### Features
18
+
19
+ * **framework:** scope css variables per runtime and version ([#7449](https://github.com/SAP/ui5-webcomponents/issues/7449)) ([d3f6c2e](https://github.com/SAP/ui5-webcomponents/commit/d3f6c2efba9cfda389ea4d700a375f75b3e2996b))
20
+
21
+
22
+
23
+
24
+
25
+ # [1.17.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0...v1.17.0-rc.0) (2023-08-10)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **ui5-illustrated-message:** support collection based illustration loading ([#7318](https://github.com/SAP/ui5-webcomponents/issues/7318)) ([6b52dbd](https://github.com/SAP/ui5-webcomponents/commit/6b52dbd157a3c8198e41c84157e3d9ae89e3386e))
31
+
32
+
33
+
34
+
35
+
36
+ # [1.16.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.4...v1.16.0) (2023-08-03)
37
+
38
+ **Note:** Version bump only for package @ui5/webcomponents-tools
39
+
40
+
41
+
42
+
43
+
44
+ # [1.16.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.3...v1.16.0-rc.4) (2023-08-03)
45
+
46
+ **Note:** Version bump only for package @ui5/webcomponents-tools
47
+
48
+
49
+
50
+
51
+
52
+ # [1.16.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.2...v1.16.0-rc.3) (2023-07-27)
53
+
54
+ **Note:** Version bump only for package @ui5/webcomponents-tools
55
+
56
+
57
+
58
+
59
+
60
+ # [1.16.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.1...v1.16.0-rc.2) (2023-07-20)
61
+
62
+ **Note:** Version bump only for package @ui5/webcomponents-tools
63
+
64
+
65
+
66
+
67
+
68
+ # [1.16.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0-rc.0...v1.16.0-rc.1) (2023-07-13)
69
+
70
+ **Note:** Version bump only for package @ui5/webcomponents-tools
71
+
72
+
73
+
74
+
75
+
76
+ # [1.16.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.15.1...v1.16.0-rc.0) (2023-07-06)
77
+
78
+ **Note:** Version bump only for package @ui5/webcomponents-tools
79
+
80
+
81
+
82
+
83
+
84
+ # [1.15.0](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.2...v1.15.0) (2023-06-30)
85
+
86
+
87
+ ### Bug Fixes
88
+
89
+ * **framework:** missing CSS variables in compact mode / rtl mode ([#7189](https://github.com/SAP/ui5-webcomponents/issues/7189)) ([9b39b9c](https://github.com/SAP/ui5-webcomponents/commit/9b39b9ce5c3720dbb106c5638f858754e11a735f))
90
+
91
+
92
+
93
+
94
+
95
+ # [1.15.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.1...v1.15.0-rc.2) (2023-06-22)
96
+
97
+ **Note:** Version bump only for package @ui5/webcomponents-tools
98
+
99
+
100
+
101
+
102
+
103
+ # [1.15.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.15.0-rc.0...v1.15.0-rc.1) (2023-06-15)
104
+
105
+ **Note:** Version bump only for package @ui5/webcomponents-tools
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+ # [1.15.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0...v1.15.0-rc.0) (2023-06-08)
116
+
117
+ **Note:** Version bump only for package @ui5/webcomponents-tools
118
+
119
+
120
+
121
+
122
+
123
+ # [1.14.0](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.2...v1.14.0) (2023-06-01)
124
+
125
+ **Note:** Version bump only for package @ui5/webcomponents-tools
126
+
127
+
128
+
129
+
130
+
131
+ # [1.14.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.1...v1.14.0-rc.2) (2023-06-01)
132
+
133
+ **Note:** Version bump only for package @ui5/webcomponents-tools
134
+
135
+
136
+
137
+
138
+
139
+ # [1.14.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.0...v1.14.0-rc.1) (2023-05-25)
140
+
141
+ **Note:** Version bump only for package @ui5/webcomponents-tools
142
+
143
+
144
+
145
+
146
+
147
+ # [1.14.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.2...v1.14.0-rc.0) (2023-05-18)
148
+
149
+ **Note:** Version bump only for package @ui5/webcomponents-tools
150
+
151
+
152
+
153
+
154
+
155
+ ## [1.13.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.5...v1.13.1) (2023-05-11)
156
+
157
+ **Note:** Version bump only for package @ui5/webcomponents-tools
158
+
159
+
160
+
161
+
162
+
163
+ # [1.13.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.4...v1.13.0-rc.5) (2023-05-11)
164
+
165
+
166
+ ### Bug Fixes
167
+
168
+ * **create-webcomponents-package:** fix package creation issues with test and lint ([#6976](https://github.com/SAP/ui5-webcomponents/issues/6976)) ([dd70f3a](https://github.com/SAP/ui5-webcomponents/commit/dd70f3aa8ef70b592f1d4e0f3f9894c6280fb1bf))
169
+
170
+
171
+
172
+
173
+
6
174
  # [1.13.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.3...v1.13.0-rc.4) (2023-05-04)
7
175
 
8
176
 
package/assets-meta.js CHANGED
@@ -9,12 +9,15 @@ const assetsMeta = {
9
9
  "sap_belize_hcw",
10
10
  "sap_fiori_3_hcb",
11
11
  "sap_fiori_3_hcw",
12
- "sap_horizon",
13
- "sap_horizon_dark",
14
- "sap_horizon_hcb",
15
- "sap_horizon_hcw",
16
- "sap_horizon_exp"
17
- ]
12
+ "sap_horizon",
13
+ "sap_horizon_dark",
14
+ "sap_horizon_hcb",
15
+ "sap_horizon_hcw",
16
+ "sap_horizon_exp",
17
+ "sap_horizon_dark_exp",
18
+ "sap_horizon_hcb_exp",
19
+ "sap_horizon_hcw_exp",
20
+ ],
18
21
  },
19
22
  "languages": {
20
23
  "default": "en",
@@ -8,12 +8,12 @@ const getScripts = (options) => {
8
8
 
9
9
  // The script creates all JS modules (dist/illustrations/{illustrationName}.js) out of the existing SVGs
10
10
  const illustrationsData = options.illustrationsData || [];
11
- const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath}`);
11
+ const illustrations = illustrationsData.map(illustration => `node "${LIB}/create-illustrations/index.js" ${illustration.path} ${illustration.defaultText} ${illustration.illustrationsPrefix} ${illustration.set} ${illustration.destinationPath} ${illustration.collection}`);
12
12
  const createIllustrationsJSImportsScript = illustrations.join(" && ");
13
13
 
14
14
  // The script creates the "dist/generated/js-imports/Illustration.js" file that registers loaders (dynamic JS imports) for each illustration
15
- const illustrationDestinationPaths = illustrationsData.map(illustrations => illustrations.destinationPath);
16
- const createIllustrationsLoadersScript = options.fioriPackage ? `node ${LIB}/generate-js-imports/illustrations.js ${illustrationDestinationPaths[0]} ${illustrationDestinationPaths[1]} dist/generated/js-imports` : "";
15
+ const createIllustrationsLoadersScript = illustrationsData.map(illustrations => `node ${LIB}/generate-js-imports/illustrations.js ${illustrations.destinationPath} ${illustrations.dynamicImports.outputFile} ${illustrations.collection} ${illustrations.dynamicImports.location} ${illustrations.dynamicImports.prefix || '\"\"'} ${illustrations.dynamicImports.filterOut.join(" ")}`).join(" && ");
16
+
17
17
  const tsOption = options.typescript;
18
18
  const tsCommand = tsOption ? "tsc" : "";
19
19
  const tsWatchCommand = tsOption ? "tsc --watch" : "";
@@ -1,9 +1,11 @@
1
1
  const postcssImport = require('postcss-import');
2
2
  const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
3
+ const postcssScopeVars = require('../lib/postcss-scope-vars/index.js');
3
4
  const cssnano = require('cssnano');
4
- const fs = require("fs");
5
+ const fs = require("fs")
5
6
 
6
- const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
7
+
8
+ const packageJSON = JSON.parse(fs.readFileSync("./package.json"))
7
9
 
8
10
  module.exports = {
9
11
  plugins: [
@@ -16,6 +18,7 @@ module.exports = {
16
18
  },
17
19
  ]
18
20
  }),
19
- postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName }),
21
+ postcssScopeVars({version: packageJSON.version}),
22
+ postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName: packageJSON.name }),
20
23
  ]
21
24
  }
@@ -2,13 +2,17 @@ const postcssImport = require('postcss-import');
2
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
+ const postcssScopeVars = require('../lib/postcss-scope-vars/index.js');
5
6
  const cssnano = require('cssnano');
6
7
  const fs = require("fs");
7
8
 
8
- const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
9
+
10
+ const packageJSON = JSON.parse(fs.readFileSync("./package.json"))
11
+ const packageName = packageJSON.name;
9
12
 
10
13
  module.exports = {
11
14
  plugins: [
15
+ postcssScopeVars({version: packageJSON.version}),
12
16
  postcssImport(),
13
17
  combineSelectors({
14
18
  removeDuplicatedProperties: true
@@ -56,7 +56,15 @@ exports.config = {
56
56
  'goog:chromeOptions': {
57
57
  // to run chrome headless the following flags are required
58
58
  // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
59
- args: ['--headless', '--disable-gpu'],
59
+ args: [
60
+ '--headless',
61
+ '--start-maximized',
62
+ '--no-sandbox',
63
+ '--disable-gpu',
64
+ '--disable-infobars',
65
+ '--disable-extensions',
66
+ '--disable-dev-shm-usage',
67
+ ],
60
68
  // args: ['--disable-gpu'],
61
69
  }
62
70
  }],
@@ -99,8 +107,7 @@ exports.config = {
99
107
  // Services take over a specific job you don't want to take care of. They enhance
100
108
  // your test setup with almost no effort. Unlike plugins, they don't add new
101
109
  // commands. Instead, they hook themselves up into the test process.
102
- services: ['chromedriver', 'devtools',
103
- ['static-server', {
110
+ services: ['chromedriver', ['static-server', {
104
111
  folders: [
105
112
  { mount: '/', path: './dist' },
106
113
  ],
@@ -56,7 +56,15 @@ exports.config = {
56
56
  'goog:chromeOptions': {
57
57
  // to run chrome headless the following flags are required
58
58
  // (see https://developers.google.com/web/updates/2017/04/headless-chrome)
59
- args: ['--headless', '--disable-gpu'],
59
+ args: [
60
+ '--headless',
61
+ '--start-maximized',
62
+ '--no-sandbox',
63
+ '--disable-gpu',
64
+ '--disable-infobars',
65
+ '--disable-extensions',
66
+ '--disable-dev-shm-usage',
67
+ ],
60
68
  // args: ['--disable-gpu'],
61
69
  }
62
70
  }],
@@ -21,7 +21,7 @@ const copyIconAssetsCommand = (options) => {
21
21
  return {
22
22
  default: "nps copy.json-imports copy.icon-collection",
23
23
  "json-imports": `node "${LIB}/copy-and-watch/index.js" --silent "src/**/*.js" dist/`,
24
- "icon-collection": `node "${LIB}/copy-and-watch/index.js" --silent "src/*.json" dist/generated/assets/`,
24
+ "icon-collection": `node "${LIB}/copy-and-watch/index.js" --silent "src/*.json" src/generated/assets/`,
25
25
  }
26
26
  }
27
27
 
@@ -32,7 +32,7 @@ const copyIconAssetsCommand = (options) => {
32
32
 
33
33
  options.versions.forEach((v) => {
34
34
  command.default += ` copy.icon-collection${v}`;
35
- command[`icon-collection${v}`] = `node "${LIB}/copy-and-watch/index.js" --silent "src/${v}/*.json" dist/generated/assets/${v}/`;
35
+ command[`icon-collection${v}`] = `node "${LIB}/copy-and-watch/index.js" --silent "src/${v}/*.json" src/generated/assets/${v}/`;
36
36
  });
37
37
 
38
38
  return command;
@@ -57,10 +57,20 @@ const generate = async () => {
57
57
  const illustrationsPrefix = process.argv[4];
58
58
  const illustrationSet = process.argv[5];
59
59
  const destPath = process.argv[6];
60
+ const collection = process.argv[7];
60
61
  const fileNamePattern = new RegExp(`${illustrationsPrefix}-.+-(.+).svg`);
61
62
  // collect each illustration name because each one should have Sample.js file
62
63
  const fileNames = new Set();
63
64
 
65
+ try {
66
+ await fs.access(srcPath);
67
+ } catch (error) {
68
+ console.log(`The path ${srcPath} does not exist.`);
69
+ return Promise.resolve(null);
70
+ }
71
+
72
+ console.log(`Generating illustrations from ${srcPath} to ${destPath}`)
73
+
64
74
  const svgImportTemplate = svgContent => {
65
75
  return `export default \`${svgContent}\`;`
66
76
  };
@@ -95,6 +105,7 @@ import {
95
105
 
96
106
  const name = "${illustrationName}";
97
107
  const set = "${illustrationSet}";
108
+ const collection = "${collection}";
98
109
  const title = IM_TITLE_${illustrationNameUpperCase};
99
110
  const subtitle = IM_SUBTITLE_${illustrationNameUpperCase};
100
111
 
@@ -105,6 +116,7 @@ registerIllustration(name, {
105
116
  title,
106
117
  subtitle,
107
118
  set,
119
+ collection,
108
120
  });
109
121
 
110
122
  export {
@@ -119,12 +131,14 @@ import spotSvg from "./${illustrationsPrefix}-Spot-${illustrationName}.js";
119
131
 
120
132
  const name = "${illustrationName}";
121
133
  const set = "${illustrationSet}";
134
+ const collection = "${collection}";
122
135
 
123
136
  registerIllustration(name, {
124
137
  dialogSvg,
125
138
  sceneSvg,
126
139
  spotSvg,
127
140
  set,
141
+ collection,
128
142
  });
129
143
 
130
144
  export {
@@ -83,7 +83,7 @@ const generateFiles = (componentName, tagName, library, packageName, isTypeScrip
83
83
  // Change the color of the output
84
84
  console.warn('\x1b[33m%s\x1b[0m', `
85
85
  Make sure to import the component in your bundle by using:
86
- import ${componentName} from "./dist/${componentName}.js";`);
86
+ import "./dist/${componentName}.js";`);
87
87
  }
88
88
 
89
89
  // Main function
@@ -314,7 +314,7 @@ const generate = async () => {
314
314
  };
315
315
 
316
316
  file.symbols.forEach(entity => {
317
- if (entity.tagname) {
317
+ if (entity.tagname || entity.kind === "class") {
318
318
  customElementsManifest.modules.push(generateJavaScriptModule(entity));
319
319
  }
320
320
  });
@@ -1,72 +1,83 @@
1
1
  const fs = require("fs").promises;
2
- const path = require('path');
3
-
4
- const generate = async () => {
5
- const fioriInputFolder = path.normalize(process.argv[2]);
6
- const tntInputFolder = path.normalize(process.argv[3]);
7
- const outputFile = path.normalize(`${process.argv[4]}/Illustrations.js`);
8
-
9
- const dir = await fs.readdir(fioriInputFolder);
10
- const fioriIllustrationsOnFileSystem = dir.map(illustrationName => {
11
- const fioriMatches = illustrationName.match(/.*\.js$/);
12
- return fioriMatches ? illustrationName : undefined;
13
- }).filter(key => !!key);
14
-
15
- const tntDir = await fs.readdir(tntInputFolder);
16
- const tntIllustrationsOnFileSystem = tntDir.map(illustrationName => {
17
- const tntMatches = illustrationName.match(/.*\.js$/);
18
- return tntMatches ? illustrationName : undefined;
19
- }).filter(key => !!key);
20
-
21
- // dynamic imports for Fiori illustrations
22
- const fioriAvailableIllustrationsArray = `[${fioriIllustrationsOnFileSystem.filter(
23
- // skipping the items starting with sapIllus-Dialog, sapIllus-Scene, sapIllus-Spot since they are included in the illustration's js file
24
- line => !line.startsWith("sapIllus-Dialog") && !line.startsWith("sapIllus-Scene") && !line.startsWith("sapIllus-Spot") && !line.startsWith("AllIllustrations")).map(illustrationName => `"${illustrationName.replace('.js', '')}"`).join(", ")}]`;
25
-
26
- const fioriDynamicImportLines = fioriIllustrationsOnFileSystem.map(illustrationName =>
27
- `\t\tcase "${illustrationName.replace('.js', '')}": return (await import("../../illustrations/${illustrationName}")).default;`).filter(
28
- // skipping the items starting with sapIllus-Dialog, sapIllus-Scene, sapIllus-Spot since they are included in the illustration's js file
29
- line => !line.startsWith("\t\tcase \"sapIllus-Dialog") && !line.startsWith("\t\tcase \"sapIllus-Scene") && !line.startsWith("\t\tcase \"sapIllus-Spot") && !line.startsWith("\t\tcase \"AllIllustrations")).join("\n");
30
-
31
- // dynamic imports for Tnt illustrations
32
- const tntAvailableIllustrationsArray = `[${tntIllustrationsOnFileSystem.filter(
33
- // skipping the items starting with tnt-Dialog, tnt-Scene, tnt-Spot since they are included in the illustration's js file
34
- line => !line.startsWith("tnt-Dialog") && !line.startsWith("tnt-Scene") && !line.startsWith("tnt-Spot")).map(illustrationName => `"Tnt${illustrationName.replace('.js', '')}"`).join(", ")}]`;
35
-
36
- const tntDynamicImportLines = tntIllustrationsOnFileSystem.map(illustrationName =>
37
- `\t\tcase "Tnt${illustrationName.replace('.js', '')}": return (await import("../../illustrations/tnt/${illustrationName}")).default;`).filter(
38
- // skipping the items starting with tnt-Dialog, tnt-Scene, tnt-Spot since they are included in the illustration's js file
39
- line => !line.startsWith("\t\tcase \"Tnttnt-Dialog") && !line.startsWith("\t\tcase \"Tnttnt-Scene") && !line.startsWith("\t\tcase \"Tnttnt-Spot")).join("\n");
40
-
41
-
42
- // dynamic imports file content
43
- const contentDynamic = `import { registerIllustrationLoader } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
44
-
45
- const loadIllustration = async (illustrationName) => {
46
- switch (illustrationName) {
47
- ${fioriDynamicImportLines}
48
- ${tntDynamicImportLines}
49
- default: throw new Error("[Illustrations] Illustration not found: " + illustrationName);
50
- }
2
+ const path = require("path");
3
+
4
+ const generateDynamicImportLines = (fileNames, location, exclusionPatterns = []) => {
5
+ return fileNames
6
+ .filter((fileName) => !exclusionPatterns.some((pattern) => fileName.startsWith(pattern)))
7
+ .map((fileName) => {
8
+ const illustrationPath = `${location}/${fileName.replace(".js", "")}`;
9
+ return `\t\tcase "${fileName.replace('.js', '')}": return (await import("${illustrationPath}.js")).default;`;
10
+ })
11
+ .join("\n");
12
+ };
13
+
14
+ const generateAvailableIllustrationsArray = (fileNames, exclusionPatterns = []) => {
15
+ return JSON.stringify(
16
+ fileNames
17
+ .filter((fileName) => !exclusionPatterns.some((pattern) => fileName.startsWith(pattern)))
18
+ .map((fileName) => fileName.replace(".js", ""))
19
+ );
20
+ };
21
+
22
+ const generateDynamicImportsFileContent = (dynamicImports, availableIllustrations, collection, prefix = "") => {
23
+ return `import { registerIllustrationLoader } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
24
+
25
+ export const loadIllustration = async (illustrationName) => {
26
+ const collectionAndPrefix = "${collection}/${prefix}";
27
+ const cleanIllustrationName = illustrationName.startsWith(collectionAndPrefix) ? illustrationName.replace(collectionAndPrefix, "") : illustrationName;
28
+ switch (cleanIllustrationName) {
29
+ ${dynamicImports}
30
+ default:
31
+ throw new Error("[Illustrations] Illustration not found: " + illustrationName);
32
+ }
33
+ };
34
+
35
+ const loadAndCheck = async (illustrationName) => {
36
+ const data = await loadIllustration(illustrationName);
37
+ return data;
38
+ };
39
+
40
+ ${availableIllustrations}.forEach((illustrationName) =>
41
+ registerIllustrationLoader(\`${collection}/${prefix}\${illustrationName}\`, loadAndCheck)
42
+ );
43
+ `;
44
+ };
45
+
46
+ const getMatchingFiles = async (folder, pattern) => {
47
+ const dir = await fs.readdir(folder);
48
+ return dir.filter((fileName) => fileName.match(pattern));
51
49
  };
52
- const loadAndCheck = async (illustrationName) => {
53
- const data = await loadIllustration(illustrationName);
54
- return data;
55
- }
56
50
 
51
+ const generateIllustrations = async (config) => {
52
+ const { inputFolder, outputFile, collection, location, prefix, filterOut } = config;
53
+
54
+ const normalizedInputFolder = path.normalize(inputFolder);
55
+ const normalizedOutputFile = path.normalize(outputFile);
56
+
57
+ const illustrations = await getMatchingFiles(normalizedInputFolder, /^.*\.js$/);
57
58
 
58
- ${fioriAvailableIllustrationsArray}.forEach(illustrationName => registerIllustrationLoader(illustrationName, loadAndCheck));
59
- ${tntAvailableIllustrationsArray}.forEach(illustrationName => registerIllustrationLoader(illustrationName, loadAndCheck));`;
60
-
59
+ const dynamicImports = generateDynamicImportLines(illustrations, location, filterOut);
60
+ const availableIllustrations = generateAvailableIllustrationsArray(illustrations, filterOut);
61
+
62
+ const contentDynamic = generateDynamicImportsFileContent(dynamicImports, availableIllustrations, collection, prefix);
63
+
64
+ await fs.mkdir(path.dirname(normalizedOutputFile), { recursive: true });
65
+ await fs.writeFile(normalizedOutputFile, contentDynamic);
66
+
67
+ console.log(`Generated ${normalizedOutputFile}`);
68
+ };
61
69
 
62
- await fs.mkdir(path.dirname(outputFile), { recursive: true });
63
- return Promise.all([fs.writeFile(outputFile, contentDynamic)]);
70
+ // Parse configuration from command-line arguments
71
+ const config = {
72
+ inputFolder: process.argv[2],
73
+ outputFile: process.argv[3],
74
+ collection: process.argv[4],
75
+ location: process.argv[5],
76
+ prefix: process.argv[6],
77
+ filterOut: process.argv.slice(7),
64
78
  };
65
79
 
66
- generate().then(() => {
67
- console.log("Generated Illustrations.js");
68
- })
69
- .catch(err => {
70
- console.error(err);
71
- process.exit(1);
80
+ // Run the generation process
81
+ generateIllustrations(config).catch((error) => {
82
+ console.error("Error generating illustrations:", error);
72
83
  });
@@ -60,7 +60,7 @@ module.exports = function (opts) {
60
60
 
61
61
  return {
62
62
  postcssPlugin: 'postcss-css-to-esm',
63
- Once (root) {
63
+ OnceExit(root) {
64
64
  const tsMode = process.env.UI5_TS === "true";
65
65
 
66
66
  let css = root.toString();
@@ -15,7 +15,7 @@ module.exports = function (opts) {
15
15
 
16
16
  return {
17
17
  postcssPlugin: 'postcss-css-to-json',
18
- Once (root) {
18
+ OnceExit (root) {
19
19
  let css = root.toString();
20
20
  css = proccessCSS(css);
21
21
 
@@ -0,0 +1,24 @@
1
+ const name = "postcss-scope-vars";
2
+
3
+ module.exports = (options) => {
4
+ const versionStr = "v" + options?.version?.replaceAll(".", "-");
5
+ return {
6
+ postcssPlugin: name,
7
+ prepare() {
8
+ return {
9
+ Declaration: (declaration) => {
10
+ if (declaration.__ui5_replaced) {
11
+ return;
12
+ }
13
+ // add version after ui5
14
+ const expr = /(--_?ui5)([^\,\:\)\s]+)/g
15
+ declaration.prop = declaration.prop.replaceAll(expr, `$1-${versionStr}$2`)
16
+ declaration.value = declaration.value.replaceAll(expr, `$1-${versionStr}$2`)
17
+ declaration.__ui5_replaced = true;
18
+ },
19
+ };
20
+ },
21
+ };
22
+ };
23
+
24
+ module.exports.postcss = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "0.0.0-cb061e041",
3
+ "version": "0.0.0-ce98ce2bb",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -24,7 +24,6 @@
24
24
  "@typescript-eslint/eslint-plugin": "^5.42.1",
25
25
  "@typescript-eslint/parser": "^5.42.1",
26
26
  "@wdio/cli": "^7.19.7",
27
- "@wdio/devtools-service": "^7.19.7",
28
27
  "@wdio/dot-reporter": "^7.19.7",
29
28
  "@wdio/local-runner": "^7.19.7",
30
29
  "@wdio/mocha-framework": "^7.19.7",
@@ -37,7 +36,7 @@
37
36
  "command-line-args": "^5.1.1",
38
37
  "concurrently": "^6.0.0",
39
38
  "cross-env": "^7.0.3",
40
- "cssnano": "^4.1.11",
39
+ "cssnano": "^6.0.1",
41
40
  "escodegen": "^2.0.0",
42
41
  "eslint": "^7.22.0",
43
42
  "eslint-config-airbnb-base": "^14.2.1",
@@ -65,7 +64,7 @@
65
64
  "slash": "3.0.0",
66
65
  "vite": "^3.0.4",
67
66
  "wdio-chromedriver-service": "^7.3.2",
68
- "zx": "^4.3.0"
67
+ "zx": "^7.2.3"
69
68
  },
70
69
  "peerDependencies": {
71
70
  "chromedriver": "*",