Skip to content

Commit

Permalink
chore: init open-wc component project
Browse files Browse the repository at this point in the history
This project uses the open-wc.org recommendations and was generated
using their generator https://open-wc.org/docs/development/generator
  • Loading branch information
ca-d committed Aug 15, 2022
1 parent 2b4c203 commit 8a5268e
Show file tree
Hide file tree
Showing 12 changed files with 14,877 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
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 = */
20 changes: 20 additions & 0 deletions .github/workflows/test-on-pr-branch.yml
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
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
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
11 changes: 11 additions & 0 deletions .gitignore
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
71 changes: 71 additions & 0 deletions README.md
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).

&copy; 2022 OMICRON electronics GmbH
6 changes: 6 additions & 0 deletions demo/index.html
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>
3 changes: 3 additions & 0 deletions open-scd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { LitElement } from 'lit';

window.customElements.define('open-scd', LitElement);
Loading

0 comments on commit 8a5268e

Please sign in to comment.