@ui5/create-webcomponents-package 1.10.4-rc.0 → 1.10.5
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 +9 -1
- package/index.js +0 -29
- package/package.json +2 -2
- package/template/package-scripts.js +0 -1
- package/template/global.d.ts +0 -12
- package/template/src/MyFirstComponent.ts +0 -57
- package/template/tsconfig.json +0 -14
package/CHANGELOG.md
CHANGED
@@ -3,7 +3,15 @@
|
|
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.10.
|
6
|
+
## [1.10.5](https://github.com/SAP/ui5-webcomponents/compare/v1.10.4...v1.10.5) (2023-02-24)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [1.10.4](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4) (2023-02-15)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
17
|
|
package/index.js
CHANGED
@@ -19,9 +19,6 @@ const toCamelCase = parts => {
|
|
19
19
|
return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
20
20
|
}).join("");
|
21
21
|
};
|
22
|
-
const isTypescriptRelatedFile = sourcePath => {
|
23
|
-
return ["MyFirstComponent.ts", "tsconfig.json", "global.d.ts"].some(fileName => sourcePath.includes(fileName));
|
24
|
-
}
|
25
22
|
|
26
23
|
// Validation of user input
|
27
24
|
const isNameValid = name => typeof name === "string" && name.match(/^[a-zA-Z0-9\-_]+$/);
|
@@ -42,13 +39,6 @@ const replaceVarsInFileName = (vars, fileName) => {
|
|
42
39
|
};
|
43
40
|
|
44
41
|
const copyFile = (vars, sourcePath, destPath) => {
|
45
|
-
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && sourcePath.includes("MyFirstComponent.js")
|
46
|
-
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTypescriptRelatedFile(sourcePath)
|
47
|
-
|
48
|
-
if (ignoreJsRelated || ignoreTsRelated) {
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
|
52
42
|
let content = fs.readFileSync(sourcePath, {encoding: "UTF-8"});
|
53
43
|
content = replaceVarsInFileContent(vars, content);
|
54
44
|
destPath = replaceVarsInFileName(vars, destPath);
|
@@ -86,24 +76,6 @@ const createWebcomponentsPackage = async () => {
|
|
86
76
|
name = response.name;
|
87
77
|
}
|
88
78
|
|
89
|
-
// Add TypeScript support
|
90
|
-
response = await prompts({
|
91
|
-
type: "select",
|
92
|
-
name: "language",
|
93
|
-
message: "Support TypeScript:",
|
94
|
-
choices: [
|
95
|
-
{
|
96
|
-
title: "JavaScript",
|
97
|
-
value: "js",
|
98
|
-
},
|
99
|
-
{
|
100
|
-
title: "TypeScript",
|
101
|
-
value: "ts",
|
102
|
-
},
|
103
|
-
]
|
104
|
-
});
|
105
|
-
const typescript = response.language === "ts";
|
106
|
-
|
107
79
|
// Get the port
|
108
80
|
response = await prompts({
|
109
81
|
type: "text",
|
@@ -132,7 +104,6 @@ const createWebcomponentsPackage = async () => {
|
|
132
104
|
INIT_PACKAGE_VAR_PORT: port,
|
133
105
|
INIT_PACKAGE_VAR_TAG: tag,
|
134
106
|
INIT_PACKAGE_VAR_CLASS_NAME: className,
|
135
|
-
INIT_PACKAGE_VAR_TYPESCRIPT: typescript
|
136
107
|
};
|
137
108
|
|
138
109
|
const packageContent = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "1.10.
|
3
|
+
"version": "1.10.5",
|
4
4
|
"description": "UI5 Web Components: create package",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -23,5 +23,5 @@
|
|
23
23
|
"npm-config-user-agent-parser": "^1.0.0",
|
24
24
|
"prompts": "^2.4.1"
|
25
25
|
},
|
26
|
-
"gitHead": "
|
26
|
+
"gitHead": "80761cf0065e72e98596c20c4136e4113d96386a"
|
27
27
|
}
|
package/template/global.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
// eslint-disable-next-line
|
2
|
-
import "@ui5/webcomponents-base/dist/global";
|
3
|
-
import { TemplateFunction } from "@ui5/webcomponents-base/dist/renderer/executeTemplate.js";
|
4
|
-
|
5
|
-
export {};
|
6
|
-
|
7
|
-
declare global {
|
8
|
-
module "*.lit.js" {
|
9
|
-
const content: TemplateFunction;
|
10
|
-
export default content;
|
11
|
-
}
|
12
|
-
}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
-
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
3
|
-
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
4
|
-
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
5
|
-
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
6
|
-
import type { I18nText } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
7
|
-
|
8
|
-
// Template
|
9
|
-
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
|
10
|
-
|
11
|
-
// Styles
|
12
|
-
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
13
|
-
|
14
|
-
// @ts-ignore
|
15
|
-
import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
|
16
|
-
|
17
|
-
/**
|
18
|
-
* @class
|
19
|
-
*
|
20
|
-
* <h3 class="comment-api-title">Overview</h3>
|
21
|
-
*
|
22
|
-
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
23
|
-
*
|
24
|
-
* @constructor
|
25
|
-
* @alias demo.components.INIT_PACKAGE_VAR_CLASS_NAME
|
26
|
-
* @extends sap.ui.webc.base.UI5Element
|
27
|
-
* @tagname INIT_PACKAGE_VAR_TAG
|
28
|
-
* @public
|
29
|
-
*/
|
30
|
-
@customElement("INIT_PACKAGE_VAR_TAG")
|
31
|
-
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
32
|
-
static i18nBundle: I18nBundle;
|
33
|
-
|
34
|
-
static get render() {
|
35
|
-
return litRender;
|
36
|
-
}
|
37
|
-
|
38
|
-
static get template() {
|
39
|
-
return INIT_PACKAGE_VAR_CLASS_NAMETemplate;
|
40
|
-
}
|
41
|
-
|
42
|
-
static get styles() {
|
43
|
-
return INIT_PACKAGE_VAR_CLASS_NAMECss;
|
44
|
-
}
|
45
|
-
|
46
|
-
static async onDefine() {
|
47
|
-
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
48
|
-
}
|
49
|
-
|
50
|
-
get pleaseWaitText() {
|
51
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(PLEASE_WAIT as I18nText);
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
56
|
-
|
57
|
-
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
package/template/tsconfig.json
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"include": ["src/**/*", "global.d.ts"],
|
3
|
-
"compilerOptions": {
|
4
|
-
"target": "ES2021",
|
5
|
-
// Generate d.ts files
|
6
|
-
"declaration": true,
|
7
|
-
"outDir": "dist",
|
8
|
-
"skipLibCheck": true,
|
9
|
-
"sourceMap": true,
|
10
|
-
"strict": true,
|
11
|
-
"moduleResolution": "node",
|
12
|
-
"experimentalDecorators": true,
|
13
|
-
},
|
14
|
-
}
|