Upgrade Node to 16 and switch to pnpm
- 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 byfabric
), which doesn't yet provide pre-built binaries for Node 18. I've added a section about this in the newCONTRIBUTING
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'snode_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 runpnpm up -L <pkg>
(which is documented in theCONTRIBUTING
guide). -
redux-provider
is now pointing to branchwith-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 tostyleguide
(i.e. to run the styleguide in development) andstyleguide
tostyleguide-build
(to build the styleguide for production). The termserve
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 runningstyleguide
. - 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:
-
Decide what to do about redux-provider
=> dist files committed tomaster
branch -
Prepare a branch in daiquiri-tomo
to use the newstyleguide
script (instead ofstyleguide-serve
) in the multivisor config andsh
scripts, and upgrade thetomodemo-npm-env
environment to Node 16 and pnpm 7 (as explained on the styleguide's "Getting started" page) => daiquiri-tomo!10 (merged) - Roll with it!
Edited by Axel Bocciarelli