38 Commits

Author SHA1 Message Date
Nicholas Cunningham
d3ecffedc1
feat(vite): add ajv dev dependency for vite-plugin-dts (#31107)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, when we generate a vite library that uses `vite-plugin-dts`
it breaks the project graph and all nx commands fail.
It happens because the wrong version of `ajv` is being hoisted in
`node_modules/ajv` so the expected module path required from
`vite-plugin-dts` is not found.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx commands should work out of the box when we generate a library with
vite.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-05-15 15:44:53 -04:00
James Garbutt
1ab8bdbe98
cleanup(vite): migrate to picomatch (#30484) 2025-05-01 11:06:39 +04:00
Colum Ferry
c1ebcb9129
feat(vite): add support for vite 6 (#29871)
## Current Behavior
Nx currently supports Vite at version 5. Nx does not generate vite
configurations using Vite 6 which has been released.
 

## Expected Behavior
Nx should use Vite 6 for vite projects.

## TODO
- [x] Add Package Update Migrations for Existing Projects
- [x] Add AST migrations to handle breaking change in resolve.extensions
- [x] Add migration to install `jsx` or `jiti` to handle processing TS
postcss config files
2025-02-11 11:28:23 -05:00
Colum Ferry
a7c8c1021e
feat(testing): support vitest 3 (#29908)
## Current Behavior
We currently still generate Vitest configuration using Vitest v1.

Vitest v3 has released so Nx is pretty far behind now.


## Expected Behavior
Update vitest version to v3 and use it to configure new projects.
Existing workspaces using v1 will continue to use v1.
2025-02-07 13:10:01 -05:00
Jack Hsu
ca9f3cce0b
feat(bundling): add nxCopyAssetsPlugin for Vite to use in JS libs (#27593)
This PR adds a `nxCopyAssetsPlugin` for Vite to brings it to parity with
the other compilers/bundlers (tsc, swc, esbuild, rollup, and webpack).

When generate a lib with Vite (e.g.`nx g @nx/js:lib --bundler=vite` or
`nx g @nx/react:lib --bundler=vite`), we expect it to at least copy
`README.md` as an asset.

Note: Vite has support for copying assets from `public/` but that is
less flexible and more intended for apps, not libs.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27351
2024-08-22 13:30:40 -04:00
Colum Ferry
6d963fd21d
fix(vite): add typecheck inferred target for vite plugin #27501 (#27531)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Vite intentionally does not run typechecking on projects. They recommend
running `tsc --noEmit` separately.
The `@nx/vite/plugin` could make this easier by adding a `typecheck`
when it detects a `tsconfig` file in the `projectRoot`.
This can then be added to the build pipeline on CI. Or users can add it
to a `dependsOn` for the `build` target if they wish.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The `@nx/vite/plugin` could make this easier by adding a `typecheck`
when it detects a `tsconfig` file in the `projectRoot`.
This can then be added to the build pipeline on CI. Or users can add it
to a `dependsOn` for the `build` target if they wish.


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27501
2024-08-20 13:53:13 +01:00
Connor Sullivan
186e4c7606
chore(vite): allow experimental vitest 2 support (#27371)
Allows consumers to use vitest 2 with the @nx/vite plugin.

closed #27259

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Users cannot use Vitest 2 with @nx/vite.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Users can use Vitest 2 with @nx/vite.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27259
2024-08-20 13:08:41 +04:00
Jason Jean
7705757c62
fix(misc): adjust npm keywords (#24743)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

NPM Keywords do not include those which are shown under the categories
under the `Discover packages` section. https://www.npmjs.com/

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

NPM Keywords include those which are shown under the categories under
the `Discover packages` section when applicable. https://www.npmjs.com/


![image](https://github.com/nrwl/nx/assets/8104246/ebbd4317-0336-4834-b4eb-0c673a358601)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-22 22:30:10 -04:00
Katerina Skroumpelou
00dae6a811
fix(vite): update vitest and use parseCLI (#21890) 2024-02-22 11:03:08 -05:00
Katerina Skroumpelou
cac2c173c5
feat(vite): update to vitest v1 (#20747) 2023-12-14 19:55:08 +04:00
Katerina Skroumpelou
c9832f4750
fix(vite): allow vitest to be v1 (#20760) 2023-12-14 14:32:28 +02:00
Katerina Skroumpelou
83db767b27
feat(vite): nodes for build, serve, test, preview targets (#20086) 2023-11-30 15:56:16 -05:00
Katerina Skroumpelou
2c88282e8a
fix(vite): adjust config generation (#20367) 2023-11-29 15:58:49 +02:00
Katerina Skroumpelou
82b39d1f86
feat(vite): update to version 5 (#20341) 2023-11-21 09:45:21 -05:00
Colum Ferry
80fde79374
feat(misc): remove deprecated Angular CLI usage of schematics and builders (#19557) 2023-10-13 17:14:16 +01:00
Emily Xiong
9d5a3830be
feat(misc): remove dotenv from executors (#18719) 2023-08-22 20:00:37 -04:00
Leosvel Pérez Espinosa
9cd0cf899a
fix(misc): set the correct dependency range for dotenv in plugins (#18573) 2023-08-10 13:02:50 -04:00
Jack Hsu
2dc6656f4b
fix(bundling): add missing main export for @nx/vite (#18344) 2023-07-27 11:34:03 -04:00
Caleb Ukle
6529be96cf
feat(vite): add tsconfig paths resolution plugin (#17844) 2023-07-17 15:42:12 +00:00
Katerina Skroumpelou
6c46ad8b61
chore(vite): update vite version (#16198) 2023-05-04 17:06:15 +00:00
Jason Jean
9aa355f8dc
fix(bundling): export collections from @nx/vite (#16514) 2023-04-24 16:49:06 -04:00
Jack Hsu
df81c0d8d5
feat(misc): update @swc/helpers version to match @swc/core (#16343) 2023-04-17 20:21:12 +00:00
Jason Jean
2d195007b0
feat(core): switch packages to use the @nx scope (#16069) 2023-04-14 19:56:37 -04:00
Leosvel Pérez Espinosa
675a5a9c87
feat(misc): bump tsquery dependency version (#16050) 2023-04-03 10:11:45 -04:00
Craigory Coppola
6834b658f7
fix(nx-plugin): allow some customization when running nx-plugins (#15438) 2023-03-21 18:35:55 -04:00
Jack Hsu
b7ef261182
fix(bundling): use a range rather than ^ for vitest peer dependency … (#15362) 2023-03-01 12:27:56 -07:00
Dmitriy Stepanenko
0e7e76f3e1
fix(vite): expose all executors and schemas (#14763) 2023-02-07 10:15:30 +02:00
Phillip Barta
415d1c745c
fix(misc): loosen chalk version (#14276) 2023-01-13 17:44:11 -05:00
Katerina Skroumpelou
e50c8ccc41
docs(vite): enhancing vite docs (#13984) 2022-12-22 20:05:31 +00:00
Katerina Skroumpelou
4f50b8929b
fix(vite): inform user to add build config (#13876) 2022-12-20 15:44:33 +00:00
Katerina Skroumpelou
b52b649fcb
feat(vite): allow user to set their custom target for transform (#13691) 2022-12-16 13:35:52 +00:00
Katerina Skroumpelou
002d7f32b5
feat(vite): update vite to version 4 (#13800) 2022-12-14 11:53:58 -05:00
Jack Hsu
fb8631ed1e
feat(bundling): initial public release for vite plugin (#13230) 2022-11-17 15:54:41 +00:00
Jonathan Cammisuli
54670c93e0
feat(testing): add vitest (#13129) 2022-11-15 09:15:19 -05:00
Katerina Skroumpelou
8d103f323c
feat(bundling): vite plugin executors (#13032) 2022-11-14 14:33:09 -05:00
Jason Jean
cb0ccea9a8
chore(repo): hide vite from being pubished publically (#13060) 2022-11-08 11:31:56 -05:00
Jack Hsu
a623e5290e
fix(bundling): add missing package.json export field (#13035) 2022-11-07 18:25:22 +00:00
Jack Hsu
8edcdac5eb
feat(bundling): add initial vite plugin (#12969) 2022-11-03 19:19:29 +02:00