@ui5/create-webcomponents-package 2.11.0-rc.2 → 2.11.0-rc.4
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 +35 -16
- package/package.json +2 -3
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
|
+
# [2.11.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v2.11.0-rc.3...v2.11.0-rc.4) (2025-06-05)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [2.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.11.0-rc.2...v2.11.0-rc.3) (2025-05-29)
|
15
|
+
|
16
|
+
|
17
|
+
### Bug Fixes
|
18
|
+
|
19
|
+
* create new package script on windows ([#11555](https://github.com/SAP/ui5-webcomponents/issues/11555)) ([2a60bc0](https://github.com/SAP/ui5-webcomponents/commit/2a60bc09d76d08a6d168ae2041d8c472d38e7cc1))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
6
25
|
# [2.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.11.0-rc.1...v2.11.0-rc.2) (2025-05-22)
|
7
26
|
|
8
27
|
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
package/create-package.js
CHANGED
@@ -4,7 +4,6 @@ import path, { dirname } from "path";
|
|
4
4
|
import prompts from "prompts";
|
5
5
|
import parser from "npm-config-user-agent-parser";
|
6
6
|
import yargs from "yargs/yargs";
|
7
|
-
import { globby } from "globby";
|
8
7
|
import { hideBin } from "yargs/helpers";
|
9
8
|
import { fileURLToPath } from "url";
|
10
9
|
import * as prettier from "prettier";
|
@@ -19,12 +18,17 @@ const VERSION = JSON.parse(
|
|
19
18
|
// Constants
|
20
19
|
const SUPPORTED_TEST_SETUPS = ["cypress", "manual"];
|
21
20
|
const SRC_DIR = path.join(__dirname, "template");
|
21
|
+
const DEST_DIR = process.cwd();
|
22
|
+
|
22
23
|
const FILES_TO_RENAME = {
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
26
|
-
|
27
|
-
|
24
|
+
[path.normalize("eslintignore")]: path.normalize(".eslintignore"),
|
25
|
+
[path.normalize("eslintrc.cjs")]: path.normalize(".eslintrc.cjs"),
|
26
|
+
[path.normalize("npsrc.json")]: path.normalize(".npsrc.json"),
|
27
|
+
[path.normalize("npmrc")]: path.normalize(".npmrc"),
|
28
|
+
[path.normalize("env")]: path.normalize(".env"),
|
29
|
+
[path.normalize("gitignore")]: path.normalize(".gitignore"),
|
30
|
+
[path.normalize("tsconfig.template.json")]: path.normalize("tsconfig.json"),
|
31
|
+
[path.normalize("cypress/tsconfig.template.json")]: path.normalize("cypress/tsconfig.json")
|
28
32
|
};
|
29
33
|
const FILES_TO_COPY = ["test/pages/img/logo.png"];
|
30
34
|
|
@@ -40,6 +44,21 @@ const isTagValid = tag => typeof tag === "string" && TagPattern.test(tag);
|
|
40
44
|
const isTestSetupValid = setup =>
|
41
45
|
typeof setup === "string" && SUPPORTED_TEST_SETUPS.includes(setup);
|
42
46
|
|
47
|
+
async function collectFiles(dir, fileList = []) {
|
48
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
49
|
+
|
50
|
+
for (const entry of entries) {
|
51
|
+
const fullPath = path.join(dir, entry.name);
|
52
|
+
if (entry.isDirectory()) {
|
53
|
+
await collectFiles(fullPath, fileList);
|
54
|
+
} else if (entry.isFile()) {
|
55
|
+
fileList.push(fullPath);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
return fileList;
|
60
|
+
}
|
61
|
+
|
43
62
|
/**
|
44
63
|
* Hyphanates the given PascalCase string, f.e.:
|
45
64
|
* Foo -> "my-foo" (adds preffix)
|
@@ -87,8 +106,8 @@ const generateFilesContent = async (
|
|
87
106
|
? packageName.slice(packageName.lastIndexOf("/") + 1)
|
88
107
|
: packageName;
|
89
108
|
const destDir = skipSubfolder
|
90
|
-
? path.join(
|
91
|
-
: path.join(
|
109
|
+
? path.join(DEST_DIR)
|
110
|
+
: path.join(DEST_DIR, packageBaseName);
|
92
111
|
|
93
112
|
await processFiles(destDir, vars, testSetup);
|
94
113
|
|
@@ -108,9 +127,9 @@ const generateFilesContent = async (
|
|
108
127
|
};
|
109
128
|
|
110
129
|
async function processFiles(destDir, replacements, testSetup) {
|
111
|
-
const files = await
|
130
|
+
const files = await collectFiles(SRC_DIR);
|
112
131
|
const FILE_PATHS_TO_SKIP = [
|
113
|
-
testSetup !== "cypress" ? "cypress" : undefined,
|
132
|
+
testSetup !== "cypress" ? path.normalize("cypress") : undefined,
|
114
133
|
].filter(Boolean);
|
115
134
|
|
116
135
|
for (const file of files) {
|
@@ -122,11 +141,11 @@ async function processFiles(destDir, replacements, testSetup) {
|
|
122
141
|
continue;
|
123
142
|
}
|
124
143
|
|
125
|
-
// Component related file based on the user input
|
126
|
-
destPath = destPath.replace(
|
127
|
-
|
128
|
-
|
129
|
-
);
|
144
|
+
// // Component related file based on the user input
|
145
|
+
// destPath = destPath.replace(
|
146
|
+
// "MyFirstComponent",
|
147
|
+
// replacements.INIT_PACKAGE_VAR_CLASS_NAME,
|
148
|
+
// );
|
130
149
|
|
131
150
|
// Files that need to be renamed
|
132
151
|
if (FILES_TO_RENAME[relativePath]) {
|
@@ -181,7 +200,7 @@ const createWebcomponentsPackage = async () => {
|
|
181
200
|
}
|
182
201
|
|
183
202
|
let packageName = argv.name || "my-package";
|
184
|
-
let componentName = "
|
203
|
+
let componentName = "MyFirstComponent";
|
185
204
|
let testSetup = argv.testSetup || "manual";
|
186
205
|
const skipSubfolder = !!argv.skipSubfolder;
|
187
206
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "2.11.0-rc.
|
3
|
+
"version": "2.11.0-rc.4",
|
4
4
|
"description": "UI5 Web Components: create package",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -20,12 +20,11 @@
|
|
20
20
|
"directory": "packages/create-package"
|
21
21
|
},
|
22
22
|
"dependencies": {
|
23
|
-
"globby": "^13.1.1",
|
24
23
|
"mkdirp": "^1.0.4",
|
25
24
|
"npm-config-user-agent-parser": "^1.0.0",
|
26
25
|
"prettier": "^3.5.3",
|
27
26
|
"prompts": "^2.4.1",
|
28
27
|
"yargs": "^17.5.1"
|
29
28
|
},
|
30
|
-
"gitHead": "
|
29
|
+
"gitHead": "14eef00495b716ea5aea644d3c124b0c83aadd62"
|
31
30
|
}
|