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

refactor: deprecate all config types from the main Vitest entrypoint, introduce SerializedConfig type #6205

Merged

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Jul 23, 2024

Description

All config types rely on node-specific types (from vite, for example). I have moved all of them to vitest/node from vitest (which should be runtime agnostic), but we should also review if all of them need to be exported.

I also started to type the serialisable config and runtime config that are available in vitest entry point and can be imported in your tests.

This PR introduces SerializedConfig that should be used at runtime instead of vitest - previously we just merged it with the ResolvedConfig and removed methods, now it is created manually so it's harder to miss something incompatible. I also plan to add a validator for resolved config values in the future and refactor how config is resolved (right now it's all over the place, but the goal of this PR is to introduce the groundwork and start deprecating node-related types in the main entry point)

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Jul 23, 2024

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit cb9d3ed
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/669fd6797e319400082bac5a
😎 Deploy Preview https://deploy-preview-6205--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sheremet-va sheremet-va changed the title refactor: deprecate all config types from the main Vitest entrypoint refactor: deprecate all config types from the main Vitest entrypoint, introduce SerializedConfig type Jul 23, 2024
@sheremet-va sheremet-va merged commit 3aab8a1 into vitest-dev:main Jul 23, 2024
16 checks passed
@sheremet-va sheremet-va deleted the fix/deprecate-node-configs-from-vitest branch July 23, 2024 17:29
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.

1 participant