@ui5/webcomponents-tools 0.0.0-c638668a1 → 0.0.0-c6c04c609

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 (67) hide show
  1. package/CHANGELOG.md +649 -0
  2. package/README.md +6 -6
  3. package/assets-meta.js +11 -4
  4. package/bin/dev.js +1 -5
  5. package/components-package/eslint.js +34 -0
  6. package/components-package/nps.js +87 -58
  7. package/components-package/postcss.components.js +18 -15
  8. package/components-package/postcss.themes.js +21 -17
  9. package/components-package/vite.config.js +13 -0
  10. package/components-package/wdio.js +405 -369
  11. package/components-package/wdio.sync.js +10 -2
  12. package/icons-collection/nps.js +8 -11
  13. package/lib/copy-and-watch/index.js +24 -1
  14. package/lib/copy-list/index.js +17 -17
  15. package/lib/create-icons/index.js +124 -72
  16. package/lib/create-illustrations/index.js +113 -88
  17. package/lib/create-new-component/index.js +71 -104
  18. package/lib/create-new-component/jsFileContentTemplate.js +73 -0
  19. package/lib/create-new-component/tsFileContentTemplate.js +80 -0
  20. package/lib/dev-server/custom-hot-update-plugin.js +39 -0
  21. package/lib/dev-server/dev-server.js +66 -0
  22. package/lib/dev-server/virtual-index-html-plugin.js +52 -0
  23. package/lib/esm-abs-to-rel/index.js +13 -9
  24. package/lib/generate-custom-elements-manifest/index.js +327 -0
  25. package/lib/generate-js-imports/illustrations.js +83 -0
  26. package/lib/generate-json-imports/i18n.js +38 -31
  27. package/lib/generate-json-imports/themes.js +31 -24
  28. package/lib/hbs2lit/src/compiler.js +24 -4
  29. package/lib/hbs2lit/src/includesReplacer.js +5 -5
  30. package/lib/hbs2lit/src/litVisitor2.js +85 -22
  31. package/lib/hbs2lit/src/svgProcessor.js +12 -5
  32. package/lib/hbs2ui5/RenderTemplates/LitRenderer.js +32 -4
  33. package/lib/hbs2ui5/index.js +56 -23
  34. package/lib/i18n/defaults.js +65 -57
  35. package/lib/i18n/toJSON.js +12 -11
  36. package/lib/jsdoc/configTypescript.json +29 -0
  37. package/lib/jsdoc/plugin.js +41 -0
  38. package/lib/jsdoc/preprocess.js +146 -0
  39. package/lib/jsdoc/template/publish.js +21 -2
  40. package/lib/postcss-combine-duplicated-selectors/index.js +178 -0
  41. package/lib/postcss-css-to-esm/index.js +52 -7
  42. package/lib/postcss-css-to-json/index.js +13 -2
  43. package/lib/postcss-p/postcss-p.mjs +14 -0
  44. package/lib/postcss-scope-vars/index.js +59 -0
  45. package/lib/replace-global-core/index.js +13 -8
  46. package/lib/scoping/get-all-tags.js +1 -8
  47. package/lib/scoping/missing-dependencies.js +65 -0
  48. package/lib/scoping/report-tags-usage.js +28 -0
  49. package/lib/scoping/scope-test-pages.js +1 -1
  50. package/lib/test-runner/test-runner.js +71 -0
  51. package/package.json +26 -27
  52. package/components-package/rollup-plugins/empty-module.js +0 -15
  53. package/components-package/rollup.js +0 -239
  54. package/lib/documentation/index.js +0 -165
  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/hash/config.js +0 -10
  63. package/lib/hash/generate.js +0 -19
  64. package/lib/hash/upToDate.js +0 -31
  65. package/lib/polyfill-placeholder/index.js +0 -5
  66. package/lib/serve/index.js +0 -46
  67. package/lib/serve/serve.json +0 -3
@@ -1,35 +0,0 @@
1
- module.exports = {
2
- template: `
3
- {{#if events}}
4
- <h3 class="comment-api-title space-top">Events</h3>
5
- <p class="small-space-top" >This Web Component fires semantic events upon user interaction. You can bind to these events with the standard DOM APIs, such as <code>addEventListener</code>. </p>
6
-
7
- <div class="small-space-top api-table">
8
- <div class="head api-table-header-roll">
9
- <div class="cell api-table-header-cell">Name</div>
10
- <div class="cell api-table-header-cell">Description</div>
11
- </div>
12
-
13
- {{#each events}}
14
- <div class="row {{checkEven @index}}">
15
- <div class="cell api-table-content-cell api-table-content-cell-bold">{{this.name}}</div>
16
- <div class="cell api-table-content-cell api-table-content-cell-description">
17
- {{{this.description}}}
18
- {{#if this.since}}
19
- <div class="api-table-content-cell-bold api-table-content-cell-since">since v{{{this.since}}}</div>
20
- {{/if}}
21
- </div>
22
- </div>
23
-
24
- {{#each this.parameters}}
25
- <tr class="api-table-event-param">
26
- <div class="api-table-content-event-params-wrapper">
27
- <div class="cell api-table-param-name api-table-content-cell api-table-content-cell-bold">{{this.name}}</div>
28
- <div class="cell api-table-event-param-cell api-table-content-cell api-table-content-cell-description"><strong class="bold" >type:</strong> {{this.type}} <br/> <strong class="api-table-event-description bold">description:</strong> {{{this.description}}}</div>
29
- </div>
30
- </tr>
31
- {{/each}}
32
- {{/each}}
33
- </div>
34
- {{/if}}`
35
- };
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- template: `
3
- {{#if methods}}
4
- <h3 class="comment-api-title space-top">Methods</h3>
5
- <p class="small-space-top" >This Web Component exposes public methods. You can invoke them directly on the Web Component instance.</p>
6
-
7
- <div class="small-space-top api-table">
8
- <div class="head api-table-header-roll">
9
- <div class="cell api-table-header-cell">Name</div>
10
- <div class="cell api-table-header-cell">Description</div>
11
- </div>
12
-
13
- {{#each methods}}
14
- <div class="row {{checkEven @index}}">
15
- <div class="cell api-table-content-cell api-table-content-cell-bold">{{this.name}}</div>
16
- <div class="cell api-table-content-cell api-table-content-cell-description">{{{this.description}}}</div>
17
- </div>
18
-
19
- {{#each this.parameters}}
20
- <div class="cell api-table-content-cell api-table-content-cell-bold api-table-param-name">{{this.name}}</div>
21
- <div class="cell api-table-event-param-cell api-table-content-cell api-table-content-cell-description"><strong class="bold" >type:</strong> {{this.type}} <br/> <strong class="api-table-event-description bold">description:</strong> {{{this.description}}}</div>
22
- {{/each}}
23
- {{/each}}
24
- </div>
25
- {{/if}}`
26
- };
@@ -1,40 +0,0 @@
1
- module.exports = {
2
- template: `
3
- {{#if properties}}
4
- <h3 class="comment-api-title" >Properties/Attributes</h3>
5
- <p class="small-space-top" >You can use both properties and attributes with the same effect. The name of each attribute is listed below the name of the property, if different.</p>
6
-
7
- <div class="small-space-top api-table">
8
- <div class="head api-table-header-roll">
9
- <div class="cell api-table-header-cell">Name</div>
10
- <div class="cell api-table-header-cell">Type</div>
11
- <div class="cell api-table-header-cell">Default Value</div>
12
- <div class="cell api-table-header-cell">Description</div>
13
- </div>
14
-
15
- {{#each properties}}
16
- <div class="row {{checkEven @index}}">
17
- <div class="cell api-table-content-cell api-table-content-cell-bold">
18
- {{this.name}}
19
- {{#if this.readonly}}
20
- (readonly)
21
- {{/if}}
22
- <br>
23
- {{#if (toKebabCase this.name)}}
24
- <code>{{toKebabCase this.name}}</code>
25
- {{/if}}
26
- </div>
27
- <div class="cell api-table-content-cell">{{this.type}}</div>
28
- <div class="cell api-table-content-cell">{{this.defaultValue}}</div>
29
- <div class="cell api-table-content-cell api-table-content-cell-description">
30
- {{{this.description}}}
31
- {{#if this.since}}
32
- <div class="api-table-content-cell-bold api-table-content-cell-since">since v{{{this.since}}}</div>
33
- {{/if}}
34
- </div>
35
- </div>
36
- {{/each}}
37
-
38
- </div>
39
- {{/if}}`
40
- };
@@ -1,28 +0,0 @@
1
- module.exports = {
2
- template: `
3
- {{#if slots}}
4
- <h3 class="comment-api-title space-top" >Slots</h3>
5
- <p class="small-space-top" >
6
- This Element provides slot(s). This means it can display its child nodes.<br>
7
- Unless targeting the default slot, use the <code>slot</code> attribute to define the destination slot for each child.<br>
8
- Text, along with HTML Elements with no <code>slot</code> attribute, goes the the <code>default</code> slot.
9
- </p>
10
-
11
- <div class="small-space-top api-table">
12
- <div class="head api-table-header-roll">
13
- <div class="cell api-table-header-cell">Slot</div>
14
- <div class="cell api-table-header-cell">Type</div>
15
- <div class="cell api-table-header-cell">Description</div>
16
- </div>
17
-
18
- {{#each slots}}
19
- <div class="row {{checkEven @index}}">
20
- <div class="cell api-table-content-cell api-table-content-cell-bold">{{this.name}}</div>
21
- <div class="cell api-table-content-cell">{{this.type}}</div>
22
- <div class="cell api-table-content-cell api-table-content-cell-description">{{{this.description}}}</div>
23
- </div>
24
- {{/each}}
25
-
26
- </div>
27
- {{/if}}`
28
- };
@@ -1,38 +0,0 @@
1
- module.exports = {
2
- template: `
3
- <div class="page-container">
4
- <div class="api-container">
5
- <section class="component-description">
6
- {{{description}}}
7
- <section class="component-api space-top">
8
- {{> properties this}}
9
- {{> slots this}}
10
- {{> events this}}
11
- {{> methods this}}
12
- {{> cssVariables this}}
13
- </section>
14
- </section>
15
- </div>
16
- </div>
17
- {{#each additionalDocs}}
18
- <div class="api-container appended-doc">
19
- <h1>{{this.basename}}</h1>
20
- <section class="component-description">
21
- {{{this.description}}}
22
- <section class="component-api space-top">
23
- {{> properties this}}
24
- {{> slots this}}
25
- {{> events this}}
26
- {{> cssVariables this}}
27
- </section>
28
- </section>
29
- </div>
30
- {{/each}}
31
- <footer class="footer-wrapper">
32
- <div class="footer-links">
33
- <a class="separator" href="https://www.sap.com/about/legal/privacy.html" target="_blank">Privacy Policy</a>
34
- <a href="https://www.sap.com/about/legal/impressum.html" target="_blank">Legal</a>
35
- </div>
36
- <img src="../../../assets/images/sap-logo-svg.svg" alt="Sap Logo" />
37
- </footer>`
38
- };
@@ -1,10 +0,0 @@
1
- const config = {
2
- files: {
3
- exclude: ['serve.json']
4
- },
5
- folders: {
6
- exclude: ['resources']
7
- },
8
- };
9
-
10
- module.exports = config;
@@ -1,19 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const process = require("process");
4
- const { hashElement } = require("folder-hash");
5
- const config = require("./config.js");
6
-
7
- const inputDir = path.normalize(process.argv[2]);
8
- const outputFileName = path.normalize(process.argv[3]);
9
-
10
- const generateHash = async (inputDir, outputFileName) => {
11
- const result = await hashElement(inputDir, config);
12
- const hash = result.hash;
13
- fs.writeFileSync(outputFileName, hash);
14
- return hash;
15
- };
16
-
17
- generateHash(inputDir, outputFileName).then(hash => {
18
- console.log(`Generated hash: ${hash}`);
19
- });
@@ -1,31 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const process = require("process");
4
- const { hashElement } = require("folder-hash");
5
- const config = require("./config.js");
6
-
7
- const inputDir = path.normalize(process.argv[2]);
8
- const hashFileName = path.normalize(process.argv[3]);
9
-
10
- const isUpToDate = async (inputDir, hashFileName) => {
11
- // No dist/ directory or no hash file
12
- if (!fs.existsSync(inputDir) || !fs.existsSync(hashFileName)) {
13
- return false;
14
- }
15
-
16
- // Empty hash file
17
- const existingHash = `${fs.readFileSync(hashFileName)}`;
18
- if (!existingHash) {
19
- return false;
20
- }
21
-
22
- // Calculate the hash of the dist/ directory
23
- const result = await hashElement(inputDir, config);
24
- const newHash = result.hash;
25
-
26
- return newHash === existingHash;
27
- };
28
-
29
- isUpToDate(inputDir, hashFileName).then(upToDate => {
30
- process.exit(upToDate ? 0 : 1); // 0 means success (it is up to date), 1 means failure (must rebuild the dist/)
31
- });
@@ -1,5 +0,0 @@
1
- const mkdirp = require("mkdirp");
2
- const fs = require("fs");
3
-
4
- mkdirp.sync("dist/webcomponentsjs/");
5
- fs.writeFileSync("dist/webcomponentsjs/webcomponents-loader.js", "");
@@ -1,46 +0,0 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
- const commandLineArgs = require("command-line-args");
4
- const { exec } = require("child_process");
5
- const colors = require("cli-color");
6
- const isPortReachable = require("is-port-reachable");
7
-
8
- const options = commandLineArgs([
9
- { name: "port", type: Number },
10
- { name: "portStep", type: Number },
11
- { name: "packageName", type: String },
12
- { name: "dir", type: String },
13
- { name: "config", type: String },
14
- ]);
15
- const serveConfig = path.join(__dirname, `serve.json`);
16
-
17
- const requestPort = async () => {
18
- const serveProcess = (await gen.next()).value;
19
- serveProcess.stdout.on('data', data => {
20
- const matches = data.match(/Accepting connections at .*?:(\d+)/);
21
- if (matches) {
22
- console.log(colors.yellow(`Reserved port ${matches[1]} for the ${options.packageName} package.`));
23
- fs.writeFileSync(".port", matches[1]);
24
- }
25
- });
26
- };
27
-
28
- async function* serverGenerator(callback, port = 8080, step = 1) {
29
- while (true) {
30
- const portInUse = await isPortReachable(port, { host: "127.0.0.1" });
31
- if (!portInUse) {
32
- const command = `serve --config "${serveConfig}" --no-port-switching --no-clipboard -l ${port} ${options.dir}`;
33
- console.log(colors.yellow(`Executing: ${command}`));
34
- const serveProcess = exec(command, (err) => {
35
- console.log(colors.yellow(`Port ${port} already in use.`));
36
- callback();
37
- });
38
- yield serveProcess;
39
- }
40
- port += step;
41
- }
42
- }
43
-
44
- const gen = serverGenerator(requestPort, options.port, options.portStep);
45
-
46
- requestPort();
@@ -1,3 +0,0 @@
1
- {
2
- "cleanUrls": false
3
- }