-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from PolymerLabs/config
Some changes to configuration and example element
- Loading branch information
Showing
11 changed files
with
942 additions
and
816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
node_modules/ | ||
dist/ | ||
build/ | ||
/node_modules/ | ||
/lib/ | ||
|
||
*.js.map | ||
*.d.ts | ||
*.d.ts.map | ||
# top level source | ||
my-element.js | ||
my-element.js.map | ||
my-element.d.ts | ||
my-element.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2019, The Polymer Authors. 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. | ||
|
||
* 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. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,43 @@ | ||
# LitElement TypeScript starter | ||
|
||
This directory includes a sample component project using LitElement with TypeScript | ||
|
||
This sample uses the TypeScript compiler (tsc) to produce JavaScript that runs in modern browsers. | ||
|
||
This sample uses [ES dev server](https://github.com/open-wc/open-wc/tree/master/packages/es-dev-server) | ||
for previewing the project without a build step. ES dev server handles resolving Node-style | ||
import specifiers, which aren't supported in browsers. It also automatically transpiles code | ||
and adds polyfills to support older browsers. | ||
This project includes a sample component using LitElement with TypeScript. | ||
|
||
## Setup | ||
|
||
Install dependencies: | ||
|
||
```bash | ||
npm -i | ||
npm i | ||
``` | ||
|
||
## Build | ||
|
||
To build JavaScript version of your component: | ||
This sample uses the TypeScript compiler to produce JavaScript that runs in modern browsers, and [lit-analyzer](https://www.npmjs.com/package/lit-analyzer), a program that type-checks and lints lit-html templates. | ||
|
||
To build the JavaScript version of your component: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
To watch files and rebuild when the files are modified, | ||
run the following command in a separate window: | ||
To watch files and rebuild when the files are modified, run the following command in a separate shell: | ||
|
||
```bash | ||
npm run build:watch | ||
``` | ||
|
||
Both the TypeScript compiler and lit-analyzer are configured to be very strict. You may want to change `tsconfig.json` to make them less strict. | ||
|
||
## Preview | ||
## Dev Server | ||
|
||
Run the dev server and open the project in a new browser tab: | ||
This sample uses [ES dev server](https://github.com/open-wc/open-wc/tree/master/packages/es-dev-server) for previewing the project without additional build steps. ES 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. | ||
|
||
To run the dev server and open the project in a new browser tab: | ||
|
||
```bash | ||
npm start | ||
npm run serve | ||
``` | ||
|
||
## 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-element.polymer-project.org/guide/start) on the LitElement site for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title><my-element> Demo</title> | ||
<script type="module" src="../my-element.js"></script> | ||
<style> | ||
p { | ||
border: solid 1px blue; | ||
padding: 8px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<my-element> | ||
<p>This is child content</p> | ||
</my-element> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.