diff --git a/.eslintignore b/.eslintignore
index 119019c..5ef7aa1 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,3 +3,4 @@ docs/*
docs-src/*
rollup-config.js
custom-elements.json
+web-dev-server.config.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..281ab05
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,14 @@
+# @lit/lit-starter-js
+
+## 1.0.0
+
+### Patch Changes
+
+- [#2113](https://github.com/lit/lit/pull/2113) [`5b2f3642`](https://github.com/lit/lit/commit/5b2f3642ff91931b5b01f8bdd2ed98aba24f1047) - Dependency upgrades including TypeScript 4.4.2
+
+- [#2103](https://github.com/lit/lit/pull/2103) [`15a8356d`](https://github.com/lit/lit/commit/15a8356ddd59a1e80880a93acd21fadc9c24e14b) - Added Lit dev mode to test and serve commands, controlled via the MODE=dev or MODE=prod environment variables.
+
+- [#2117](https://github.com/lit/lit/pull/2117) [`eff2fbc7`](https://github.com/lit/lit/commit/eff2fbc7e45cfc2a7b8df21e18c84619dfbcb277) - Updated starter templates to use open-wc analyzer for generating custom-elements.json, and updated basic API docs generater included in the template to the new manifest format.
+
+- Updated dependencies [[`15a8356d`](https://github.com/lit/lit/commit/15a8356ddd59a1e80880a93acd21fadc9c24e14b), [`5fabe2b5`](https://github.com/lit/lit/commit/5fabe2b5ae4ab8fba9dc2d23a69105d32e4c0705), [`5b2f3642`](https://github.com/lit/lit/commit/5b2f3642ff91931b5b01f8bdd2ed98aba24f1047), [`5fabe2b5`](https://github.com/lit/lit/commit/5fabe2b5ae4ab8fba9dc2d23a69105d32e4c0705), [`5fabe2b5`](https://github.com/lit/lit/commit/5fabe2b5ae4ab8fba9dc2d23a69105d32e4c0705), [`0312f3e5`](https://github.com/lit/lit/commit/0312f3e533611eb3f4f9381594485a33ad003b74)]:
+ - lit@2.0.0
diff --git a/LICENSE b/LICENSE
index 529f69e..6ab8d4a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,20 +1,20 @@
BSD 3-Clause License
-Copyright (c) 2019, The Polymer Authors. All rights reserved.
+Copyright (c) 2019 Google LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
-* Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -25,4 +25,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/README.md b/README.md
index bec2206..64c1fd0 100644
--- a/README.md
+++ b/README.md
@@ -18,12 +18,20 @@ Mocha, Chai, and some related helpers for testing. See the
[modern-web.dev testing documentation](https://modern-web.dev/docs/test-runner/overview) for
more information.
-Tests can be run with the `test` script:
+Tests can be run with the `test` script, which will run your tests against Lit's development mode (with more verbose errors) as well as against Lit's production mode:
```bash
npm test
```
+For local testing during development, the `test:dev:watch` command will run your tests in Lit's development mode (with verbose errors) on every change to your source files:
+
+```bash
+npm test:watch
+```
+
+Alternatively the `test:prod` and `test:prod:watch` commands will run your tests in Lit's production mode.
+
## Dev Server
This sample uses modern-web.dev's [@web/dev-server](https://www.npmjs.com/package/@web/dev-server) for previewing the project without additional build steps. Web Dev Server handles resolving Node-style "bare" import specifiers, which aren't supported in browsers. It also automatically transpiles JavaScript and adds polyfills to support older browsers. See [modern-web.dev's Web Dev Server documentation](https://modern-web.dev/docs/dev-server/overview/) for more information.
@@ -34,7 +42,7 @@ To run the dev server and open the project in a new browser tab:
npm run serve
```
-There is a development HTML file located at `/dev/index.html` that you can view at http://localhost:8000/dev/index.html.
+There is a development HTML file located at `/dev/index.html` that you can view at http://localhost:8000/dev/index.html. Note that this command will serve your code using Lit's development mode (with more verbose errors). To serve your code against Lit's production mode, use `npm run serve:prod`.
## Editing
@@ -64,7 +72,7 @@ npm run lint
## Formatting
-[Prettier](https://prettier.io/) is used for code formatting. It has been pre-configured according to the Polymer Project's style. You can change this in `.prettierrc.json`.
+[Prettier](https://prettier.io/) is used for code formatting. It has been pre-configured according to the Lit's style. You can change this in `.prettierrc.json`.
Prettier has not been configured to run when commiting files, but this can be added with Husky and and `pretty-quick`. See the [prettier.io](https://prettier.io/) site for instructions.
@@ -98,8 +106,8 @@ The site will usually be served at http://localhost:8000.
This starter project doesn't include any build-time optimizations like bundling or minification. We recommend publishing components as unoptimized JavaScript modules, and performing build-time optimizations at the application level. This gives build tools the best chance to deduplicate code, remove dead code, and so on.
-For information on building application projects that include LitElement components, see [Build for production](https://lit-element.polymer-project.org/guide/build) on the LitElement site.
+For information on building application projects that include LitElement components, see [Build for production](https://lit.dev/docs/tools/production/) on the LitElement site.
## More information
-See [Get started](https://lit-element.polymer-project.org/guide/start) on the LitElement site for more information.
+See [Get started](https://lit.dev/docs/getting-started/) on the Lit site for more information.
diff --git a/custom-elements.json b/custom-elements.json
deleted file mode 100644
index e21a755..0000000
--- a/custom-elements.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
- "version": "experimental",
- "tags": [
- {
- "name": "my-element",
- "path": "./my-element.js",
- "description": "An example element.",
- "attributes": [
- {
- "name": "name",
- "description": "The name to say \"Hello\" to.",
- "type": "string",
- "default": "\"World\""
- },
- {
- "name": "count",
- "description": "The number of times the button has been clicked.",
- "type": "number",
- "default": "0"
- }
- ],
- "properties": [
- {
- "name": "name",
- "attribute": "name",
- "description": "The name to say \"Hello\" to.",
- "type": "string",
- "default": "\"World\""
- },
- {
- "name": "count",
- "attribute": "count",
- "description": "The number of times the button has been clicked.",
- "type": "number",
- "default": "0"
- },
- {
- "name": "renderRoot",
- "description": "Node or ShadowRoot into which element DOM should be rendered. Defaults\nto an open shadowRoot.",
- "type": "HTMLElement | ShadowRoot"
- },
- {
- "name": "isUpdatePending",
- "type": "boolean"
- },
- {
- "name": "hasUpdated",
- "type": "boolean"
- },
- {
- "name": "updateComplete",
- "description": "Returns a Promise that resolves when the element has completed updating.\nThe Promise value is a boolean that is `true` if the element completed the\nupdate without triggering another update. The Promise result is `false` if\na property was set inside `updated()`. If the Promise is rejected, an\nexception was thrown during the update.\n\nTo await additional asynchronous work, override the `getUpdateComplete`\nmethod. For example, it is sometimes useful to await a rendered element\nbefore fulfilling this Promise. To do this, first await\n`super.getUpdateComplete()`, then any subsequent state.",
- "type": "PromiseAPI
- ${tags
+ ${elements
.map(
- (tag) => `
- <${tag.name}>
+ (element) => `
+ <${element.tagName}>
${name}
+ ${name ? `${name}
` : ''}
@@ -60,43 +60,53 @@
- ${properties.map((p) => `
${data
.map(
(i) => `
${capitalize(p)} `).join('')}
+ ${properties
+ .map(
+ (p) =>
+ `${capitalize(
+ (Array.isArray(p) ? p[0] : p).split('.')[0]
+ )} `
+ )
+ .join('')}
- ${properties.map((p) => `
`
)
diff --git a/docs-src/docs.css b/docs-src/docs.css
index 006c5f7..800e27e 100644
--- a/docs-src/docs.css
+++ b/docs-src/docs.css
@@ -159,4 +159,5 @@ td, th {
border: solid 1px #aaa;
padding: 4px;
text-align: left;
+ vertical-align: top;
}
diff --git a/docs/api/index.html b/docs/api/index.html
index a40532b..758fce8 100644
--- a/docs/api/index.html
+++ b/docs/api/index.html
@@ -43,11 +43,11 @@ ${i[p]} `).join('')}
+ ${properties.map((p) => `${get(i, p)} `).join('')}
Attributes
-
name The name to say "Hello" to. string "World"
+ name The name to say "Hello" to. string
-
count The number of times the button has been clicked. number 0
+ count The number of times the button has been clicked. number
Properties
-
name name The name to say "Hello" to. string "World"
+ name name The name to say "Hello" to. string 'World'
+
+
+
+ count count The number of times the button has been clicked. number 0
Methods
+
+
+
+
+
+
+
Name Parameters Description Return
+
-
+ renderRoot undefined Node or ShadowRoot into which element DOM should be rendered. Defaults
-to an open shadowRoot. HTMLElement | ShadowRoot undefined
- sayHello
+
+
+
+
+
Name Description Type
+
-
- isUpdatePending undefined undefined boolean undefined
+ name The name to say "Hello" to string
- hasUpdated undefined undefined boolean undefined
+ Formats a greeting string
+ Events
+
+
-
-
-
+
+
+
Name Description
+
-
updateComplete undefined Returns a Promise that resolves when the element has completed updating.
-The Promise value is a boolean that is `true` if the element completed the
-update without triggering another update. The Promise result is `false` if
-a property was set inside `updated()`. If the Promise is rejected, an
-exception was thrown during the update.
-
-To await additional asynchronous work, override the `getUpdateComplete`
-method. For example, it is sometimes useful to await a rendered element
-before fulfilling this Promise. To do this, first await
-`super.getUpdateComplete()`, then any subsequent state. Promise undefined
+ count-changed Indicates when the count changes
Slots
@@ -105,7 +115,7 @@
@@ -132,7 +142,7 @@ Slots
-
This element has a slot
+ (default) This element has a slot
CSS Shadow Parts
diff --git a/docs/docs.css b/docs/docs.css index 006c5f7..800e27e 100644 --- a/docs/docs.css +++ b/docs/docs.css @@ -159,4 +159,5 @@ td, th { border: solid 1px #aaa; padding: 4px; text-align: left; + vertical-align: top; } diff --git a/docs/examples/index.html b/docs/examples/index.html index e10d352..3ca4560 100644 --- a/docs/examples/index.html +++ b/docs/examples/index.html @@ -68,7 +68,7 @@
diff --git a/docs/examples/name-property/index.html b/docs/examples/name-property/index.html index 5ebab63..0c39717 100644 --- a/docs/examples/name-property/index.html +++ b/docs/examples/name-property/index.html @@ -58,7 +58,7 @@
diff --git a/docs/index.html b/docs/index.html index f303528..a99cee3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -68,7 +68,7 @@
diff --git a/docs/install/index.html b/docs/install/index.html index 0663a0d..298b122 100644 --- a/docs/install/index.html +++ b/docs/install/index.html @@ -46,7 +46,7 @@
diff --git a/docs/my-element.bundled.js b/docs/my-element.bundled.js index 09710ce..ebd570e 100644 Binary files a/docs/my-element.bundled.js and b/docs/my-element.bundled.js differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..70aa376 --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + +
+ +
+ +
+