Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add Angular 16 support & update packages #450

Merged
merged 16 commits into from
May 16, 2023
Merged

build: add Angular 16 support & update packages #450

merged 16 commits into from
May 16, 2023

Conversation

Yberion
Copy link
Contributor

@Yberion Yberion commented May 7, 2023

Hello,

This PR fixes #449.

What I did:

  • I couldn't use yarn to run the nx migration so I had to switch to npm:
    • deleted yarn.lock
    • deleted node_modules
    • npm install
  • I executed the nx migration (with npm) to nx 16.1 which also migrated to Angular 16
    • npx nx migrate latest
    • There was nothing related to Angular 16 migration this time
    • I did not migrate to standalone nor inject pattern
  • I then had to update Storybook packages to 7.1.0-alpha.13 to support Angular 16 + Typescript 5 before installing the migrated packages
    • I removed node_modules & package-lock.json and switched back to yarn
    • then yarn install
  • I applied the migration
    • yarn nx migrate --run-migrations
  • The migration migrated Storybook to full version 7
    • For more information it created storybook-migration-summary.md
  • I had to switch back again to npm because caniuse-lite wasn't installing properly with yarn which caused problem when building
    • It was missing some files in caniuse-lite/dist/unpacker
  • I updated the .gitignore to reflect nx project migration
    • Properly ignore reports folders
  • I had to explicitly install core-js
    • I also had to update the import in test.ts of the lib to core-js/stable/reflect
  • I added hammerjs in allowedCommonJsDependencies for the demo app
  • I updated all packages to latest version
  • I scoped package versions to maximum patch
  • After updating all packages, caniuse-lite was installed properly so I switched back to yarn 😄
  • CI workflow nodejs now run on Node.js 16 and 18
    • Node.js 14 is not compatible anymore with Angular
  • CI workflow npm-publish now run on Node.js 18
  • actions/setup-node updated to v3 on all workflows

Problems:

  • I was not able to fix component-test
  • I was not able to fix storybook

Note:

  • Since the repo got moved to nx, it seems that some Typescript eslint rules were removed, if you want to add them back:
    • For "files": ["*.ts"] add "plugin:@nx/typescript" in the "extends": [...] array
    • I didn't add it cause I'm not sure how to properly fix all the problems on the project
    • I removed the unused comments using previous eslint setup (before nx migration) for cypress project (in commands.ts)

TODO on your side:

  • Update compatibility array
  • Release a new major version 8.0.0
  • Close branches related to package update

@Yberion
Copy link
Contributor Author

Yberion commented May 7, 2023

Oh, I didn't run the CI, I forgot that Node.js 14 wasn't supported anymore by Angular 16.
You might run against "^16.14.0 || >=18.10.0" now

@nx-cloud
Copy link

nx-cloud bot commented May 12, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit e8a7c3f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@Yberion
Copy link
Contributor Author

Yberion commented May 12, 2023

Hello @santoshyadavdev, I've updated to latest packages (again) and updated the CI, it works fine now ^^

@santoshyadavdev santoshyadavdev merged commit 33862ed into uiuniversal:master May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update for Angular 16
2 participants