Skip to content

Commit 4a3c129

Browse files
authored
Merge pull request #83 from open-wc/feat/update
feat: updates
2 parents d234d19 + 7dfac63 commit 4a3c129

File tree

21 files changed

+7415
-6989
lines changed

21 files changed

+7415
-6989
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@
5858
"@babel/register": "^7.16.0",
5959
"@custom-elements-manifest/analyzer": "^0.4.17",
6060
"@open-wc/building-rollup": "^2.0.2",
61-
"@open-wc/eslint-config": "^8.0.2",
61+
"@open-wc/eslint-config": "^9.0.0",
6262
"@open-wc/testing": "^2.5.33",
6363
"@rollup/plugin-babel": "^5.3.0",
6464
"@web/rollup-plugin-html": "^1.11.0",
6565
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
6666
"babel-plugin-transform-dynamic-import": "^2.1.0",
6767
"chai": "^4.3.4",
6868
"chai-fs": "^2.0.0",
69-
"eslint": "^7.32.0",
69+
"eslint": "^8.30.0",
7070
"eslint-config-prettier": "^8.3.0",
7171
"eslint-plugin-import": "^2.25.3",
7272
"eslint-plugin-lit": "^1.6.1",
@@ -77,6 +77,7 @@
7777
"mocha": "^9.1.3",
7878
"onchange": "^7.1.0",
7979
"prettier": "^2.4.1",
80+
"rollup-plugin-esbuild": "^5.0.0",
8081
"standard-version": "^9.3.2"
8182
},
8283
"prettier": {

src/generators/app-lit-element-ts/templates/MyApp.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"schemaVersion": "1.0.0",
3+
"readme": "",
4+
"modules": [
5+
{
6+
"kind": "javascript-module",
7+
"path": "src/scaffold-app.js",
8+
"declarations": [
9+
{
10+
"kind": "class",
11+
"description": "",
12+
"name": "ScaffoldApp",
13+
"members": [
14+
{
15+
"kind": "field",
16+
"name": "header",
17+
"type": {
18+
"text": "string"
19+
},
20+
"default": "'My app'",
21+
"privacy": "public",
22+
"attribute": "header"
23+
}
24+
],
25+
"attributes": [
26+
{
27+
"name": "header",
28+
"fieldName": "header"
29+
}
30+
],
31+
"superclass": {
32+
"name": "LitElement",
33+
"package": "lit"
34+
},
35+
"tagName": "scaffold-app",
36+
"customElement": true
37+
}
38+
],
39+
"exports": [
40+
{
41+
"kind": "custom-element-definition",
42+
"name": "scaffold-app",
43+
"declaration": {
44+
"name": "ScaffoldApp",
45+
"module": "src/scaffold-app.js"
46+
}
47+
}
48+
]
49+
},
50+
{
51+
"kind": "javascript-module",
52+
"path": "stories/scaffold-app.stories.js",
53+
"declarations": [
54+
{
55+
"kind": "variable",
56+
"name": "App"
57+
}
58+
],
59+
"exports": [
60+
{
61+
"kind": "js",
62+
"name": "default",
63+
"declaration": {
64+
"module": "stories/scaffold-app.stories.js"
65+
}
66+
},
67+
{
68+
"kind": "js",
69+
"name": "App",
70+
"declaration": {
71+
"name": "App",
72+
"module": "stories/scaffold-app.stories.js"
73+
}
74+
}
75+
]
76+
}
77+
]
78+
}
Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,81 @@
1-
import { <%= className %> } from './<%= className %>.js';
1+
import { LitElement, html, css } from 'lit';
2+
import { property, customElement } from 'lit/decorators.js';
23

3-
customElements.define('<%= tagName %>', <%= className %>);
4+
const logo = new URL('../../assets/open-wc-logo.svg', import.meta.url).href;
5+
6+
@customElement('<%= tagName %>')
7+
class <%= className %> extends LitElement {
8+
@property({ type: String }) header = 'My app';
9+
10+
static styles = css`
11+
:host {
12+
min-height: 100vh;
13+
display: flex;
14+
flex-direction: column;
15+
align-items: center;
16+
justify-content: flex-start;
17+
font-size: calc(10px + 2vmin);
18+
color: #1a2b42;
19+
max-width: 960px;
20+
margin: 0 auto;
21+
text-align: center;
22+
background-color: var(--<%= tagName %>-background-color);
23+
}
24+
25+
main {
26+
flex-grow: 1;
27+
}
28+
29+
.logo {
30+
margin-top: 36px;
31+
animation: app-logo-spin infinite 20s linear;
32+
}
33+
34+
@keyframes app-logo-spin {
35+
from {
36+
transform: rotate(0deg);
37+
}
38+
to {
39+
transform: rotate(360deg);
40+
}
41+
}
42+
43+
.app-footer {
44+
font-size: calc(12px + 0.5vmin);
45+
align-items: center;
46+
}
47+
48+
.app-footer a {
49+
margin-left: 5px;
50+
}
51+
`;
52+
53+
render() {
54+
return html`
55+
<main>
56+
<div class="logo"><img alt="open-wc logo" src=${logo} /></div>
57+
<h1>${this.header}</h1>
58+
59+
<p>Edit <code>src/<%= className %>.ts</code> and save to reload.</p>
60+
<a
61+
class="app-link"
62+
href="https://open-wc.org/guides/developing-components/code-examples"
63+
target="_blank"
64+
rel="noopener noreferrer"
65+
>
66+
Code examples
67+
</a>
68+
</main>
69+
70+
<p class="app-footer">
71+
🚽 Made with love by
72+
<a
73+
target="_blank"
74+
rel="noopener noreferrer"
75+
href="https://github.com/open-wc"
76+
>open-wc</a
77+
>.
78+
</p>
79+
`;
80+
}
81+
}

src/generators/app-lit-element/templates/MyApp.js

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)