@ui5/create-webcomponents-package 0.0.0-111ecd79a → 0.0.0-1acdb5da5
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 +83 -0
- package/create-package.js +27 -3
- package/package.json +1 -1
- package/template/gitignore +4 -0
- package/template/npmrc +2 -0
- package/template/src/MyFirstComponent.ts +6 -13
- package/template/test/specs/Demo.spec.js +3 -1
- package/template/tsconfig.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,89 @@
|
|
|
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
|
+
# [1.13.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0...v1.13.0-rc.0) (2023-04-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* inline sources in the .map file so the src folder is not mandatory ([#6732](https://github.com/SAP/ui5-webcomponents/issues/6732)) ([16771a6](https://github.com/SAP/ui5-webcomponents/commit/16771a64d7b13f418af9afa1a03b224fe3762775))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [1.12.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.0...v1.12.0-rc.1) (2023-03-16)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# [1.11.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.4...v1.11.0) (2023-03-06)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# [1.11.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.3...v1.11.0-rc.4) (2023-03-02)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# [1.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.2...v1.11.0-rc.3) (2023-02-23)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [1.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.1...v1.11.0-rc.2) (2023-02-16)
|
|
82
|
+
|
|
83
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
6
89
|
# [1.11.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.0...v1.11.0-rc.1) (2023-02-09)
|
|
7
90
|
|
|
8
91
|
|
package/create-package.js
CHANGED
|
@@ -23,9 +23,18 @@ const toCamelCase = parts => {
|
|
|
23
23
|
return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
|
24
24
|
}).join("");
|
|
25
25
|
};
|
|
26
|
-
const
|
|
26
|
+
const isTSRelatedFile = sourcePath => {
|
|
27
27
|
return ["Assets.ts", "MyFirstComponent.ts", "tsconfig.json", "global.d.ts"].some(fileName => sourcePath.includes(fileName));
|
|
28
28
|
};
|
|
29
|
+
const isJSRelatedFile = sourcePath => {
|
|
30
|
+
return ["Assets.js", "MyFirstComponent.js"].some(fileName => sourcePath.includes(fileName));
|
|
31
|
+
};
|
|
32
|
+
const isGitIgnore = sourcePath => {
|
|
33
|
+
return sourcePath.includes("gitignore");
|
|
34
|
+
};
|
|
35
|
+
const isNPMRC = sourcePath => {
|
|
36
|
+
return sourcePath.includes("npmrc");
|
|
37
|
+
};
|
|
29
38
|
|
|
30
39
|
// Validation of user input
|
|
31
40
|
const isNameValid = name => typeof name === "string" && name.match(/^[a-zA-Z0-9\-_]+$/);
|
|
@@ -45,8 +54,8 @@ const replaceVarsInFileName = (vars, fileName) => {
|
|
|
45
54
|
};
|
|
46
55
|
|
|
47
56
|
const copyFile = (vars, sourcePath, destPath) => {
|
|
48
|
-
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && sourcePath
|
|
49
|
-
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT &&
|
|
57
|
+
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && isJSRelatedFile(sourcePath);
|
|
58
|
+
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTSRelatedFile(sourcePath);
|
|
50
59
|
|
|
51
60
|
if (ignoreJsRelated || ignoreTsRelated) {
|
|
52
61
|
return;
|
|
@@ -55,7 +64,18 @@ const copyFile = (vars, sourcePath, destPath) => {
|
|
|
55
64
|
let content = fs.readFileSync(sourcePath, { encoding: "UTF-8" });
|
|
56
65
|
content = replaceVarsInFileContent(vars, content);
|
|
57
66
|
destPath = replaceVarsInFileName(vars, destPath);
|
|
67
|
+
|
|
58
68
|
fs.writeFileSync(destPath, content);
|
|
69
|
+
|
|
70
|
+
// Rename "gitignore" to ".gitignore" (npm init won't include ".gitignore", so we add it as "gitignore" and rename it later)
|
|
71
|
+
if (isGitIgnore(sourcePath)) {
|
|
72
|
+
fs.renameSync(destPath, destPath.replace("gitignore", ".gitignore"))
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Rename "npmrc" to ".npmrc" (npm init won't include ".npmrc", so we add it as "npmrc" and rename it later)
|
|
76
|
+
if (isNPMRC(sourcePath)) {
|
|
77
|
+
fs.renameSync(destPath, destPath.replace("npmrc", ".npmrc"));
|
|
78
|
+
}
|
|
59
79
|
};
|
|
60
80
|
|
|
61
81
|
const copyFiles = (vars, sourcePath, destPath) => {
|
|
@@ -116,6 +136,10 @@ const generateFilesContent = (name, tag, typescript) => {
|
|
|
116
136
|
},
|
|
117
137
|
};
|
|
118
138
|
|
|
139
|
+
if (typescript) {
|
|
140
|
+
packageContent.devDependencies.typescript = "^4.9.4";
|
|
141
|
+
}
|
|
142
|
+
|
|
119
143
|
// Update package.json
|
|
120
144
|
const destDir = path.join(`./`, name);
|
|
121
145
|
mkdirp.sync(destDir);
|
package/package.json
CHANGED
package/template/npmrc
ADDED
|
@@ -25,22 +25,15 @@ import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
|
|
|
25
25
|
* @tagname INIT_PACKAGE_VAR_TAG
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
28
|
-
@customElement(
|
|
28
|
+
@customElement({
|
|
29
|
+
tag: "INIT_PACKAGE_VAR_TAG",
|
|
30
|
+
renderer: litRender,
|
|
31
|
+
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
|
32
|
+
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
|
33
|
+
})
|
|
29
34
|
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
30
35
|
static i18nBundle: I18nBundle;
|
|
31
36
|
|
|
32
|
-
static get render() {
|
|
33
|
-
return litRender;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static get template() {
|
|
37
|
-
return INIT_PACKAGE_VAR_CLASS_NAMETemplate;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static get styles() {
|
|
41
|
-
return INIT_PACKAGE_VAR_CLASS_NAMECss;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
37
|
static async onDefine() {
|
|
45
38
|
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
|
46
39
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const assert = require("assert");
|
|
2
2
|
|
|
3
3
|
describe("INIT_PACKAGE_VAR_TAG rendering", async () => {
|
|
4
|
-
|
|
4
|
+
before(async () => {
|
|
5
|
+
await browser.url("test/pages/index.html");
|
|
6
|
+
});
|
|
5
7
|
|
|
6
8
|
it("tests if web component is correctly rendered", async () => {
|
|
7
9
|
|