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

upgrade vitest from 0.x to 1.x #278

Merged
merged 19 commits into from
Mar 22, 2024
Merged

upgrade vitest from 0.x to 1.x #278

merged 19 commits into from
Mar 22, 2024

Conversation

Burnett2k
Copy link
Member

@Burnett2k Burnett2k commented Mar 14, 2024

Description

This upgrades our devDependency on vitest from a beta version to the official 1.x.x major release. This meant snapshots needed to be updated, and we have to modify some of the types a little bit in the PR.

Kudos to @scottrippey for helping me get past a couple of the weird TS issues encountered.

Once this is done, we should no longer be referencing a vulnerable vite server vulnerability AND will be on a more stable version of Vitest for future testing.

After this + updating Sanity to 3.15.0, we're not pointing at the vulnerable version of 4.2.1 of vite server any longer.

❯ pnpm why vite -r
Legend: production dependency, optional only, dev only

playground-example@0.0.1 /Users/sawyerburnett/git-repos/formidable/groqd/examples/playground-example

dependencies:
groqd-playground link:../../packages/groqd-playground
└─┬ sanity 3.15.0
  ├─┬ @vitejs/plugin-react 4.2.1
  │ └── vite 4.5.2 peer
  └── vite 4.5.2
sanity 3.15.0
├─┬ @vitejs/plugin-react 4.2.1
│ └── vite 4.5.2 peer
└── vite 4.5.2

groq-builder@0.9.0 /Users/sawyerburnett/git-repos/formidable/groqd/packages/groq-builder

devDependencies:
vitest 1.3.1
├── vite 5.1.6
└─┬ vite-node 1.3.1
  └── vite 5.1.6

groqd@0.15.10 /Users/sawyerburnett/git-repos/formidable/groqd/packages/groqd

devDependencies:
vitest 1.3.1
├── vite 5.1.6
└─┬ vite-node 1.3.1
  └── vite 5.1.6

groqd-playground@0.0.18 /Users/sawyerburnett/git-repos/formidable/groqd/packages/groqd-playground

dependencies:
sanity 3.15.0
├─┬ @vitejs/plugin-react 4.2.1
│ └── vite 4.5.2 peer
└── vite 4.5.2

Fixes #274

Type of Change

  • security update

How Has This Been Tested?

Checklist: (Feel free to delete this section upon completion)

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run all builds, tests, and linting and all checks pass
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link

changeset-bot bot commented Mar 14, 2024

🦋 Changeset detected

Latest commit: 20df5a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
playground-example Patch
groqd-playground Patch
groq-builder Patch
groqd Patch
website Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Mar 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
groqd ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 3:22pm

@Burnett2k Burnett2k marked this pull request as ready for review March 19, 2024 14:58
Comment on lines +4 to +11
test: {
typecheck: {
enabled: true,
checker: "tsc",
allowJs: false,
include: ["**.test.ts"],
},
exclude: [...configDefaults.exclude],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out with v1, this config is needed in order to enable typechecking our files. Otherwise, we'd have to rename the type testing files with test-d in the file name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means now if there's type errors we should see it fail when running tests locally, rather than on the lint and type check step in CI.

Copy link
Member

@scottrippey scottrippey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thank you so much for persevering!

@Burnett2k Burnett2k merged commit 38f3f23 into main Mar 22, 2024
4 checks passed
@Burnett2k Burnett2k deleted the issue/325-upgrade-vitest branch March 22, 2024 16:11
@github-actions github-actions bot mentioned this pull request Mar 22, 2024
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.

groqd: remediate critical and high security warnings
2 participants