@ui5/webcomponents-tools 0.0.0-f734ea2da → 0.0.0-f79db712b

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 (108) hide show
  1. package/CHANGELOG.md +808 -0
  2. package/README.md +6 -6
  3. package/assets-meta.js +18 -3
  4. package/bin/dev.js +1 -5
  5. package/components-package/eslint.js +36 -0
  6. package/components-package/nps.js +108 -66
  7. package/components-package/postcss.components.js +1 -21
  8. package/components-package/postcss.themes.js +1 -23
  9. package/components-package/vite.config.js +13 -0
  10. package/components-package/wdio.js +405 -344
  11. package/components-package/wdio.sync.js +368 -0
  12. package/icons-collection/nps.js +51 -18
  13. package/lib/cem/custom-elements-manifest.config.mjs +499 -0
  14. package/lib/cem/event.mjs +135 -0
  15. package/lib/cem/schema-internal.json +1354 -0
  16. package/lib/cem/schema.json +1098 -0
  17. package/lib/cem/types-internal.d.ts +801 -0
  18. package/lib/cem/types.d.ts +736 -0
  19. package/lib/cem/utils.mjs +354 -0
  20. package/lib/cem/validate.js +67 -0
  21. package/lib/copy-and-watch/index.js +24 -1
  22. package/lib/copy-list/index.js +17 -17
  23. package/lib/create-icons/index.js +124 -58
  24. package/lib/create-illustrations/index.js +165 -0
  25. package/lib/create-new-component/index.js +72 -97
  26. package/lib/create-new-component/jsFileContentTemplate.js +73 -0
  27. package/lib/create-new-component/tsFileContentTemplate.js +71 -0
  28. package/lib/css-processors/css-processor-components.mjs +77 -0
  29. package/lib/css-processors/css-processor-themes.mjs +79 -0
  30. package/lib/css-processors/scope-variables.mjs +46 -0
  31. package/lib/css-processors/shared.mjs +76 -0
  32. package/lib/dev-server/custom-hot-update-plugin.js +39 -0
  33. package/lib/dev-server/dev-server.js +66 -0
  34. package/lib/dev-server/virtual-index-html-plugin.js +52 -0
  35. package/lib/esm-abs-to-rel/index.js +17 -10
  36. package/lib/generate-custom-elements-manifest/index.js +327 -0
  37. package/lib/generate-js-imports/illustrations.js +86 -0
  38. package/lib/generate-json-imports/i18n.js +43 -31
  39. package/lib/generate-json-imports/themes.js +36 -24
  40. package/lib/hbs2lit/src/compiler.js +24 -4
  41. package/lib/hbs2lit/src/includesReplacer.js +5 -5
  42. package/lib/hbs2lit/src/litVisitor2.js +95 -24
  43. package/lib/hbs2lit/src/svgProcessor.js +12 -5
  44. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +33 -11
  45. package/lib/hbs2ui5/index.js +56 -23
  46. package/lib/i18n/defaults.js +65 -57
  47. package/lib/i18n/toJSON.js +12 -11
  48. package/lib/jsdoc/configTypescript.json +29 -0
  49. package/lib/jsdoc/plugin.js +41 -0
  50. package/lib/jsdoc/preprocess.js +146 -0
  51. package/lib/jsdoc/template/publish.js +21 -2
  52. package/lib/postcss-combine-duplicated-selectors/index.js +185 -0
  53. package/lib/replace-global-core/index.js +13 -8
  54. package/lib/scoping/get-all-tags.js +2 -9
  55. package/lib/scoping/lint-src.js +1 -1
  56. package/lib/scoping/missing-dependencies.js +65 -0
  57. package/lib/scoping/report-tags-usage.js +28 -0
  58. package/lib/scoping/scope-test-pages.js +2 -1
  59. package/lib/test-runner/test-runner.js +71 -0
  60. package/package.json +36 -38
  61. package/bin/init-ui5-package.js +0 -3
  62. package/components-package/rollup.js +0 -216
  63. package/lib/documentation/index.js +0 -165
  64. package/lib/documentation/templates/api-component-since.js +0 -3
  65. package/lib/documentation/templates/api-css-variables-section.js +0 -24
  66. package/lib/documentation/templates/api-events-section.js +0 -35
  67. package/lib/documentation/templates/api-methods-section.js +0 -26
  68. package/lib/documentation/templates/api-properties-section.js +0 -40
  69. package/lib/documentation/templates/api-slots-section.js +0 -28
  70. package/lib/documentation/templates/template.js +0 -38
  71. package/lib/hash/config.js +0 -10
  72. package/lib/hash/generate.js +0 -19
  73. package/lib/hash/upToDate.js +0 -31
  74. package/lib/init-package/index.js +0 -136
  75. package/lib/init-package/resources/.eslintignore +0 -3
  76. package/lib/init-package/resources/bundle.es5.js +0 -25
  77. package/lib/init-package/resources/bundle.esm.js +0 -31
  78. package/lib/init-package/resources/config/.eslintrc.js +0 -1
  79. package/lib/init-package/resources/config/postcss.components/postcss.config.js +0 -1
  80. package/lib/init-package/resources/config/postcss.themes/postcss.config.js +0 -1
  81. package/lib/init-package/resources/config/rollup.config.js +0 -1
  82. package/lib/init-package/resources/config/wdio.conf.js +0 -1
  83. package/lib/init-package/resources/package-scripts.js +0 -11
  84. package/lib/init-package/resources/src/Assets.js +0 -5
  85. package/lib/init-package/resources/src/MyFirstComponent.hbs +0 -1
  86. package/lib/init-package/resources/src/MyFirstComponent.js +0 -56
  87. package/lib/init-package/resources/src/i18n/messagebundle.properties +0 -2
  88. package/lib/init-package/resources/src/i18n/messagebundle_de.properties +0 -1
  89. package/lib/init-package/resources/src/i18n/messagebundle_en.properties +0 -1
  90. package/lib/init-package/resources/src/i18n/messagebundle_es.properties +0 -1
  91. package/lib/init-package/resources/src/i18n/messagebundle_fr.properties +0 -1
  92. package/lib/init-package/resources/src/themes/MyFirstComponent.css +0 -11
  93. package/lib/init-package/resources/src/themes/sap_belize/parameters-bundle.css +0 -3
  94. package/lib/init-package/resources/src/themes/sap_belize_hcb/parameters-bundle.css +0 -3
  95. package/lib/init-package/resources/src/themes/sap_belize_hcw/parameters-bundle.css +0 -3
  96. package/lib/init-package/resources/src/themes/sap_fiori_3/parameters-bundle.css +0 -3
  97. package/lib/init-package/resources/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
  98. package/lib/init-package/resources/src/themes/sap_fiori_3_hcb/parameters-bundle.css +0 -3
  99. package/lib/init-package/resources/src/themes/sap_fiori_3_hcw/parameters-bundle.css +0 -3
  100. package/lib/init-package/resources/test/pages/index.html +0 -56
  101. package/lib/init-package/resources/test/specs/Demo.spec.js +0 -12
  102. package/lib/polyfill-placeholder/index.js +0 -5
  103. package/lib/postcss-css-to-esm/index.js +0 -45
  104. package/lib/postcss-css-to-json/index.js +0 -31
  105. package/lib/postcss-new-files/index.js +0 -36
  106. package/lib/serve/index.js +0 -46
  107. package/lib/serve/serve.json +0 -3
  108. package/package-lock.json +0 -48
@@ -0,0 +1,185 @@
1
+ /*
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2016 Christian Murphy
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
+
25
+ const parser = require('postcss-selector-parser');
26
+ const name = "postcss-combine-duplicated-selectors";
27
+
28
+ /**
29
+ * Ensure that attributes with different quotes match.
30
+ * @param {Object} selector - postcss selector node
31
+ */
32
+ function normalizeAttributes(selector) {
33
+ selector.walkAttributes((node) => {
34
+ if (node.value) {
35
+ // remove quotes
36
+ node.value = node.value.replace(/'|\\'|"|\\"/g, '');
37
+ }
38
+ });
39
+ }
40
+
41
+ /**
42
+ * Sort class and id groups alphabetically
43
+ * @param {Object} selector - postcss selector node
44
+ */
45
+ function sortGroups(selector) {
46
+ selector.each((subSelector) => {
47
+ subSelector.nodes.sort((a, b) => {
48
+ // different types cannot be sorted
49
+ if (a.type !== b.type) {
50
+ return 0;
51
+ }
52
+
53
+ // sort alphabetically
54
+ return a.value < b.value ? -1 : 1;
55
+ });
56
+ });
57
+
58
+ selector.sort((a, b) => (a.nodes.join('') < b.nodes.join('') ? -1 : 1));
59
+ }
60
+
61
+ /**
62
+ * Remove duplicated properties
63
+ * @param {Object} selector - postcss selector node
64
+ * @param {Boolean} exact
65
+ */
66
+ function removeDupProperties(selector, exact) {
67
+ if (!exact) { // Remove duplicated properties, regardless of value
68
+ const retainedProps = new Set();
69
+
70
+ for (let actIndex = selector.nodes.length - 1; actIndex >= 1; actIndex--) {
71
+ const prop = selector.nodes[actIndex].prop;
72
+ if (prop !== undefined) {
73
+ if (!retainedProps.has(prop)) {
74
+ retainedProps.add(prop); // Mark the prop as retained, all other occurrences must be removed
75
+ } else {
76
+ selector.nodes[actIndex].remove(); // This occurrence of the prop must be removed
77
+ }
78
+ }
79
+ }
80
+ } else {
81
+ // Remove duplicated properties from bottom to top ()
82
+ for (let actIndex = selector.nodes.length - 1; actIndex >= 1; actIndex--) {
83
+ for (let befIndex = actIndex - 1; befIndex >= 0; befIndex--) {
84
+ if (
85
+ selector.nodes[actIndex].prop === selector.nodes[befIndex].prop &&
86
+ selector.nodes[actIndex].value === selector.nodes[befIndex].value
87
+ ) {
88
+ selector.nodes[befIndex].remove();
89
+ actIndex--;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ const uniformStyle = parser((selector) => {
97
+ normalizeAttributes(selector);
98
+ sortGroups(selector);
99
+ });
100
+
101
+ const defaultOptions = {
102
+ removeDuplicatedProperties: false,
103
+ };
104
+
105
+ module.exports = (options) => {
106
+ options = Object.assign({}, defaultOptions, options);
107
+ return {
108
+ postcssPlugin: name,
109
+ prepare() {
110
+ // Create a map to store maps
111
+ const mapTable = new Map();
112
+ // root map to store root selectors
113
+ mapTable.set('root', new Map());
114
+
115
+ return {
116
+ Rule: (rule) => {
117
+ let map;
118
+ // Check selector parent for any at rule
119
+ if (rule.parent.type === 'atrule') {
120
+ // Use name and query params as the key
121
+ const query =
122
+ rule.parent.name.toLowerCase() +
123
+ rule.parent.params.replace(/\s+/g, '');
124
+
125
+ // See if this query key is already in the map table
126
+ map = mapTable.has(query) ? // If it is use it
127
+ mapTable.get(query) : // if not set it and get it
128
+ mapTable.set(query, new Map()).get(query);
129
+ } else {
130
+ // Otherwise we are dealing with a selector in the root
131
+ map = mapTable.get('root');
132
+ }
133
+
134
+ // create a uniform selector
135
+ const selector = uniformStyle.processSync(rule.selector, {
136
+ lossless: false,
137
+ });
138
+
139
+ if (map.has(selector)) {
140
+ // store original rule as destination
141
+ const destination = map.get(selector);
142
+
143
+ // check if node has already been processed
144
+ if (destination === rule) return;
145
+
146
+ // move declarations to original rule
147
+ while (rule.nodes.length > 0) {
148
+ destination.append(rule.nodes[0]);
149
+ }
150
+ // remove duplicated rule
151
+ rule.remove();
152
+
153
+ if (
154
+ options.removeDuplicatedProperties ||
155
+ options.removeDuplicatedValues
156
+ ) {
157
+ // removeDupProperties(
158
+ // destination,
159
+ // options.removeDuplicatedValues,
160
+ // );
161
+ }
162
+ } else {
163
+ if (
164
+ options.removeDuplicatedProperties ||
165
+ options.removeDuplicatedValues
166
+ ) {
167
+ // removeDupProperties(rule, options.removeDuplicatedValues);
168
+ }
169
+ // add new selector to symbol table
170
+ map.set(selector, rule);
171
+ }
172
+ },
173
+ OnceExit(root) {
174
+ root.nodes.forEach(node => {
175
+ if (node.type === "rule") {
176
+ removeDupProperties(node, options.removeDuplicatedValues);
177
+ }
178
+ })
179
+ }
180
+ };
181
+ },
182
+ };
183
+ };
184
+
185
+ module.exports.postcss = true;
@@ -1,20 +1,25 @@
1
- const fs = require("fs");
2
- const glob = require("glob");
1
+ const fs = require("fs").promises;
3
2
 
4
3
  const basePath = process.argv[2];
5
4
 
6
- const replaceGlobalCoreUsage = (srcPath) => {
5
+ const replaceGlobalCoreUsage = async (srcPath) => {
7
6
 
8
- const original = fs.readFileSync(srcPath).toString();
7
+ const original = (await fs.readFile(srcPath)).toString();
9
8
  let replaced = original.replace(/sap\.ui\.getCore\(\)/g, `Core`);
10
9
 
11
10
  if (original !== replaced) {
12
11
  replaced = `import Core from 'sap/ui/core/Core';
13
12
  ${replaced}`;
14
- fs.writeFileSync(srcPath, replaced);
13
+ return fs.writeFile(srcPath, replaced);
15
14
  }
16
15
  };
17
16
 
18
- const fileNames = glob.sync(basePath + "**/*.js");
19
- fileNames.forEach(replaceGlobalCoreUsage);
20
- console.log("Success: Replaced global core usage in:", basePath);
17
+ const generate = async () => {
18
+ const { globby } = await import("globby");
19
+ const fileNames = await globby(basePath.replace(/\\/g, "/") + "**/*.js");
20
+ return Promise.all(fileNames.map(replaceGlobalCoreUsage).filter(x => !!x));
21
+ };
22
+
23
+ generate().then(() => {
24
+ console.log("Success: Replaced global core usage in:", basePath);
25
+ });
@@ -8,18 +8,11 @@ const getTag = file => {
8
8
  return matches ? matches[1] : undefined;
9
9
  };
10
10
 
11
- const getAltTag = file => {
12
- const fileContent = String(fs.readFileSync(file)).replace(/\n/g, "");
13
- const matches = fileContent.match(/\baltTag\b:\s*\"(.*?)\"/);
14
- return matches ? matches[1] : undefined;
15
- };
16
-
17
11
  const getPackageTags = (packageDir) => {
18
12
  const srcDir = path.join(packageDir, "src/");
19
- return glob.sync(path.join(srcDir, "/**/*.js")).flatMap(file => {
13
+ return glob.sync(path.join(srcDir, "/**/*.ts")).flatMap(file => {
20
14
  const tag = getTag(file);
21
- const altTag = getAltTag(file);
22
- return [tag, altTag];
15
+ return [tag];
23
16
  }).filter(item => !!item);
24
17
  };
25
18
 
@@ -10,7 +10,7 @@ const errors = [];
10
10
  glob.sync(path.join(process.cwd(), "src/**/*.css")).forEach(file => {
11
11
  let content = String(fs.readFileSync(file));
12
12
  tags.forEach(tag => {
13
- if (content.match(new RegExp(`(^|[^\-_A-Za-z0-9"\[])(${tag})([^\-_A-Za-z0-9]|$)`, "g"))) {
13
+ if (content.match(new RegExp(`(^|[^\.\-_A-Za-z0-9"\[])(${tag})([^\-_A-Za-z0-9]|$)`, "g"))) {
14
14
  errors.push(`Warning! ${tag} found in ${file}`);
15
15
  }
16
16
  });
@@ -0,0 +1,65 @@
1
+ const fs = require("fs");
2
+ const glob = require("glob");
3
+ const path = require("path");
4
+ const process = require("process");
5
+
6
+ const projectPath = process.argv[2];
7
+
8
+ // gather all tags from all files
9
+ const tagsToFiles = new Map();
10
+ const filesToTags = new Map();
11
+
12
+ let files = [
13
+ ...glob.sync(path.join("packages/main/src/**/*.js")),
14
+ ...glob.sync(path.join("packages/fiori/src/**/*.js")),
15
+ ];
16
+ files.forEach(file => {
17
+ let matches = file.match(/([a-zA-Z0-9_]+)\.js$/);
18
+ const name = matches[1];
19
+
20
+ const content = `${fs.readFileSync(file)}`;
21
+ matches = content.match(/tag: "(.*?)",/);
22
+ if (matches) {
23
+ const tag = matches[1];
24
+ tagsToFiles.set(tag, name);
25
+ filesToTags.set(name, tag);
26
+ }
27
+ });
28
+
29
+ // Process the package
30
+ files = glob.sync(path.join(projectPath, "src/**/*.js"));
31
+ tagsToFiles.forEach((file, tag) => {
32
+ const sourcePath = path.join(projectPath, "src/", `${file}.js`);
33
+ if (!fs.existsSync(sourcePath)) {
34
+ return;
35
+ }
36
+ const sourceContent = `${fs.readFileSync(sourcePath)}`.split("\n").join(" ");
37
+
38
+ const hbsPath = path.join(projectPath, "src/", `${file}.hbs`);
39
+ const hbsContent = fs.existsSync(hbsPath) ? `${fs.readFileSync(hbsPath)}` : "";
40
+
41
+ const hbsPopoverPath = path.join(projectPath, "src/", `${file}Popover.hbs`);
42
+ const hbsPopoverContent = fs.existsSync(hbsPopoverPath) ? `${fs.readFileSync(hbsPopoverPath)}` : "";
43
+
44
+ // deps
45
+ let deps = [];
46
+ let matches = sourceContent.match(/static get dependencies\(\) \{\s+return \[(.*?)\]/);
47
+ if (matches) {
48
+ deps = matches[1].split(",").map(x => x.trim()).filter(x => !!x);
49
+ }
50
+
51
+ // tags
52
+ matches = [
53
+ ...hbsContent.matchAll(/<ui5-[a-z0-9-]+/g),
54
+ ...hbsPopoverContent.matchAll(/<ui5-[a-z0-9-]+/g),
55
+ ];
56
+ if (matches) {
57
+ matches.forEach(match => {
58
+ const tagUsed = match[0].substr(1);
59
+ const dep = tagsToFiles.get(tagUsed);
60
+ if (!deps.includes(dep)) {
61
+ console.log(`${file} used ${tagUsed}`);
62
+ }
63
+ });
64
+ }
65
+ });
@@ -0,0 +1,28 @@
1
+ const fs = require("fs");
2
+ const glob = require("glob");
3
+ const path = require("path");
4
+ const process = require("process");
5
+
6
+ // gather all tags from all files
7
+ const tags = new Set();
8
+ const files = glob.sync(path.join(process.argv[2], "src/**/*.js"));
9
+ files.forEach(file => {
10
+ const content = `${fs.readFileSync(file)}`;
11
+ const matches = content.match(/tag: "(.*?)",/);
12
+ if (matches) {
13
+ tags.add(matches[1]);
14
+ }
15
+ });
16
+
17
+ // report all usages of any tag within any file, which is not the tag definition and is not hasAttribute
18
+ files.forEach(file => {
19
+ const content = `${fs.readFileSync(file)}`;
20
+ const lines = content.split("\n");
21
+ lines.forEach(line => {
22
+ tags.forEach(tag => {
23
+ if (line.includes(`"${tag}"`) && !line.includes(`tag: "${tag}",`) && !line.includes(`hasAttribute("${tag}")`)) {
24
+ console.log(`${file}: ${line.trim()}`);
25
+ }
26
+ });
27
+ });
28
+ });
@@ -18,6 +18,7 @@ const replaceTagsHTML = content => {
18
18
 
19
19
  // Replace tags in any content
20
20
  const replaceTagsAny = content => {
21
+ console.log(tags.length);
21
22
  tags.forEach(tag => {
22
23
  content = content.replace(new RegExp(`(^|[^\-_A-Za-z0-9])(${tag})([^\-_A-Za-z0-9]|$)`, "g"), `$1$2-${suffix}$3`);
23
24
  });
@@ -27,7 +28,7 @@ const replaceTagsAny = content => {
27
28
  // Replace bundle names and HTML tag names in test pages
28
29
  glob.sync(path.join(root, "/**/*.html")).forEach(file => {
29
30
  let content = String(fs.readFileSync(file));
30
- content = content.replace(/bundle\.(.*?)\.js/g, `bundle.scoped.$1.js`);
31
+ content = content.replace("%VITE_BUNDLE_PATH%", "%VITE_BUNDLE_PATH_SCOPED%");
31
32
  content = replaceTagsHTML(content);
32
33
  fs.writeFileSync(file, content);
33
34
  });
@@ -0,0 +1,71 @@
1
+ const child_process = require("child_process");
2
+ const { readFileSync } = require("fs");
3
+ const path = require("path");
4
+ const fs = require("fs");
5
+
6
+ // search for dev-server port
7
+ // start in current folder
8
+ // traversing upwards in case of mono repo tests and dev-server running in root folder of repository
9
+ let devServerFolder = process.cwd();
10
+ let devServerPort;
11
+ while (true) {
12
+ try {
13
+ devServerPort = readFileSync(path.join(devServerFolder, ".dev-server-port")).toString();
14
+ break; // found
15
+ } catch (e) {
16
+ // file not found
17
+ if (devServerFolder === path.dirname(devServerFolder)) {
18
+ break; // reached root folder "/"
19
+ }
20
+ devServerFolder = path.dirname(devServerFolder);
21
+ }
22
+ }
23
+
24
+ // check if we are in a monorepo and extract path from package.json
25
+ let packageRepositoryPath = "";
26
+ const pkg = require(path.join(process.cwd(), "package.json"));
27
+ packageRepositoryPath = pkg.repository ? pkg.repository.directory : "";
28
+
29
+ // construct base url
30
+ // use devServerPort if a dev server is running, otherwise let the baseUrl in the wdio config be used
31
+ // if a dev server is running in the root of a mono repo, append tha package path like this
32
+ // http://localhost:${devServerPort}/packages/main/
33
+ let baseUrl = "";
34
+ if (devServerPort) {
35
+ console.log(`Found port ${devServerPort} from '${path.join(devServerFolder, ".dev-server-port")}'`);
36
+ const devServerInRoot = !devServerFolder.includes(packageRepositoryPath);
37
+ if (devServerInRoot) {
38
+ baseUrl = `--base-url http://localhost:${devServerPort}/${packageRepositoryPath}/`;
39
+ } else {
40
+ baseUrl = `--base-url http://localhost:${devServerPort}/`;
41
+ }
42
+ }
43
+
44
+ if (!baseUrl) {
45
+ console.log("No dev server running, running tests served from `dist`, make sure it is up to date");
46
+ }
47
+
48
+ // add single spec parameter if passed
49
+ let spec = "";
50
+ if (process.argv.length === 3) {
51
+ const specFile = process.argv[2];
52
+ spec = `--spec ${specFile}`;
53
+ }
54
+
55
+ // more parameters - pass them to wdio
56
+ let restParams = "";
57
+ if (process.argv.length > 3) {
58
+ restParams = process.argv.slice(2).join(" ");
59
+ }
60
+
61
+ let wdioConfig = "";
62
+ if (fs.existsSync("config/wdio.conf.cjs")) {
63
+ wdioConfig = "config/wdio.conf.cjs";
64
+ } else if (fs.existsSync("config/wdio.conf.js")) {
65
+ wdioConfig = "config/wdio.conf.js";
66
+ }
67
+
68
+ // run wdio with calculated parameters
69
+ const cmd = `yarn cross-env WDIO_LOG_LEVEL=error wdio ${wdioConfig} ${spec} ${baseUrl} ${restParams}`;
70
+ console.log(`executing: ${cmd}`);
71
+ child_process.execSync(cmd, {stdio: 'inherit'});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "0.0.0-f734ea2da",
3
+ "version": "0.0.0-f79db712b",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -13,8 +13,7 @@
13
13
  "scripts": {},
14
14
  "bin": {
15
15
  "wc-dev": "bin/dev.js",
16
- "wc-create-ui5-element": "bin/create-ui5-element.js",
17
- "wc-init-ui5-package": "bin/init-ui5-package.js"
16
+ "wc-create-ui5-element": "bin/create-ui5-element.js"
18
17
  },
19
18
  "repository": {
20
19
  "type": "git",
@@ -22,63 +21,62 @@
22
21
  "directory": "packages/tools"
23
22
  },
24
23
  "dependencies": {
25
- "@babel/cli": "^7.13.10",
26
- "@babel/core": "^7.13.10",
27
- "@babel/plugin-proposal-object-rest-spread": "^7.13.8",
28
- "@babel/preset-env": "^7.13.10",
29
- "@rollup/plugin-babel": "^5.3.0",
30
- "@rollup/plugin-json": "^4.1.0",
31
- "@rollup/plugin-node-resolve": "^11.2.0",
32
- "@rollup/plugin-url": "^6.0.0",
33
- "@wdio/cli": "^7.2.0",
34
- "@wdio/dot-reporter": "^7.2.0",
35
- "@wdio/local-runner": "^7.2.0",
36
- "@wdio/mocha-framework": "^7.2.0",
37
- "@wdio/spec-reporter": "^7.2.0",
38
- "@wdio/sync": "^7.2.0",
39
- "@webcomponents/webcomponentsjs": "^2.5.0",
24
+ "@custom-elements-manifest/analyzer": "^0.8.4",
25
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
26
+ "@typescript-eslint/parser": "^6.9.0",
27
+ "@wdio/cli": "^7.19.7",
28
+ "@wdio/dot-reporter": "^7.19.7",
29
+ "@wdio/local-runner": "^7.19.7",
30
+ "@wdio/mocha-framework": "^7.19.7",
31
+ "@wdio/spec-reporter": "^7.19.7",
32
+ "@wdio/static-server-service": "^7.19.5",
33
+ "ajv": "^8.12.0",
40
34
  "chai": "^4.3.4",
41
35
  "child_process": "^1.0.2",
42
36
  "chokidar": "^3.5.1",
43
- "chokidar-cli": "^2.1.0",
44
- "clean-css": "^5.1.1",
45
- "colors": "^1.4.0",
37
+ "chokidar-cli": "^3.0.0",
46
38
  "command-line-args": "^5.1.1",
39
+ "comment-parser": "^1.4.0",
47
40
  "concurrently": "^6.0.0",
48
41
  "cross-env": "^7.0.3",
49
- "cssnano": "^4.1.10",
50
42
  "escodegen": "^2.0.0",
51
43
  "eslint": "^7.22.0",
52
44
  "eslint-config-airbnb-base": "^14.2.1",
53
45
  "eslint-plugin-import": "^2.22.1",
54
46
  "esprima": "^4.0.1",
55
- "folder-hash": "^4.0.1",
56
47
  "getopts": "^2.3.0",
57
48
  "glob": "^7.1.6",
49
+ "glob-parent": "^6.0.2",
50
+ "globby": "^13.1.1",
58
51
  "handlebars": "^4.7.7",
59
- "is-port-reachable": "^3.0.0",
52
+ "is-port-reachable": "^3.1.0",
60
53
  "jsdoc": "^3.6.6",
61
54
  "json-beautify": "^1.1.1",
62
55
  "mkdirp": "^1.0.4",
63
- "npm-run-all": "^4.1.3",
64
56
  "nps": "^5.10.0",
65
- "postcss": "^8.2.8",
66
- "postcss-cli": "^8.3.1",
67
- "postcss-combine-duplicated-selectors": "^10.0.2",
68
- "postcss-import": "^14.0.0",
57
+ "postcss": "^8.4.5",
58
+ "postcss-cli": "^9.1.0",
59
+ "postcss-selector-parser": "^6.0.10",
60
+ "prompts": "^2.4.2",
69
61
  "properties-reader": "^2.2.0",
70
- "puppeteer": "^8.0.0",
71
62
  "recursive-readdir": "^2.2.2",
63
+ "resolve": "^1.20.0",
72
64
  "rimraf": "^3.0.2",
73
- "rollup": "^2.41.4",
74
- "rollup-plugin-filesize": "^9.1.1",
75
- "rollup-plugin-livereload": "^2.0.0",
76
- "rollup-plugin-string": "^3.0.0",
77
- "rollup-plugin-terser": "^7.0.2",
78
- "serve": "^12.0.0",
79
- "wdio-chromedriver-service": "^7.0.0"
65
+ "slash": "3.0.0",
66
+ "vite": "^4.4.9",
67
+ "wdio-chromedriver-service": "^7.3.2"
80
68
  },
81
69
  "peerDependencies": {
82
- "chromedriver": "*"
70
+ "chromedriver": "*",
71
+ "typescript": "^4.9.4"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "typescript": {
75
+ "optional": true
76
+ }
77
+ },
78
+ "devDependencies": {
79
+ "esbuild": "^0.19.9",
80
+ "yargs": "^17.5.1"
83
81
  }
84
82
  }
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../lib/init-package/index.js");