@ui5/webcomponents-tools 0.0.0-f24ff9019 → 0.0.0-f42e7c18c

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 (62) hide show
  1. package/CHANGELOG.md +955 -0
  2. package/README.md +3 -6
  3. package/assets-meta.js +5 -3
  4. package/components-package/cypress/support/commands.js +39 -0
  5. package/components-package/cypress/support/component-index.html +17 -0
  6. package/components-package/cypress/support/component.d.ts +23 -0
  7. package/components-package/cypress/support/component.js +34 -0
  8. package/components-package/cypress.config.js +19 -0
  9. package/components-package/eslint.js +90 -28
  10. package/components-package/nps.js +53 -45
  11. package/components-package/postcss.components.js +1 -24
  12. package/components-package/postcss.themes.js +1 -30
  13. package/components-package/wdio.js +415 -405
  14. package/icons-collection/nps.js +7 -5
  15. package/lib/amd-to-es6/index.js +102 -0
  16. package/lib/amd-to-es6/no-remaining-require.js +33 -0
  17. package/lib/cem/custom-elements-manifest.config.mjs +527 -0
  18. package/lib/cem/event.mjs +168 -0
  19. package/lib/cem/schema-internal.json +1413 -0
  20. package/lib/cem/schema.json +1098 -0
  21. package/lib/cem/types-internal.d.ts +808 -0
  22. package/lib/cem/types.d.ts +736 -0
  23. package/lib/cem/utils.mjs +408 -0
  24. package/lib/cem/validate.js +70 -0
  25. package/lib/create-icons/index.js +8 -6
  26. package/lib/create-illustrations/index.js +40 -33
  27. package/lib/create-new-component/index.js +4 -13
  28. package/lib/create-new-component/tsFileContentTemplate.js +4 -13
  29. package/lib/css-processors/css-processor-components.mjs +77 -0
  30. package/lib/css-processors/css-processor-themes.mjs +79 -0
  31. package/lib/css-processors/scope-variables.mjs +49 -0
  32. package/lib/{postcss-css-to-esm/index.js → css-processors/shared.mjs} +36 -50
  33. package/lib/dev-server/custom-hot-update-plugin.js +4 -4
  34. package/lib/dev-server/{dev-server.js → dev-server.mjs} +4 -4
  35. package/lib/generate-js-imports/illustrations.js +17 -14
  36. package/lib/generate-json-imports/i18n.js +45 -61
  37. package/lib/generate-json-imports/themes.js +16 -33
  38. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +12 -7
  39. package/lib/hbs2ui5/index.js +3 -3
  40. package/lib/i18n/defaults.js +3 -2
  41. package/lib/postcss-combine-duplicated-selectors/index.js +12 -5
  42. package/lib/remove-dev-mode/remove-dev-mode.mjs +37 -0
  43. package/lib/scoping/get-all-tags.js +10 -3
  44. package/lib/scoping/lint-src.js +8 -7
  45. package/lib/scoping/scope-test-pages.js +2 -1
  46. package/package.json +19 -11
  47. package/tsconfig.json +16 -0
  48. package/types/index.d.ts +1 -0
  49. package/components-package/wdio.sync.js +0 -368
  50. package/lib/create-new-component/jsFileContentTemplate.js +0 -73
  51. package/lib/esm-abs-to-rel/index.js +0 -58
  52. package/lib/generate-custom-elements-manifest/index.js +0 -327
  53. package/lib/jsdoc/config.json +0 -29
  54. package/lib/jsdoc/configTypescript.json +0 -29
  55. package/lib/jsdoc/plugin.js +0 -2468
  56. package/lib/jsdoc/preprocess.js +0 -146
  57. package/lib/jsdoc/template/publish.js +0 -4120
  58. package/lib/postcss-css-to-json/index.js +0 -47
  59. package/lib/postcss-new-files/index.js +0 -36
  60. package/lib/postcss-p/postcss-p.mjs +0 -14
  61. package/lib/postcss-scope-vars/index.js +0 -24
  62. package/lib/replace-global-core/index.js +0 -25
@@ -1,47 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const mkdirp = require('mkdirp');
4
-
5
- const proccessCSS = css => {
6
- css = css.replace(/\.sapThemeMeta[\s\S]*?:root/, ":root");
7
- css = css.replace(/\.background-image.*{.*}/, "");
8
- css = css.replace(/\.sapContrast[ ]*:root[\s\S]*?}/, "");
9
- css = css.replace(/--sapFontUrl.*\);?/, "");
10
- return css;
11
- }
12
-
13
- module.exports = function (opts) {
14
- opts = opts || {};
15
-
16
- return {
17
- postcssPlugin: 'postcss-css-to-json',
18
- OnceExit (root) {
19
- let css = root.toString();
20
- css = proccessCSS(css);
21
-
22
- const targetFile = root.source.input.from.replace(`/${opts.toReplace}/`, "/dist/generated/assets/").replace(`\\${opts.toReplace}\\`, "\\dist\\generated\\assets\\");
23
- mkdirp.sync(path.dirname(targetFile));
24
-
25
- const filePath = `${targetFile}.json`;
26
- const data = {
27
- packageName: opts.packageName,
28
- fileName: targetFile.substr(targetFile.lastIndexOf("themes")),
29
- content: css
30
- };
31
- // it seems slower to read the old content, but writing the same content with no real changes
32
- // (as in initial build and then watch mode) will cause an unnecessary dev server refresh
33
- let oldContent = "";
34
- try {
35
- oldContent = fs.readFileSync(filePath).toString();
36
- } catch (e) {
37
- // file not found
38
- }
39
- const content = JSON.stringify({_: data});
40
- if (content !== oldContent) {
41
- fs.writeFileSync(filePath, content);
42
- }
43
- }
44
- };
45
- };
46
-
47
- module.exports.postcss = true;
@@ -1,36 +0,0 @@
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
- });
@@ -1,14 +0,0 @@
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
- }));
@@ -1,24 +0,0 @@
1
- const name = "postcss-scope-vars";
2
-
3
- module.exports = (options) => {
4
- const versionStr = "v" + options?.version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-");
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;
@@ -1,25 +0,0 @@
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.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
- });