@ui5/create-webcomponents-package 1.12.0-rc.2 → 1.12.0

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 CHANGED
@@ -3,6 +3,22 @@
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](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
7
+
8
+ **Note:** Version bump only for package @ui5/create-webcomponents-package
9
+
10
+
11
+
12
+
13
+
14
+ # [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)
15
+
16
+ **Note:** Version bump only for package @ui5/create-webcomponents-package
17
+
18
+
19
+
20
+
21
+
6
22
  # [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
23
 
8
24
 
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 isTypescriptRelatedFile = sourcePath => {
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.includes("MyFirstComponent.js");
49
- const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTypescriptRelatedFile(sourcePath);
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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/create-webcomponents-package",
3
- "version": "1.12.0-rc.2",
3
+ "version": "1.12.0",
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": "2af8e0fa36a3c85253cbc4f76f6b92b1c5a7a47f"
27
+ "gitHead": "a3ea5367f668040c721ca45d3bf73f560c3ae9af"
28
28
  }
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ dist
3
+ jsdoc-dist
4
+ src/generated
package/template/npmrc ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect the chromedriver version
2
+ detect_chromedriver_version=true