…ets (#23264)"
This reverts commit 85c89160
<!-- 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 -->
## 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 #
<!-- 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 -->
The migration to update vite config is incorrectly matching other object
literal and arrow functions
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure more accurate updating of vite config file
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#20921
- Update Vitest `cache.dir` to be scoped to each project root to avoid
collisions (same as what's already done for Vite)
- Normalize Vite `cacheDir` to avoid trailing `/.` paths for root
projects
- Fix Remix & Storybook Vite `cacheDir` generation
<!-- 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 -->
## 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#21775
<!-- 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 -->
Calculating conflicts in target names does not consider if the
project.json defined targets will actually be impacted by the plugin
that wants to be added creating false negatives
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Calculating conflicts should be more accurate
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#22476
<!-- 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 -->
We currently do not handle passing `--watch` when running inferred
`vitest` commands
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
We should support handling `--watch`
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#23185
## Current Behavior
Since v18.2.3 (e4c4697f69cf29c50aced1997715a7da5f680e23) the
`tsconfig.generated.json` file generated if `"buildLibsFromSource":
false` is placed under a path containing the current build target. The
`nx-tsconfig-paths` plugin of `@nx/vite` was not updated accordingly, so
now it doesn't find `tsconfig.generated.json`, effectively causing
`@nx/vite` to ignore the `"buildLibsFromSource": false` setting.
## Expected Behavior
With this PR, `nx-tsconfig-paths` finds `tsconfig.generated.json` at the
correct path, so `"buildLibsFromSource": false` works as it did before
v18.2.3.
<!-- 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 -->
Attempting to use Remix + Vite results in a few errors. I assume this is
due to the vite and remix plugins conflicting with each other.
One of which being:
```
Failed to process project graph.
The "@nx/vite/plugin" plugin threw an error while creating nodes from myremixapp/vite.config.ts:
Error: Missing "root" route file in /Users/username/work/remix-demo/app
at Object.resolveConfig (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/config.js:154:11)
at updateRemixPluginContext (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/vite/plugin.js:367:9)
at config (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/vite/plugin.js:598:7)
```
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
It should work just like it currently does for Remix Classic.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
#22035
## PR Status
This is a very early draft. I don't think this is a good approach but it
does work for me at the moment. I'm not sure exactly how we can discern
a remix project from a vanilla vite project (that you can use standard
tooling for) without parsing the `package.json` or `vite.config.ts` and
searching for remix-specific content.
## Steps to reproduce my current state
Set up a standard @nx/remix project as shown
[here](https://nx.dev/recipes/react/remix).
Follow the instructions
[here](https://remix.run/docs/en/main/future/vite#migrating) from
`Migrating` down to but NOT including `Migrating a custom server`.
Once I use the modified @nx/vite code provided in this PR, I'm able to
run `npx nx dev [app-name]` successfully.
## A Personal Note
I'd love to contribute more to nrwl/nx.
I'm quite a fan of Nx and use it in a few separate projects.
That being said, I don't currently have a comprehensive knowledge of its
internals.
If anyone wants to give me some guidance (text-based or we can hop on a
call), I'd be more than happy to contribute the rest of this myself (and
other fixes).
---------
Co-authored-by: Colum Ferry <cferry09@gmail.com>