@ui5/create-webcomponents-package 0.0.0-97cba4b0b → 0.0.0-99b763015
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 +19 -0
- package/create-package.js +23 -3
- package/package.json +1 -1
- package/template/gitignore +4 -0
- package/template/test/specs/Demo.spec.js +3 -1
- package/template/tsconfig.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* 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))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
package/create-package.js
CHANGED
|
@@ -23,9 +23,19 @@ 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
|
+
|
|
36
|
+
const renameGitIgnore = (destPath) => {
|
|
37
|
+
fs.renameSync(destPath, destPath.replace("gitignore", ".gitignore"))
|
|
38
|
+
};
|
|
29
39
|
|
|
30
40
|
// Validation of user input
|
|
31
41
|
const isNameValid = name => typeof name === "string" && name.match(/^[a-zA-Z0-9\-_]+$/);
|
|
@@ -45,8 +55,8 @@ const replaceVarsInFileName = (vars, fileName) => {
|
|
|
45
55
|
};
|
|
46
56
|
|
|
47
57
|
const copyFile = (vars, sourcePath, destPath) => {
|
|
48
|
-
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && sourcePath
|
|
49
|
-
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT &&
|
|
58
|
+
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && isJSRelatedFile(sourcePath);
|
|
59
|
+
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTSRelatedFile(sourcePath);
|
|
50
60
|
|
|
51
61
|
if (ignoreJsRelated || ignoreTsRelated) {
|
|
52
62
|
return;
|
|
@@ -55,7 +65,13 @@ const copyFile = (vars, sourcePath, destPath) => {
|
|
|
55
65
|
let content = fs.readFileSync(sourcePath, { encoding: "UTF-8" });
|
|
56
66
|
content = replaceVarsInFileContent(vars, content);
|
|
57
67
|
destPath = replaceVarsInFileName(vars, destPath);
|
|
68
|
+
|
|
58
69
|
fs.writeFileSync(destPath, content);
|
|
70
|
+
|
|
71
|
+
// Rename "gitignore" to ".gitignore" (npm init won't include ".gitignore", so we add it as "gitignore" and rename it later)
|
|
72
|
+
if (isGitIgnore(sourcePath)) {
|
|
73
|
+
renameGitIgnore(destPath);
|
|
74
|
+
}
|
|
59
75
|
};
|
|
60
76
|
|
|
61
77
|
const copyFiles = (vars, sourcePath, destPath) => {
|
|
@@ -116,6 +132,10 @@ const generateFilesContent = (name, tag, typescript) => {
|
|
|
116
132
|
},
|
|
117
133
|
};
|
|
118
134
|
|
|
135
|
+
if (typescript) {
|
|
136
|
+
packageContent.devDependencies.typescript = "^4.9.4";
|
|
137
|
+
}
|
|
138
|
+
|
|
119
139
|
// Update package.json
|
|
120
140
|
const destDir = path.join(`./`, name);
|
|
121
141
|
mkdirp.sync(destDir);
|
package/package.json
CHANGED
|
@@ -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
|
|