-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: init open-wc component project
This project uses the open-wc.org recommendations and was generated using their generator https://open-wc.org/docs/development/generator
- Loading branch information
Showing
12 changed files
with
14,877 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
root = true | ||
|
||
[*] | ||
|
||
indent_style = space | ||
indent_size = 2 | ||
|
||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.{html,js,md}] | ||
block_comment_start = /** | ||
block_comment = * | ||
block_comment_end = */ |
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 @@ | ||
name: Test on PR branch | ||
on: pull_request | ||
|
||
jobs: | ||
test-on-pr-branch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run tests | ||
run: npm run-script test |
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 @@ | ||
name: Test | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run tests | ||
run: npm run-script test |
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,11 @@ | ||
## npm | ||
/node_modules/ | ||
/npm-debug.log | ||
|
||
## testing | ||
/coverage/ | ||
|
||
# build | ||
/dist | ||
/custom-elements.json | ||
/.tsbuildinfo |
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,71 @@ | ||
# OpenSCD Core | ||
## \<open-scd> | ||
|
||
## Installation | ||
|
||
```sh | ||
npm i open-scd | ||
``` | ||
|
||
## Usage | ||
|
||
```html | ||
<script type="module"> | ||
import 'open-scd/open-scd.js'; | ||
</script> | ||
|
||
<open-scd></open-scd> | ||
``` | ||
|
||
## Linting and formatting | ||
|
||
To scan the project for linting and formatting errors, run | ||
|
||
```sh | ||
npm run lint | ||
``` | ||
|
||
To automatically fix linting and formatting errors, run | ||
|
||
```sh | ||
npm run format | ||
``` | ||
|
||
We use ESLint and Prettier for linting and formatting. Plugins for automatic | ||
formatting and linting during editing are available for vim, emacs, VSCode, | ||
and all popular IDEs. | ||
|
||
## Testing with Web Test Runner | ||
|
||
To execute a single test run: | ||
|
||
```sh | ||
npm test | ||
``` | ||
|
||
To run the tests in interactive watch mode run: | ||
|
||
```sh | ||
npm run test:watch | ||
``` | ||
|
||
## Tooling configs | ||
|
||
For most of the tools, the configuration is in the `package.json` to reduce the | ||
amount of files in the project. | ||
|
||
## Local Demo with `web-dev-server` | ||
|
||
```sh | ||
npm start | ||
``` | ||
|
||
To run a local development server that serves the basic demo located in `demo/index.html` | ||
|
||
> This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation. | ||
## License | ||
|
||
This project is licensed under the [Apache License 2.0](LICENSE). | ||
|
||
© 2022 OMICRON electronics GmbH |
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,6 @@ | ||
<title>OpenSCD Core Demo</title> | ||
<open-scd></open-scd> | ||
|
||
<script type="module"> | ||
import '../dist/open-scd.js'; | ||
</script> |
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,3 @@ | ||
import { LitElement } from 'lit'; | ||
|
||
window.customElements.define('open-scd', LitElement); |
Oops, something went wrong.