@ui5/create-webcomponents-package 0.0.0-b93c2a321 → 0.0.0-cad512aa3
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 +198 -0
- package/README.md +32 -13
- package/{index.js → create-package.js} +91 -45
- package/package.json +4 -3
- package/template/.eslintignore +2 -0
- package/template/global.d.ts +12 -0
- package/template/package-scripts.js +2 -1
- package/template/src/Assets.ts +5 -0
- package/template/src/MyFirstComponent.js +16 -0
- package/template/src/MyFirstComponent.ts +48 -0
- package/template/test/pages/index.html +1 -3
- package/template/test/specs/Demo.spec.js +3 -1
- package/template/tsconfig.json +15 -0
- package/template/config/.eslintrc.js +0 -1
- package/template/config/rollup.config.js +0 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,204 @@
|
|
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.12.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.0...v1.12.0-rc.1) (2023-03-16)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [1.12.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0...v1.12.0-rc.0) (2023-03-09)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
# [1.11.0](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.4...v1.11.0) (2023-03-06)
|
23
|
+
|
24
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
# [1.11.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.3...v1.11.0-rc.4) (2023-03-02)
|
31
|
+
|
32
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
# [1.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.2...v1.11.0-rc.3) (2023-02-23)
|
39
|
+
|
40
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
# [1.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.1...v1.11.0-rc.2) (2023-02-16)
|
47
|
+
|
48
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
# [1.11.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.0...v1.11.0-rc.1) (2023-02-09)
|
55
|
+
|
56
|
+
|
57
|
+
### Features
|
58
|
+
|
59
|
+
* **framework:** add option to define package name, tag and typescript support from CLI ([#6379](https://github.com/SAP/ui5-webcomponents/issues/6379)) ([687c0f7](https://github.com/SAP/ui5-webcomponents/commit/687c0f7a420a72f77f294ace2898223c48708ae2)), closes [#6382](https://github.com/SAP/ui5-webcomponents/issues/6382)
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
# [1.11.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.4-rc.0...v1.11.0-rc.0) (2023-02-02)
|
66
|
+
|
67
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
## [1.10.4-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.10.3...v1.10.4-rc.0) (2023-01-26)
|
74
|
+
|
75
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
## [1.10.3](https://github.com/SAP/ui5-webcomponents/compare/v1.10.2...v1.10.3) (2023-01-25)
|
82
|
+
|
83
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
## [1.10.1](https://github.com/SAP/ui5-webcomponents/compare/v0.0.0-7b49a7ff1...v1.10.1) (2023-01-24)
|
90
|
+
|
91
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
# [1.10.0](https://github.com/SAP/ui5-webcomponents/compare/v1.9.3...v1.10.0) (2023-01-20)
|
98
|
+
|
99
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
## [1.9.3](https://github.com/SAP/ui5-webcomponents/compare/v1.9.2...v1.9.3) (2022-12-16)
|
106
|
+
|
107
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
## [1.9.1](https://github.com/SAP/ui5-webcomponents/compare/v1.9.0...v1.9.1) (2022-11-10)
|
114
|
+
|
115
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# [1.9.0](https://github.com/SAP/ui5-webcomponents/compare/v1.8.0...v1.9.0) (2022-10-31)
|
122
|
+
|
123
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
# [1.8.0](https://github.com/SAP/ui5-webcomponents/compare/v1.7.1...v1.8.0) (2022-10-03)
|
130
|
+
|
131
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
## [1.7.1](https://github.com/SAP/ui5-webcomponents/compare/v1.7.0...v1.7.1) (2022-09-08)
|
138
|
+
|
139
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
# [1.7.0](https://github.com/SAP/ui5-webcomponents/compare/v1.6.0...v1.7.0) (2022-09-02)
|
146
|
+
|
147
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
# [1.6.0](https://github.com/SAP/ui5-webcomponents/compare/v1.5.0...v1.6.0) (2022-07-25)
|
154
|
+
|
155
|
+
|
156
|
+
### Bug Fixes
|
157
|
+
|
158
|
+
* create package bugs ([#5517](https://github.com/SAP/ui5-webcomponents/issues/5517)) ([f528f5c](https://github.com/SAP/ui5-webcomponents/commit/f528f5c))
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
# [1.5.0](https://github.com/SAP/ui5-webcomponents/compare/v1.4.0...v1.5.0) (2022-07-03)
|
165
|
+
|
166
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
# [1.4.0](https://github.com/SAP/ui5-webcomponents/compare/v1.3.1...v1.4.0) (2022-05-25)
|
173
|
+
|
174
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
## [1.3.1](https://github.com/SAP/ui5-webcomponents/compare/v1.3.0...v1.3.1) (2022-04-27)
|
181
|
+
|
182
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
# [1.3.0](https://github.com/SAP/ui5-webcomponents/compare/v1.2.4...v1.3.0) (2022-04-19)
|
189
|
+
|
190
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
## [1.2.4](https://github.com/SAP/ui5-webcomponents/compare/v1.2.3...v1.2.4) (2022-03-30)
|
197
|
+
|
198
|
+
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
6
204
|
## [1.2.3](https://github.com/SAP/ui5-webcomponents/compare/v1.2.2...v1.2.3) (2022-03-23)
|
7
205
|
|
8
206
|
**Note:** Version bump only for package @ui5/create-webcomponents-package
|
package/README.md
CHANGED
@@ -1,38 +1,57 @@
|
|
1
|
-

|
2
2
|
|
3
3
|
# UI5 Web Components - Create Package
|
4
4
|
|
5
|
-
[](https://travis-ci.org/SAP/ui5-webcomponents)
|
6
5
|
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
7
6
|
|
8
7
|
Provides an `npm init` script for creating new "UI5 Web Components" packages.
|
9
8
|
|
10
|
-
## Usage
|
9
|
+
## Usage with npm
|
11
10
|
|
12
|
-
|
11
|
+
```
|
12
|
+
Usage:
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
# npm 6.x
|
15
|
+
npm init @ui5/webcomponents-package [OPTIONS]
|
16
|
+
# npm 7+, an extra double-dash is needed:
|
17
|
+
npm init @ui5/webcomponents-package -- [OPTIONS]
|
16
18
|
|
17
|
-
|
19
|
+
Options:
|
20
|
+
--name <string> - defines the package name
|
21
|
+
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
22
|
+
--enable-typescript - enables TypeScript support for the package
|
23
|
+
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
24
|
+
```
|
18
25
|
|
19
|
-
|
20
|
-
|
26
|
+
The script creates a new directory, and fills it with a `package.json` file and all necessary source files, and resources for a new
|
27
|
+
components package.
|
28
|
+
|
29
|
+
## Usage with yarn
|
30
|
+
|
31
|
+
```
|
32
|
+
Usage:
|
33
|
+
yarn create @ui5/webcomponents-package [OPTIONS]
|
34
|
+
Options:
|
35
|
+
--name <string> - defines the package name
|
36
|
+
--tag <string> - defines the tag name of the sample web component that will be created in your new package
|
37
|
+
--enable-typescript - enables TypeScript support for the package
|
38
|
+
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
|
39
|
+
```
|
21
40
|
|
22
41
|
The script creates a new directory, and fills it with a `package.json` file and all necessary source files, and resources for a new
|
23
42
|
components package.
|
24
43
|
|
25
44
|
## Resources
|
26
|
-
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/
|
45
|
+
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
27
46
|
- [UI5 Web Components - Home Page](https://sap.github.io/ui5-webcomponents)
|
28
47
|
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/playground/)
|
29
48
|
|
30
49
|
## Support
|
31
|
-
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
50
|
+
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://join-ui5-slack.herokuapp.com/).
|
32
51
|
|
33
52
|
## Contribute
|
34
|
-
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/
|
53
|
+
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
35
54
|
|
36
55
|
## License
|
37
56
|
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
|
38
|
-
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/
|
57
|
+
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/main/LICENSE.txt) file.
|
@@ -5,6 +5,12 @@ const path = require("path");
|
|
5
5
|
const mkdirp = require("mkdirp");
|
6
6
|
const prompts = require("prompts");
|
7
7
|
const parser = require("npm-config-user-agent-parser");
|
8
|
+
const yargs = require("yargs/yargs");
|
9
|
+
const { hideBin } = require("yargs/helpers");
|
10
|
+
|
11
|
+
const argv = yargs(hideBin(process.argv)).argv;
|
12
|
+
|
13
|
+
const version = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))).version;
|
8
14
|
|
9
15
|
// from where all the files will be copied
|
10
16
|
const TEMPLATE_DIR = path.join(`${__dirname}`, `template/`);
|
@@ -17,10 +23,15 @@ const toCamelCase = parts => {
|
|
17
23
|
return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
18
24
|
}).join("");
|
19
25
|
};
|
26
|
+
const isTypescriptRelatedFile = sourcePath => {
|
27
|
+
return ["Assets.ts", "MyFirstComponent.ts", "tsconfig.json", "global.d.ts"].some(fileName => sourcePath.includes(fileName));
|
28
|
+
};
|
29
|
+
const isJSRelatedFile = sourcePath => {
|
30
|
+
return ["Assets.js", "MyFirstComponent.js"].some(fileName => sourcePath.includes(fileName));
|
31
|
+
};
|
20
32
|
|
21
33
|
// Validation of user input
|
22
34
|
const isNameValid = name => typeof name === "string" && name.match(/^[a-zA-Z0-9\-_]+$/);
|
23
|
-
const isPortValid = port => typeof port === "string" && port.match(/^[0-9]+$/);
|
24
35
|
const isTagValid = tag => typeof tag === "string" && tag.match(/^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/);
|
25
36
|
|
26
37
|
// Utils for building the file structure
|
@@ -37,7 +48,14 @@ const replaceVarsInFileName = (vars, fileName) => {
|
|
37
48
|
};
|
38
49
|
|
39
50
|
const copyFile = (vars, sourcePath, destPath) => {
|
40
|
-
|
51
|
+
const ignoreJsRelated = vars.INIT_PACKAGE_VAR_TYPESCRIPT && isJSRelatedFile(sourcePath);
|
52
|
+
const ignoreTsRelated = !vars.INIT_PACKAGE_VAR_TYPESCRIPT && isTypescriptRelatedFile(sourcePath);
|
53
|
+
|
54
|
+
if (ignoreJsRelated || ignoreTsRelated) {
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
|
58
|
+
let content = fs.readFileSync(sourcePath, { encoding: "UTF-8" });
|
41
59
|
content = replaceVarsInFileContent(vars, content);
|
42
60
|
destPath = replaceVarsInFileName(vars, destPath);
|
43
61
|
fs.writeFileSync(destPath, content);
|
@@ -57,51 +75,15 @@ const copyFiles = (vars, sourcePath, destPath) => {
|
|
57
75
|
}
|
58
76
|
};
|
59
77
|
|
60
|
-
|
61
|
-
const createWebcomponentsPackage = async () => {
|
62
|
-
let response;
|
63
|
-
|
64
|
-
// Get the name
|
65
|
-
let name = process.argv[2];
|
66
|
-
|
67
|
-
if (!isNameValid(name)) {
|
68
|
-
response = await prompts({
|
69
|
-
type: "text",
|
70
|
-
name: "name",
|
71
|
-
message: "Package name:",
|
72
|
-
validate: isNameValid,
|
73
|
-
});
|
74
|
-
name = response.name;
|
75
|
-
}
|
76
|
-
|
77
|
-
// Get the port
|
78
|
-
response = await prompts({
|
79
|
-
type: "text",
|
80
|
-
name: "port",
|
81
|
-
message: "Dev server port:",
|
82
|
-
validate: isPortValid,
|
83
|
-
initial: "8080",
|
84
|
-
});
|
85
|
-
const port = response.port;
|
86
|
-
|
87
|
-
// Get the tag
|
88
|
-
response = await prompts({
|
89
|
-
type: "text",
|
90
|
-
name: "tag",
|
91
|
-
message: "Demo component name:",
|
92
|
-
initial: "my-first-component",
|
93
|
-
validate: isTagValid,
|
94
|
-
});
|
95
|
-
const tag = response.tag;
|
96
|
-
|
78
|
+
const generateFilesContent = (name, tag, typescript) => {
|
97
79
|
const className = capitalizeFirst(kebabToCamelCase(tag));
|
98
80
|
|
99
81
|
// All variables that will be replaced in the content of the resources/
|
100
82
|
const vars = {
|
101
83
|
INIT_PACKAGE_VAR_NAME: name,
|
102
|
-
INIT_PACKAGE_VAR_PORT: port,
|
103
84
|
INIT_PACKAGE_VAR_TAG: tag,
|
104
85
|
INIT_PACKAGE_VAR_CLASS_NAME: className,
|
86
|
+
INIT_PACKAGE_VAR_TYPESCRIPT: typescript,
|
105
87
|
};
|
106
88
|
|
107
89
|
const packageContent = {
|
@@ -115,14 +97,12 @@ const createWebcomponentsPackage = async () => {
|
|
115
97
|
"lint": "wc-dev lint",
|
116
98
|
"start": "wc-dev start",
|
117
99
|
"watch": "wc-dev watch",
|
118
|
-
"serve": "wc-dev serve",
|
119
100
|
"build": "wc-dev build",
|
120
101
|
"test": "wc-dev test",
|
121
102
|
"create-ui5-element": "wc-create-ui5-element",
|
122
103
|
"prepublishOnly": "npm run build",
|
123
104
|
},
|
124
105
|
exports: {
|
125
|
-
"./.port": "./.port",
|
126
106
|
"./src/*": "./src/*",
|
127
107
|
"./dist/*": "./dist/*",
|
128
108
|
"./package.json": "./package.json",
|
@@ -130,15 +110,19 @@ const createWebcomponentsPackage = async () => {
|
|
130
110
|
"./*": "./dist/*",
|
131
111
|
},
|
132
112
|
"dependencies": {
|
133
|
-
"@ui5/webcomponents-base":
|
134
|
-
"@ui5/webcomponents-theming":
|
113
|
+
"@ui5/webcomponents-base": version,
|
114
|
+
"@ui5/webcomponents-theming": version,
|
135
115
|
},
|
136
116
|
"devDependencies": {
|
137
|
-
"@ui5/webcomponents-tools":
|
117
|
+
"@ui5/webcomponents-tools": version,
|
138
118
|
"chromedriver": "*",
|
139
119
|
},
|
140
120
|
};
|
141
121
|
|
122
|
+
if (typescript) {
|
123
|
+
packageContent.devDependencies.typescript = "^4.9.4";
|
124
|
+
}
|
125
|
+
|
142
126
|
// Update package.json
|
143
127
|
const destDir = path.join(`./`, name);
|
144
128
|
mkdirp.sync(destDir);
|
@@ -165,4 +149,66 @@ const createWebcomponentsPackage = async () => {
|
|
165
149
|
console.log("\n");
|
166
150
|
};
|
167
151
|
|
152
|
+
// Main function
|
153
|
+
const createWebcomponentsPackage = async () => {
|
154
|
+
let response;
|
155
|
+
if (argv.name && !isNameValid(argv.name)) {
|
156
|
+
throw new Error("The package name should be a string (a-z, A-Z, 0-9).");
|
157
|
+
}
|
158
|
+
|
159
|
+
if (argv.tag && !isTagValid(argv.tag) ) {
|
160
|
+
throw new Error("The tag should be in kebab-case (my-first-component f.e) and it can't be a single word.");
|
161
|
+
}
|
162
|
+
|
163
|
+
let name = argv.name || "my-package";
|
164
|
+
let tag = argv.tag || "my-first-component";
|
165
|
+
let typescriptSupport = !!argv.enableTypescript;
|
166
|
+
|
167
|
+
if (argv.skip) {
|
168
|
+
return generateFilesContent(name, tag, typescriptSupport);
|
169
|
+
}
|
170
|
+
|
171
|
+
if (!argv.name) {
|
172
|
+
response = await prompts({
|
173
|
+
type: "text",
|
174
|
+
name: "name",
|
175
|
+
message: "Package name:",
|
176
|
+
validate: isNameValid,
|
177
|
+
});
|
178
|
+
name = response.name;
|
179
|
+
}
|
180
|
+
|
181
|
+
if (!typescriptSupport) {
|
182
|
+
response = await prompts({
|
183
|
+
type: "select",
|
184
|
+
name: "language",
|
185
|
+
message: "Project type:",
|
186
|
+
choices: [
|
187
|
+
{
|
188
|
+
title: "JavaScript",
|
189
|
+
value: false,
|
190
|
+
},
|
191
|
+
{
|
192
|
+
title: "TypeScript",
|
193
|
+
value: true,
|
194
|
+
},
|
195
|
+
],
|
196
|
+
});
|
197
|
+
typescriptSupport = response.language;
|
198
|
+
}
|
199
|
+
|
200
|
+
if (!argv.tag) {
|
201
|
+
response = await prompts({
|
202
|
+
type: "text",
|
203
|
+
name: "tag",
|
204
|
+
message: "Component name:",
|
205
|
+
initial: "my-first-component",
|
206
|
+
validate: isTagValid,
|
207
|
+
});
|
208
|
+
tag = response.tag;
|
209
|
+
}
|
210
|
+
|
211
|
+
return generateFilesContent(name, tag, typescriptSupport);
|
212
|
+
};
|
213
|
+
|
168
214
|
createWebcomponentsPackage();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/create-webcomponents-package",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-cad512aa3",
|
4
4
|
"description": "UI5 Web Components: create package",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"ui5"
|
12
12
|
],
|
13
13
|
"bin": {
|
14
|
-
"create-webcomponents-package": "
|
14
|
+
"create-webcomponents-package": "create-package.js"
|
15
15
|
},
|
16
16
|
"repository": {
|
17
17
|
"type": "git",
|
@@ -21,6 +21,7 @@
|
|
21
21
|
"dependencies": {
|
22
22
|
"mkdirp": "^1.0.4",
|
23
23
|
"npm-config-user-agent-parser": "^1.0.0",
|
24
|
-
"prompts": "^2.4.1"
|
24
|
+
"prompts": "^2.4.1",
|
25
|
+
"yargs": "^17.5.1"
|
25
26
|
}
|
26
27
|
}
|
package/template/.eslintignore
CHANGED
@@ -0,0 +1,12 @@
|
|
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
|
+
}
|
@@ -10,6 +10,9 @@ import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_
|
|
10
10
|
|
11
11
|
import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
|
12
12
|
|
13
|
+
/**
|
14
|
+
* @public
|
15
|
+
*/
|
13
16
|
const metadata = {
|
14
17
|
tag: "INIT_PACKAGE_VAR_TAG",
|
15
18
|
properties: {
|
@@ -20,6 +23,19 @@ const metadata = {
|
|
20
23
|
},
|
21
24
|
};
|
22
25
|
|
26
|
+
/**
|
27
|
+
* @class
|
28
|
+
*
|
29
|
+
* <h3 class="comment-api-title">Overview</h3>
|
30
|
+
*
|
31
|
+
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
32
|
+
*
|
33
|
+
* @constructor
|
34
|
+
* @alias demo.components.INIT_PACKAGE_VAR_CLASS_NAME
|
35
|
+
* @extends sap.ui.webc.base.UI5Element
|
36
|
+
* @tagname INIT_PACKAGE_VAR_TAG
|
37
|
+
* @public
|
38
|
+
*/
|
23
39
|
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
24
40
|
static get metadata() {
|
25
41
|
return metadata;
|
@@ -0,0 +1,48 @@
|
|
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
|
+
|
7
|
+
// Template
|
8
|
+
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
|
9
|
+
|
10
|
+
// Styles
|
11
|
+
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
12
|
+
|
13
|
+
import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
|
14
|
+
|
15
|
+
/**
|
16
|
+
* @class
|
17
|
+
*
|
18
|
+
* <h3 class="comment-api-title">Overview</h3>
|
19
|
+
*
|
20
|
+
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
21
|
+
*
|
22
|
+
* @constructor
|
23
|
+
* @alias demo.components.INIT_PACKAGE_VAR_CLASS_NAME
|
24
|
+
* @extends sap.ui.webc.base.UI5Element
|
25
|
+
* @tagname INIT_PACKAGE_VAR_TAG
|
26
|
+
* @public
|
27
|
+
*/
|
28
|
+
@customElement({
|
29
|
+
tag: "INIT_PACKAGE_VAR_TAG",
|
30
|
+
renderer: litRender,
|
31
|
+
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
32
|
+
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
33
|
+
})
|
34
|
+
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
35
|
+
static i18nBundle: I18nBundle;
|
36
|
+
|
37
|
+
static async onDefine() {
|
38
|
+
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
39
|
+
}
|
40
|
+
|
41
|
+
get pleaseWaitText() {
|
42
|
+
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(PLEASE_WAIT);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
47
|
+
|
48
|
+
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
@@ -2,12 +2,10 @@
|
|
2
2
|
<html>
|
3
3
|
|
4
4
|
<head>
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
5
|
<meta charset="utf-8">
|
7
6
|
|
8
7
|
<title>INIT_PACKAGE_VAR_TAG</title>
|
9
8
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
10
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
11
9
|
<meta charset="utf-8">
|
12
10
|
|
13
11
|
<script data-ui5-config type="application/json">
|
@@ -16,7 +14,7 @@
|
|
16
14
|
}
|
17
15
|
</script>
|
18
16
|
|
19
|
-
<script src="../../
|
17
|
+
<script src="../../bundle.esm.js" type="module"></script>
|
20
18
|
|
21
19
|
<style>
|
22
20
|
code { color: blue; font-size: small; }
|
@@ -1,7 +1,9 @@
|
|
1
1
|
const assert = require("assert");
|
2
2
|
|
3
3
|
describe("INIT_PACKAGE_VAR_TAG rendering", async () => {
|
4
|
-
|
4
|
+
before(async () => {
|
5
|
+
await browser.url("test/pages/index.html");
|
6
|
+
});
|
5
7
|
|
6
8
|
it("tests if web component is correctly rendered", async () => {
|
7
9
|
|
@@ -0,0 +1,15 @@
|
|
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
|
+
"inlineSources": true,
|
11
|
+
"strict": true,
|
12
|
+
"moduleResolution": "node",
|
13
|
+
"experimentalDecorators": true,
|
14
|
+
},
|
15
|
+
}
|
@@ -1 +0,0 @@
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/eslint.js"); // eslint-disable-line
|
@@ -1 +0,0 @@
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/rollup.js"); // eslint-disable-line
|