Skip to content

Commit

Permalink
Merge pull request #1 from PolymerLabs/config
Browse files Browse the repository at this point in the history
Some changes to configuration and example element
  • Loading branch information
justinfagnani authored Dec 17, 2019
2 parents 387a753 + 9df8c64 commit 2c090ee
Show file tree
Hide file tree
Showing 11 changed files with 942 additions and 816 deletions.
13 changes: 7 additions & 6 deletions .gitignore
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
28 changes: 28 additions & 0 deletions LICENSE
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.
31 changes: 13 additions & 18 deletions README.md
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.
9 changes: 0 additions & 9 deletions demo.html

This file was deleted.

20 changes: 20 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>

<html>
<head>
<meta charset="utf-8">
<title>&lt;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>
24 changes: 0 additions & 24 deletions my-element.ts

This file was deleted.

48 changes: 0 additions & 48 deletions npm-debug.log

This file was deleted.

Loading

0 comments on commit 2c090ee

Please sign in to comment.