|
1 | | -<p align="center"> |
2 | | - <img width="200" src="https://open-wc.org/hero.png"></img> |
3 | | -</p> |
| 1 | +# OSCD Template Generator |
4 | 2 |
|
5 | | -## Open-wc Starter App |
| 3 | +OpenSCD plugin for creating new Logical Node Types (LNodeType) for IEC 61850 SCL files. |
6 | 4 |
|
7 | | -[](https://github.com/open-wc) |
| 5 | +## Overview |
8 | 6 |
|
9 | | -## Quickstart |
| 7 | +This project provides a web component and supporting dialogs for generating and managing Logical Node Types (`LNodeType`) in SCL files. It uses [OpenSCD Core](https://github.com/openenergytools/open-scd-core), [SCL-lib](https://github.com/openscd/scl-lib), and [Tree Grid](https://github.com/openenergytools/tree-grid) for SCL manipulation and UI. |
10 | 8 |
|
11 | | -To get started: |
| 9 | +## Features |
| 10 | + |
| 11 | +- Create and insert new `LNodeType` elements into SCL documents |
| 12 | +- Interactive tree-based selection of Data Objects and attributes for Logical Node Types |
| 13 | +- Dialogs for adding Data Objects, editing descriptions, previewing changes, and settings |
| 14 | + |
| 15 | +## Getting Started |
| 16 | + |
| 17 | +### Installation |
| 18 | + |
| 19 | +Clone the repository and install dependencies: |
12 | 20 |
|
13 | 21 | ```sh |
14 | | -npm init @open-wc |
15 | | -# requires node 10 & npm 6 or higher |
| 22 | +git clone https://github.com/com-pas/oscd-template-generator.git |
| 23 | +cd oscd-template-generator |
| 24 | +npm install |
16 | 25 | ``` |
17 | 26 |
|
18 | | -## Scripts |
| 27 | +### Development |
| 28 | + |
| 29 | +To start the development server with live reload on http://localhost:8000/: |
| 30 | + |
| 31 | +```sh |
| 32 | +npm start |
| 33 | +``` |
| 34 | + |
| 35 | +To build the project for production: |
| 36 | + |
| 37 | +```sh |
| 38 | +npm run build |
| 39 | +``` |
| 40 | + |
| 41 | +To run tests: |
| 42 | + |
| 43 | +```sh |
| 44 | +npm test |
| 45 | +``` |
| 46 | + |
| 47 | +To lint and format code: |
19 | 48 |
|
20 | | -- `start` runs your app for development, reloading on file changes |
21 | | -- `start:build` runs your app after it has been built using the build command |
22 | | -- `build` builds your app and outputs it in your `dist` directory |
23 | | -- `test` runs your test suite with Web Test Runner |
24 | | -- `lint` runs the linter for your project |
| 49 | +```sh |
| 50 | +npm run lint |
| 51 | +npm run format |
| 52 | +``` |
| 53 | + |
| 54 | +## Usage |
| 55 | + |
| 56 | +The main component is `oscd-template-generator`. It can be integrated into OpenSCD or used standalone in a web application. See `index.html` for a usage example. |
| 57 | + |
| 58 | +## Scripts |
25 | 59 |
|
26 | | -## Tooling configs |
| 60 | +- `start` - Start development server with live reload |
| 61 | +- `build` - Build the app and output to `dist` |
| 62 | +- `test` - Run test suite with coverage |
| 63 | +- `lint` - Run linter and prettier checks |
| 64 | +- `format` - Auto-format code |
| 65 | +- `deploy` - Build and deploy to GitHub Pages |
27 | 66 |
|
28 | | -For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project. |
| 67 | +## Project Structure |
29 | 68 |
|
30 | | -If you customize the configuration a lot, you can consider moving them to individual files. |
| 69 | +- `oscd-template-generator.ts` - Main web component |
| 70 | +- `components/` - Dialogs and UI components |
| 71 | +- `foundation.ts` - Utility functions for tree and selection logic |
| 72 | +- `constants.ts` - Shared constants |
| 73 | +- `utils/` - Utility helpers |
| 74 | +- `index.html` - Demo entry point |
0 commit comments