@ui5/create-webcomponents-package 0.0.0-db2be6526 → 0.0.0-db622d8a8
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 +349 -0
- package/README.md +33 -13
- package/create-package.js +271 -0
- package/package.json +4 -3
- package/template/.eslintignore +3 -0
- package/template/.eslintrc.js +5 -0
- package/template/gitignore +4 -0
- package/template/npmrc +2 -0
- package/template/package-scripts.js +2 -1
- package/template/src/Assets.ts +5 -0
- package/template/src/MyFirstComponent.hbs +1 -1
- package/template/src/MyFirstComponent.js +33 -4
- package/template/src/MyFirstComponent.ts +62 -0
- package/template/src/i18n/messagebundle.properties +3 -2
- package/template/src/i18n/messagebundle_de.properties +1 -1
- package/template/src/i18n/messagebundle_en.properties +1 -1
- package/template/src/i18n/messagebundle_es.properties +1 -1
- package/template/src/i18n/messagebundle_fr.properties +1 -1
- package/template/src/themes/MyFirstComponent.css +10 -9
- package/template/src/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/template/src/themes/sap_horizon_dark/parameters-bundle.css +3 -0
- package/template/src/themes/sap_horizon_hcb/parameters-bundle.css +3 -0
- package/template/test/pages/css/index.css +36 -0
- package/template/test/pages/img/logo.png +0 -0
- package/template/test/pages/index.html +37 -34
- package/template/test/specs/Demo.spec.js +3 -2
- package/template/tsconfig.json +15 -0
- package/index.js +0 -168
- package/template/config/.eslintrc.js +0 -1
- package/template/config/rollup.config.js +0 -1
- package/template/src/themes/sap_belize_hcw/parameters-bundle.css +0 -3
- package/template/src/themes/sap_fiori_3_dark/parameters-bundle.css +0 -3
- package/template/src/themes/sap_fiori_3_hcb/parameters-bundle.css +0 -3
- package/template/src/themes/sap_fiori_3_hcw/parameters-bundle.css +0 -3
- /package/template/src/themes/{sap_belize → sap_horizon}/parameters-bundle.css +0 -0
- /package/template/src/themes/{sap_belize_hcb → sap_horizon_hcw}/parameters-bundle.css +0 -0
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-db622d8a8",
|
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,5 @@
|
|
1
|
+
const config = require("@ui5/webcomponents-tools/components-package/eslint.js");
|
2
|
+
|
3
|
+
// This eslint config is defined @ui5/webcomponents-tools,
|
4
|
+
// Feel free to override part of the configuration or provide entirely new config to fit your dev requirements.
|
5
|
+
module.exports = config;
|
package/template/npmrc
ADDED
@@ -1 +1 @@
|
|
1
|
-
<div>
|
1
|
+
<div @click="{{onClick}}">{{counterText}} :: {{count}}</div>
|
@@ -8,11 +8,23 @@ import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACK
|
|
8
8
|
// Styles
|
9
9
|
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
10
10
|
|
11
|
-
import {
|
11
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
12
12
|
|
13
|
+
/**
|
14
|
+
* @public
|
15
|
+
*/
|
13
16
|
const metadata = {
|
14
17
|
tag: "INIT_PACKAGE_VAR_TAG",
|
15
|
-
properties: {
|
18
|
+
properties: /** @lends INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME.prototype */ {
|
19
|
+
/**
|
20
|
+
* Defines the count of the component.
|
21
|
+
* @type { number }
|
22
|
+
* @defaultvalue 0
|
23
|
+
* @public
|
24
|
+
*/
|
25
|
+
count: {
|
26
|
+
defaultValue: 0,
|
27
|
+
},
|
16
28
|
},
|
17
29
|
slots: {
|
18
30
|
},
|
@@ -20,6 +32,19 @@ const metadata = {
|
|
20
32
|
},
|
21
33
|
};
|
22
34
|
|
35
|
+
/**
|
36
|
+
* @class
|
37
|
+
*
|
38
|
+
* <h3 class="comment-api-title">Overview</h3>
|
39
|
+
*
|
40
|
+
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
41
|
+
*
|
42
|
+
* @constructor
|
43
|
+
* @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
|
44
|
+
* @extends sap.ui.webc.base.UI5Element
|
45
|
+
* @tagname INIT_PACKAGE_VAR_TAG
|
46
|
+
* @public
|
47
|
+
*/
|
23
48
|
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
24
49
|
static get metadata() {
|
25
50
|
return metadata;
|
@@ -41,8 +66,12 @@ class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
41
66
|
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
42
67
|
}
|
43
68
|
|
44
|
-
|
45
|
-
|
69
|
+
onClick() {
|
70
|
+
this.count++;
|
71
|
+
}
|
72
|
+
|
73
|
+
get counterText() {
|
74
|
+
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNT);
|
46
75
|
}
|
47
76
|
}
|
48
77
|
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
+
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
3
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
4
|
+
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
5
|
+
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
6
|
+
import type I18nBundle 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
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @class
|
18
|
+
*
|
19
|
+
* <h3 class="comment-api-title">Overview</h3>
|
20
|
+
*
|
21
|
+
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
22
|
+
*
|
23
|
+
* @constructor
|
24
|
+
* @alias INIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME
|
25
|
+
* @extends sap.ui.webc.base.UI5Element
|
26
|
+
* @tagname INIT_PACKAGE_VAR_TAG
|
27
|
+
* @public
|
28
|
+
*/
|
29
|
+
@customElement({
|
30
|
+
tag: "INIT_PACKAGE_VAR_TAG",
|
31
|
+
renderer: litRender,
|
32
|
+
styles: INIT_PACKAGE_VAR_CLASS_NAMECss,
|
33
|
+
template: INIT_PACKAGE_VAR_CLASS_NAMETemplate,
|
34
|
+
})
|
35
|
+
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
36
|
+
static i18nBundle: I18nBundle;
|
37
|
+
|
38
|
+
static async onDefine() {
|
39
|
+
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Defines the component count.
|
44
|
+
* @name NIT_PACKAGE_VAR_NAMESPACE.INIT_PACKAGE_VAR_CLASS_NAME.prototype.count
|
45
|
+
* @public
|
46
|
+
* @type { number }
|
47
|
+
*/
|
48
|
+
@property({ defaultValue: 0 })
|
49
|
+
count!: number;
|
50
|
+
|
51
|
+
onClick() {
|
52
|
+
this.count++;
|
53
|
+
}
|
54
|
+
|
55
|
+
get counterText() {
|
56
|
+
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(COUNT);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
61
|
+
|
62
|
+
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
@@ -1,2 +1,3 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# the "counter" text for the sample component
|
2
|
+
COUNT=Count
|
3
|
+
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Zählung
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Count
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Cuenta
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
COUNT=Comte
|
@@ -1,11 +1,12 @@
|
|
1
1
|
:host {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
padding: 0 2rem;
|
3
|
+
color: var(--sapAvatar_6_TextColor);
|
4
|
+
background-color: var(--sapAvatar_6_Background);
|
5
|
+
border: 2px solid var(--my-component-border-color);
|
6
|
+
border-radius: 0.5rem;
|
7
|
+
box-shadow: var(--sapContent_Shadow0);
|
8
|
+
text-align: center;
|
9
|
+
line-height: 3rem;
|
10
|
+
font-size: 1.25rem;
|
11
|
+
user-select: none;
|
11
12
|
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
body {
|
2
|
+
color: var(--sapTextColor);
|
3
|
+
background-color: var(--sapBackgroundColor);
|
4
|
+
font-size: var(--sapFontSize);
|
5
|
+
font-family: var(--sapFontFamily);
|
6
|
+
}
|
7
|
+
|
8
|
+
h1 {
|
9
|
+
font-size: var(--sapFontHeader2Size);
|
10
|
+
margin-bottom: 0.5rem;
|
11
|
+
}
|
12
|
+
|
13
|
+
h2 {
|
14
|
+
font-size: var(--sapFontHeader3Size);
|
15
|
+
margin-bottom: 0.5rem;
|
16
|
+
}
|
17
|
+
|
18
|
+
.app, .app-first-component, .app-settings, .app-docs {
|
19
|
+
display: flex;
|
20
|
+
align-items: center;
|
21
|
+
justify-content: center;
|
22
|
+
flex-direction: column;
|
23
|
+
}
|
24
|
+
|
25
|
+
.app-first-component {
|
26
|
+
margin-bottom: 3rem;
|
27
|
+
}
|
28
|
+
|
29
|
+
.app-docs {
|
30
|
+
margin-top: 3rem;
|
31
|
+
}
|
32
|
+
|
33
|
+
a {
|
34
|
+
margin: 0.25rem;
|
35
|
+
color: var(--sapLinkColor);
|
36
|
+
}
|
Binary file
|
@@ -2,53 +2,56 @@
|
|
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">
|
14
12
|
{
|
13
|
+
"theme": "sap_horizon_dark",
|
15
14
|
"language": "EN"
|
16
15
|
}
|
17
16
|
</script>
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
<style>
|
22
|
-
code { color: blue; font-size: small; }
|
23
|
-
</style>
|
24
|
-
|
17
|
+
|
18
|
+
<link rel="stylesheet" type="text/css" href="./css/index.css">
|
19
|
+
<script src="../../bundle.esm.js" type="module"></script>
|
25
20
|
</head>
|
26
21
|
|
27
22
|
<body>
|
28
|
-
<
|
29
|
-
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
23
|
+
<div class="app">
|
24
|
+
<a href="https://sap.github.io/ui5-webcomponents/playground/getting-started" target="_blank"><img src="./img/logo.png" alt="logo"/></a>
|
25
|
+
|
26
|
+
<div class="app-first-component">
|
27
|
+
<h1>Hooray! It's Your First Web Component!</h1>
|
28
|
+
<div> <pre><INIT_PACKAGE_VAR_TAG></INIT_PACKAGE_VAR_TAG> </pre></div>
|
29
|
+
<INIT_PACKAGE_VAR_TAG id="myFirstComponent"></INIT_PACKAGE_VAR_TAG>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="app-settings">
|
33
|
+
|
34
|
+
<h2>Switch themes</h2>
|
35
|
+
<div style="display: flex; flex-direction: row;">
|
36
|
+
<a class="link" href="?sap-ui-theme=sap_horizon">Horizon</a>
|
37
|
+
<a class="link" href="?sap-ui-theme=sap_horizon_dark">Horizon Dark</a>
|
38
|
+
<a class="link" href="?sap-ui-theme=sap_horizon_hcb">Horizon High Contrast Black</a>
|
39
|
+
<a class="link" href="?sap-ui-theme=sap_horizon_hcw">Horizon High Contrast White</a>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<h2>Switch language</h2>
|
43
|
+
<div>
|
44
|
+
<a class="link" href="?sap-ui-language=en">English</a>
|
45
|
+
<a class="link" href="?sap-ui-language=de">German</a>
|
46
|
+
<a class="link" href="?sap-ui-language=es">Spanish</a>
|
47
|
+
<a class="link" href="?sap-ui-language=fr">French</a>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div class="app-docs">
|
52
|
+
<h2>Documentation</h2>
|
53
|
+
<a class="link" href="https://sap.github.io/ui5-webcomponents/playground/development">Custom Component Development</a>
|
54
|
+
</div>
|
55
|
+
</div>
|
52
56
|
</body>
|
53
|
-
|
54
57
|
</html>
|
@@ -1,10 +1,11 @@
|
|
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
|
-
|
8
9
|
const innerContent = await browser.$("#myFirstComponent").shadow$("div");
|
9
10
|
|
10
11
|
assert.ok(innerContent, "content rendered");
|
@@ -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
|
+
}
|
package/index.js
DELETED
@@ -1,168 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
|
3
|
-
const fs = require("fs");
|
4
|
-
const path = require("path");
|
5
|
-
const mkdirp = require("mkdirp");
|
6
|
-
const prompts = require("prompts");
|
7
|
-
const parser = require("npm-config-user-agent-parser");
|
8
|
-
|
9
|
-
// from where all the files will be copied
|
10
|
-
const TEMPLATE_DIR = path.join(`${__dirname}`, `template/`);
|
11
|
-
|
12
|
-
// String utils
|
13
|
-
const capitalizeFirst = str => str.substr(0,1).toUpperCase() + str.substr(1);
|
14
|
-
const kebabToCamelCase = string => toCamelCase(string.split("-"));
|
15
|
-
const toCamelCase = parts => {
|
16
|
-
return parts.map((string, index) => {
|
17
|
-
return index === 0 ? string.toLowerCase() : string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
18
|
-
}).join("");
|
19
|
-
};
|
20
|
-
|
21
|
-
// Validation of user input
|
22
|
-
const isNameValid = name => typeof name === "string" && name.match(/^[a-zA-Z0-9\-_]+$/);
|
23
|
-
const isPortValid = port => typeof port === "string" && port.match(/^[0-9]+$/);
|
24
|
-
const isTagValid = tag => typeof tag === "string" && tag.match(/^[a-z0-9]+?-[a-zA-Z0-9\-_]+?[a-z0-9]$/);
|
25
|
-
|
26
|
-
// Utils for building the file structure
|
27
|
-
const replaceVarsInFileContent = (vars, content) => {
|
28
|
-
for (let key in vars) {
|
29
|
-
const re = new RegExp(key, "g");
|
30
|
-
content = content.replace(re, vars[key]);
|
31
|
-
}
|
32
|
-
return content;
|
33
|
-
};
|
34
|
-
|
35
|
-
const replaceVarsInFileName = (vars, fileName) => {
|
36
|
-
return fileName.replace(/MyFirstComponent/, vars.INIT_PACKAGE_VAR_CLASS_NAME);
|
37
|
-
};
|
38
|
-
|
39
|
-
const copyFile = (vars, sourcePath, destPath) => {
|
40
|
-
let content = fs.readFileSync(sourcePath, {encoding: "UTF-8"});
|
41
|
-
content = replaceVarsInFileContent(vars, content);
|
42
|
-
destPath = replaceVarsInFileName(vars, destPath);
|
43
|
-
fs.writeFileSync(destPath, content);
|
44
|
-
};
|
45
|
-
|
46
|
-
const copyFiles = (vars, sourcePath, destPath) => {
|
47
|
-
const isDir = fs.lstatSync(sourcePath).isDirectory();
|
48
|
-
if (isDir) {
|
49
|
-
if (destPath) {
|
50
|
-
mkdirp.sync(destPath);
|
51
|
-
}
|
52
|
-
fs.readdirSync(sourcePath).forEach(file => {
|
53
|
-
copyFiles(vars, path.join(sourcePath, file), path.join(destPath, file));
|
54
|
-
});
|
55
|
-
} else {
|
56
|
-
copyFile(vars, sourcePath, destPath);
|
57
|
-
}
|
58
|
-
};
|
59
|
-
|
60
|
-
// Main function
|
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
|
-
|
97
|
-
const className = capitalizeFirst(kebabToCamelCase(tag));
|
98
|
-
|
99
|
-
// All variables that will be replaced in the content of the resources/
|
100
|
-
const vars = {
|
101
|
-
INIT_PACKAGE_VAR_NAME: name,
|
102
|
-
INIT_PACKAGE_VAR_PORT: port,
|
103
|
-
INIT_PACKAGE_VAR_TAG: tag,
|
104
|
-
INIT_PACKAGE_VAR_CLASS_NAME: className,
|
105
|
-
};
|
106
|
-
|
107
|
-
const packageContent = {
|
108
|
-
name,
|
109
|
-
version: "0.0.1",
|
110
|
-
ui5: {
|
111
|
-
webComponentsPackage: true,
|
112
|
-
},
|
113
|
-
scripts: {
|
114
|
-
"clean": "wc-dev clean",
|
115
|
-
"lint": "wc-dev lint",
|
116
|
-
"start": "wc-dev start",
|
117
|
-
"watch": "wc-dev watch",
|
118
|
-
"serve": "wc-dev serve",
|
119
|
-
"build": "wc-dev build",
|
120
|
-
"test": "wc-dev test",
|
121
|
-
"create-ui5-element": "wc-create-ui5-element",
|
122
|
-
"prepublishOnly": "npm run build",
|
123
|
-
},
|
124
|
-
exports: {
|
125
|
-
"./.port": "./.port",
|
126
|
-
"./src/*": "./src/*",
|
127
|
-
"./dist/*": "./dist/*",
|
128
|
-
"./package.json": "./package.json",
|
129
|
-
"./bundle.js": "./bundle.js",
|
130
|
-
"./*": "./dist/*",
|
131
|
-
},
|
132
|
-
"dependencies": {
|
133
|
-
"@ui5/webcomponents-base": "1.0.0-rc.15",
|
134
|
-
"@ui5/webcomponents-theming": "1.0.0-rc.15",
|
135
|
-
},
|
136
|
-
"devDependencies": {
|
137
|
-
"@ui5/webcomponents-tools": "1.0.0-rc.15",
|
138
|
-
"chromedriver": "*",
|
139
|
-
},
|
140
|
-
};
|
141
|
-
|
142
|
-
// Update package.json
|
143
|
-
const destDir = path.join(`./`, name);
|
144
|
-
mkdirp.sync(destDir);
|
145
|
-
fs.writeFileSync(path.join(destDir, "package.json"), JSON.stringify(packageContent, null, 2));
|
146
|
-
// Copy files
|
147
|
-
copyFiles(vars, TEMPLATE_DIR, destDir);
|
148
|
-
|
149
|
-
console.log("\nPackage successfully created!\nNext steps:\n");
|
150
|
-
console.log(`$ cd ${name}`);
|
151
|
-
|
152
|
-
let userAgentInfo;
|
153
|
-
try {
|
154
|
-
userAgentInfo = parser(process.env.npm_config_user_agent);
|
155
|
-
} catch (e) {}
|
156
|
-
|
157
|
-
if (userAgentInfo && userAgentInfo.yarn) {
|
158
|
-
console.log(`$ yarn`);
|
159
|
-
console.log(`$ yarn start`);
|
160
|
-
} else {
|
161
|
-
console.log(`$ npm i`);
|
162
|
-
console.log(`$ npm start`);
|
163
|
-
}
|
164
|
-
|
165
|
-
console.log("\n");
|
166
|
-
};
|
167
|
-
|
168
|
-
createWebcomponentsPackage();
|
@@ -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
|
File without changes
|
File without changes
|