Skip to content

Commit 246e50e

Browse files
author
Tamás Russ
authored
infra: switch to monorepo
1 parent 802dd41 commit 246e50e

File tree

861 files changed

+36202
-19496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

861 files changed

+36202
-19496
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
jobs:
88
build-and-deploy:
99
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
shell: bash
13+
working-directory: packages/open-scd
1014
steps:
1115
- name: Checkout
1216
uses: actions/[email protected]
@@ -18,13 +22,13 @@ jobs:
1822

1923
- name: Install and Build
2024
run: |
21-
npm ci
25+
npm clean-install
2226
npm run-script build
23-
27+
2428
- name: Deploy
2529
uses: JamesIves/[email protected]
2630
with:
2731
branch: master
2832
folder: build
2933
repository-name: openscd/openscd.github.io
30-
ssh-key: ${{ secrets.DEPLOY_KEY }}
34+
ssh-key: ${{ secrets.DEPLOY_KEY }}

.github/workflows/test-and-build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ jobs:
1515

1616
- name: Install and Build
1717
run: |
18-
npm ci
19-
npm run-script build
18+
cd packages/open-scd
19+
npm clean-install
20+
npm run-script build

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Test
2-
on:
2+
on:
33
push:
44
branches-ignore:
55
- main
@@ -18,5 +18,6 @@ jobs:
1818

1919
- name: Install and Test
2020
run: |
21-
npm ci
22-
npm run-script test
21+
cd packages/open-scd
22+
npm clean-install
23+
npm run-script test

.gitignore

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,5 @@
66
.DS_Store
77

88
## npm
9-
/node_modules/
9+
node_modules/
1010
/npm-debug.log
11-
12-
## testing
13-
/coverage/
14-
/**/dist/*.snap.dev.js
15-
16-
## docs
17-
/doc/
18-
19-
# build
20-
/_site/
21-
/build/
22-
/out-tsc/

README.md

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,52 +19,22 @@ In order to install your own instance of OpenSCD on your own webserver (e.g. on
1919

2020
If you don't have your own webserver but still want your own version of OpenSCD hosted locally (e.g. on a system without an internet connection), you can [use a browser plugin that acts as a local webserver](https://github.com/openscd/open-scd/wiki/Install-OpenSCD#offline) (only for you) instead.
2121

22-
## Contributing
23-
24-
The easiest way to get in touch is to join the `#open-scd` channel kindly hosted on [the LF Energy Slack server](https://lfenergy.slack.com/archives/C03LH7EUP34).
25-
If you say "hi" there we will be more than happy to help you find your way around this project.
26-
27-
### Building
28-
29-
If you want to build OpenSCD yourself in order to make some changes to your local installation or to contribute to the project, you may first want to install [Node.js](https://nodejs.org/) in order to be able to use our local development setup. It is recommended to use Node.js 18.x. it is is the version used to build and test on GitHub Actions.
30-
31-
Once Node.js is installed on your system, you may get started by entering the following lines in your command prompt:
32-
33-
```
34-
git clone https://github.com/openscd/open-scd.git
35-
cd open-scd
36-
npm install
37-
npm start
38-
```
3922

40-
This will start a local development server and open a browser window which will automatically be reloaded as soon as you save any changes to your local source code files.
23+
## Development
4124

42-
### TypeDoc
25+
This repository is a [↗ monorepo](https://en.wikipedia.org/wiki/Monorepo), made up of several packages.
26+
To find out more about the development of each packages, such as the base distribution or the plugins, please refer to their respective READMEs:
27+
- [open-scd](packages/open-scd/README.md): provides the base distribution available on [openscd.github.io](https://openscd.github.io)
4328

44-
This project uses [TypeDoc](https://typedoc.org/) to transform documentation comments in the source code into a rendered HTML document that can be queried and navigated through. If you want to consult the generated documentation for the TypeScript components, mixins, modules and other relevant artifacts of this project, you can [do it here](https://openscd.github.io/doc/).
45-
46-
### Linting & Formatting
47-
48-
If you use VSCode to develop, we recommend you install and use the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extensions in order to automatically lint and format your code as you edit it. There are similar plugins available for using [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/) from within other IDEs and text editors.
49-
50-
### Scripts
51-
52-
We provide the following `npm` scripts for your convenience:
53-
54-
- `npm start` runs `OpenSCD` for development, reloading on file changes
55-
- `npm test` runs the test suite with Karma
56-
- `npm run lint` runs the linter (fixes problems in your code)
57-
- `npm run format` runs the formatter (formats your code in a unified way)
58-
- `npm run doc` builds HTML documentation into the `doc` directory
59-
- `npm run build` builds a deployable version of the project into the `dist` directory
29+
## Contributing
6030

61-
## License
31+
The easiest way to get in touch is to join the `#open-scd` channel kindly hosted on [the LF Energy Slack server](https://lfenergy.slack.com/archives/C03LH7EUP34).
32+
If you say "hi" there we will be more than happy to help you find your way around this project.
6233

63-
The [IEC 61850](https://webstore.iec.ch/publication/63319) XSD and NSD code components used are
64-
distributed under their [end user license agreement](CC-EULA.pdf).
34+
## Documentation
6535

66-
This project is licensed under the [Apache License 2.0](LICENSE.md).
36+
How the documentation is organized.
6737

68-
© 2020-2022 OMICRON electronics GmbH, TransnetBW GmbH, Alliander N.V., and others
38+
A high-level overview of how it’s organized will help you know where to look for certain things:
6939

70-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenscd%2Fopen-scd.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenscd%2Fopen-scd?ref=badge_large)
40+
- [⚖️ Decisions](docs/decisions/README.md) documents the decisions we made and why we made them.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# 2. Use Monorepo
2+
3+
Date: 2023-08
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
We want:
12+
- better access management to core functionalities, plugins and ui components
13+
- easier maintainability and refactorability of critical parts
14+
- more shareable code
15+
16+
17+
## Decision
18+
19+
We will use a monorepo to manage the codebase for the time being.
20+
21+
To control access to the codebase we will use CODEOWNERS files.
22+
23+
24+
## Consequences
25+
26+
- it makes the the dependency discovery and management easier between packages
27+
- we can add packages that can be deployed and published independently and still used directly inside the monorepo
28+
- it will allow us to experiment and beta test packages before publishing them
29+
- CI pipeline runs will be faster because changes are more separated
30+
- it will make it harder to bundle and distribute parts of the base distribution
31+
- it moves the complexity of package management into a concentrated place
32+
33+

docs/decisions/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Decisions
2+
3+
- [ADR-0001: Record architecture decisions](0001-record-architecture-decisions.md) <kbd>✅ active</kbd>
4+
- [ADR-0002: Use Monorepo](0002-use-monorepo.md) <kbd>✅ active</kbd>

0 commit comments

Comments
 (0)