Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CoMPAS OpenSCD build process. #284

Closed
4 tasks
pascalwilbrink opened this issue Oct 26, 2023 · 2 comments · Fixed by #293
Closed
4 tasks

Update CoMPAS OpenSCD build process. #284

pascalwilbrink opened this issue Oct 26, 2023 · 2 comments · Fixed by #293

Comments

@pascalwilbrink
Copy link
Member

pascalwilbrink commented Oct 26, 2023

Since we have a lot of Code duplication as a result of #283 + no explicit imports, we need to make sure that building CoMPAS OpenSCD works with in combination with OpenSCD.

Acceptance criteria

  • CoMPAS OpenSCD builds correctly
  • CoMPAS OpenSCD uses OpenSCD as a dependency
  • CoMPAS OpenSCD uses plugins from packages/openscd
  • Code duplication is removed

Waiting for #283 to be merged back to main.

@Sander3003
Copy link
Member

Possible solution:

Make sure that CoMPAS-Open-SCD and OpenSCD are build correctly. For CoMPAS-Open-SCD, we can easily check if it's build correctly (npm start).
Since CoMPAS-Open-SCD will make use of plugins that are maintained by OpenSCD, we need to either Copy those (built) plugins over, or adjust the build process of CoMPAS-Open-SCD.

Copy plugins over:
5A) Create a build script in the root package.json
'build': 'cd packages/open-scd && npm run build && cd packages/compas-openscd && npm run build'
'postbuild': 'cp packages/open-scd/build'

Adjust build process:
5B) Update the snowpack.config.mjs inside packages/compas-openscd.
Add the
packageOptions.knownEntrypoints inside snowpack configuration to add @openscd/open-scd as a known dependency.

Step 5B will be easiest and cleanest, just some playing around with Snowpack.

@Sander3003
Copy link
Member

Risks/uncertainties:

  • How to ship OpenSCD in CoMPAS-OpenSCD?
  • Snowpack is looking all typescriptcode and changes it to javascriptcode; Snowpack will ignore some files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants