@ui5/create-webcomponents-package 1.12.0-rc.1 → 1.12.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 +19 -0
- package/create-package.js +27 -3
- package/package.json +2 -2
- package/template/gitignore +4 -0
- package/template/npmrc +2 -0
- 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.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [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)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* 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))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
6
25
|
# [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)
|
7
26
|
|
8
27
|
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "1.12.0-rc.
|
3
|
+
"version": "1.12.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",
|
@@ -24,5 +24,5 @@
|
|
24
24
|
"prompts": "^2.4.1",
|
25
25
|
"yargs": "^17.5.1"
|
26
26
|
},
|
27
|
-
"gitHead": "
|
27
|
+
"gitHead": "ae6ca4708b81a04de42ec2be50383fa80630e250"
|
28
28
|
}
|
package/template/npmrc
ADDED