Skip to content

Upgrade Node to 16 and switch to pnpm

Axel Bocciarelli requested to merge node16-pnpm7 into master
  • pnpm v7 requires Node 16+, so I had to upgrade Node at the same time.
  • I didn't end up upgrading to Node 18 to simplify the installation of node-canvas (required by fabric), which doesn't yet provide pre-built binaries for Node 18. I've added a section about this in the new CONTRIBUTING guide.
  • I've moved the main developer documentation out of the styleguide and into the new CONTRIBUTING guide to avoid duplication. Seems like a better place to put it, since in order to start the styleguide, you need to know how to set up the project... 😅 The structure of the guide is similar to the one on H5Web. It includes a cheat sheet for pnpm 7 and information on dependency management, which notably lists peer dependency version requirements.
  • I had to add a bunch of packages in package.json because pnpm's node_modules structure is a lot stricter. This brings a lot of previously-hidden inter-dependencies to light, which is a really good thing moving forward.
  • I also pinned all the dependencies in package.json to their exact installed versions to make it easier to debug dependency issues. This is becoming a best practice. To update a package, you just need to run pnpm up -L <pkg> (which is documented in the CONTRIBUTING guide).
  • redux-provider is now pointing to branch with-built-files, in which the built files are committed to version control. This avoids any installation issue in the CI and ensures we can properly cache everything. I've opened this PR as a draft until we decide if this is the right way forward. @sfisher
  • I've renamed the styleguide-serve script to styleguide (i.e. to run the styleguide in development) and styleguide to styleguide-build (to build the styleguide for production). The term serve made it sound like it was for serving the output folder statically. Also, it's fewer characters to type in development.
  • To make things even clearer, I've added a script called styleguide-preview to do just that: serve the styleguide locally from /styleguide after running styleguide.
  • I've also added a preview script to serve the production build of Daiquiri UI locally.

From here, what's left to do, I think, is:

  1. Decide what to do about redux-provider => dist files committed to master branch
  2. Prepare a branch in daiquiri-tomo to use the new styleguide script (instead of styleguide-serve) in the multivisor config and sh scripts, and upgrade the tomodemo-npm-env environment to Node 16 and pnpm 7 (as explained on the styleguide's "Getting started" page) => daiquiri-tomo!10 (merged)
  3. Roll with it!
Edited by Axel Bocciarelli

Merge request reports

Loading