@ui5/webcomponents-tools 2.6.3 → 2.7.0-rc.1
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 +8 -3
- package/assets-meta.js +0 -4
- package/components-package/cypress/support/component.js +1 -0
- package/components-package/cypress.config.js +5 -0
- package/components-package/nps.js +2 -2
- package/lib/create-new-component/{tsFileContentTemplate.js → Component.js} +11 -8
- package/lib/create-new-component/ComponentTemplate.js +12 -0
- package/lib/create-new-component/index.js +7 -6
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
@@ -3,12 +3,17 @@
|
|
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
|
-
|
6
|
+
# [2.7.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.7.0-rc.0...v2.7.0-rc.1) (2025-01-23)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
9
|
+
|
7
10
|
|
8
11
|
|
9
|
-
### Bug Fixes
|
10
12
|
|
11
|
-
|
13
|
+
|
14
|
+
# [2.7.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.6.2...v2.7.0-rc.0) (2025-01-16)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
12
17
|
|
13
18
|
|
14
19
|
|
package/assets-meta.js
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
const { defineConfig } = require('cypress')
|
2
2
|
const path = require("path");
|
3
|
+
const coverageTask = require('@cypress/code-coverage/task');
|
3
4
|
|
4
5
|
module.exports = defineConfig({
|
5
6
|
component: {
|
7
|
+
setupNodeEvents(on, config) {
|
8
|
+
coverageTask(on, config)
|
9
|
+
return config
|
10
|
+
},
|
6
11
|
supportFile: path.join(__dirname, "cypress/support/component.js"),
|
7
12
|
indexHtmlFile: path.join(__dirname, "cypress/support/component-index.html"),
|
8
13
|
specPattern: ["**/specs/*.cy.{js,ts}", "**/specs/**/*.cy.{js,ts}"],
|
@@ -122,8 +122,8 @@ const getScripts = (options) => {
|
|
122
122
|
},
|
123
123
|
start: "nps prepare watch.devServer",
|
124
124
|
test: `node "${LIB}/test-runner/test-runner.js"`,
|
125
|
-
"test-cy-ci": `yarn cypress run --component --browser chrome`,
|
126
|
-
"test-cy-open": `yarn cypress open --component --browser chrome`,
|
125
|
+
"test-cy-ci": `CYPRESS_COVERAGE=true yarn cypress run --component --browser chrome`,
|
126
|
+
"test-cy-open": `CYPRESS_COVERAGE=true yarn cypress open --component --browser chrome`,
|
127
127
|
"test-suite-1": `node "${LIB}/test-runner/test-runner.js" --suite suite1`,
|
128
128
|
"test-suite-2": `node "${LIB}/test-runner/test-runner.js" --suite suite2`,
|
129
129
|
startWithScope: "nps scope.prepare scope.watchWithBundle",
|
@@ -1,12 +1,12 @@
|
|
1
|
-
const
|
1
|
+
const Component = (componentName, tagName, library, packageName) => {
|
2
2
|
return `import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
3
3
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
4
4
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
5
5
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
6
|
-
import event from "@ui5/webcomponents-base/dist/decorators/event.js";
|
7
|
-
import
|
6
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
7
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
8
8
|
|
9
|
-
import ${componentName}Template from "
|
9
|
+
import ${componentName}Template from "./${componentName}Template.js";
|
10
10
|
|
11
11
|
// Styles
|
12
12
|
import ${componentName}Css from "./generated/themes/${componentName}.css.js";
|
@@ -30,10 +30,9 @@ import ${componentName}Css from "./generated/themes/${componentName}.css.js";
|
|
30
30
|
*/
|
31
31
|
@customElement({
|
32
32
|
tag: "${tagName}",
|
33
|
-
renderer:
|
33
|
+
renderer: jsxRenderer,
|
34
34
|
styles: ${componentName}Css,
|
35
35
|
template: ${componentName}Template,
|
36
|
-
dependencies: [],
|
37
36
|
})
|
38
37
|
|
39
38
|
/**
|
@@ -42,8 +41,12 @@ import ${componentName}Css from "./generated/themes/${componentName}.css.js";
|
|
42
41
|
*
|
43
42
|
* @public
|
44
43
|
*/
|
45
|
-
@event("interact"
|
44
|
+
@event("interact")
|
46
45
|
class ${componentName} extends UI5Element {
|
46
|
+
eventDetails!: {
|
47
|
+
"interact": void,
|
48
|
+
};
|
49
|
+
|
47
50
|
/**
|
48
51
|
* Defines the value of the component.
|
49
52
|
*
|
@@ -68,4 +71,4 @@ export default ${componentName};
|
|
68
71
|
`;
|
69
72
|
};
|
70
73
|
|
71
|
-
module.exports =
|
74
|
+
module.exports = Component;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
const ComponentTemplate = (componentName) => {
|
2
|
+
return `import type ${componentName} from "./${componentName}.js";
|
3
|
+
|
4
|
+
export default function ${componentName}Template(this: ${componentName}) {
|
5
|
+
return (
|
6
|
+
<div>Hello World!</div>
|
7
|
+
);
|
8
|
+
}
|
9
|
+
`;
|
10
|
+
};
|
11
|
+
|
12
|
+
module.exports = ComponentTemplate;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
const fs = require("fs");
|
2
2
|
const prompts = require("prompts");
|
3
|
-
const
|
3
|
+
const Component = require("./Component.js");
|
4
|
+
const ComponentTemplate= require("./ComponentTemplate.js");
|
4
5
|
|
5
6
|
/**
|
6
7
|
* Hyphanates the given PascalCase string, f.e.:
|
@@ -61,12 +62,12 @@ const generateFiles = (componentName, tagName, library, packageName) => {
|
|
61
62
|
const filePaths = {
|
62
63
|
"main": `./src/${componentName}.ts`,
|
63
64
|
"css": `./src/themes/${componentName}.css`,
|
64
|
-
"template": `./src/${componentName}.
|
65
|
+
"template": `./src/${componentName}Template.tsx`,
|
65
66
|
};
|
66
67
|
|
67
|
-
fs.writeFileSync(filePaths.main,
|
68
|
+
fs.writeFileSync(filePaths.main, Component(componentName, tagName, library, packageName), { flag: "wx+" });
|
68
69
|
fs.writeFileSync(filePaths.css, "", { flag: "wx+" });
|
69
|
-
fs.writeFileSync(filePaths.template,
|
70
|
+
fs.writeFileSync(filePaths.template, ComponentTemplate(componentName), { flag: "wx+" });
|
70
71
|
|
71
72
|
console.log(`Successfully generated ${filePaths.main}`);
|
72
73
|
console.log(`Successfully generated ${filePaths.css}`);
|
@@ -74,8 +75,8 @@ const generateFiles = (componentName, tagName, library, packageName) => {
|
|
74
75
|
|
75
76
|
// Change the color of the output
|
76
77
|
console.warn('\x1b[33m%s\x1b[0m', `
|
77
|
-
|
78
|
-
|
78
|
+
Now, import the component via: "import ${componentName} from ./${componentName}.js";
|
79
|
+
And, add it to your HTML: <${tagName}></${tagName}>.`);
|
79
80
|
}
|
80
81
|
|
81
82
|
// Main function
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-tools",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.7.0-rc.1",
|
4
4
|
"description": "UI5 Web Components: webcomponents.tools",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -23,6 +23,7 @@
|
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
25
|
"@custom-elements-manifest/analyzer": "^0.8.4",
|
26
|
+
"@cypress/code-coverage": "^3.13.10",
|
26
27
|
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
27
28
|
"@typescript-eslint/parser": "^6.9.0",
|
28
29
|
"@wdio/cli": "^7.19.7",
|
@@ -70,6 +71,7 @@
|
|
70
71
|
"rimraf": "^3.0.2",
|
71
72
|
"slash": "3.0.0",
|
72
73
|
"vite": "^5.4.8",
|
74
|
+
"vite-plugin-istanbul": "^6.0.2",
|
73
75
|
"wdio-chromedriver-service": "^7.3.2"
|
74
76
|
},
|
75
77
|
"peerDependencies": {
|
@@ -87,5 +89,5 @@
|
|
87
89
|
"esbuild": "^0.19.9",
|
88
90
|
"yargs": "^17.5.1"
|
89
91
|
},
|
90
|
-
"gitHead": "
|
92
|
+
"gitHead": "2f90ed3982de20cc411a1cda852ee98709b15e33"
|
91
93
|
}
|