@ui5/webcomponents-tools 0.0.0-e463d2345 → 0.0.0-e55c2cec6

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 (86) hide show
  1. package/CHANGELOG.md +319 -1
  2. package/README.md +5 -6
  3. package/assets-meta.js +153 -0
  4. package/bin/dev.js +12 -1
  5. package/components-package/eslint.js +28 -0
  6. package/components-package/nps.js +99 -42
  7. package/components-package/postcss.themes.js +6 -3
  8. package/components-package/vite.config.js +12 -0
  9. package/components-package/wdio.js +125 -65
  10. package/components-package/wdio.sync.js +360 -0
  11. package/icons-collection/nps.js +67 -28
  12. package/lib/copy-and-watch/index.js +145 -0
  13. package/lib/copy-list/index.js +28 -0
  14. package/lib/create-icons/index.js +101 -50
  15. package/lib/create-illustrations/index.js +161 -0
  16. package/lib/create-new-component/index.js +23 -11
  17. package/lib/dev-server/dev-server.js +66 -0
  18. package/lib/dev-server/virtual-index-html-plugin.js +53 -0
  19. package/lib/esm-abs-to-rel/index.js +58 -0
  20. package/lib/generate-custom-elements-manifest/index.js +373 -0
  21. package/lib/generate-js-imports/illustrations.js +72 -0
  22. package/lib/generate-json-imports/i18n.js +98 -47
  23. package/lib/generate-json-imports/themes.js +71 -16
  24. package/lib/hbs2lit/index.js +2 -4
  25. package/lib/hbs2lit/src/compiler.js +26 -8
  26. package/lib/hbs2lit/src/includesReplacer.js +23 -17
  27. package/lib/hbs2lit/src/litVisitor2.js +103 -19
  28. package/lib/hbs2lit/src/svgProcessor.js +3 -3
  29. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +5 -5
  30. package/lib/hbs2ui5/index.js +52 -30
  31. package/lib/i18n/defaults.js +72 -52
  32. package/lib/i18n/toJSON.js +25 -13
  33. package/lib/jsdoc/config.json +1 -1
  34. package/lib/jsdoc/configTypescript.json +29 -0
  35. package/lib/jsdoc/plugin.js +65 -4
  36. package/lib/jsdoc/preprocess.js +146 -0
  37. package/lib/jsdoc/template/publish.js +32 -4
  38. package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
  39. package/lib/postcss-css-to-esm/index.js +45 -21
  40. package/lib/postcss-css-to-json/index.js +38 -11
  41. package/lib/postcss-new-files/index.js +36 -0
  42. package/lib/postcss-p/postcss-p.mjs +14 -0
  43. package/lib/replace-global-core/index.js +25 -0
  44. package/lib/scoping/get-all-tags.js +37 -0
  45. package/lib/scoping/lint-src.js +31 -0
  46. package/lib/scoping/missing-dependencies.js +65 -0
  47. package/lib/scoping/report-tags-usage.js +28 -0
  48. package/lib/scoping/scope-test-pages.js +40 -0
  49. package/lib/test-runner/test-runner.js +63 -0
  50. package/package.json +48 -55
  51. package/bin/init-ui5-package.js +0 -3
  52. package/components-package/rollup.js +0 -134
  53. package/components-package/serve.json +0 -3
  54. package/lib/documentation/index.js +0 -143
  55. package/lib/documentation/templates/api-component-since.js +0 -3
  56. package/lib/documentation/templates/api-css-variables-section.js +0 -24
  57. package/lib/documentation/templates/api-events-section.js +0 -35
  58. package/lib/documentation/templates/api-methods-section.js +0 -26
  59. package/lib/documentation/templates/api-properties-section.js +0 -40
  60. package/lib/documentation/templates/api-slots-section.js +0 -28
  61. package/lib/documentation/templates/template.js +0 -38
  62. package/lib/init-package/index.js +0 -119
  63. package/lib/init-package/resources/.eslintignore +0 -3
  64. package/lib/init-package/resources/bundle.es5.js +0 -25
  65. package/lib/init-package/resources/bundle.esm.js +0 -34
  66. package/lib/init-package/resources/config/.eslintrc.js +0 -1
  67. package/lib/init-package/resources/config/postcss.components/postcss.config.js +0 -1
  68. package/lib/init-package/resources/config/postcss.themes/postcss.config.js +0 -1
  69. package/lib/init-package/resources/config/rollup.config.js +0 -1
  70. package/lib/init-package/resources/config/wdio.conf.js +0 -1
  71. package/lib/init-package/resources/package-scripts.js +0 -11
  72. package/lib/init-package/resources/src/Assets.js +0 -6
  73. package/lib/init-package/resources/src/Demo.hbs +0 -1
  74. package/lib/init-package/resources/src/Demo.js +0 -57
  75. package/lib/init-package/resources/src/i18n/messagebundle.properties +0 -2
  76. package/lib/init-package/resources/src/i18n/messagebundle_de.properties +0 -1
  77. package/lib/init-package/resources/src/i18n/messagebundle_en.properties +0 -1
  78. package/lib/init-package/resources/src/i18n/messagebundle_es.properties +0 -1
  79. package/lib/init-package/resources/src/i18n/messagebundle_fr.properties +0 -1
  80. package/lib/init-package/resources/src/themes/Demo.css +0 -11
  81. package/lib/init-package/resources/src/themes/sap_belize/parameters-bundle.css +0 -3
  82. package/lib/init-package/resources/src/themes/sap_belize_hcb/parameters-bundle.css +0 -3
  83. package/lib/init-package/resources/src/themes/sap_fiori_3/parameters-bundle.css +0 -3
  84. package/lib/init-package/resources/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
  85. package/lib/init-package/resources/test/pages/index.html +0 -51
  86. package/lib/init-package/resources/test/specs/Demo.spec.js +0 -12
@@ -0,0 +1,36 @@
1
+ const chokidar = require("chokidar");
2
+ const commandLineArgs = require("command-line-args");
3
+ const { exec } = require("child_process");
4
+
5
+ const options = commandLineArgs([
6
+ { name: "srcFiles", type: String },
7
+ ]);
8
+
9
+ const runPostcss = path => {
10
+ let command = `postcss ${path} --config config/postcss.components --base src --dir dist/css/`;
11
+ console.log(`Executing: ${command}`);
12
+ exec(command, (err, stdout, stderr) => {
13
+ if (err) {
14
+ console.log(`Could not run postcss for ${path}. Error: ${err}`);
15
+ }
16
+ });
17
+
18
+ command = `${command} -w`;
19
+ console.log(`Executing: ${command}`);
20
+ exec(command, (err, stdout, stderr) => {
21
+ if (err) {
22
+ console.log(`Could not run postcss in watch mode for ${path}. Error: ${err}`);
23
+ }
24
+ });
25
+ };
26
+
27
+ let ready = false; // Do nothing until the ready event has been fired (we don't want to recompile all files initially)
28
+ const watcher = chokidar.watch(options.srcFiles);
29
+ watcher.on("ready", () => {
30
+ ready = true; // Initial scan is over -> waiting for new files
31
+ });
32
+ watcher.on("add", path => {
33
+ if (ready) {
34
+ runPostcss(path);
35
+ }
36
+ });
@@ -0,0 +1,14 @@
1
+ import 'zx/globals';
2
+
3
+ // don't print executed commands and their output
4
+ $.verbose = false;
5
+
6
+ const inputFiles = await globby("src/**/parameters-bundle.css");
7
+
8
+ const restArgs = process.argv.slice(2);
9
+
10
+ // run all postcss processes in parallel as passing the glob directly to postcss makes them processed sequentially.
11
+ // and the amount of imports give a big speed up when run in parallel
12
+ await Promise.all(inputFiles.map(file => {
13
+ return $`postcss ${file} --config config/postcss.themes --base src --dir dist/css/ ${restArgs}`;
14
+ }));
@@ -0,0 +1,25 @@
1
+ const fs = require("fs").promises;
2
+
3
+ const basePath = process.argv[2];
4
+
5
+ const replaceGlobalCoreUsage = async (srcPath) => {
6
+
7
+ const original = (await fs.readFile(srcPath)).toString();
8
+ let replaced = original.replace(/sap\.ui\.getCore\(\)/g, `Core`);
9
+
10
+ if (original !== replaced) {
11
+ replaced = `import Core from 'sap/ui/core/Core';
12
+ ${replaced}`;
13
+ return fs.writeFile(srcPath, replaced);
14
+ }
15
+ };
16
+
17
+ const generate = async () => {
18
+ const { globby } = await import("globby");
19
+ const fileNames = await globby(basePath + "**/*.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
+ });
@@ -0,0 +1,37 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const glob = require("glob");
4
+
5
+ const getTag = file => {
6
+ const fileContent = String(fs.readFileSync(file)).replace(/\n/g, "");
7
+ const matches = fileContent.match(/\btag\b:\s*\"(.*?)\"/);
8
+ return matches ? matches[1] : undefined;
9
+ };
10
+
11
+ const getPackageTags = (packageDir) => {
12
+ const srcDir = path.join(packageDir, "src/");
13
+ return glob.sync(path.join(srcDir, "/**/*.js")).flatMap(file => {
14
+ const tag = getTag(file);
15
+ return [tag];
16
+ }).filter(item => !!item);
17
+ };
18
+
19
+ const isComponentsPackage = (packageFileContent) => {
20
+ return packageFileContent.ui5 && packageFileContent.ui5.webComponentsPackage;
21
+ };
22
+
23
+ const getDepComponentPackages = packageDir => {
24
+ const packageFile = path.join(packageDir, "package.json");
25
+ const packageFileContent = JSON.parse(fs.readFileSync(packageFile));
26
+ if (!isComponentsPackage(packageFileContent)) {
27
+ return [];
28
+ }
29
+
30
+ return Object.keys(packageFileContent.dependencies || {}).map(dep => path.dirname(require.resolve(path.join(dep, "package.json"))));
31
+ };
32
+
33
+ const getAllTags = (packageDir) => {
34
+ return getPackageTags(packageDir).concat(getDepComponentPackages(packageDir).flatMap(getPackageTags));
35
+ };
36
+
37
+ module.exports = getAllTags;
@@ -0,0 +1,31 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const glob = require("glob");
4
+ const getAllTags = require("./get-all-tags.js");
5
+
6
+ const tags = getAllTags(process.cwd());
7
+
8
+ const errors = [];
9
+
10
+ glob.sync(path.join(process.cwd(), "src/**/*.css")).forEach(file => {
11
+ let content = String(fs.readFileSync(file));
12
+ tags.forEach(tag => {
13
+ if (content.match(new RegExp(`(^|[^\.\-_A-Za-z0-9"\[])(${tag})([^\-_A-Za-z0-9]|$)`, "g"))) {
14
+ errors.push(`Warning! ${tag} found in ${file}`);
15
+ }
16
+ });
17
+ });
18
+
19
+ glob.sync(path.join(process.cwd(), "src/**/*.js")).forEach(file => {
20
+ let content = String(fs.readFileSync(file));
21
+ tags.forEach(tag => {
22
+ if (content.match(new RegExp(`querySelector[A-Za-z]*..${tag}`, "g"))) {
23
+ errors.push(`Warning! querySelector for ${tag} found in ${file}`);
24
+ }
25
+ });
26
+ });
27
+
28
+ if (errors.length) {
29
+ errors.forEach(error => console.log(error));
30
+ throw new Error("Errors found.");
31
+ }
@@ -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
+ });
@@ -0,0 +1,40 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const glob = require("glob");
4
+ const getAllTags = require("./get-all-tags.js");
5
+
6
+ const root = process.argv[2];
7
+ const suffix = process.argv[3];
8
+
9
+ const tags = getAllTags(process.cwd());
10
+
11
+ // Replaces tags in HTML content, f.e. <ui5-button> with <ui5-button-ver> or </ui5-button> with </ui5-button-ver>
12
+ const replaceTagsHTML = content => {
13
+ tags.forEach(tag => {
14
+ content = content.replace(new RegExp(`(<\/?)(${tag})(\/?[> \t\n])`, "g"), `$1$2-${suffix}$3`);
15
+ });
16
+ return content;
17
+ };
18
+
19
+ // Replace tags in any content
20
+ const replaceTagsAny = content => {
21
+ tags.forEach(tag => {
22
+ content = content.replace(new RegExp(`(^|[^\-_A-Za-z0-9])(${tag})([^\-_A-Za-z0-9]|$)`, "g"), `$1$2-${suffix}$3`);
23
+ });
24
+ return content;
25
+ };
26
+
27
+ // Replace bundle names and HTML tag names in test pages
28
+ glob.sync(path.join(root, "/**/*.html")).forEach(file => {
29
+ let content = String(fs.readFileSync(file));
30
+ content = content.replace(/bundle\.(.*?)\.js/g, `../bundle.scoped.$1.js`);
31
+ content = replaceTagsHTML(content);
32
+ fs.writeFileSync(file, content);
33
+ });
34
+
35
+ // Replace tag names everywhere
36
+ glob.sync(path.join(root, "/**/*.{html,css,js}")).forEach(file => {
37
+ let content = String(fs.readFileSync(file));
38
+ content = replaceTagsAny(content);
39
+ fs.writeFileSync(file, content);
40
+ });
@@ -0,0 +1,63 @@
1
+ const child_process = require("child_process");
2
+ const { readFileSync } = require("fs");
3
+ const path = require("path");
4
+
5
+ // search for dev-server port
6
+ // start in current folder
7
+ // traversing upwards in case of mono repo tests and dev-server running in root folder of repository
8
+ let devServerFolder = process.cwd();
9
+ let devServerPort;
10
+ while (true) {
11
+ try {
12
+ devServerPort = readFileSync(path.join(devServerFolder, ".dev-server-port")).toString();
13
+ break; // found
14
+ } catch (e) {
15
+ // file not found
16
+ if (devServerFolder === path.dirname(devServerFolder)) {
17
+ break; // reached root folder "/"
18
+ }
19
+ devServerFolder = path.dirname(devServerFolder);
20
+ }
21
+ }
22
+
23
+ // check if we are in a monorepo and extract path from package.json
24
+ let packageRepositoryPath = "";
25
+ const pkg = require(path.join(process.cwd(), "package.json"));
26
+ packageRepositoryPath = pkg.repository.directory;
27
+
28
+ // construct base url
29
+ // use devServerPort if a dev server is running, otherwise let the baseUrl in the wdio config be used
30
+ // if a dev server is running in the root of a mono repo, append tha package path like this
31
+ // http://localhost:${devServerPort}/packages/main/
32
+ let baseUrl = "";
33
+ if (devServerPort) {
34
+ console.log(`Found port ${devServerPort} from '${path.join(devServerFolder, ".dev-server-port")}'`);
35
+ const devServerInRoot = !devServerFolder.includes(packageRepositoryPath);
36
+ if (devServerInRoot) {
37
+ baseUrl = `--base-url http://localhost:${devServerPort}/${packageRepositoryPath}/`;
38
+ } else {
39
+ baseUrl = `--base-url http://localhost:${devServerPort}/`;
40
+ }
41
+ }
42
+
43
+ if (!baseUrl) {
44
+ console.log("No dev server running, running tests served from `dist`, make sure it is up to date");
45
+ }
46
+
47
+ // add single spec parameter if passed
48
+ let spec = "";
49
+ if (process.argv.length === 3) {
50
+ const specFile = process.argv[2];
51
+ spec = `--spec ${specFile}`;
52
+ }
53
+
54
+ // more parameters - pass them to wdio
55
+ let restParams = "";
56
+ if (process.argv.length > 3) {
57
+ restParams = process.argv.slice(2).join(" ");
58
+ }
59
+
60
+ // run wdio with calculated parameters
61
+ const cmd = `yarn cross-env WDIO_LOG_LEVEL=error wdio config/wdio.conf.js ${spec} ${baseUrl} ${restParams}`;
62
+ console.log(`executing: ${cmd}`);
63
+ 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-e463d2345",
3
+ "version": "0.0.0-e55c2cec6",
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,61 +21,55 @@
22
21
  "directory": "packages/tools"
23
22
  },
24
23
  "dependencies": {
25
- "@babel/cli": "^7.1.2",
26
- "@babel/core": "^7.1.2",
27
- "@babel/plugin-proposal-object-rest-spread": "^7.3.2",
28
- "@babel/preset-env": "^7.1.0",
29
- "@wdio/cli": "^5.12.1",
30
- "@wdio/dot-reporter": "^5.12.1",
31
- "@wdio/local-runner": "^5.12.1",
32
- "@wdio/mocha-framework": "^5.12.1",
33
- "@wdio/spec-reporter": "^5.12.1",
34
- "@wdio/sync": "^5.12.1",
35
- "@webcomponents/webcomponentsjs": "^2.4.0",
36
- "chai": "^4.2.0",
37
- "chokidar-cli": "^2.0.0",
38
- "chromedriver": "^79.0.0",
39
- "clean-css": "^4.2.1",
24
+ "@typescript-eslint/eslint-plugin": "^5.42.1",
25
+ "@typescript-eslint/parser": "^5.42.1",
26
+ "@wdio/cli": "^7.19.7",
27
+ "@wdio/devtools-service": "^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
+ "chai": "^4.3.4",
34
+ "child_process": "^1.0.2",
35
+ "chokidar": "^3.5.1",
36
+ "chokidar-cli": "^3.0.0",
40
37
  "command-line-args": "^5.1.1",
41
- "concurrently": "^5.0.0",
42
- "copy-and-watch": "^0.1.4",
43
- "cross-env": "^5.2.0",
44
- "cssnano": "^4.1.10",
45
- "escodegen": "^1.11.0",
46
- "eslint": "^5.10.0",
47
- "eslint-config-airbnb-base": "^13.1.0",
48
- "eslint-plugin-import": "^2.14.0",
38
+ "concurrently": "^6.0.0",
39
+ "cross-env": "^7.0.3",
40
+ "cssnano": "^4.1.11",
41
+ "escodegen": "^2.0.0",
42
+ "eslint": "^7.22.0",
43
+ "eslint-config-airbnb-base": "^14.2.1",
44
+ "eslint-plugin-import": "^2.22.1",
49
45
  "esprima": "^4.0.1",
50
- "getopts": "^2.2.3",
51
- "glob": "^7.1.3",
52
- "handlebars": "^4.1.2",
53
- "jsdoc": "^3.6.3",
46
+ "getopts": "^2.3.0",
47
+ "glob": "^7.1.6",
48
+ "glob-parent": "^6.0.2",
49
+ "globby": "^13.1.1",
50
+ "handlebars": "^4.7.7",
51
+ "is-port-reachable": "^3.1.0",
52
+ "jsdoc": "^3.6.6",
54
53
  "json-beautify": "^1.1.1",
55
- "mkdirp": "^0.5.1",
56
- "npm-run-all": "^4.1.3",
57
- "nps": "^5.9.8",
58
- "postcss": "^7.0.18",
59
- "postcss-cli": "^6.1.3",
60
- "postcss-combine-duplicated-selectors": "^7.0.0",
61
- "postcss-import": "^12.0.1",
62
- "properties-reader": "^0.3.1",
63
- "puppeteer": "^1.11.0",
64
- "rimraf": "^2.6.2",
65
- "rollup": "^1.1.2",
66
- "rollup-plugin-babel": "^4.0.3",
67
- "rollup-plugin-filesize": "^6.0.1",
68
- "rollup-plugin-less": "^1.1.2",
69
- "rollup-plugin-livereload": "^1.0.4",
70
- "rollup-plugin-node-resolve": "^4.0.0",
71
- "rollup-plugin-notify": "^1.1.0",
72
- "rollup-plugin-string": "^2.0.2",
73
- "rollup-plugin-terser": "^5.1.3",
74
- "rollup-plugin-url": "^2.2.0",
75
- "rollup-plugin-visualizer": "^0.9.2",
76
- "serve": "^10.1.1",
77
- "wdio-chromedriver-service": "^5.0.2"
54
+ "mkdirp": "^1.0.4",
55
+ "nps": "^5.10.0",
56
+ "postcss": "^8.4.5",
57
+ "postcss-cli": "^9.1.0",
58
+ "postcss-import": "^14.0.2",
59
+ "postcss-selector-parser": "^6.0.10",
60
+ "properties-reader": "^2.2.0",
61
+ "recursive-readdir": "^2.2.2",
62
+ "resolve": "^1.20.0",
63
+ "rimraf": "^3.0.2",
64
+ "slash": "3.0.0",
65
+ "vite": "^2.9.12",
66
+ "wdio-chromedriver-service": "^7.3.2",
67
+ "zx": "^4.3.0"
78
68
  },
79
- "resolutions": {
80
- "rollup-plugin-livereload/livereload/chokidar": "^3.x"
69
+ "peerDependencies": {
70
+ "chromedriver": "*"
71
+ },
72
+ "devDependencies": {
73
+ "yargs": "^17.5.1"
81
74
  }
82
75
  }
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../lib/init-package/index.js");
@@ -1,134 +0,0 @@
1
- const babel = require("rollup-plugin-babel");
2
- const process = require("process");
3
- const resolve = require("rollup-plugin-node-resolve");
4
- const url = require("rollup-plugin-url");
5
- const { terser } = require("rollup-plugin-terser");
6
- const notify = require('rollup-plugin-notify');
7
- const filesize = require('rollup-plugin-filesize');
8
- const livereload = require('rollup-plugin-livereload');
9
- const os = require("os");
10
- const fs = require("fs");
11
-
12
- const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
13
- const DEPLOY_PUBLIC_PATH = process.env.DEPLOY_PUBLIC_PATH || "";
14
-
15
- function ui5DevImportCheckerPlugin() {
16
- return {
17
- name: "ui5-dev-import-checker-plugin",
18
- transform(code, file) {
19
- const re = new RegExp(`^import.*"${packageName}/`);
20
- if (re.test(code)) {
21
- throw new Error(`illegal import in ${file}`);
22
- }
23
- }
24
- };
25
- }
26
-
27
- const getPlugins = ({ transpile }) => {
28
- const plugins = [];
29
- let publicPath = DEPLOY_PUBLIC_PATH || "/resources/";
30
-
31
- if (!process.env.DEV) {
32
- plugins.push(filesize({
33
- render : function (options, bundle, { minSize, gzipSize, brotliSize, bundleSize }){
34
- return gzipSize;
35
- }
36
- }));
37
- }
38
-
39
- plugins.push(ui5DevImportCheckerPlugin());
40
-
41
- plugins.push(url({
42
- limit: 0,
43
- include: [
44
- /.*assets\/.*\.json/
45
- ],
46
- emitFiles: true,
47
- fileName: "[name].[hash][extname]",
48
- publicPath,
49
- }));
50
-
51
-
52
- if (transpile) {
53
- plugins.push(babel({
54
- presets: ["@babel/preset-env"],
55
- exclude: "node_modules/**",
56
- sourcemap: true,
57
- }));
58
- }
59
-
60
- plugins.push(resolve());
61
-
62
- if (!process.env.DEV) {
63
- plugins.push(terser());
64
- }
65
-
66
- if (process.env.DEV) {
67
- plugins.push(notify());
68
- }
69
-
70
- const es6DevMain = process.env.DEV && !transpile && packageName === "@ui5/webcomponents";
71
- if (es6DevMain && os.platform() !== "win32") {
72
- plugins.push(livereload({
73
- watch: [
74
- "dist/resources/bundle.esm.js",
75
- "dist/**/*.html",
76
- "dist/**/*.json",
77
- ]
78
- }));
79
- }
80
-
81
- return plugins;
82
- };
83
-
84
- const getES6Config = () => {
85
- return [{
86
- input: "bundle.esm.js",
87
- output: {
88
- dir: "dist/resources",
89
- format: "esm",
90
- sourcemap: true
91
- },
92
- moduleContext: (id) => {
93
- if (id.includes("url-search-params-polyfill")) {
94
- // suppress the rollup error for this module as it uses this in the global scope correctly even without changing the context here
95
- return "window";
96
- }
97
- },
98
- watch: {
99
- clearScreen: false
100
- },
101
- plugins: getPlugins({transpile: false}),
102
- }];
103
- };
104
-
105
- const getES5Config = () => {
106
- return [ {
107
- input: "bundle.es5.js",
108
- output: {
109
- dir: "dist/resources",
110
- format: "iife",
111
- name: "sap-ui-webcomponents-bundle",
112
- extend: "true", // Whether or not to extend the global variable defined by the name option in umd or iife formats.
113
- sourcemap: true
114
- },
115
- moduleContext: (id) => {
116
- if (id.includes("url-search-params-polyfill")) {
117
- // suppress the rollup error for this module as it uses this in the global scope correctly even without changing the context here
118
- return "window";
119
- }
120
- },
121
- watch: {
122
- clearScreen: false
123
- },
124
- plugins: getPlugins({transpile: true}),
125
- }];
126
- };
127
-
128
- let config = getES6Config();
129
-
130
- if (process.env.ES5_BUILD) {
131
- config = config.concat(getES5Config());
132
- }
133
-
134
- module.exports = config;
@@ -1,3 +0,0 @@
1
- {
2
- "cleanUrls": false
3
- }