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

fix(nx-plugin): rename Vite config and correct Vitest version for Vitest schematic #965

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

brandonroberts
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • vite-plugin-angular
  • vite-plugin-nitro
  • astro-angular
  • create-analog
  • router
  • platform
  • content
  • nx-plugin
  • trpc

What is the current behavior?

The setup-vitest schematic/generator installs an incorrect version of Vitest (1.31.1), and uses a vite.config.ts which fails because an existing project is not set to use ESM by default.

Closes #

What is the new behavior?

  • The setup-vitest schematic/generator installs the correct version of Vitest (^1.3.1).
  • A vite.config.mts file is used instead which uses ESM for Vitest only.
  • The ^1.0.0 version of Analog packages is installed.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

[optional] What gif best describes this PR or how it makes you feel?

@brandonroberts brandonroberts merged commit dceb37e into beta Mar 25, 2024
8 checks passed
@brandonroberts brandonroberts deleted the fix-vitest-setup branch March 25, 2024 13:07
@Micha-Richter
Copy link
Contributor

Do the vite config files in the templates of create-analog also need to be renamed? 🤔

@brandonroberts
Copy link
Member Author

@Micha-Richter no, they don't. This is for the standalone Vitest setup. If you want to migrate completely to Analog, more changes are required, including updating the package.json, angular.json, and possibly renaming vite.config.mts to vite.config.ts. Both filenames will work though. We're using vite.config.mts in this case so Vite resolves it to ESM, because the plugins are ESM-only now. The Angular CLI is still using CommonJS though.

I don't want to force the full update to ESM for existing workspaces as its not as fully tested with the Angular CLI.

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.

2 participants