Skip to content

Commit dc86d7b

Browse files
committed
chore: refresh plugin infrastructure based on up to date norms
1 parent a625789 commit dc86d7b

18 files changed

+1123
-636
lines changed

.editorconfig

Lines changed: 29 additions & 0 deletions
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 = */

.github/actions/setup-node-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
- name: Set up Node.js
1414
uses: actions/setup-node@v3
1515
with:
16-
node-version: '20'
16+
node-version: '22'
1717
registry-url: ${{ inputs.registry-url }}
1818

1919
- name: Cache Node Modules
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 }}

.github/workflows/release-please.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,32 @@ jobs:
4747
env:
4848
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4949

50-
gh-pages:
50+
upload-release-bundle:
5151
needs: release-please
5252
if: ${{ needs.release-please.outputs.release_created }}
5353
runs-on: ubuntu-latest
5454
permissions:
5555
contents: write
56-
pages: write
5756
id-token: write
5857

59-
environment:
60-
name: github-pages
61-
url: ${{ steps.deployment.outputs.page_url }}
6258
steps:
6359
- uses: actions/checkout@v4
6460

6561
- name: Setup Node Environment
6662
run: npm ci
6763

64+
- name: Set repository name env var
65+
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
66+
6867
- name: Build plugin bundle
6968
run: npm run bundle
7069

71-
- name: Upload bundle
72-
uses: actions/upload-pages-artifact@v3
73-
with:
74-
path: ./dist
70+
- name: Create zipped bundle
71+
run: |
72+
(cd ./dist && zip -r ../${REPO_NAME}.zip .)
73+
tar -C ./dist -czvf ${REPO_NAME}.tar.gz ./
7574
76-
- name: Deploy to GitHub Pages
77-
id: deployment
78-
uses: actions/deploy-pages@v4
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

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## 0.0.1 (2025-07-15)
44

5-
65
### Features
76

8-
* initial commit ([ad2729a](https://github.com/OMICRONEnergyOSS/oscd-background-wizard-events/commit/ad2729a539f8a0bcc625aa2852687daa42ae5f03))
7+
- initial commit ([ad2729a](https://github.com/OMICRONEnergyOSS/oscd-background-wizard-events/commit/ad2729a539f8a0bcc625aa2852687daa42ae5f03))

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) reco
66

77
## What is this?
88

9-
This is an OpenSCD backgroun plugin for [OpenSCD](https://openscd.org) which provides backwards compatability for other plugins which are reliant on the wizard events:
10-
* oscd-create-wizard-request
11-
* oscd-edit-wizard-request
12-
* oscd-close-wizard
9+
The oscd-shell has been updated with the recent api changes, which removes built in support for the Wizard.
10+
This means the oscd-shell (formerly known as open-scd-core) no longer listens for wizard events.
11+
This OpenSCD background plugin, provides backwards compatability for other plugins which are reliant on the wizard events:
12+
13+
- oscd-create-wizard-request
14+
- oscd-edit-wizard-request
15+
- oscd-close-wizard
1316

1417
If your distro uses plugins which fire these events, you need to include this background plugin to intercept these events and open up the appropriate wizard dialog.
1518

custom-elements.json

Lines changed: 2 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -112,29 +112,14 @@
112112
}
113113
]
114114
},
115-
{
116-
"kind": "javascript-module",
117-
"path": "oscd-background-wizard-events.spec.ts",
118-
"declarations": [],
119-
"exports": [
120-
{
121-
"kind": "custom-element-definition",
122-
"name": "oscd-background-wizard-events",
123-
"declaration": {
124-
"name": "OscdMenuOpen",
125-
"module": "/oscd-background-wizard-events.js"
126-
}
127-
}
128-
]
129-
},
130115
{
131116
"kind": "javascript-module",
132117
"path": "oscd-background-wizard-events.ts",
133118
"declarations": [
134119
{
135120
"kind": "class",
136121
"description": "",
137-
"name": "OscdBackgroundEditDialogEvents",
122+
"name": "OscdBackgroundWizardEvents",
138123
"members": [
139124
{
140125
"kind": "field",
@@ -201,157 +186,11 @@
201186
"kind": "js",
202187
"name": "default",
203188
"declaration": {
204-
"name": "OscdBackgroundEditDialogEvents",
189+
"name": "OscdBackgroundWizardEvents",
205190
"module": "oscd-background-wizard-events.ts"
206191
}
207192
}
208193
]
209-
},
210-
{
211-
"kind": "javascript-module",
212-
"path": "demo/demo-editor-plugin.ts",
213-
"declarations": [
214-
{
215-
"kind": "class",
216-
"description": "",
217-
"name": "TriggerWizard",
218-
"members": [
219-
{
220-
"kind": "field",
221-
"name": "doc",
222-
"type": {
223-
"text": "XMLDocument"
224-
},
225-
"attribute": "doc"
226-
},
227-
{
228-
"kind": "field",
229-
"name": "editor",
230-
"type": {
231-
"text": "XMLEditor"
232-
},
233-
"attribute": "editor"
234-
},
235-
{
236-
"kind": "field",
237-
"name": "editCount",
238-
"type": {
239-
"text": "unknown"
240-
},
241-
"attribute": "editCount"
242-
},
243-
{
244-
"kind": "field",
245-
"name": "newTagName",
246-
"type": {
247-
"text": "HTMLSelectElement"
248-
}
249-
},
250-
{
251-
"kind": "field",
252-
"name": "parentSelector",
253-
"type": {
254-
"text": "HTMLInputElement"
255-
}
256-
},
257-
{
258-
"kind": "field",
259-
"name": "childinput",
260-
"type": {
261-
"text": "HTMLInputElement"
262-
}
263-
},
264-
{
265-
"kind": "field",
266-
"name": "tagSelector",
267-
"type": {
268-
"text": "HTMLInputElement"
269-
}
270-
},
271-
{
272-
"kind": "field",
273-
"name": "editDialog",
274-
"type": {
275-
"text": "WizardDialog"
276-
}
277-
},
278-
{
279-
"kind": "method",
280-
"name": "triggerWizardCreate",
281-
"return": {
282-
"type": {
283-
"text": "Promise<void>"
284-
}
285-
}
286-
},
287-
{
288-
"kind": "method",
289-
"name": "triggerWizardEdit",
290-
"return": {
291-
"type": {
292-
"text": "Promise<void>"
293-
}
294-
}
295-
}
296-
],
297-
"attributes": [
298-
{
299-
"name": "doc",
300-
"type": {
301-
"text": "XMLDocument"
302-
},
303-
"fieldName": "doc"
304-
},
305-
{
306-
"name": "editor",
307-
"type": {
308-
"text": "XMLEditor"
309-
},
310-
"fieldName": "editor"
311-
},
312-
{
313-
"name": "editCount",
314-
"type": {
315-
"text": "unknown"
316-
},
317-
"fieldName": "editCount"
318-
}
319-
],
320-
"superclass": {
321-
"name": "LitElement",
322-
"package": "lit"
323-
},
324-
"customElement": true
325-
}
326-
],
327-
"exports": [
328-
{
329-
"kind": "js",
330-
"name": "default",
331-
"declaration": {
332-
"name": "TriggerWizard",
333-
"module": "demo/demo-editor-plugin.ts"
334-
}
335-
}
336-
]
337-
},
338-
{
339-
"kind": "javascript-module",
340-
"path": "coverage/lcov-report/block-navigation.js",
341-
"declarations": [],
342-
"exports": []
343-
},
344-
{
345-
"kind": "javascript-module",
346-
"path": "coverage/lcov-report/prettify.js",
347-
"declarations": [],
348-
"exports": []
349-
},
350-
{
351-
"kind": "javascript-module",
352-
"path": "coverage/lcov-report/sorter.js",
353-
"declarations": [],
354-
"exports": []
355194
}
356195
]
357196
}

0 commit comments

Comments
 (0)