@ui5/create-webcomponents-package 1.13.0 → 1.14.0-rc.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,7 +3,29 @@
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.13.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.4...v1.13.0) (2023-05-05)
6
+ # [1.14.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.13.2...v1.14.0-rc.0) (2023-05-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * 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))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.13.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.5...v1.13.1) (2023-05-11)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **create-package:** revert `moduleResolution` setting to `node` ([#7020](https://github.com/SAP/ui5-webcomponents/issues/7020)) ([9fc84e2](https://github.com/SAP/ui5-webcomponents/commit/9fc84e288452616ee72f3a2b6fc31d9752f05f6f))
23
+
24
+
25
+
26
+
27
+
28
+ # [1.13.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.4...v1.13.0-rc.5) (2023-05-11)
7
29
 
8
30
 
9
31
  ### Bug Fixes
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
- return generateFilesContent(name, componentName, typescriptSupport, skipSubfolder);
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.13.0",
3
+ "version": "1.14.0-rc.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": "c85ff70d47ba8f5e8c906066f2f4d36d432d2f6a"
27
+ "gitHead": "16aabf49d35a4ac30a5639fa5a88e46cb56024d8"
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 demo.components.INIT_PACKAGE_VAR_CLASS_NAME
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 demo.components.INIT_PACKAGE_VAR_CLASS_NAME
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
@@ -9,8 +9,7 @@
9
9
  "sourceMap": true,
10
10
  "inlineSources": true,
11
11
  "strict": true,
12
- "module": "node16",
13
- "moduleResolution": "node16",
12
+ "moduleResolution": "node",
14
13
  "experimentalDecorators": true,
15
14
  },
16
15
  }