Skip to content

Commit da16db6

Browse files
committed
feat: migrate to using oscd-shell, editV1, scoped md components, updated deps and renamed repo
1 parent 3a4972f commit da16db6

27 files changed

+9537
-20485
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Setup Node Environment'
2+
description: 'Setup Node, cache and clean install'
3+
4+
inputs:
5+
registry-url:
6+
description: 'the url for the registry (github or npm)'
7+
required: false
8+
default: 'https://registry.npmjs.org'
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: '20'
17+
registry-url: ${{ inputs.registry-url }}
18+
19+
- name: Cache Node Modules
20+
id: cache-node-modules
21+
uses: actions/cache@v4
22+
with:
23+
path: |
24+
node_modules
25+
key: modules-${{ hashFiles('package-lock.json') }}
26+
27+
- name: Install dependencies
28+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
29+
run: npm ci
30+
shell: bash
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Continuous Deployment
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '22'
18+
19+
- name: Install dependencies
20+
run: npm ci
21+
22+
- name: Build
23+
run: npm run bundle
24+
25+
- name: Deploy
26+
run: |
27+
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
28+
npx gh-pages -d dist -u "github-actions <support+actions@github.com>"
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
release-please:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
release_created: ${{ steps.release.outputs.release_created }}
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
issues: write
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
config-file: release-please-config.json
24+
manifest-file: .release-please-manifest.json
25+
26+
npm-publish:
27+
needs: release-please
28+
if: ${{ needs.release-please.outputs.release_created }}
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
id-token: write
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: '22'
39+
registry-url: 'https://registry.npmjs.org'
40+
cache: 'npm'
41+
- name: Install dependencies
42+
run: npm ci
43+
- name: Build the package
44+
run: npm run build
45+
- name: Publish to NPMJS.org
46+
run: npm publish --provenance --access public
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
50+
upload-release-bundle:
51+
needs: release-please
52+
if: ${{ needs.release-please.outputs.release_created }}
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: write
56+
id-token: write
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Setup Node Environment
62+
run: npm ci
63+
64+
- name: Set repository name env var
65+
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
66+
67+
- name: Build plugin bundle
68+
run: npm run bundle
69+
70+
- name: Create zipped bundle
71+
run: |
72+
(cd ./dist && zip -r ../${REPO_NAME}.zip .)
73+
tar -C ./dist -czvf ${REPO_NAME}.tar.gz ./
74+
75+
- name: Upload zipped bundle to GitHub release
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: gh release upload ${{ needs.release-please.outputs.tag_name }} ${REPO_NAME}.zip ${REPO_NAME}.tar.gz

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
on: [push, pull_request, workflow_dispatch]
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
container:
8+
image: mcr.microsoft.com/playwright:v1.54.1-noble
9+
options: --user 1001
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- uses: ./.github/actions/setup-node-env
15+
16+
- name: Build
17+
run: npm run-script build
18+
19+
- name: Run unit tests
20+
run: npm run-script test

.gitignore

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1+
node_modules
2+
*.tsbuildinfo
3+
14
## editors
25
/.idea
36
/.vscode
47

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/
8+
## build artifacts
9+
dist
10+
coverage
11+
doc
1712

18-
# build
19-
/_site/
20-
/dist/
21-
.tsbuildinfo
22-
.rollup.cache
23-
/out-tsc/
2413

25-
storybook-static
26-
custom-elements.json

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ ".": "0.0.0" }

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
# \<oscd-publisher>
1+
[![Tests](https://github.com/OMICRONEnergyOSS/oscd-editor-template/actions/workflows/test.yml/badge.svg)](https://github.com/OMICRONEnergyOSS/oscd-editor-template/actions/workflows/test.yml) ![NPM Version](https://img.shields.io/npm/v/@omicronenergy/oscd-editor-template)
22

3-
## What is this?
4-
5-
This is an editor plugin for [open-scd-core](https://github.com/openscd/open-scd-core#readme), the new core editor engine for OpenSCD. With this plugin you can edit control block and related elements and its data sets. Visit the [demo environment](https://shorturl.at/ENV03) and see for yourself.
3+
# \<oscd-editor-template>
64

7-
## Missing features
5+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
86

9-
- edit `SampledValueControl` elements
10-
- create `SampledValueControl` elements
11-
- re-allocate control blocks in data model (new once are allocated the first logical device `LLN0`)
12-
- re-arrange `FCDA` element in the `DataSet`
7+
## What is this?
138

14-
## Quick access tp the plugin
9+
This is an editor plugin for [OpenSCD](https://openscd.org). With this plugin you can view, edit and insert Data Type Templates into an SCL document. Visit the [demo environment](https://omicronenergyoss.github.io/oscd-editor-template/demo/index.html) and see for yourself.
1510

1611
## Linting and formatting
1712

@@ -29,6 +24,8 @@ npm run format
2924

3025
## Testing with Web Test Runner
3126

27+
> Currently there have been no unit tests developed for this plugin.
28+
3229
To execute a single test run:
3330

3431
```bash
@@ -50,9 +47,14 @@ If you customize the configuration a lot, you can consider moving them to indivi
5047
## Local Demo with `web-dev-server`
5148

5249
```bash
53-
npm start
50+
npm run start
5451
```
5552

5653
To run a local development server that serves the basic demo located in `demo/index.html`
5754

5855
&copy; Jakob Vogelsang
56+
&copy; 2025 OMICRON electronics GmbH
57+
58+
## License
59+
60+
[Apache-2.0](LICENSE)

0 commit comments

Comments
 (0)