78 Commits

Author SHA1 Message Date
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
85877e3e18
feat(react): make vitest the default test runner since it supports ESM and different moduleResolution better (#28153)
This PR updates the default test runner for React/Web apps to be
`vitest`. It aligned better with our emphasis on modern tooling, and the
lack of ESM and proper TS support (using `module` other than `commonjs`)
in Jest makes it hard to use in some workspaces.

<!-- 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 -->

## 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 09:00:01 -04:00
Colum Ferry
8290969cb7
feat(storybook): remove cypress options for e2e testing (#27850)
- feat(storybook): remove cypress options from configuration generator
- feat(react): remove cypress options from storybook-configuration
- feat(react): remove cypress options from stories generator
- feat(react): remove component-cypress-spec generator
- chore(storybook): restore @nx/cypress dep
- feat(remix): remove cypress options from storybook
- feat(angular): remove cypress options from storybook-configuration
- feat(angular): remove cypress options from stories generator
- feat(angular): remove component-cypress-spec generator
- feat(vue): remove cypress options from stories generator

<!-- 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 -->
With Storybook Interaction Testing, there's no longer a need to setup
Cypress to specifically test storybook instances


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Remove cypress options for creating an e2e project specifically for
testing storybook instances.

Use Storybook Interaction Testing instead

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

Fixes #
2024-09-24 15:54:58 +01:00
Leosvel Pérez Espinosa
c92528f65d
feat(misc): remove derived generator paths (#27714)
<!-- 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 -->

## 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 #

---------

Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-09-23 09:19:42 -04:00
Juri Strumpflohner
c50acf793a
fix(react): vite should be default bundler in app generator (#28013)
<!-- 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 -->

## 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-20 12:12:03 -04:00
Colum Ferry
7351a1a25e
feat(react): add rspack module federation support (#27696)
- feat(react): add remote rspack module federation support
- feat(react): add host rspack module federation support
- feat(react): add federate module rspack module federation support
- fix(react): migration test

<!-- 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 -->
We do not have an option to generate a react host and remote with rspack


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add rspack as an option when generating host and remote

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

Fixes #
2024-09-06 09:54:27 -04:00
Colum Ferry
11f30dbd00
feat(storybook): add storybook 8 support (#27214)
<!-- 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 -->

## 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 #27175 #26914 #22941 #26531
2024-08-14 16:37:20 +01:00
Colum Ferry
2e8f162cf8
feat(react): add skipPackageJson flag to remote and host generators (#27116)
<!-- 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 -->
The `host` and `remote` generators do not have an option to skip package
install.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add the `skipPackageJson` flag to the remote and host generators

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

Fixes #
2024-07-25 15:19:02 +01:00
Jack Hsu
31989c4d1e
docs(core): clean-up outdated content from docs and CNW readme (#26748)
This PR:

1. Removes the `{{getting-started}}` template string from [CNW
README.md](https://www.npmjs.com/package/create-nx-workspace), which was
removed before from generation but this file missed an update.
2. Updates docs for `run-scripts` to show `project.json` examples, not
`workspace.json` (we link to this from PDV and it's very awkward).
3. Removes unused run-script and run-commands example files from
`packages/workspace/docs`. These were moved to `packages/nx/docs` but
somehow the old files remained even though they aren't used.
4. Updates host/remotes React generators to mention `nx.json` not
`workspace.json`. The option is already renamed `--skipNxJson` but the
description does not match.

<!-- 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-06-28 11:15:44 -04:00
Jack Hsu
86954ae96b
fix(misc): rename @nrwl/* to @nx/* in init generator descriptions (#26610)
We forgot to rename these in the init generator descriptions. This
affects tutorials since we've been including the terminal output with
the wrong scope.


## 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-20 13:08:39 -04:00
Leosvel Pérez Espinosa
2b820a274e
docs(misc): update /packages/ links to /nx-api/ (#26128)
- Update `/packages/` links to `/nx-api/`
- Convert some unneeded absolute links to relative
- Remove leftover examples doc for the already removed `cypress-project`
generator

<!-- 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 #26126
2024-05-28 09:44:48 -04:00
Jason Jean
8f705e31e2
fix(misc): adjust deprecation messages to v20 (#23223)
<!-- 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` -->

## Breaking Changes:


BREAKING CHANGE: `nx print-affected` was deprecated in 16.4.0 and has
been removed.
BREAKING CHANGE: `nx affected:graph` was deprecated in 16.4.0 and has
been removed.
BREAKING CHANGE: The `criticalPath` and `affectedProjects` properties of
the JSON created by `nx graph --file graph.json` was deprecated in
16.2.0 and has been removed.

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

Some deprecation messages still reference v19.

`nx print-affected` was deprecated in 16.4.0 to be removed in Nx 19 but
was not removed.
`nx affected:graph` was deprecated in 16.4.0 to be removed in Nx 19 but
was not removed.

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

Deprecation messages reference v20 now.

`nx print-affected` is removed.
`nx affected:graph` is removed.

There are redirects to a `deprecated` page describing those commands for
Nx users using Nx <19

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

Fixes #
2024-05-08 21:54:41 -04:00
Colum Ferry
739e2e7115
feat(testing): make playwright default e2e test runner option (#22511) 2024-04-23 11:27:09 -04:00
Nicholas Cunningham
92a2cc775d
fix(nx-dev): Update urls that are 404 (#22653) 2024-04-03 15:35:10 -06:00
Colum Ferry
3b384c78ac
feat(react): add tailwind as style prompt option for app gen (#21784) 2024-02-14 17:51:37 +00:00
Remco Krams
c87884ad6e
fix(react): generate correctly when --js is used for module federation host/remote (#20119)
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-02-12 20:42:11 +00:00
Jason Jean
396ffc4636
feat(core): enable project crystal by default (#21403)
Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-02-02 03:40:59 -05:00
Craigory Coppola
deb0f1a492
chore(repo): bump deprecation messages to v19 (#21430) 2024-01-30 16:29:05 -05:00
beeman
a9974d3f25
docs(misc): change http:// to https:// (#19534) 2024-01-30 11:33:13 -05:00
Vadim Zhamkov
7192141c44
feat(react): Add playwright support to generators (#21150)
Co-authored-by: Vadim Zhamkov <vad-js@nebius.com>
2024-01-18 10:56:54 -05:00
Emily Xiong
6141f44203
feat(core): add keepExistingVersions to all packages (#21169) 2024-01-17 14:22:58 -05:00
Leosvel Pérez Espinosa
047dc22aed
cleanup(misc): clean up init generators (#21088) 2024-01-16 15:29:44 +01:00
Nicholas Cunningham
6475c41ec8
feat(module-federation): Add react support for dynamic federation (#20024) 2023-11-13 17:53:21 +00:00
MaxKless
e8e8f94f7a
cleanup(storybook): rename name to project to be consistent with other generators (#20181) 2023-11-10 11:22:43 -05:00
Nicholas Cunningham
67f47c287a
fix(module-federation): refactor federate-module generator (#19979) 2023-11-01 14:52:29 -04:00
Isaac Mann
4d1e0bd7e9
docs(core): deprecation for nameAndDirectoryFormat (#19861) 2023-10-31 10:13:17 -04:00
Isaac Mann
cc8d8e8f4c
docs(core): deprecate workspaceLayout (#19767) 2023-10-23 11:55:34 -04:00
Colum Ferry
7caae07881
fix(angular): federate-module should support as-provided for new remotes (#19731) 2023-10-19 14:22:55 +01:00
Nicholas Cunningham
b9e671c11d
fix(react): Error when invalid path is provided to federate-module generator (#19720) 2023-10-18 20:29:13 -04:00
Katerina Skroumpelou
3df85295a1
fix(react): respect unitTestRunner none and inform about vitest (#19676) 2023-10-18 16:29:29 -04:00
Katerina Skroumpelou
b994a297a9
fix(storybook): default ignore *.stories.* files (#19699) 2023-10-18 16:27:29 -04:00
Jack Hsu
513e2346b3
feat(react): support generating components using the path as provided (#19608) 2023-10-16 16:04:01 -04:00
Katerina Skroumpelou
08bc16d952
docs(misc): fix link to storybook configuration generator (#19632) 2023-10-16 11:12:57 -04:00
Katerina Skroumpelou
72e2a3ba50
docs(storybook): deprecate cypress spec generation option (#19633) 2023-10-16 11:12:47 -04:00
Jack Hsu
8826a7737d
feat(react): remove stylus option from generators (#19441) 2023-10-12 12:49:45 -04:00
Colum Ferry
14643b68b5
feat(react): use TS config files for module federation (#19455) 2023-10-12 11:42:41 -04:00
Nicholas Cunningham
8ccd88cfcb
feat(react): Add federate-module generator (#19286) 2023-10-06 14:54:29 -06:00
Jack Hsu
f04519996c
feat(react): use JS webpack config files for module federation (#19452) 2023-10-04 17:43:02 -04:00
Colum Ferry
11fcb8f2d4
feat(react): switch default to typescript configuration for module federation (#19031) 2023-09-18 17:11:38 +01:00
Isaac Mann
c2c664a055
docs(core): add directory flag to all project generators (#18977) 2023-09-07 09:36:25 -04:00
Katerina Skroumpelou
7f519d151a
docs(storybook): rearrange recipes and docs (#18732) 2023-08-21 09:44:29 -06:00
Nadav Shatz
1a0962fcaf
fix(react): fix remote generation devServerPort (#18603) 2023-08-21 16:48:25 +03:00
Leosvel Pérez Espinosa
eb9caa1ade
feat(react): use helper to determine project name and root directory in project generators (#18615) 2023-08-18 13:12:23 -04:00
Emily Xiong
24b1ab5463
feat(react): add playwright to e2eTestRunner option (#18200) 2023-08-03 17:16:35 +02:00
Katerina Skroumpelou
e06b9e0954 docs(storybook): interaction tests updated documentation 2023-07-28 15:59:58 +02:00
Katerina Skroumpelou
b311cbf8e3
fix(storybook): un-deprecate cypress specs generation (#18236) 2023-07-21 18:09:09 +03:00
Katerina Skroumpelou
29a9f8eba8
feat(storybook): interaction tests generators for angular (#18166) 2023-07-19 17:42:13 +03:00
Katerina Skroumpelou
4bba066d57
feat(react): interaction tests story generator (#18082) 2023-07-13 13:06:04 +03:00
Katerina Skroumpelou
58e1f233cf
feat(storybook): interaction testing init generator (#18051) 2023-07-12 18:02:12 +03:00
Jack Hsu
08339ee49f
feat(js): do not generate root babel.config.json for babel projects (#17289) 2023-06-06 15:45:33 -04:00