@ui5/create-webcomponents-package 2.10.0-rc.2 → 2.10.0-rc.3
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 -0
- package/README.md +0 -4
- package/create-package.js +3 -31
- package/package.json +2 -2
- package/template/cypress/component/MyFirstComponent.cy.tsx +2 -2
- package/template/env +1 -0
- package/template/{bundle.esm.js → src/bundle.esm.ts} +4 -3
- package/template/test/pages/index.html +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
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
|
+
# [2.10.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.10.0-rc.2...v2.10.0-rc.3) (2025-05-01)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
# [2.10.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.10.0-rc.1...v2.10.0-rc.2) (2025-04-24)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
package/README.md
CHANGED
@@ -16,8 +16,6 @@ Usage:
|
|
16
16
|
|
17
17
|
Options:
|
18
18
|
--name <string> - defines the package name
|
19
|
-
--component-name <string> - defines the component class name that will be created in your new package
|
20
|
-
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
21
19
|
--test-setup <"cypress" | "manual"> - defines whether the predefined test setup should be added or it will be configured manually.
|
22
20
|
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
23
21
|
```
|
@@ -32,8 +30,6 @@ Usage:
|
|
32
30
|
yarn create @ui5/webcomponents-package [OPTIONS]
|
33
31
|
Options:
|
34
32
|
--name <string> - defines the package name
|
35
|
-
--component-name <string> - defines the component class name that will be created in your new package
|
36
|
-
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
37
33
|
--test-setup <"cypress" | "manual"> - defines whether the predefined test setup should be added or it will be configured manually.
|
38
34
|
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
39
35
|
```
|
package/create-package.js
CHANGED
@@ -21,6 +21,7 @@ const SUPPORTED_TEST_SETUPS = ["cypress", "manual"];
|
|
21
21
|
const SRC_DIR = path.join(__dirname, "template");
|
22
22
|
const FILES_TO_RENAME = {
|
23
23
|
"npmrc": ".npmrc",
|
24
|
+
"env": ".env",
|
24
25
|
"gitignore": ".gitignore",
|
25
26
|
"tsconfig.template.json": "tsconfig.json",
|
26
27
|
"cypress/tsconfig.template.json": "cypress/tsconfig.json"
|
@@ -28,7 +29,6 @@ const FILES_TO_RENAME = {
|
|
28
29
|
const FILES_TO_COPY = ["test/pages/img/logo.png"];
|
29
30
|
|
30
31
|
// Validation Patterns
|
31
|
-
const ComponentNamePattern = /^[A-Z][A-Za-z0-9]+$/;
|
32
32
|
const PackageNamePattern =
|
33
33
|
/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
|
34
34
|
const TagPattern = /^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/;
|
@@ -36,8 +36,6 @@ const TagPattern = /^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/;
|
|
36
36
|
// Utility Functions
|
37
37
|
const isPackageNameValid = name =>
|
38
38
|
typeof name === "string" && PackageNamePattern.test(name);
|
39
|
-
const isComponentNameValid = name =>
|
40
|
-
typeof name === "string" && ComponentNamePattern.test(name);
|
41
39
|
const isTagValid = tag => typeof tag === "string" && TagPattern.test(tag);
|
42
40
|
const isTestSetupValid = setup =>
|
43
41
|
typeof setup === "string" && SUPPORTED_TEST_SETUPS.includes(setup);
|
@@ -75,7 +73,7 @@ const generateFilesContent = async (
|
|
75
73
|
: "",
|
76
74
|
INIT_PACKAGE_CYPRESS_DEV_DEPS:
|
77
75
|
testSetup === "cypress"
|
78
|
-
? `"@ui5/cypress-ct-ui5-webc": "^0.0.
|
76
|
+
? `"@ui5/cypress-ct-ui5-webc": "^0.0.4",\n"cypress": "^13.11.0",`
|
79
77
|
: "",
|
80
78
|
INIT_PACKAGE_CYPRESS_TEST_COMMANDS:
|
81
79
|
testSetup === "cypress"
|
@@ -176,18 +174,6 @@ const createWebcomponentsPackage = async () => {
|
|
176
174
|
);
|
177
175
|
}
|
178
176
|
|
179
|
-
if (argv.componentName && !isComponentNameValid(argv.componentName)) {
|
180
|
-
throw new Error(
|
181
|
-
"The component name should be a string, starting with a capital letter [A-Z][a-z], for example: Button, MyButton, etc.",
|
182
|
-
);
|
183
|
-
}
|
184
|
-
|
185
|
-
if (argv.tag && !isTagValid(argv.tag)) {
|
186
|
-
throw new Error(
|
187
|
-
"The tag should be in kebab-case (f.e my-component) and it can't be a single word.",
|
188
|
-
);
|
189
|
-
}
|
190
|
-
|
191
177
|
if (argv.testSetup && !isTestSetupValid(argv.testSetup)) {
|
192
178
|
throw new Error(
|
193
179
|
`The test setup should be a string and one of the following options: ${SUPPORTED_TEST_SETUPS.join(", ")}`,
|
@@ -195,7 +181,7 @@ const createWebcomponentsPackage = async () => {
|
|
195
181
|
}
|
196
182
|
|
197
183
|
let packageName = argv.name || "my-package";
|
198
|
-
let componentName =
|
184
|
+
let componentName = "MyComponent";
|
199
185
|
let testSetup = argv.testSetup || "manual";
|
200
186
|
const skipSubfolder = !!argv.skipSubfolder;
|
201
187
|
|
@@ -221,20 +207,6 @@ const createWebcomponentsPackage = async () => {
|
|
221
207
|
packageName = response.name;
|
222
208
|
}
|
223
209
|
|
224
|
-
if (!argv.componentName) {
|
225
|
-
response = await prompts({
|
226
|
-
type: "text",
|
227
|
-
name: "componentName",
|
228
|
-
message: "Component name:",
|
229
|
-
initial: "MyComponent",
|
230
|
-
validate: value =>
|
231
|
-
isComponentNameValid(value)
|
232
|
-
? true
|
233
|
-
: "Component name should follow PascalCase naming convention (f.e. Button, MyButton, etc.).",
|
234
|
-
});
|
235
|
-
componentName = response.componentName;
|
236
|
-
}
|
237
|
-
|
238
210
|
if (!argv.testSetup) {
|
239
211
|
response = await prompts({
|
240
212
|
type: "select",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "2.10.0-rc.
|
3
|
+
"version": "2.10.0-rc.3",
|
4
4
|
"description": "UI5 Web Components: create package",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -27,5 +27,5 @@
|
|
27
27
|
"prompts": "^2.4.1",
|
28
28
|
"yargs": "^17.5.1"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "930bdc688d96e3bacf4b3d77d7e1d5388c90be41"
|
31
31
|
}
|
@@ -4,10 +4,10 @@ describe('{{INIT_PACKAGE_VAR_CLASS_NAME}}.cy.tsx', () => {
|
|
4
4
|
it('playground', () => {
|
5
5
|
cy.mount(<{{INIT_PACKAGE_VAR_CLASS_NAME}} />)
|
6
6
|
|
7
|
-
cy.get("[
|
7
|
+
cy.get("[{{INIT_PACKAGE_VAR_TAG}}]")
|
8
8
|
.click();
|
9
9
|
|
10
|
-
cy.get("[
|
10
|
+
cy.get("[{{INIT_PACKAGE_VAR_TAG}}]")
|
11
11
|
.should("have.prop", "count", 1)
|
12
12
|
})
|
13
13
|
})
|
package/template/env
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
VITE_BUNDLE_PATH="../../dist/bundle.esm.js"
|
@@ -9,11 +9,12 @@ import { getNoConflict, setNoConflict } from "@ui5/webcomponents-base/dist/confi
|
|
9
9
|
import { getFirstDayOfWeek } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
|
10
10
|
|
11
11
|
// Enable additional themes and i18n texts
|
12
|
-
import "./
|
12
|
+
import "./Assets.js";
|
13
13
|
|
14
|
-
// Import your web components here from the
|
15
|
-
import "./
|
14
|
+
// Import your web components here from the src/ directory
|
15
|
+
import "./{{INIT_PACKAGE_VAR_CLASS_NAME}}.js";
|
16
16
|
|
17
|
+
// @ts-expect-error
|
17
18
|
window["sap-ui-webcomponents-bundle"] = {
|
18
19
|
renderFinished,
|
19
20
|
configuration: {
|