71 Commits

Author SHA1 Message Date
Leosvel Pérez Espinosa
db47dc30a5
feat(js): support esbuild and swc bundlers with the new ts solution config setup (#28409)
<!-- 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: Jack Hsu <jack.hsu@gmail.com>
2024-10-14 09:30:43 +02:00
Isaac Mann
d477ea7b6a
docs(core): ts project references guide (#28281)
Adds a TS project references guide
2024-10-03 20:39:25 -04:00
Jack Hsu
810896caae
docs(js): add a note to JS plugin overview that --preset=ts changed in Nx 20, and that --preset=app can still be used (#28277)
Since `--preset=ts` has changed, we want to provide users with a way to
generate the older, integrated setup if they need to.

<!-- 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-10-03 14:00:01 -04:00
Jack Hsu
27edf71cef
feat(misc): make directory a required option for generators (#28093)
<!-- 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: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-10-01 09:29:44 -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
Leosvel Pérez Espinosa
49c5a73cd0
feat(js): generate experimental simplified library with ts solution setup (#27910)
<!-- 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: Jack Hsu <jack.hsu@gmail.com>
2024-09-27 14:14:19 -04:00
Leosvel Pérez Espinosa
72cd1c15e6
feat(js): add the setup-prettier generator (#27996)
<!-- 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-24 17:24:09 +04: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
James Henry
1108ebf0c6
fix(release): support forwarding the --access flag to npm publish (#27765) 2024-09-04 17:58:34 +04:00
Jack Hsu
d39624cbb1
feat(js): @nx/js:init generator does not generate prettier and tsconfig.base.json files by default (#27406)
In order to use `nx release` you must run `nx add @nx/js`. However, the
init generator will add Prettier and `tsconfig.base.json` files by
default, which is not what the user wants.

This PR adds two options:
- `addTsConfigBase` - generates `tsconfig.base.json` when `true`.
Default to`false`
- `setUpPrettier` - adds `prettier` and generates `.prettierrc` and
`.prettierignore` files when `true`. Defaults to `false`.

The programmatic `initGenerator` API defaults both options to `true` to
usages remain unaffected.

The one behavior change is if users run `nx g @nx/js:init` then the two
options default to `false`. However, since this is an internal API, the
actual usages should be through `nx add` or the programmatic API.



<!-- 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-08-14 09:08:56 -04:00
Leosvel Pérez Espinosa
add5a675c3
feat(misc): add nx syncing mechanism and update the typescript-sync generator (#26793)
- Add the `nx sync` command to run sync generators and apply changes to
bring the workspace up to date according to their logic.
- Add the `nx sync:check` command to validate that the workspace is up
to date by running the sync generators without applying the changes. It
can be used on CI as a validation check.
- Update the task runner to run the sync generators (or obtain their
state from the daemon) and prompt the user whether to apply the changes,
if any
- This is only run if the `NX_ENABLE_SYNC_GENERATORS` environment
variable is set to `'true'`
  - Allow the user to configure a default value for the prompt
- Update the `@nx/js:typescript-sync` generator (keep tsconfig project
references in sync with the project graph) with misc 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` -->

<!-- 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 NXC-787 -->
<!-- Fixes NXC-788 -->
<!-- Fixes NXC-789 -->

Fixes #
2024-08-12 10:44:04 -04:00
Isaac Mann
efa59fa681
docs(core): add outputFileName to tsc executor schema (#27161)
Fixes #17397
2024-07-26 15:45:36 -04:00
Wixewr
50e08aa356
feat(js): added a verdaccio listen address to configuration (#26976)
Co-authored-by: William van der Vegt <william.van.der.vegt@moba.net>
Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2024-07-25 14:43:33 -04:00
Emily Xiong
28cd0c4eef
feat(js): add scopes option for verdaccio (#26918) 2024-07-24 16:18:13 -04:00
Emily Xiong
471f82c991
fix(js): remove default port for verdaccio (#26502)
<!-- 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
-->
- remove default port for verdaccio so it can take port from config file

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

Fixes https://github.com/nrwl/nx/issues/23007
2024-06-12 10:06:49 -04:00
Austin Fahsl
b2855fd6e1
feat(release): add support for version plans (#23190) 2024-06-04 16:44:28 +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
James Henry
526ea7cfdf
chore(js): experimental tsc entrypoint (#22852)
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-04-24 10:14:57 -04:00
Jack Hsu
701c513fd7
feat(js): add swc cli options --strip-leading-paths (#22856) 2024-04-17 14:18:10 -04:00
Jason Jean
2ee965042d
Revert "feat(js): add swc cli options --strip-leading-paths (#22193)" (#22832) 2024-04-15 20:35:58 -04:00
Philip Fulcher
810a3b5259
docs(release): adjust description for preid to be more clear (#22569) 2024-04-14 19:26:54 +04:00
Every
f59ed58ae6
feat(js): add swc cli options --strip-leading-paths (#22193)
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-04-11 10:54:27 -04:00
Austin Fahsl
38179ad278
feat(js): replace publish script with nx release config (#21474) 2024-03-05 17:53:07 -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
beeman
a9974d3f25
docs(misc): change http:// to https:// (#19534) 2024-01-30 11:33:13 -05:00
Aditya Mathur
dd5f3c8d17
docs(misc): standardize all the install commands with different pm (#21226) 2024-01-19 15:21:42 +01:00
Emily Xiong
6141f44203
feat(core): add keepExistingVersions to all packages (#21169) 2024-01-17 14:22:58 -05:00
Isaac Mann
4d1e0bd7e9
docs(core): deprecation for nameAndDirectoryFormat (#19861) 2023-10-31 10:13:17 -04:00
Katerina Skroumpelou
7942ea3c83
feat(js): skipPackageJson in js lib generator (#19821) 2023-10-26 12:53:02 -04:00
Austin Fahsl
dbb73aa2eb
feat(release): add 'git-tag' currentVersionResolver and conventional commits support (#19267)
Co-authored-by: James Henry <james@henry.sc>
2023-10-26 11:52:49 +03:00
Isaac Mann
cc8d8e8f4c
docs(core): deprecate workspaceLayout (#19767) 2023-10-23 11:55:34 -04:00
Emily Xiong
0b0df51263
chore(core): add batch description in cli (#19707) 2023-10-18 15:15:20 -04:00
Jack Hsu
76a7506074
feat(js): remove options to update package.json dependencies and peerDependencies (#19543) 2023-10-12 12:06:45 -04:00
James Henry
6b16230499
fix(core): support dry-run on nx release publish (#19228) 2023-09-20 08:57:13 -04:00
James Henry
9116c29c18
feat(core): initial implementation of nx release (#19110)
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2023-09-18 15:11:44 -04:00
Isaac Mann
4f3988cb2c
docs(core): sync nx package versions (#18973) 2023-09-08 08:25:19 -04:00
Isaac Mann
c2c664a055
docs(core): add directory flag to all project generators (#18977) 2023-09-07 09:36:25 -04:00
Isaac Mann
d70a6ceb36 docs(core): clarify waitUntilTargets 2023-08-28 12:39:31 +02:00
Leosvel Pérez Espinosa
c785871b5c
docs(js): call out @nx/js:tsc batch executor being available from Nx 16.6.0 (#18467) 2023-08-11 12:46:47 +01:00
Leosvel Pérez Espinosa
730260320d
feat(js): provide a new way of generating project name and root directory for libraries (#18420) 2023-08-10 13:30:46 -04:00
Jack Hsu
d63d3573c4
feat(js): add generateExportsField and additionalEntryPoints options to update exports field when building with tsc/swc (#18319) 2023-08-01 09:23:48 -06:00
Leosvel Pérez Espinosa
bd71ce35a4
fix(js): fix misc issues in tsc batch executor (#18363) 2023-07-28 14:44:35 +01:00
Leosvel Pérez Espinosa
4f9f04fb96
docs(js): add docs about @nx/js:tsc batch execution (#18071) 2023-07-14 08:41:40 +01:00
Leosvel Pérez Espinosa
95a2256a34
feat(misc): deprecate executor options to generate package.json for libraries (#17923) 2023-07-11 15:28:03 +00:00
Leosvel Pérez Espinosa
64765eb313
feat(misc): change updateBuildableProjectDepsInPackageJson option default value to false (#17920) 2023-07-06 09:06:48 +01:00
Jack Hsu
c6a0615fa5
fix(js): add watchIgnore and runBuildTargetDependencies options to speed up build (#17953) 2023-07-05 14:50:53 -04:00
Jack Hsu
8d5ef222cc
feat(testing): add support for additional environment options when generating vite config (#17560) 2023-06-13 13:30:52 -04:00
Jack Hsu
edf0b1ce20
feat(js): add setup-build generator for JS packages (#17523) 2023-06-12 12:38:26 -04:00
Jack Hsu
20359e77a6
fix(js): mark importPath option as important since it is required for publishable libs (#17509) 2023-06-09 10:21:12 +03:00