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

[wrangler] Remove ambient vitest types from generated tsconfig.jsons #2839

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Mar 2, 2023

What this PR solves / how to test:

Previously, wrangler init generated a tsconfig.json with "types": [..., "vitest"], even if Vitest tests weren't generated. Unlike Jest, Vitest doesn't provide global APIs by default (https://vitest.dev/config/#globals), so there's no need for ambient types. Because these ambient types don't actually exist, this was causing issues during type checking.

Associated docs issues/PR:

N/A

Author has included the following, where applicable:

  • Tests
  • Changeset

Reviewer has performed the following, where applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Fixes #2773.

@mrbbot mrbbot requested a review from a team as a code owner March 2, 2023 16:54
@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2023

🦋 Changeset detected

Latest commit: fd986a4

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4342514155/npm-package-wrangler-2839

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/2839/npm-package-wrangler-2839

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4342514155/npm-package-wrangler-2839 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4342514155/npm-package-cloudflare-pages-shared-2839

Note that these links will no longer work once the GitHub Actions artifact expires.

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #2839 (fd986a4) into main (e3c036d) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2839   +/-   ##
=======================================
  Coverage   74.05%   74.05%           
=======================================
  Files         166      166           
  Lines       10218    10218           
  Branches     2734     2734           
=======================================
  Hits         7567     7567           
  Misses       2651     2651           

Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

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

Really love how much Templates are getting improvements and maintenance 🥳

@mrbbot mrbbot force-pushed the bcoll/remove-vitest-ambient branch from 9dc956f to dda8647 Compare March 3, 2023 16:12
@mrbbot mrbbot changed the title Remove ambient vitest types from generated tsconfig.jsons [wrangler] Remove ambient vitest types from generated tsconfig.jsons Mar 3, 2023
Previously, `wrangler init` generated a `tsconfig.json` with
`"types": [..., "vitest"]`, even if Vitest tests weren't generated.
Unlike Jest, Vitest doesn't provide global APIs by default
(https://vitest.dev/config/#globals), so there's no need for ambient
types.
@mrbbot mrbbot force-pushed the bcoll/remove-vitest-ambient branch from dda8647 to fd986a4 Compare March 6, 2023 10:40
@mrbbot mrbbot merged commit ad4b123 into main Mar 6, 2023
@mrbbot mrbbot deleted the bcoll/remove-vitest-ambient branch March 6, 2023 11:11
@github-actions github-actions bot mentioned this pull request Mar 6, 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.

🐛 BUG: tsconfig.json contains vitest even with opted out
2 participants