IOT-Map-Component icon indicating copy to clipboard operation
IOT-Map-Component copied to clipboard

fix(build): library build refactoring

Open julien-deramond opened this issue 3 years ago • 2 comments

Fixes https://github.com/Orange-OpenSource/IOT-Map-Component/issues/18 FIxes https://github.com/Orange-OpenSource/IOT-Map-Component/issues/100

  • [x] Package this fix in iotmapmanager-labs
  • [ ] Test iotmapmanager-labs in the root project
  • [ ] Test iotmapmanager-labs in a real Orange Angular project
  • [ ] Check if other packages should be defined as peerDependencies (@types/leaflet, @types/leaflet.markercluster, leaflet-polylineoffset and leaflet.markercluster)
  • [ ] Study exactly where the Bounds are not valid issue comes from
  • [x] Finish the work to migrate to Node 16 while we are testing it in a real project
  • [ ] Fix the test project to embed resources in angular.json and not in index.html
  • [ ] Before merging it, remove modification in component.ts

What's been done regarding Node 16

We observed some issues while building the library with Node 14 so I embedded this modification as well in this PR:

  • Run npm i with Node 16 in src/iotMapManager to update package-lock.json
  • Run npm i with Node 16 at the root of the project to update package-lock.json
  • Updated .github/workflows/docs.yml to use latest versions of actions (v3) and use Node 16 (+ cache)
    • [x] Run it via https://github.com/Orange-OpenSource/IOT-Map-Component/runs/6190089824?check_suite_focus=true and Storybook was well deployed

How to test it locally / manually

  1. Run npm i at the root of the project
  2. Go to src/iotMapmanager and then run npm i
  3. Run npm pack
  4. Go to /tmp and run rm -rf iotmap* package ; cp /Users/ju/IOT-Map-Component/src/iotMapManager/iotmapmanager-2.6.8.tgz . ; tar -xvf iotmapmanager-2.6.8.tgz ; rm -rf /Users/ju/IOT-Map-Component/node_modules/iotmapmanager/* ; cp -R package/* /Users/ju/IOT-Map-Component/node_modules/iotmapmanager/
  5. Go back to the root of this branch and run npm run start

How to test it with the iotmapmanager-labs

TODO

julien-deramond avatar Apr 27 '22 08:04 julien-deramond

Some notes for triage

  • in src/iotMapManager/package-lock.json leaflet version is 1.7.1
  • Need to regenerate package-lock.json from scratch to handle correctly the leaflet versions?

julien-deramond avatar Apr 27 '22 09:04 julien-deramond

This PR would need to be updated to reflect the new architecture. But the principle is probably still valid and relevant.

julien-deramond avatar Feb 15 '24 14:02 julien-deramond