From 2bf7876e8ade51907f87d1d896ea6a049530c703 Mon Sep 17 00:00:00 2001 From: Stephen Renwick Date: Fri, 28 Nov 2025 08:31:36 +0100 Subject: [PATCH] feat: updating module naming to openscd --- README.md | 20 +++++++++----------- package-lock.json | 4 ++-- package.json | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b608647..5a273ba 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ -This repository hold the XML editing engine inspired by the [OpenSCD core](https://github.com/openscd/open-scd-core) and is following the newest agreed [OpenSCD Core API](https://github.com/OpenEnergyTools/open-scd-core/blob/main/API.md) - +This repository hold the XML editing engine, following the newest agreed [OpenSCD Plugin API](https://github.com/openscd/oscd-api/blob/main/docs/plugin-api.md) ## Usage You can either load and use the `handleEdit` function through npm or other content delivery networks. This function does manipulate a XMLDocument as per user intent through the edit as its input: ```ts -const removeNode: Remove = {node: toBeRemovedNode} -handleEdit(removeNode) +const removeNode: Remove = { node: toBeRemovedNode }; +handleEdit(removeNode); ``` You can also use the exported `EditV2Editor` class which keeps track of an undo/redo @@ -15,11 +14,11 @@ history. This class is a wrapper around the `handleEdit` function and provides a more user-friendly API. The `EditV2Editor` class can be used as follows: ```ts -import { EditV2Editor } from '@omicronenergy/oscd-editor'; +import { EditV2Editor } from '@openscd/oscd-editor'; const editor = new EditV2Editor(); -const removeNode: Remove = {node: toBeRemovedNode} +const removeNode: Remove = { node: toBeRemovedNode }; editor.handleEdit(removeNode); expect(toBeRemovedNode.parentNode).to.not.exist; @@ -37,11 +36,11 @@ expect(toBeRemovedNode.parentNode).to.not.exist; To scan the project for linting and formatting errors, run ->npm run lint +> npm run lint To automatically fix linting and formatting errors, run ->npm run format +> 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. @@ -49,12 +48,11 @@ We use ESLint and Prettier for linting and formatting. Plugins for automatic for To execute a single test run: ->npm test +> npm test To run the tests in interactive watch mode run: ->npm run test:watch - +> npm run test:watch # License diff --git a/package-lock.json b/package-lock.json index 40f9925..c7f19ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@omicronenergy/oscd-editor", + "name": "@openscd/oscd-editor", "version": "1.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@omicronenergy/oscd-editor", + "name": "@openscd/oscd-editor", "version": "1.7.1", "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index e1afad5..260eaaf 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@omicronenergy/oscd-editor", + "name": "@openscd/oscd-editor", "description": "Function library for basic XML manipulations", "license": "Apache-2.0", "author": "OMICRON electronics GmbH", @@ -12,7 +12,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/OMICRONEnergyOSS/oscd-editor.git" + "url": "https://github.com/openscd/oscd-editor.git" }, "publishConfig": { "access": "public"