16 Commits

Author SHA1 Message Date
Jack Hsu
766d1b32e0
docs(misc): remove installation instructions for Nx < 18 (#30950)
This PR removes installation instructions for Nx < 18 since it has
fallen out of support window. Users can always `npm install <plugin>` as
usual if they are on an unsupported Nx version, but the docs will assume
`nx add` moving forward.

The changes are on the plugin overview page:
https://nx-dev-git-docs-remove-nx-pre-18-install-nrwl.vercel.app/nx-api
2025-04-30 14:34:28 -04:00
Jack Hsu
8fa7065cf1
docs(misc): update generator examples to use new directory/path positional args (#28144)
This PR updates examples in `.md` files (both docs and blog posts) to
use positional args. Nx 20 changes the position arg to be either
`directory` for apps/libs or `path` for artifacts (e.g. components).

So before you'd do this:

```
nx g app myapp --directory=apps/myapp
nx g lib mylib --directory=libs/mylib
nx g lib mylib --directory=libs/nested/mylib
nx g lib @acme/foo --directory=libs/@acme/foo --importPath=@acme/foo
nx g component foo --directory=libs/ui/src/foo --pascalCaseFiles
```

Will now be simplified to

```
nx g app apps/myapp
nx g lib libs/mylib
nx g lib libs/nested/mylib
nx g lib libs/@acme/foo # name and import path are both "@acme/foo"
nx g component libs/ui/src/foo/Foo
```

For cases where `name` and `importPath` need to be changed, you can
always manually specify them.

```
nx g lib libs/nested/foo # name is foo
nx g lib libs/nested/foo --name=nested-foo # specify name with prefix
nx g lib libs/@acme/foo --name # use "foo" as name and don't match importPath
nx g lib libs/@internal/foo --importPath=@acme/foo # different importPath from name

<!-- 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 #
2024-09-30 13:20:10 -04:00
Jack Hsu
4a5eb23302
fix(bundling): vite init generator supports updating vite projects to use workspace libraries (#26503)
This PR adds a `@nx/vite:setup-paths-plugin` generator to add
`nxViteTsPaths` plugin to all vite config files in the workspace. This
can also be used with init/add as follows:

```shell
nx add @nx/vite --setupPathsPlugin
nx g @nx/vite:init --setupPathsPlugin
```

Which takes a config such as:

```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
})
```

And updates it to:

```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
  plugins: [react(), nxViteTsPaths()],
})
```

Taking into account ESM (default) and CJS (deprecated).

<!-- 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 #
2024-06-11 16:55:58 -04:00
Leosvel Pérez Espinosa
6576325f7b
docs(misc): fix misc issues (#22039)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-02-28 10:02:27 -05:00
Miroslav Jonaš
3ead01987b
fix(nx-dev): remove fence from new packages and "nx add" commands (#21705) 2024-02-08 14:43:50 +01:00
Isaac Mann
61436a64ef
docs(core): inferred targets (#21167)
Co-authored-by: Katerina Skroumpelou <mandarini@users.noreply.github.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
Co-authored-by: Victor Savkin <mail@vsavkin.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-02-03 00:14:05 -05:00
Aditya Mathur
dd5f3c8d17
docs(misc): standardize all the install commands with different pm (#21226) 2024-01-19 15:21:42 +01:00
Juri
54eab7f8b1 docs(vite): remove webcomponents setup and adjust some wording 2023-11-28 18:05:51 +01:00
Isaac Mann
d1fe398ea0
docs(core): packages to api (#19281) 2023-09-22 14:24:35 -04:00
Isaac Mann
4f3988cb2c
docs(core): sync nx package versions (#18973) 2023-09-08 08:25:19 -04:00
Isaac Mann
afa5eb59fa
docs(core): document the @nrwl => @nx rescope (#16403)
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2023-04-27 18:14:59 -04:00
Katerina Skroumpelou
2876996a39
docs(vite): frontmatter and description to documents (#14750) 2023-02-01 21:53:19 +02:00
Katerina Skroumpelou
a10dc40f18
docs(misc): webpack overview page and other fixes (#14715) 2023-01-31 08:18:21 -05:00
Katerina Skroumpelou
e50c8ccc41
docs(vite): enhancing vite docs (#13984) 2022-12-22 20:05:31 +00:00
Benjamin Cabanes
ae8e0280fd
docs(core): move package documents into its own folder (#13935)
Signed-off-by: Ben <3447705+bcabanes@users.noreply.github.com>
2022-12-20 14:21:42 -05:00
Benjamin Cabanes
19fd40ddc7
docs(nxdev): refactor docs sources generation and app consumption (#13834) 2022-12-19 18:59:50 +00:00