@ui5/webcomponents-tools 0.0.0-1acdb5da5 → 0.0.0-1b5f0ec39

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,33 @@
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-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.2...v1.13.0-rc.3) (2023-04-27)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.13.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.1...v1.13.0-rc.2) (2023-04-20)
15
+
16
+ **Note:** Version bump only for package @ui5/webcomponents-tools
17
+
18
+
19
+
20
+
21
+
22
+ # [1.13.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.13.0-rc.0...v1.13.0-rc.1) (2023-04-13)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **framework:** correct fileName in component CSS import ([#6900](https://github.com/SAP/ui5-webcomponents/issues/6900)) ([4d950c5](https://github.com/SAP/ui5-webcomponents/commit/4d950c5ea3bee0e3b629e5797693ecf41a2cdfd3))
28
+
29
+
30
+
31
+
32
+
6
33
  # [1.13.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0...v1.13.0-rc.0) (2023-04-06)
7
34
 
8
35
  **Note:** Version bump only for package @ui5/webcomponents-tools
@@ -1,3 +1,5 @@
1
+ console.log("Creating new web component...")
2
+
1
3
  const fs = require("fs");
2
4
  const prompts = require("prompts");
3
5
  const jsFileContentTemplate = require("./jsFileContentTemplate.js");
@@ -78,9 +80,6 @@ const createWebComponent = async () => {
78
80
  const consoleArguments = process.argv.slice(2);
79
81
  let componentName = consoleArguments[0];
80
82
  let tagName = consoleArguments[1];
81
- let language = consoleArguments[2];
82
- let isTypeScript;
83
-
84
83
 
85
84
  if (componentName && !isNameValid(componentName)) {
86
85
  throw new Error("Invalid component name. Please use only letters, numbers, dashes and underscores. The first character must be a letter.");
@@ -90,10 +89,6 @@ const createWebComponent = async () => {
90
89
  throw new Error("Invalid tag name. The tag name should only contain lowercase letters, numbers, dashes, and underscores. The first character must be a letter, and it should follow the pattern 'tag-name'.");
91
90
  }
92
91
 
93
- if (language && language !== "typescript" && language !== "ts" && language !== "javascript" && language !== "js") {
94
- throw new Error("Invalid language. Please use 'typescript','javascript' or their respective 'ts','js'.");
95
- }
96
-
97
92
  if (!componentName) {
98
93
  const response = await prompts({
99
94
  type: "text",
@@ -122,28 +117,9 @@ const createWebComponent = async () => {
122
117
  }
123
118
  }
124
119
 
125
- if (!language) {
126
- const response = await prompts({
127
- type: "select",
128
- name: "isTypeScript",
129
- message: "Please select a language:",
130
- choices: [
131
- {
132
- title: "TypeScript (recommended)",
133
- value: true,
134
- },
135
- {
136
- title: "JavaScript",
137
- value: false,
138
- },
139
- ],
140
- });
141
- isTypeScript = response.isTypeScript;
142
- } else if (language === "typescript" || language === "ts") {
143
- isTypeScript = true;
144
- } else {
145
- isTypeScript = false;
146
- }
120
+ const isTypeScript = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
121
+ console.log({ isTypeScript })
122
+
147
123
 
148
124
  generateFiles(componentName, tagName, library, packageName, isTypeScript);
149
125
  };
@@ -49,7 +49,7 @@ const convertImports = async (srcPath) => {
49
49
 
50
50
  const generate = async () => {
51
51
  const { globby } = await import("globby");
52
- const fileNames = await globby(basePath + "**/*.js");
52
+ const fileNames = await globby(basePath.replace(/\\/g, "/") + "**/*.js");
53
53
  return Promise.all(fileNames.map(convertImports).filter(x => !!x));
54
54
  };
55
55
 
@@ -34,7 +34,7 @@ const convertToJSON = async (file) => {
34
34
  const generate = async () => {
35
35
  const { globby } = await import("globby");
36
36
  await fs.mkdir(messagesJSONDist, { recursive: true });
37
- const files = await globby(messagesBundles);
37
+ const files = await globby(messagesBundles.replace(/\\/g, "/"));
38
38
  return Promise.all(files.map(convertToJSON));
39
39
  };
40
40
 
@@ -8,7 +8,7 @@ const sourceDir = process.argv[3];
8
8
  const preprocessTypes = async () => {
9
9
  try {
10
10
  const { globby } = await import("globby");
11
- const fileNames = await globby(inputDir + "**/types/*.js");
11
+ const fileNames = await globby(inputDir.replace(/\\/g, "/") + "**/types/*.js");
12
12
 
13
13
  return Promise.all(fileNames.map(processTypeFile));
14
14
  } catch(e) {
@@ -63,7 +63,7 @@ const preprocessComponents = async () => {
63
63
 
64
64
  try {
65
65
  const { globby } = await import("globby");
66
- const fileNames = await globby(sourceDir + "/*.ts");
66
+ const fileNames = await globby(sourceDir.replace(/\\/g, "/") + "/*.ts");
67
67
 
68
68
  return Promise.all(fileNames.map(processComponentFile));
69
69
  } catch(e) {
@@ -16,7 +16,7 @@ const replaceGlobalCoreUsage = async (srcPath) => {
16
16
 
17
17
  const generate = async () => {
18
18
  const { globby } = await import("globby");
19
- const fileNames = await globby(basePath + "**/*.js");
19
+ const fileNames = await globby(basePath.replace(/\\/g, "/") + "**/*.js");
20
20
  return Promise.all(fileNames.map(replaceGlobalCoreUsage).filter(x => !!x));
21
21
  };
22
22
 
@@ -61,8 +61,8 @@ if (process.argv.length > 3) {
61
61
  let wdioConfig = "";
62
62
  if (fs.existsSync("config/wdio.conf.cjs")) {
63
63
  wdioConfig = "config/wdio.conf.cjs";
64
- } else {
65
- fs.existsSync("config/wdio.conf.js")
64
+ } else if (fs.existsSync("config/wdio.conf.js")) {
65
+ wdioConfig = "config/wdio.conf.js";
66
66
  }
67
67
 
68
68
  // run wdio with calculated parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "0.0.0-1acdb5da5",
3
+ "version": "0.0.0-1b5f0ec39",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -57,6 +57,7 @@
57
57
  "postcss-cli": "^9.1.0",
58
58
  "postcss-import": "^14.0.2",
59
59
  "postcss-selector-parser": "^6.0.10",
60
+ "prompts": "^2.4.2",
60
61
  "properties-reader": "^2.2.0",
61
62
  "recursive-readdir": "^2.2.2",
62
63
  "resolve": "^1.20.0",