engine_web-ifc icon indicating copy to clipboard operation
engine_web-ifc copied to clipboard

Update project structure to work with npm link and rollup

Open RodrigoHamuy opened this issue 4 years ago • 0 comments

I have done a bunch of changes in an attempt to simplify development and allow npm link to work.

The idea is to use the same rollup setup through across all the web-ifc projects and export to support both CJS and ESM modules.

There are still some more things I need to clean/fix, but I wanted to know your opinion in what I have so far.

Some of the changes I have done:

  • Use rollup instead of esbuild
  • Reduce the number of npm scripts required to run to have a working environment.
  • Update docker script so you can re-build wasm without having to rebuild docker.
  • Update add-wasm-path to convert wasm JS file to a TS friendly format.
  • Deleted ifc2x4_helper as it was an exact copy of IFC4x2. Was giving me namespace conflicts.
  • Deleted .js files and kept just the .ts ones.

To use:

npm i
npm run docker-build-wasm # build wasm files and post script to convert it to TS
npm run build # build using rollup and copy the wasm file to the dist folder

If you want to test npm link, run npm link and then go to your web-ifc-three repo and run npm link web-ifc to use your local web-ifc version instead of the npm published package.

To-do:

  • [x] Update examples
  • [ ] Update github actions for PR reviews and publishing (nice to have)
  • [x] Review all npm scripts
  • [x] Update schema scripts
  • [ ] Review benchmark (won't make sense until a new version is released)

RodrigoHamuy avatar Aug 25 '21 19:08 RodrigoHamuy