Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9dee12c
refactor: move openscd dependencies to their own lib folder
philippilievskibearingpointcom Apr 4, 2025
791ebd8
refactor: add missing dependencies and extend tsconfig
philippilievskibearingpointcom Apr 7, 2025
e860c76
refactor: add missing dependencies and change project config + snowpack
philippilievskibearingpointcom Apr 8, 2025
00badfe
test: add vite build and buildscript
philippilievskibearingpointcom Apr 9, 2025
80ad2b5
refactor: update build-script to include all types of plugins in fina…
philippilievskibearingpointcom Apr 10, 2025
2cf9412
refactor: udpate build and and publish script
philippilievskibearingpointcom Apr 11, 2025
d230eef
refactor: udpate build and and publish script
philippilievskibearingpointcom Apr 11, 2025
b9b0482
Merge pull request #2 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 11, 2025
c9ccf40
feature: add translations for editor-plugins
philippilievskibearingpointcom Apr 11, 2025
eb17e0d
Merge pull request #3 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 11, 2025
65e12a2
feature: add translations for editor-plugins
philippilievskibearingpointcom Apr 11, 2025
af8bbe6
Merge pull request #4 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 11, 2025
1573ac3
test: change textfield and build process
philippilievskibearingpointcom Apr 15, 2025
dd07c93
refactor: revert back to old textfield and update buildscript
philippilievskibearingpointcom Apr 16, 2025
3062f6d
refactor: add lit-html and lit-element to external and update package…
philippilievskibearingpointcom Apr 16, 2025
183a1ab
test: add mwc to peer deps and to external in vite config
philippilievskibearingpointcom Apr 17, 2025
377c159
refactor: add external deps to buildscript
philippilievskibearingpointcom Apr 17, 2025
80b9be1
refactor: update gh workflow
philippilievskibearingpointcom Apr 18, 2025
99f1b43
Merge pull request #5 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 18, 2025
bcddd17
refactor: update gh workflow
philippilievskibearingpointcom Apr 18, 2025
c3fdf57
Merge pull request #6 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 18, 2025
796edc6
refactor: update gh workflow
philippilievskibearingpointcom Apr 18, 2025
f274094
Merge pull request #7 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 18, 2025
36bb25b
fix: removed unnecessary renaming of wizard textfield
philippilievskibearingpointcom Apr 18, 2025
a13736f
Merge pull request #8 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 18, 2025
2b00081
fix: remove snowpack
philippilievskibearingpointcom Apr 18, 2025
09df5bf
Merge pull request #9 from philippilievskibearingpointcom/refactor/ex…
philippilievskibearingpointcom Apr 18, 2025
da819e8
Merge branch 'main' into refactor/extract-openscd-dependencies
salvar3nga Apr 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 36 additions & 56 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,80 +17,60 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
outputs:
artifact-name: ${{ steps.upload.outputs.artifact-name }}
steps:
- name: Checkout Repository (with Submodules)
- name: Checkout main branch
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Cache Main Project Dependencies
uses: actions/cache@v4
id: main-cache
with:
path: node_modules
key: ${{ runner.os }}-main-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-main-node-

- name: Install Dependencies
if: steps.main-cache.outputs.cache-hit != 'true'
run: npm install


- name: Cache Submodule Dependencies
uses: actions/cache@v4
id: submodule-cache
with:
path: openscd/node_modules
key: ${{ runner.os }}-submodule-node-${{ hashFiles('openscd/package-lock.json') }}
restore-keys: |
${{ runner.os }}-submodule-node-

- name: Install Submodule Dependencies
if: steps.submodule-cache.outputs.cache-hit != 'true'
run: npm install
working-directory: openscd


- name: Build Submodule
run: npm run build
working-directory: openscd
- name: Build plugins
run: npm run build:plugins

- name: Build Project
run: npm run build

- name: Upload Build Artifact
id: upload
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
name: plugins-dist
path: dist/

deploy:
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
if: |
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true))
steps:
- name: Checkout Repository
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Download Build Artifact
- name: Clean gh-pages branch
run: |
git rm -rf .
git clean -fxd

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
branch: gh-pages
target-folder: plugins
name: plugins-dist
path: ./dist

- name: Copy plugins to gh-pages
run: |
mkdir -p plugins
cp -r dist/* plugins/

- name: Commit and push changes
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add plugins
git commit -m "Deploy latest plugins build" || echo "No changes to commit"
git push origin gh-pages

1 change: 0 additions & 1 deletion apps/plugins/.nojekyll

This file was deleted.

34 changes: 0 additions & 34 deletions apps/plugins/snowpack.config.mjs

This file was deleted.

2 changes: 2 additions & 0 deletions apps/plugins/src/editors/Cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import './cleanup/datasets-container.js';
import './cleanup/control-blocks-container.js';
import './cleanup/datatypes-container.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for cleaning SCL references and definitions. */
export default class Cleanup extends LitElement {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/Communication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { createElement } from '@openscd/xml';
import { newActionEvent } from '@openscd/core/foundation/deprecated/editor.js';
import { createSubNetworkWizard } from '../wizards/subnetwork.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for editing the `Communication` section. */
export default class CommunicationPlugin extends LitElement {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/GooseSubscriberDataBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Nsdoc } from '@openscd/open-scd/src/foundation/nsdoc.js';
import './subscription/fcda-binding-list.js';
import './subscription/later-binding/ext-ref-ln-binding-list.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for Subscribe Data Binding (GOOSE). */
export default class GooseSubscribeDataBindingPlugin extends LitElement {
@property({ attribute: false })
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/GooseSubscriberLaterBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { css, html, LitElement, property, TemplateResult } from 'lit-element';
import './subscription/fcda-binding-list.js';
import './subscription/later-binding/ext-ref-later-binding-list.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for Subscribe Later Binding (GOOSE). */
export default class GooseSubscribeLaterBindingPlugin extends LitElement {
@property({ attribute: false })
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/GooseSubscriberMessageBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import './subscription/goose/goose-list.js';
import './subscription/ied-list.js';
import { newViewEvent, View, ViewEvent } from './subscription/foundation.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** Defining view outside the class, which makes it persistent. */
let view: View = View.PUBLISHER;

Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/IED.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {
import { Nsdoc } from '@openscd/open-scd/src/foundation/nsdoc.js';
import { getIcon } from '@openscd/open-scd/src/icons/icons.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for editing the `IED` section. */
export default class IedPlugin extends LitElement {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/Protocol104.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { RadioListItem } from '@material/mwc-list/mwc-radio-list-item';
import './protocol104/network-container.js';
import './protocol104/values-container.js';

import '@openscd/open-scd/src/translations/i18n-config';

import {
newViewEvent,
View,
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import './publisher/gse-control-editor.js';
import './publisher/sampled-value-control-editor.js';
import './publisher/data-set-editor.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] to configure `Report`, `GOOSE`, `SampledValue` control blocks and its `DataSet` */
export default class PublisherPlugin extends LitElement {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/SMVSubscriberDataBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Nsdoc } from '@openscd/open-scd/src/foundation/nsdoc.js';
import './subscription/fcda-binding-list.js';
import './subscription/later-binding/ext-ref-ln-binding-list.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for Subscribe Data Binding (SMV). */
export default class SMVSubscribeDataBindingPlugin extends LitElement {
@property({ attribute: false })
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/SMVSubscriberLaterBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { css, html, LitElement, property, TemplateResult } from 'lit-element';
import './subscription/fcda-binding-list.js';
import './subscription/later-binding/ext-ref-later-binding-list.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for Subscribe Later Binding (SMV). */
export default class SMVSubscribeLaterBindingPlugin extends LitElement {
@property({ attribute: false })
Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/SMVSubscriberMessageBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import './subscription/sampledvalues/smv-list.js';
import './subscription/ied-list.js';
import { newViewEvent, View, ViewEvent } from './subscription/foundation.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** Defining view outside the class, which makes it persistent. */
let view: View = View.PUBLISHER;

Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/SingleLineDiagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import '@material/mwc-list/mwc-list-item';
import '@material/mwc-select';
import '@material/mwc-textfield';

import '@openscd/open-scd/src/translations/i18n-config';

/*
* We need a variable outside the plugin to save the selected substation, because the Plugin is created
* more than once during working with the SLD, for instance when opening a Wizard to edit equipment.
Expand Down
14 changes: 8 additions & 6 deletions apps/plugins/src/editors/Substation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import './substation/zeroline-pane.js';
import { newWizardEvent } from '@openscd/open-scd/src/foundation.js';
import { wizards } from '../wizards/wizard-library.js';

import '@openscd/open-scd/src/translations/i18n-config';

/** An editor [[`plugin`]] for editing the `Substation` section. */
export default class SubstationPlugin extends LitElement {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
Expand All @@ -25,18 +27,18 @@ export default class SubstationPlugin extends LitElement {
return html` <zeroline-pane
.editCount=${this.editCount}
.doc=${this.doc}
></zeroline-pane>
${!this.doc?.querySelector(
></zeroline-pane>
${!this.doc?.querySelector(
':root > Substation, :root > Line, :root > Process'
)
)
? html`<h1>
<mwc-fab
<mwc-fab
extended
icon="add"
label="${get('substation.wizard.title.add')}"
@click=${() => this.openCreateSubstationWizard()}
></mwc-fab>
</h1>`
></mwc-fab>
</h1>`
: html``}`;
}

Expand Down
2 changes: 2 additions & 0 deletions apps/plugins/src/editors/Templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { List } from '@material/mwc-list';
import { ListItem } from '@material/mwc-list/mwc-list-item';
import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';

import '@openscd/open-scd/src/translations/i18n-config';

const templates = fetch('public/xml/templates.scd')
.then(response => response.text())
.then(str => new DOMParser().parseFromString(str, 'application/xml'));
Expand Down
26 changes: 14 additions & 12 deletions apps/plugins/src/wizards/substation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import {
import { guessVoltageLevel } from '../editors/substation/guess-wizard.js';
import { updateNamingAttributeWithReferencesAction } from './foundation/actions.js';

import '@openscd/open-scd/src/translations/i18n-config';

function render(
name: string,
desc: string | null,
guessable: boolean
name: string,
desc: string | null,
guessable: boolean
): TemplateResult[] {
return [
html`<wizard-textfield
Expand All @@ -38,10 +40,10 @@ function render(
helper="${get('substation.wizard.descHelper')}"
></wizard-textfield>`,
guessable
? html`<mwc-formfield label="${get('guess.wizard.primary')}">
? html`<mwc-formfield label="${get('guess.wizard.primary')}">
<mwc-checkbox></mwc-checkbox>
</mwc-formfield>`
: html``,
: html``,
];
}

Expand All @@ -65,8 +67,8 @@ export function createAction(parent: Element): WizardActor {

export function createSubstationWizard(parent: Element): Wizard {
const guessable =
parent.ownerDocument.querySelector('Substation') === null &&
parent.tagName === 'SCL';
parent.ownerDocument.querySelector('Substation') === null &&
parent.tagName === 'SCL';

return [
{
Expand All @@ -91,14 +93,14 @@ export function substationEditWizard(element: Element): Wizard {
icon: 'edit',
label: get('save'),
action: updateNamingAttributeWithReferencesAction(
element,
'substation.action.updatesubstation'
element,
'substation.action.updatesubstation'
),
},
content: render(
element.getAttribute('name') ?? '',
element.getAttribute('desc'),
false
element.getAttribute('name') ?? '',
element.getAttribute('desc'),
false
),
},
];
Expand Down
10 changes: 8 additions & 2 deletions apps/plugins/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "es2020",
"module": "esnext",
Expand All @@ -16,7 +17,12 @@
"sourceMap": true,
"inlineSources": true,
"resolveJsonModule": true,
"rootDir": "./src"
"rootDir": "../../",
},
"include": ["src/**/*.ts"]
"include": [
"./src/**/*.ts",
"../../libs/openscd/open-scd/src/**/*.ts",
"../../libs/openscd/core/src/**/*.ts",
"../../libs/openscd/xml/src/**/*.ts"
]
}
Loading