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

chore(pie-monorepo): DSW-000 upgrade node 22 #2222

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

siggerzz
Copy link
Contributor

Describe your changes (can list changeset entries if preferable)

Just wanted to see what needs to be done in order to upgrade the repo for Node 22 compatibility.

Issues

Type 'FSWatcher' is missing the following properties from type 'FSWatcher'

I encountered this error when trying to build pie-icons-webc - vitejs/vite#15714

Cause: This is an issue in Vite 4. While we have a direct dependency of vite 5.x in the repo, our version of Vitest uses Vite 4.

Fix: Update vitest from 0.29.8 > 3.5.0.

Note

Given how old our version of Vitest is, it looks like the new version causes some slightly different formatting in snapshots. A couple of tests also needed to be updated.

Typecheck errors when building components

More info here - vitest-dev/vitest#4921

@justeattakeaway/pie-card:build: [vite:dts] Start generate declaration files...
@justeattakeaway/pie-card:build: ../../../node_modules/@vitest/utils/dist/diff.d.ts:93:96 - error TS2304: Cannot find name 'WeakKey'.
@justeattakeaway/pie-card:build: 
@justeattakeaway/pie-card:build: 93 declare function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced?: WeakSet<WeakKey>, expectedReplaced?: WeakSet<WeakKey>): {
@justeattakeaway/pie-card:build:                                                                                                   ~~~~~~~
@justeattakeaway/pie-card:build: ../../../node_modules/@vitest/utils/dist/diff.d.ts:93:133 - error TS2304: Cannot find name 'WeakKey'.
@justeattakeaway/pie-card:build: 
@justeattakeaway/pie-card:build: 93 declare function replaceAsymmetricMatcher(actual: any, expected: any, actualReplaced?: WeakSet<WeakKey>, expectedReplaced?: WeakSet<WeakKey>): {
@justeattakeaway/pie-card:build:                                                                                                                                        ~~~~~~~
@justeattakeaway/pie-card:build: ../../../node_modules/@vitest/utils/dist/error.d.ts:4:58 - error TS2304: Cannot find name 'WeakKey'.
@justeattakeaway/pie-card:build: 
@justeattakeaway/pie-card:build: 4 declare function serializeValue(val: any, seen?: WeakMap<WeakKey, any>): any;
@justeattakeaway/pie-card:build:                                                            ~~~~~~~
@justeattakeaway/pie-card:build: ../../../node_modules/@vitest/utils/dist/error.d.ts:6:84 - error TS2304: Cannot find name 'WeakKey'.
@justeattakeaway/pie-card:build: 
@justeattakeaway/pie-card:build: 6 declare function processError(_err: any, diffOptions?: DiffOptions, seen?: WeakSet<WeakKey>): any;
@justeattakeaway/pie-card:build:                                                                                      ~~~~~~~
@justeattakeaway/pie-card:build: ../../../node_modules/vitest/node_modules/vite/dist/node/index.d.ts:5:41 - error TS2307: Cannot find module 'rollup/parseAst' or its corresponding type declarations.
@justeattakeaway/pie-card:build: 
@justeattakeaway/pie-card:build: 5 export { parseAst, parseAstAsync } from 'rollup/parseAst';

Fix: Modify @justeattakeaway/pie-components-config tsconfig.json

"moduleResolution": "bundler": Updated from node > bundler. - Not sure if this has any unintended side effects, but I got a warning in my IDE saying node was deprecated anyway.

"skipLibCheck": true - This was suggested in open issues I saw related to this issue. Probably not ideal, but I noticed we have this set in other TS configs across the repo.

Author Checklist (complete before requesting a review, do not delete any)

  • I have performed a self-review of my code.
  • I have added thorough tests where applicable (unit / component / visual).
  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have reviewed visual test updates properly before approving.
  • If changes will affect consumers of the package, I have created a changeset entry.
  • If a changeset file has been created, I have tested these changes in PIE Aperture using the /test-aperture command.

Not-applicable Checklist items

Please move any Author checklist items that do not apply to this pull request here.


Testing

How do I test my changes?

Task Link
Aperture PR 🔗
NextJS 14 deployment 🔗
Nuxt 3 deployment 🔗
Vanilla deployment 🔗

Reviewer checklists (complete before approving)

Mark items as [-] N/A if not applicable.

Reviewer 1

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

Reviewer 2

  • I have reviewed the PIE Storybook/PIE Docs PR preview.
  • I have verified that all acceptance criteria for this ticket have been completed.
  • I have reviewed the Aperture changes (if added)
  • If there are visual test updates, I have reviewed them.

@siggerzz siggerzz requested review from a team as code owners February 14, 2025 14:48
Copy link

changeset-bot bot commented Feb 14, 2025

⚠️ No Changeset found

Latest commit: 7bf380c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pie-design-system-bot
Copy link
Contributor

pie-design-system-bot commented Feb 14, 2025




Fails
🚫 You have unchecked checklist items outside the "Not-applicable Checklist items" section.

Please ensure all unchecked checkboxes are moved to the appropriate section.

🚫 You have unchecked checklist items in Reviewer 1's section.

Please ensure all items are addressed before approval.

🚫 You have unchecked checklist items in Reviewer 2's section.

Please ensure all items are addressed before approval.

Generated by 🚫 dangerJS against 7bf380c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants