26 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
Nicholas Cunningham
d289134bb0
fix(web): Add strict mode for @nx/web (#23497) 2024-05-17 20:29:32 +04:00
James Henry
c560b2bba6
Revert "fix(web): Add strict mode" (#23472)
Reverts nrwl/nx#23457
2024-05-17 15:05:29 +02:00
Nicholas Cunningham
0f47f03451
fix(web): Add strict mode (#23457)
This PR adds the option of `strict` when using `@nx/web:app` generator.

It also updates the application generator by separating utility
functions into their own modules.


closes: #9238
2024-05-16 21:38:19 -06:00
Colum Ferry
739e2e7115
feat(testing): make playwright default e2e test runner option (#22511) 2024-04-23 11:27:09 -04:00
Colum Ferry
29c80a33de
fix(web): spa flag should correctly define redirect (#22487) 2024-03-26 16:51:03 +00:00
beeman
a9974d3f25
docs(misc): change http:// to https:// (#19534) 2024-01-30 11:33:13 -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
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
Katerina Skroumpelou
3df85295a1
fix(react): respect unitTestRunner none and inform about vitest (#19676) 2023-10-18 16:29:29 -04:00
Isaac Mann
c2c664a055
docs(core): add directory flag to all project generators (#18977) 2023-09-07 09:36:25 -04:00
Leosvel Pérez Espinosa
6640c32748
feat(web): use helper to determine project name and root in application generator (#18737) 2023-08-22 15:25:33 +01:00
Caleb Ukle
27923fd2d8
feat(web): add playwright e2eTestRunner option (#18284) 2023-08-01 10:53:06 -04: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
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
Emily Xiong
3eede1c7de
feat(react): deprecate styl from react and next for 17 (#16135) 2023-04-12 08:23:13 -04:00
Jack Hsu
e772ee22bd
feat(web): remove hard dependencies on cypress, rollup, jest, and linter (#15797) 2023-03-21 11:46:12 -04:00
Caleb Ukle
3a4b108dd8
feat(web): add a generator to add @nrwl/web:file-server target (#15434) 2023-03-07 13:09:57 -06:00
Emily Xiong
a97212b601
feat(core): move tsconfig.base.json to @nrwl/js:init (#14467) 2023-02-16 11:17:30 -05:00
Chau Tran
d0c978e898
docs(web): add prioritize flags to web packages (#14281) 2023-02-01 08:20:57 -06:00
Jack Hsu
d7536aa7e3 feat(core): clean up workspace configuration code 2023-01-23 19:35:15 -05:00
Caleb Ukle
e96dfe575a
fix(web): dynamic default unitTestRunner based on bundler for @nrwl/web:app (#14188)
Fixes https://github.com/nrwl/nx/issues/14167
2023-01-06 10:36:46 -06:00
Benjamin Cabanes
19fd40ddc7
docs(nxdev): refactor docs sources generation and app consumption (#13834) 2022-12-19 18:59:50 +00:00