@blockquote/create-wc 1.2.0 → 1.3.0
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 +1 -0
- package/package.json +1 -1
- package/src/common-repo/templates/package.json +2 -1
- package/src/common-repo/templates/static/vite.config.js +19 -8
- package/src/wc-lit-element/templates/MyEl.js +0 -57
- package/src/wc-lit-element/templates/my-el.js +0 -3
- package/src/wc-lit-element/templates/partials/README.demoing.md +0 -13
- package/src/wc-lit-element/templates/partials/README.linting.md +0 -13
- package/src/wc-lit-element/templates/partials/README.testing.md +0 -13
- package/src/wc-lit-element/templates/static/README.md +0 -35
- package/src/wc-lit-element/templates/static/demo/index.html +0 -25
- package/src/wc-lit-element/templates/static/index.js +0 -1
- package/src/wc-lit-element/templates/styles/MyEl-styles.js +0 -20
- package/src/wc-lit-element-ts/templates/MyEl.ts +0 -46
- package/src/wc-lit-element-ts/templates/my-el.ts +0 -3
- package/src/wc-lit-element-ts/templates/partials/README.demoing.md +0 -13
- package/src/wc-lit-element-ts/templates/partials/README.linting.md +0 -13
- package/src/wc-lit-element-ts/templates/partials/README.testing.md +0 -13
- package/src/wc-lit-element-ts/templates/static/README.md +0 -35
- package/src/wc-lit-element-ts/templates/static/demo/index.html +0 -25
- package/src/wc-lit-element-ts/templates/static/index.ts +0 -1
- package/src/wc-lit-element-ts/templates/styles/MyEl-styles.ts +0 -20
- package/src/wc-lit-element-ts/templates/tsconfig.json +0 -27
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# create-blockquote-wc
|
package/package.json
CHANGED
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"rollup-plugin-copy": "^3.4.0",
|
|
38
38
|
"rollup-plugin-summary": "^1.3.0",
|
|
39
39
|
"rollup-plugin-minify-html-literals": "^1.2.6",
|
|
40
|
-
"
|
|
40
|
+
"tiny-array-flat-polyfill": "^0.2.1",
|
|
41
|
+
"vite": "^2.7.0-beta.8",
|
|
41
42
|
"sort-package-json": "^1.52.0"
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://vite-rollup-plugins.patak.dev/
|
|
3
|
+
*/
|
|
1
4
|
import { defineConfig } from 'vite';
|
|
2
5
|
import pluginHtml from '@web/rollup-plugin-html';
|
|
3
6
|
import copy from 'rollup-plugin-copy';
|
|
@@ -18,6 +21,10 @@ const copyConfig = {
|
|
|
18
21
|
src: 'node_modules/@ungap/global-this/index.js',
|
|
19
22
|
dest: 'dev/web_modules/@ungap/global-this',
|
|
20
23
|
},
|
|
24
|
+
{
|
|
25
|
+
src: 'node_modules/tiny-array-flat-polyfill/tiny-array-flat-polyfill.min.js',
|
|
26
|
+
dest: 'dev/web_modules/tiny-array-flat-polyfill',
|
|
27
|
+
},
|
|
21
28
|
{
|
|
22
29
|
src: 'node_modules/lit/polyfill-support.js',
|
|
23
30
|
dest: 'dev/web_modules/lit',
|
|
@@ -52,14 +59,16 @@ export default defineConfig({
|
|
|
52
59
|
plugins: [
|
|
53
60
|
pluginHtml({
|
|
54
61
|
transformHtml: [
|
|
55
|
-
html =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
(html) =>
|
|
63
|
+
html.replace(
|
|
64
|
+
'<meta charset="utf-8">',
|
|
65
|
+
`<meta charset="utf-8">
|
|
66
|
+
<script src="./web_modules/@ungap/global-this/index.js"></script>
|
|
67
|
+
<script src="./web_modules/tiny-array-flat-polyfill/tiny-array-flat-polyfill.min.js"></script>
|
|
68
|
+
<script src="./web_modules/lit/polyfill-support.js"></script>
|
|
69
|
+
<script src="./web_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
|
70
|
+
<script src="./web_modules/@webcomponents/shadycss/custom-style-interface.min.js"></script>`,
|
|
71
|
+
),
|
|
63
72
|
],
|
|
64
73
|
}),
|
|
65
74
|
|
|
@@ -68,6 +77,8 @@ export default defineConfig({
|
|
|
68
77
|
summary(),
|
|
69
78
|
],
|
|
70
79
|
build: {
|
|
80
|
+
target: ['edge18'],
|
|
81
|
+
minify: 'terser',
|
|
71
82
|
outDir: 'dev',
|
|
72
83
|
rollupOptions: {
|
|
73
84
|
input: 'demo/*.html',
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { html, LitElement } from 'lit';
|
|
2
|
-
import styles from './styles/<%= className %>-styles.js';
|
|
3
|
-
|
|
4
|
-
export class <%= className %> extends LitElement {
|
|
5
|
-
static get is() {
|
|
6
|
-
return '<%= tagName %>';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
static get styles() {
|
|
10
|
-
return [styles];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
static get properties() {
|
|
14
|
-
return {
|
|
15
|
-
/**
|
|
16
|
-
* The heading to say "Hello" to.
|
|
17
|
-
* @type {string}
|
|
18
|
-
*/
|
|
19
|
-
heading: { type: String },
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The number of times the button has been clicked.
|
|
23
|
-
* @type {number}
|
|
24
|
-
*/
|
|
25
|
-
counter: { type: Number },
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
|
-
this.heading = 'Hey there';
|
|
32
|
-
this.counter = 5;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
return html`
|
|
37
|
-
<h1>${this.sayHello(this.heading)}!</h1>
|
|
38
|
-
<button @click=${this._onClick}>Counter: ${this.counter}</button>
|
|
39
|
-
<hr />
|
|
40
|
-
<slot></slot>
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
_onClick() {
|
|
45
|
-
this.counter += 1;
|
|
46
|
-
this.dispatchEvent(new CustomEvent('counter-changed'));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Formats a greeting
|
|
51
|
-
* @param heading {string} The heading to say "Hello" to
|
|
52
|
-
* @returns {string} A greeting directed at `heading`
|
|
53
|
-
*/
|
|
54
|
-
sayHello(heading) {
|
|
55
|
-
return `Hello, ${heading}`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# \<<%= tagName %>>
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i <%= tagName %>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<script type="module">
|
|
17
|
-
import '<%= tagName %>/<%= tagName %>.js';
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<<%= tagName %>></<%= tagName %>>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Tooling configs
|
|
24
|
-
|
|
25
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
26
|
-
|
|
27
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
28
|
-
|
|
29
|
-
## Local Demo with `vite`
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm start
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
To run a local development server that serves the basic demo located in demo/index.html
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit';
|
|
16
|
-
import '../define/<%= tagName %>.js';
|
|
17
|
-
|
|
18
|
-
const heading = 'World!';
|
|
19
|
-
render(
|
|
20
|
-
html`<<%= tagName %> .heading=${heading}>some light-dom</<%= tagName %>>`,
|
|
21
|
-
document.querySelector('#demo'),
|
|
22
|
-
);
|
|
23
|
-
</script>
|
|
24
|
-
</body>
|
|
25
|
-
</html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { <%= className %> } from './src/<%= className %>.js';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-unused-vars */
|
|
2
|
-
import { css } from 'lit';
|
|
3
|
-
|
|
4
|
-
export default css`
|
|
5
|
-
:host {
|
|
6
|
-
display: block;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host([hidden]),
|
|
11
|
-
[hidden] {
|
|
12
|
-
display: none !important;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
*,
|
|
16
|
-
*:before,
|
|
17
|
-
*:after {
|
|
18
|
-
box-sizing: inherit;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { html, LitElement } from 'lit';
|
|
2
|
-
import { property } from 'lit/decorators.js';
|
|
3
|
-
import styles from './styles/<%= className %>-styles.js';
|
|
4
|
-
|
|
5
|
-
export class <%= className %> extends LitElement {
|
|
6
|
-
static get is() {
|
|
7
|
-
return '<%= tagName %>';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
static override styles = [styles];
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The heading to say "Hello" to.
|
|
14
|
-
*/
|
|
15
|
-
@property({ type: String })
|
|
16
|
-
heading = 'Hey there';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The number of times the button has been clicked.
|
|
20
|
-
*/
|
|
21
|
-
@property({ type: Number })
|
|
22
|
-
counter = 5;
|
|
23
|
-
|
|
24
|
-
override render() {
|
|
25
|
-
return html`
|
|
26
|
-
<h1>${this.sayHello(this.heading)}!</h1>
|
|
27
|
-
<button @click=${this._onClick}>Counter: ${this.counter}</button>
|
|
28
|
-
<hr />
|
|
29
|
-
<slot></slot>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private _onClick() {
|
|
34
|
-
this.counter += 1;
|
|
35
|
-
this.dispatchEvent(new CustomEvent('counter-changed'));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Formats a greeting
|
|
40
|
-
* @param heading The heading to say "Hello" to
|
|
41
|
-
* @returns {string} A greeting directed at `heading`
|
|
42
|
-
*/
|
|
43
|
-
sayHello(heading: string): string {
|
|
44
|
-
return `Hello, ${heading}`;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# \<<%= tagName %>>
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i <%= tagName %>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<script type="module">
|
|
17
|
-
import '<%= tagName %>/<%= tagName %>.js';
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<<%= tagName %>></<%= tagName %>>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Tooling configs
|
|
24
|
-
|
|
25
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
26
|
-
|
|
27
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
28
|
-
|
|
29
|
-
## Local Demo with `vite`
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm start
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
To run a local development server that serves the basic demo located in demo/index.html
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit';
|
|
16
|
-
import '../define/<%= tagName %>.ts';
|
|
17
|
-
|
|
18
|
-
const heading = 'World!';
|
|
19
|
-
render(
|
|
20
|
-
html`<<%= tagName %> .heading=${heading}>some light-dom</<%= tagName %>>`,
|
|
21
|
-
document.querySelector('#demo'),
|
|
22
|
-
);
|
|
23
|
-
</script>
|
|
24
|
-
</body>
|
|
25
|
-
</html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { <%= className %> } from './src/<%= className %>.js';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-unused-vars */
|
|
2
|
-
import { css } from 'lit';
|
|
3
|
-
|
|
4
|
-
export default css`
|
|
5
|
-
:host {
|
|
6
|
-
display: block;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host([hidden]),
|
|
11
|
-
[hidden] {
|
|
12
|
-
display: none !important;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
*,
|
|
16
|
-
*:before,
|
|
17
|
-
*:after {
|
|
18
|
-
box-sizing: inherit;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2019",
|
|
4
|
-
"module": "es2020",
|
|
5
|
-
"lib": ["es2020", "DOM", "DOM.Iterable"],
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"outDir": "./dist",
|
|
11
|
-
"rootDirs": ["./src", "./define", ".test/"],
|
|
12
|
-
"strict": true,
|
|
13
|
-
"noUnusedLocals": true,
|
|
14
|
-
"noUnusedParameters": true,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"noFallthroughCasesInSwitch": true,
|
|
17
|
-
"noImplicitAny": true,
|
|
18
|
-
"noImplicitThis": true,
|
|
19
|
-
"moduleResolution": "node",
|
|
20
|
-
"allowSyntheticDefaultImports": true,
|
|
21
|
-
"experimentalDecorators": true,
|
|
22
|
-
"forceConsistentCasingInFileNames": true,
|
|
23
|
-
"noImplicitOverride": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["src/**/*.ts", "define/**/*.ts", "test/**/*.ts", "./index.ts"],
|
|
26
|
-
"exclude": []
|
|
27
|
-
}
|