22 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
Isaac Mann
d378f2c449
docs(core): plugin atomizer set up (#27478)
Update plugin overview pages to describe atomizer set up
2024-08-16 10:53:56 -04:00
Michal Jez
b224e7c732
feat(testing): support positional arg for jest executor (#27328)
<!-- 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

The syntax to test a single file is different when using the jest
executor versus the jest cli

```sh
jest <file>
# vs
nx test project --testFile <file>
```

## Expected Behavior

I would expect the jest executor to support a single positional argument
as well

```sh
nx test project <file>
```

This is one of the common questions/complaints that I hear from
developers when transitioning from our standalone apps to our monorepo

This change supports both syntaxes so that this is not a breaking change
and prints a warning when both are used
2024-08-13 09:29:23 +02:00
Arthur
264f727a8f
docs(testing): moved the cleanup func calls into the func that be export default (#27268)
<!-- 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 cleanup function is called **immediately** when the file is imported
if it is placed outside of the exported function in jest global setup
file.

<img width="1202" alt="Screenshot 2024-08-02 at 7 45 12 AM"
src="https://github.com/user-attachments/assets/caa9cc2b-9212-4c91-b557-d44e6ba7ae05">

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The cleanup func in jest global setup file, should be call inside the
default export function.

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

N/A!
2024-08-09 13:44:00 -04:00
Jason Jean
fd7cf38c20
feat(testing): add ability to split jest tests (#22662) 2024-04-10 14:00:03 -04:00
Leosvel Pérez Espinosa
eada6060ba
docs(testing): improve jest plugin overview page (#22437) 2024-04-09 16:02:05 +02: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
Craigory Coppola
6946f65059
fix(misc): pass full path to tsconfig when registering transpiler (#19451) 2023-10-06 14:40:15 -04: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
Caleb Ukle
b3f68fe89e
docs(testing): update docs to use configuration generator (#18587) 2023-08-14 11:57:41 -04:00
Paul Coroneos
1e4f4952f6
docs(testing): fix dynmamic typo. closes 17044 (#17045) 2023-05-16 07:52:12 -05:00
Caleb Ukle
5743f158ba
fix(js): info about jest global setup/teardown + swc (#16681) 2023-05-09 10:40:45 -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
Miroslav Jonaš
2dd59c3b57
feat(core): extract js related code from affected and hasher (#16244) 2023-04-18 10:42:05 -04:00
Caleb Ukle
b997ee6cd5
docs(testing): add info about getJestProjects() (#16269) 2023-04-14 14:28:38 -04:00
Victor Savkin
2bc33f14d7
docs(core): use -t and -p instead of --targets and --projects 2023-04-10 13:30:17 -04:00
Caleb Ukle
f03e903ee9
docs(testing): remove debug section in jest overview (#16124) 2023-04-05 11:14:53 -04:00
Caleb Ukle
b47e3ae1dc
docs(testing): add info about global scripts & @swc/jest (#14043)
Fixes https://github.com/nrwl/nx/issues/13345
2022-12-28 14:36:30 -05:00
Benjamin Cabanes
19fd40ddc7
docs(nxdev): refactor docs sources generation and app consumption (#13834) 2022-12-19 18:59:50 +00:00