Skip to content

Commit 4da7d07

Browse files
committed
Initial OpenWC scaffolding
0 parents  commit 4da7d07

15 files changed

+15884
-0
lines changed

.editorconfig

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
10+
# Change these settings to your own preference
11+
indent_style = space
12+
indent_size = 2
13+
14+
# We recommend you to keep these unchanged
15+
end_of_line = lf
16+
charset = utf-8
17+
trim_trailing_whitespace = true
18+
insert_final_newline = true
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
[*.json]
24+
indent_size = 2
25+
26+
[*.{html,js,md}]
27+
block_comment_start = /**
28+
block_comment = *
29+
block_comment_end = */

.gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## editors
2+
/.idea
3+
/.vscode
4+
5+
## system files
6+
.DS_Store
7+
8+
## npm
9+
/node_modules/
10+
/npm-debug.log
11+
12+
## testing
13+
/coverage/
14+
15+
## temp folders
16+
/.tmp/
17+
18+
# build
19+
/_site/
20+
/dist/
21+
/out-tsc/
22+
23+
storybook-static

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 typescript-template
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# \<typescript-template>
2+
3+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4+
5+
## Installation
6+
```bash
7+
npm i typescript-template
8+
```
9+
10+
## Usage
11+
```html
12+
<script type="module">
13+
import 'typescript-template/typescript-template.js';
14+
</script>
15+
16+
<typescript-template></typescript-template>
17+
```
18+
19+
## Linting with ESLint, Prettier, and Types
20+
To scan the project for linting errors, run
21+
```bash
22+
npm run lint
23+
```
24+
25+
You can lint with ESLint and Prettier individually as well
26+
```bash
27+
npm run lint:eslint
28+
```
29+
```bash
30+
npm run lint:prettier
31+
```
32+
33+
To automatically fix many linting errors, run
34+
```bash
35+
npm run format
36+
```
37+
38+
You can format using ESLint and Prettier individually as well
39+
```bash
40+
npm run format:eslint
41+
```
42+
```bash
43+
npm run format:prettier
44+
```
45+
46+
## Testing with Web Test Runner
47+
To run the suite of Web Test Runner tests, run
48+
```bash
49+
npm run test
50+
```
51+
52+
To run the tests in watch mode (for &lt;abbr title=&#34;test driven development&#34;&gt;TDD&lt;/abbr&gt;, for example), run
53+
54+
```bash
55+
npm run test:watch
56+
```
57+
58+
59+
## Tooling configs
60+
61+
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
62+
63+
If you customize the configuration a lot, you can consider moving them to individual files.
64+
65+
## Local Demo with `web-dev-server`
66+
```bash
67+
npm start
68+
```
69+
To run a local development server that serves the basic demo located in `demo/index.html`

custom-elements.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"version": 2,
3+
"tags": [
4+
{
5+
"name": "typescript-template",
6+
"description": "A component with a title and an action counter",
7+
"properties": [
8+
{
9+
"name": "title",
10+
"type": "String",
11+
"description": "The title of your component",
12+
"default": "Hey there"
13+
},
14+
{
15+
"name": "counter",
16+
"type": "Number",
17+
"description": "An action counter",
18+
"default": 0
19+
}
20+
],
21+
"events": [],
22+
"slots": [],
23+
"cssProperties": [
24+
{
25+
"name": "--typescript-template-text-color",
26+
"description": "Main Text Color",
27+
"type": "Color"
28+
}
29+
]
30+
}
31+
]
32+
}

demo/index.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!doctype html>
2+
<html lang="en-GB">
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-html';
16+
import '../dist/typescript-template.js';
17+
18+
const title = 'Hello owc World!';
19+
render(
20+
html`
21+
<typescript-template .title=${title}>
22+
some more light-dom
23+
</typescript-template>
24+
`,
25+
document.querySelector('#demo')
26+
);
27+
</script>
28+
</body>
29+
</html>

index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { TypescriptTemplate } from './src/TypescriptTemplate.js';

0 commit comments

Comments
 (0)