ReadAlongs / Studio-Web

Suite of web packages for creating interactive ReadAlongs (this repo was formerly called Web-Component)
https://readalong-studio.mothertongues.org/
Other
9 stars 9 forks source link

Migrate all the things to Angular 17 and Nx 18 #247

Closed dhdaines closed 5 months ago

dhdaines commented 5 months ago

This is complete insofar as the tests appear to be passing for me (may need to fix them in CI).

Note that all of the dev dependencies have been consolidated at the top-level package.json, and numerous redundant dependencies have been removed.

Why on earth Angular comes as 50 different packages all of which have to be updated separately I will never know. What I have learned from this is that:

  1. First you migrate nx, then you migrate @angular/core, then you migrate @angular/material.
  2. nx is so proud of the fact that it runs migrations separately from updating packages but this is an utterly useless feature since you can only run one migration at a time! Do not try to accumulate multiple migrations in the same migrations.json! Do not try to migrate multiple packages on the same command line! THIS DOES NOT WORK!
  3. So instead of one command you need to run like six of them. But it mostly works except for the npm dependency nightmare.

Also since MacOS likes to run things on port 5000 I moved the test data to a more random-looking port number.

Also, we don't really use @angular/cli for anything except running the 'test:once' script, and this is because we use the very harmful karma/jasmine test framework, so we should switch to jest as it is better, but that's a different PR.

Also, Nx 17 introduced a very annoying breaking change which makes releasing packages from a monorepo needlessly difficult: https://github.com/nrwl/nx/issues/19989 so I have added some hacks which I hope will work, but seriously... why is monorepo good again? Is it like monorail?

github-actions[bot] commented 5 months ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://ReadAlongs.github.io/Web-Component/pr-preview/pr-247/ on branch gh-pages at 2024-03-26 23:23 UTC

joanise commented 5 months ago

Sweet:

$ npm audit
found 0 vulnerabilities
joanise commented 5 months ago

@dhdaines Rebased and re-opened as a new PR: #258