@ui5/create-webcomponents-package 1.13.1 → 1.14.0-rc.1
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,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.14.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.14.0-rc.0...v1.14.0-rc.1) (2023-05-25)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [1.14.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.2...v1.14.0-rc.0) (2023-05-18)
|
15
|
+
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
* users can provide a JSDoc namespeace when creating a package ([#7034](https://github.com/SAP/ui5-webcomponents/issues/7034)) ([0af8d23](https://github.com/SAP/ui5-webcomponents/commit/0af8d2376e25e5abe6d940c72286ab7c682eea56))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
6
25
|
## [1.13.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.5...v1.13.1) (2023-05-11)
|
7
26
|
|
8
27
|
|
package/create-package.js
CHANGED
@@ -38,8 +38,10 @@ const isNPMRC = sourcePath => {
|
|
38
38
|
|
39
39
|
// Validation of user input
|
40
40
|
const ComponentNamePattern = /^[A-Z][A-Za-z0-9]+$/;
|
41
|
+
const NamespacePattern = /^[a-z][a-z0-9\.\-]+$/;
|
41
42
|
const isNameValid = name => typeof name === "string" && name.match(/^[a-zA-Z][a-zA-Z0-9\-_]+$/);
|
42
43
|
const isComponentNameValid = name => typeof name === "string" && ComponentNamePattern.test(name);
|
44
|
+
const isNamespaceValid = name => typeof name === "string" && NamespacePattern.test(name);
|
43
45
|
const isTagValid = tag => typeof tag === "string" && tag.match(/^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/);
|
44
46
|
|
45
47
|
/**
|
@@ -105,11 +107,12 @@ const copyFiles = (vars, sourcePath, destPath) => {
|
|
105
107
|
}
|
106
108
|
};
|
107
109
|
|
108
|
-
const generateFilesContent = (name, componentName, typescript, skipSubfolder) => {
|
110
|
+
const generateFilesContent = (name, componentName, namespace, typescript, skipSubfolder) => {
|
109
111
|
const tagName = argv.tag || hyphaneteComponentName(componentName);
|
110
112
|
|
111
113
|
// All variables that will be replaced in the content of the resources/
|
112
114
|
const vars = {
|
115
|
+
INIT_PACKAGE_VAR_NAMESPACE: namespace, // namespace must be replaced before name
|
113
116
|
INIT_PACKAGE_VAR_NAME: name,
|
114
117
|
INIT_PACKAGE_VAR_TAG: tagName,
|
115
118
|
INIT_PACKAGE_VAR_CLASS_NAME: componentName,
|
@@ -190,17 +193,22 @@ const createWebcomponentsPackage = async () => {
|
|
190
193
|
throw new Error("The component name should be a string, starting with a capital letter [A-Z][a-z], for example: Button, MyButton, etc.");
|
191
194
|
}
|
192
195
|
|
196
|
+
if (argv.namespace && !isNamespaceValid(argv.namespace)) {
|
197
|
+
throw new Error("The JSDoc namespace must start with a letter and can only contain small-case letters, numbers, dots and dashes.");
|
198
|
+
}
|
199
|
+
|
193
200
|
if (argv.tag && !isTagValid(argv.tag) ) {
|
194
201
|
throw new Error("The tag should be in kebab-case (f.e my-component) and it can't be a single word.");
|
195
202
|
}
|
196
203
|
|
197
204
|
let name = argv.name || "my-package";
|
198
205
|
let componentName = argv.componentName || "MyComponent";
|
206
|
+
let namespace = argv.namespace || "demo.components";
|
199
207
|
let typescriptSupport = !!argv.enableTypescript;
|
200
208
|
const skipSubfolder = !!argv.skipSubfolder;
|
201
209
|
|
202
210
|
if (argv.skip) {
|
203
|
-
return generateFilesContent(name, componentName, typescriptSupport, skipSubfolder);
|
211
|
+
return generateFilesContent(name, componentName, namespace, typescriptSupport, skipSubfolder);
|
204
212
|
}
|
205
213
|
|
206
214
|
if (!argv.name) {
|
@@ -243,7 +251,18 @@ const createWebcomponentsPackage = async () => {
|
|
243
251
|
componentName = response.componentName;
|
244
252
|
}
|
245
253
|
|
246
|
-
|
254
|
+
if (!argv.namespace) {
|
255
|
+
response = await prompts({
|
256
|
+
type: "text",
|
257
|
+
name: "namespace",
|
258
|
+
message: "JSDoc namespace:",
|
259
|
+
initial: "demo.components",
|
260
|
+
validate: (value) => isNamespaceValid(value) ? true : "The JSDoc namespace must start with a letter and can only contain small-case letters, numbers, dots and dashes.",
|
261
|
+
});
|
262
|
+
namespace = response.namespace;
|
263
|
+
}
|
264
|
+
|
265
|
+
return generateFilesContent(name, componentName, namespace, typescriptSupport, skipSubfolder);
|
247
266
|
};
|
248
267
|
|
249
268
|
createWebcomponentsPackage();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.14.0-rc.1",
|
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": "9238cbf560b0fd9adbbdd0b0615632a56c9f955e"
|
28
28
|
}
|
@@ -31,7 +31,7 @@ const metadata = {
|
|
31
31
|
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
32
32
|
*
|
33
33
|
* @constructor
|
34
|
-
* @alias
|
34
|
+
* @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
|
35
35
|
* @extends sap.ui.webc.base.UI5Element
|
36
36
|
* @tagname INIT_PACKAGE_VAR_TAG
|
37
37
|
* @public
|
@@ -20,7 +20,7 @@ import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
|
|
20
20
|
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
21
21
|
*
|
22
22
|
* @constructor
|
23
|
-
* @alias
|
23
|
+
* @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
|
24
24
|
* @extends sap.ui.webc.base.UI5Element
|
25
25
|
* @tagname INIT_PACKAGE_VAR_TAG
|
26
26
|
* @public
|