@ui5/create-webcomponents-package 0.0.0-1b5f0ec39 → 0.0.0-1c3388f4d
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 +1559 -0
- package/README.md +9 -13
- package/create-package.js +200 -179
- package/package.json +3 -1
- package/template/.npsrc.json +3 -0
- package/template/cypress.config.ts +10 -0
- package/template/env +1 -0
- package/template/gitignore +2 -2
- package/template/{package-scripts.js → package-scripts.cjs} +0 -1
- package/template/package.json +35 -0
- package/template/src/Assets.ts +1 -1
- package/template/src/MyFirstComponent.ts +28 -20
- package/template/src/MyFirstComponentTemplate.tsx +9 -0
- package/template/{bundle.esm.js → src/bundle.esm.ts} +4 -5
- 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 +16 -10
- package/template/src/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/template/src/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/template/tsconfig.template.json +14 -0
- package/template/vite.config.js +14 -0
- package/template/.eslintignore +0 -5
- package/template/config/postcss.components/postcss.config.js +0 -1
- package/template/config/postcss.themes/postcss.config.js +0 -1
- package/template/config/wdio.conf.js +0 -1
- package/template/global.d.ts +0 -12
- package/template/src/Assets.js +0 -5
- package/template/src/MyFirstComponent.hbs +0 -1
- package/template/src/MyFirstComponent.js +0 -67
- package/template/src/themes/sap_fiori_3/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/test/pages/index.html +0 -53
- package/template/test/specs/Demo.spec.js +0 -14
- package/template/tsconfig.json +0 -15
|
@@ -1,48 +1,56 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
|
+
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
5
|
+
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
5
6
|
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
6
7
|
|
|
7
8
|
// Template
|
|
8
|
-
import
|
|
9
|
+
import {{INIT_PACKAGE_VAR_CLASS_NAME}}Template from "./{{INIT_PACKAGE_VAR_CLASS_NAME}}Template.js";
|
|
9
10
|
|
|
10
11
|
// Styles
|
|
11
|
-
import
|
|
12
|
+
import {{INIT_PACKAGE_VAR_CLASS_NAME}}Css from "./generated/themes/{{INIT_PACKAGE_VAR_CLASS_NAME}}.css.js";
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import { COUNT } from "./generated/i18n/i18n-defaults.js";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* @class
|
|
17
18
|
*
|
|
18
19
|
* <h3 class="comment-api-title">Overview</h3>
|
|
19
20
|
*
|
|
20
|
-
* The <code>INIT_PACKAGE_VAR_TAG</code> component is a demo component that displays some text.
|
|
21
|
+
* The <code>{{INIT_PACKAGE_VAR_TAG}}</code> component is a demo component that displays some text.
|
|
21
22
|
*
|
|
22
23
|
* @constructor
|
|
23
|
-
* @
|
|
24
|
-
* @extends sap.ui.webc.base.UI5Element
|
|
25
|
-
* @tagname INIT_PACKAGE_VAR_TAG
|
|
24
|
+
* @extends UI5Element
|
|
26
25
|
* @public
|
|
27
26
|
*/
|
|
28
27
|
@customElement({
|
|
29
|
-
tag: "INIT_PACKAGE_VAR_TAG",
|
|
30
|
-
renderer:
|
|
31
|
-
styles:
|
|
32
|
-
template:
|
|
28
|
+
tag: "{{INIT_PACKAGE_VAR_TAG}}",
|
|
29
|
+
renderer: jsxRenderer,
|
|
30
|
+
styles: {{INIT_PACKAGE_VAR_CLASS_NAME}}Css,
|
|
31
|
+
template: {{INIT_PACKAGE_VAR_CLASS_NAME}}Template,
|
|
33
32
|
})
|
|
34
|
-
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
33
|
+
class {{INIT_PACKAGE_VAR_CLASS_NAME}} extends UI5Element {
|
|
34
|
+
@i18n("{{INIT_PACKAGE_VAR_NAME}}")
|
|
35
35
|
static i18nBundle: I18nBundle;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Defines the component count.
|
|
39
|
+
* @default 0
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
@property({ type: Number })
|
|
43
|
+
count = 0;
|
|
44
|
+
|
|
45
|
+
onClick() {
|
|
46
|
+
this.count++;
|
|
39
47
|
}
|
|
40
48
|
|
|
41
|
-
get
|
|
42
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(
|
|
49
|
+
get counterText() {
|
|
50
|
+
return {{INIT_PACKAGE_VAR_CLASS_NAME}}.i18nBundle.getText(COUNT);
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
|
|
46
|
-
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
|
54
|
+
{{INIT_PACKAGE_VAR_CLASS_NAME}}.define();
|
|
47
55
|
|
|
48
|
-
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
|
56
|
+
export default {{INIT_PACKAGE_VAR_CLASS_NAME}};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type {{INIT_PACKAGE_VAR_CLASS_NAME}} from "./{{INIT_PACKAGE_VAR_CLASS_NAME}}.js";
|
|
2
|
+
|
|
3
|
+
export default function {{INIT_PACKAGE_VAR_CLASS_NAME}}Template(this: {{INIT_PACKAGE_VAR_CLASS_NAME}}) {
|
|
4
|
+
return (
|
|
5
|
+
<div class="root" onClick={this.onClick}>
|
|
6
|
+
{this.counterText} :: {this.count}
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -6,15 +6,15 @@ import { getLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
|
|
|
6
6
|
import { getCalendarType } from "@ui5/webcomponents-base/dist/config/CalendarType.js";
|
|
7
7
|
import { getTheme, setTheme } from "@ui5/webcomponents-base/dist/config/Theme.js";
|
|
8
8
|
import { getNoConflict, setNoConflict } from "@ui5/webcomponents-base/dist/config/NoConflict.js";
|
|
9
|
-
import { getRTL } from "@ui5/webcomponents-base/dist/config/RTL.js";
|
|
10
9
|
import { getFirstDayOfWeek } from "@ui5/webcomponents-base/dist/config/FormatSettings.js";
|
|
11
10
|
|
|
12
11
|
// Enable additional themes and i18n texts
|
|
13
|
-
import "./
|
|
12
|
+
import "./Assets.js";
|
|
14
13
|
|
|
15
|
-
// Import your web components here from the
|
|
16
|
-
import "./
|
|
14
|
+
// Import your web components here from the src/ directory
|
|
15
|
+
import "./{{INIT_PACKAGE_VAR_CLASS_NAME}}.js";
|
|
17
16
|
|
|
17
|
+
// @ts-expect-error
|
|
18
18
|
window["sap-ui-webcomponents-bundle"] = {
|
|
19
19
|
renderFinished,
|
|
20
20
|
configuration: {
|
|
@@ -25,7 +25,6 @@ window["sap-ui-webcomponents-bundle"] = {
|
|
|
25
25
|
getNoConflict,
|
|
26
26
|
setNoConflict,
|
|
27
27
|
getCalendarType,
|
|
28
|
-
getRTL,
|
|
29
28
|
getFirstDayOfWeek,
|
|
30
29
|
},
|
|
31
30
|
};
|
|
@@ -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,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
.root {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
padding: 0 2rem;
|
|
7
|
+
color: var(--sapAvatar_6_TextColor);
|
|
8
|
+
background-color: var(--sapAvatar_6_Background);
|
|
9
|
+
border: 2px solid var(--my-component-border-color);
|
|
10
|
+
border-radius: 0.5rem;
|
|
11
|
+
box-shadow: var(--sapContent_Shadow0);
|
|
12
|
+
text-align: center;
|
|
13
|
+
line-height: 3rem;
|
|
14
|
+
font-size: 1.25rem;
|
|
15
|
+
user-select: none;
|
|
16
|
+
cursor: pointer;
|
|
11
17
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@ui5/webcomponents-tools/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"src/**/*",
|
|
5
|
+
"global.d.ts"
|
|
6
|
+
],
|
|
7
|
+
"compilerOptions": {
|
|
8
|
+
{{INIT_PACKAGE_CYPRESS_ROOT_TSCONFIG}}
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"experimentalDecorators": true,
|
|
11
|
+
"module": "NodeNext",
|
|
12
|
+
"moduleResolution": "NodeNext"
|
|
13
|
+
},
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import viteConfig from "@ui5/webcomponents-tools/components-package/vite.config.js"; //eslint-disable-line
|
|
2
|
+
|
|
3
|
+
// Modifying the default Vite configuration provided by the @ui5/webcomponents-tools package.
|
|
4
|
+
// You can directly access and update the properties you need to change.
|
|
5
|
+
// Ensure that the property exists before modifying it to avoid unintended errors.
|
|
6
|
+
// For available configuration options, refer to: https://vite.dev/config/#configuring-vite
|
|
7
|
+
//
|
|
8
|
+
// Ensure the plugins array exists
|
|
9
|
+
// viteConfig.plugins = viteConfig.plugins || [];
|
|
10
|
+
//
|
|
11
|
+
// Push a new fake plugin
|
|
12
|
+
// viteConfig.plugins.push({ name: 'my-custom-plugin' });
|
|
13
|
+
|
|
14
|
+
export default viteConfig;
|
package/template/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/postcss.components.js"); // eslint-disable-line
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/postcss.themes.js"); // eslint-disable-line
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require("@ui5/webcomponents-tools/components-package/wdio.js"); // eslint-disable-line
|
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
|
-
}
|
package/template/src/Assets.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div>This is: INIT_PACKAGE_VAR_TAG. {{pleaseWaitText}}</div>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
-
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
3
|
-
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
4
|
-
|
|
5
|
-
// Template
|
|
6
|
-
import INIT_PACKAGE_VAR_CLASS_NAMETemplate from "./generated/templates/INIT_PACKAGE_VAR_CLASS_NAMETemplate.lit.js";
|
|
7
|
-
|
|
8
|
-
// Styles
|
|
9
|
-
import INIT_PACKAGE_VAR_CLASS_NAMECss from "./generated/themes/INIT_PACKAGE_VAR_CLASS_NAME.css.js";
|
|
10
|
-
|
|
11
|
-
import { PLEASE_WAIT } from "./generated/i18n/i18n-defaults.js";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
const metadata = {
|
|
17
|
-
tag: "INIT_PACKAGE_VAR_TAG",
|
|
18
|
-
properties: {
|
|
19
|
-
},
|
|
20
|
-
slots: {
|
|
21
|
-
},
|
|
22
|
-
events: {
|
|
23
|
-
},
|
|
24
|
-
};
|
|
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
|
-
*/
|
|
39
|
-
class INIT_PACKAGE_VAR_CLASS_NAME extends UI5Element {
|
|
40
|
-
static get metadata() {
|
|
41
|
-
return metadata;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static get render() {
|
|
45
|
-
return litRender;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static get template() {
|
|
49
|
-
return INIT_PACKAGE_VAR_CLASS_NAMETemplate;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
static get styles() {
|
|
53
|
-
return INIT_PACKAGE_VAR_CLASS_NAMECss;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static async onDefine() {
|
|
57
|
-
INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle = await getI18nBundle("INIT_PACKAGE_VAR_NAME");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get pleaseWaitText() {
|
|
61
|
-
return INIT_PACKAGE_VAR_CLASS_NAME.i18nBundle.getText(PLEASE_WAIT);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
INIT_PACKAGE_VAR_CLASS_NAME.define();
|
|
66
|
-
|
|
67
|
-
export default INIT_PACKAGE_VAR_CLASS_NAME;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
|
|
7
|
-
<title>INIT_PACKAGE_VAR_TAG</title>
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<meta charset="utf-8">
|
|
10
|
-
|
|
11
|
-
<script data-ui5-config type="application/json">
|
|
12
|
-
{
|
|
13
|
-
"language": "EN"
|
|
14
|
-
}
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<script src="../../bundle.esm.js" type="module"></script>
|
|
18
|
-
|
|
19
|
-
<style>
|
|
20
|
-
code { color: blue; font-size: small; }
|
|
21
|
-
</style>
|
|
22
|
-
|
|
23
|
-
</head>
|
|
24
|
-
|
|
25
|
-
<body>
|
|
26
|
-
<ul>
|
|
27
|
-
<li><a href="?sap-ui-theme=sap_fiori_3">Fiori 3</a></li>
|
|
28
|
-
<li><a href="?sap-ui-theme=sap_fiori_3_dark">Fiori 3 Dark</a></li>
|
|
29
|
-
<li><a href="?sap-ui-theme=sap_fiori_3_hcb">Fiori 3 High Contrast Black</a></li>
|
|
30
|
-
<li><a href="?sap-ui-theme=sap_fiori_3_hcw">Fiori 3 High Contrast White</a></li>
|
|
31
|
-
<li><a href="?sap-ui-theme=sap_horizon">Horizon</a></li>
|
|
32
|
-
<li><a href="?sap-ui-theme=sap_horizon_dark">Horizon Dark</a></li>
|
|
33
|
-
<li><a href="?sap-ui-theme=sap_horizon_hcb">Horizon High Contrast Black</a></li>
|
|
34
|
-
<li><a href="?sap-ui-theme=sap_horizon_hcw">Horizon High Contrast White</a></li>
|
|
35
|
-
</ul>
|
|
36
|
-
<br>
|
|
37
|
-
<span>or in the browser console, for example:</span>
|
|
38
|
-
<code>window['sap-ui-webcomponents-bundle'].configuration.setTheme("sap_horizon_hcb")</code>
|
|
39
|
-
|
|
40
|
-
<br><br>
|
|
41
|
-
|
|
42
|
-
<a href="?sap-ui-language=en">English</a> |
|
|
43
|
-
<a href="?sap-ui-language=de">German</a> |
|
|
44
|
-
<a href="?sap-ui-language=es">Spanish</a> |
|
|
45
|
-
<a href="?sap-ui-language=fr">French</a>
|
|
46
|
-
|
|
47
|
-
<br><br>
|
|
48
|
-
|
|
49
|
-
<h1>Test your web components here</h1>
|
|
50
|
-
<INIT_PACKAGE_VAR_TAG id="myFirstComponent"></INIT_PACKAGE_VAR_TAG>
|
|
51
|
-
</body>
|
|
52
|
-
|
|
53
|
-
</html>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const assert = require("assert");
|
|
2
|
-
|
|
3
|
-
describe("INIT_PACKAGE_VAR_TAG rendering", async () => {
|
|
4
|
-
before(async () => {
|
|
5
|
-
await browser.url("test/pages/index.html");
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
it("tests if web component is correctly rendered", async () => {
|
|
9
|
-
|
|
10
|
-
const innerContent = await browser.$("#myFirstComponent").shadow$("div");
|
|
11
|
-
|
|
12
|
-
assert.ok(innerContent, "content rendered");
|
|
13
|
-
});
|
|
14
|
-
});
|
package/template/tsconfig.json
DELETED
|
@@ -1,15 +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
|
-
"inlineSources": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
},
|
|
15
|
-
}
|