79 Commits

Author SHA1 Message Date
Ashkan
8ddd697a07
fix(bundling): correctly handle .cjs.js .mjs.js in rollup for type definitions (#29366)
…le extensions for type definitions.

Updated the Rollup plugin's logic for generating type definition files
to ensure compatibility with additional file extensions, including
.cjs.js and .mjs.js.

This change improves the handling of entry points and ensures that
corresponding .d.ts files are correctly named and emitted in all
supported scenarios.

Added a comprehensive test case to validate the new behavior.

closed #29308

<!-- 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>
2025-06-11 15:06:49 +01:00
Miguel
fa9290abf4
fix(release): sort groups topologically bottom-up and fix typo to allow multi-level group dependencies (#31374) 2025-06-06 13:05:13 +04:00
James Henry
9ab5d820ab
fix(core): infer codex environment and use default tasks runner (#31359) 2025-05-28 14:12:17 +02:00
Leosvel Pérez Espinosa
752d418f78
feat(angular): support angular cli v20.0.0-rc.3 (#30715)
Add support for the Angular CLI **20.0.0-rc.3** version.
2025-05-26 10:00:47 -04:00
Isaac Mann
514cdd890d
chore(core): disable flaky e2e tests (#31200)
Disable flaky `e2e-release` tasks
2025-05-14 09:58:39 -04:00
Nicholas Cunningham
28ddb8e9e7
feat(core)!: drop support for node versions prior to 20.19.0 (#30818)
<!-- 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. -->

BREAKING CHANGE: We are updating our minimum node version to `20.19.0`
which drops support for all prior versions.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-01 02:13:50 -04:00
James Henry
ee097a8e10
feat(release)!: useLegacyVersioning is false by default, migrate config (#30838)
This PR updates `nx release` to use the revamped versioning
implementation by default. It also updates and adds relevant
documentation, and provides an automated migration for the new
configuration structure.

For anyone exclusively versioning TS/JS packages, there should be no
real difference to your experience (although a number of bugs have been
fixed and new features around updating multiple `package.json` files at
once are now available to you with this change).

For the lifecycle of Nx v21, `release.version.useLegacyVersioning` will
remain as a option that can be set to `true` to revert to the old
behavior and configuration structure.

NOTE: This should only be a temporary solution, for example if one of
the plugins you use does provide a `VersionActions` based versioning
implementation yet. The option and legacy implementation will be removed
entirely in Nx v22 (in ~6 months).

BREAKING CHANGE:

**⚠️ For any early adopters of `VersionActions` in Nx 20.8 when it was
opt-in, there are breaking changes to the abstract class here as well.**

`manifestRootsToUpdate` has gone from `string[]` to `manifestsToUpdate:
{ manifestPath: string; preserveLocalDependencyProtocols: boolean; }[]`
to support controlling the local dependency updates per manifest in
order to support advanced source vs dist scenarios, and correspondingly
`isLocalDependencyProtocol` has been removed from the abstract class and
the method will no longer be called from the core logic. It should be
thought of as an implementation detail of `updateProjectDependencies`
instead.
2025-04-24 22:09:38 -04:00
James Henry
7b85d912ba
feat(release): revamped nx release version implementation (#30418) 2025-04-08 18:17:19 +04:00
Emily Xiong
e8acab6ae0
feat(vue): add release option to vue publishable libraries (#29867) 2025-03-05 14:29:07 +04:00
James Henry
443d4fd27a
feat(core): support bun's new text-based lockfile and use bun publish within nx release (#30064) 2025-02-19 13:42:35 +04:00
Emily Xiong
1047991200
fix(js): identify correct circular dependecies (#29759) 2025-02-19 13:13:08 +04:00
Emily Xiong
4f70cdb721
feat(angular): add release option to angular publishable libraries (#29869) 2025-02-18 19:54:35 +04:00
Emily Xiong
fc39b3dc49
fix(react): add release option for @nx/react:lib --publishable (#29776) 2025-02-15 13:27:18 +04:00
James Henry
888957a010
fix(release): ensure tags for version match stable variant before prerelease (#30047) 2025-02-14 11:08:34 -05:00
James Henry
b10856bb32
feat(release): configure when all branches should be checked for a matching releaseTagPattern (#30044) 2025-02-14 17:02:02 +04:00
Emily Xiong
540aeff488
fix(js): allow publishable library to run release command (#29775)
<!-- 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 -->
- there is no option `fallbackCurrentVersionResolver: 'disk',`
- can't run release for newly created publishable libraries

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- move code to add release for publishable libraries into its own file
to be reused by other stacks
- add `fallbackCurrentVersionResolver: 'disk',` to project's
release.version. generatorOptions

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

Fixes https://github.com/nrwl/nx/issues/29723
2025-02-10 14:02:15 -05:00
Mads Mætzke Tandrup
3e4f16f8b0
feat(release): allow invalid conventional commits to be considered via custom config (#29658) 2025-01-24 14:29:35 +04:00
James Henry
5f77d65554
chore(release): fix e2e (#29399) 2024-12-18 16:28:39 +04:00
James Henry
73735ca247
feat(release): allow automated git push from version or changelog step (#29280) 2024-12-18 13:29:47 +04:00
Thomas Dekiere
a0d760f790
fix(release): remove duplicate space character in changelog thank you header (#28664) 2024-11-20 17:14:50 +04:00
James Henry
2c0994ac87
feat(release)!: rewrite ChangelogRenderer to a class API and remove deprecated config (#28229)
BREAKING CHANGE

In Nx v19, implementing a custom changelog renderer would involve a lot
of work on the user side. They would need to create an additional
function making every property available in its declaration and then
call the underlying default one and customize the final string (or
reimplement the whole thing).

E.g.

```js
const changelogRenderer = async ({
  projectGraph,
  commits,
  releaseVersion,
  project,
  entryWhenNoChanges,
  changelogRenderOptions,
  repoSlug,
  conventionalCommitsConfig,
  changes,
}) => {
  const defaultChangelog = await defaultChangelogRenderer({
    projectGraph,
    commits,
    releaseVersion,
    project,
    entryWhenNoChanges,
    changelogRenderOptions,
    repoSlug,
    conventionalCommitsConfig,
    changes,
  });

  // ...Do custom stuff and return final string...
};

module.exports = changelogRenderer;
```

In Nx v20, changelog renderer are classes. The DefaultChangelogRenderer
can therefore easily and granularly be extended and customized, and the
config does not need to be redeclared on the user side at all. We will
improve things even further in this area, but this breaking change is an
important stepping stone.

E.g. for manipulating the final string equivalent to the previous
example:

```js
module.exports = class CustomChangelogRenderer extends (
  DefaultChangelogRenderer
) {
  async render() {
    const defaultChangelogEntry = await super.render();
    // ...Do custom stuff and return final string...
  }
};
```

E.g. for customizing just how titles get rendered:

```js
class CustomChangelogRenderer extends DefaultChangelogRenderer {
  renderVersionTitle(): string {
    return 'Custom Version Title';
  }
}
```
2024-10-02 22:20:23 +04:00
James Henry
6b715ff96c
feat(release)!: version.generatorOptions.updateDependents is "auto" by default (#28231)
BREAKING CHANGE

In Nx v19, `release.version.generatorOptions.updateDependents` is
"never" by default, meaning dependents are not automatically patched
when their dependencies change (applicable to independent projects).

In Nx v20, `release.version.generatorOptions.updateDependents` is "auto"
by default, meaning dependents are automatically patched when their
dependencies change (applicable to independent projects).
2024-10-02 17:52:03 +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
James Henry
619dbe7316
fix(release): add groupPreVersionCommand to schema, improve logging (#28087) 2024-09-25 14:51:10 +04:00
Jonathan Gelin
71fe65ffbd
feat(release): support groupPreVersionCommand for release groups (#27474) 2024-09-17 14:23:08 +04:00
James Henry
431fe2a021
feat(release): allow local dependency version protocols to be preserved, pnpm publish support (#27787) 2024-09-10 17:56:56 +04:00
James Henry
71715363bf
fix(release): version plan changelogs should contain authors and refs (#27737) 2024-09-03 17:11:24 +04:00
Austin Fahsl
4c39ad76bd
fix(release): release plan command should take filters and touched projects into account (#27706) 2024-08-30 17:38:02 +04:00
Austin Fahsl
4d2793987c
fix(release): allow specifier override for version command when version plans are enabled (#27436) 2024-08-14 14:35:23 -04:00
James Henry
4108bfc8a6
feat(release): add nx release plan:check command to ensure relevant version plans exist (#27343)
<!-- 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 -->

When using version plans as a versioning strategy with `nx release`,
there is no way to enforce that version plan files are created when
changing files.

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

There is a new `nx release plan:check` subcommand, intended to be run in
CI (and/or potentially a git hook) which will return with exit code 1 if
touched projects are not represented in at least one version plan file
on disk.

What constitutes a touched file is shared with our `affected` logic in
other commands, with the additionally capability to be able to ignore
file patterns from consideration. This would be useful for not requiring
version plans when only documentation or spec files change, for example.

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

Fixes #
2024-08-12 13:44:17 -04:00
James Henry
7e2266177d
fix(release): allow version plans to have multi-line, arbitrarily formatted messages (#27323) 2024-08-08 01:27:34 +04:00
Jason Jean
064eb714cf
chore(repo): update nx to 19.5.0-beta.5 (#26925)
<!-- 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 -->

This repo uses Nx `19.4.0-rc.1`

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

This repo uses Nx `19.5.0-beta.5`

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

Fixes #
2024-07-17 11:12:21 -04:00
Craigory Coppola
b2e6662e19
chore(repo): dont use unit-test-setup during e2e (#26393)
<!-- 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-06 15:57:24 -04:00
Austin Fahsl
b2855fd6e1
feat(release): add support for version plans (#23190) 2024-06-04 16:44:28 +04:00
Jason Jean
901d17d273
chore(release): fix failing snapshots (#26133)
<!-- 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 -->

Snapshot tests are failing.

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

Snapshot tests are fixed

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

Fixes #
2024-05-27 13:11:27 -04:00
James Henry
aa2519ff62
fix(js): show lifecycle script contents in publish executor, scrub version in dry-run (#23850)
<!-- 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 -->

Lifecycle scripts related to publishing change the output of `npm
publish`, which mixes JSON with non-JSON content despite the `--json`
flag being set. Currently, we will error when attempting to parse the
whole thing as JSON.

The lifecycle scripts contents themselves are not shown to the user.

Additionally, during dry-run we have no choice but to print the version
that currently exists on disk, which can be confusing.

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

We extract and parse the JSON from the `npm publish` output, even when
it is mixed with other output. We also show the lifecycle script outputs
to the user, where applicable.

During dry-run, we replace the version in the publish output with a
placeholder to avoid confusion around what would be published.

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

Fixes https://github.com/nrwl/nx/issues/22925
2024-05-27 10:20:01 -04:00
Austin Fahsl
95cea78f66
chore(release): fix e2e test project configuration (#25984)
Fixes an issue with the e2e test project configuration for the Nx
Release e2e tests.
2024-05-23 17:56:52 -04:00
James Henry
253de9b985
feat(release): updateDependents generator option for versioning, support circular dependencies (#23252)
<!-- 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 -->

When releasing projects independently, if a dependent project is
untouched directly by the changes, it will not have its version updated
and there is no way to opt into this behavior.

Additionally, circular dependencies between packages are not supported.

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

When releasing projects independently, if a dependent project is
untouched directly by the changes, **BY DEFAULT** it will not have its
version updated, **BUT** you can opt into it always being updated via a
generator option (`release.version.generatorOptions.updateDependents =
auto` and you can control what kind of semver bump should be applied to
the otherwise unchanged dependent project. Transitive local dependents
(`A -> B -> C`) will also be updated in this scenario.

Additionally, when opted into, such version only changes will appear in
the changelog under a new `Updated Dependencies` section.

Circular dependencies between packages are now supported for versioning,
changelog generation and publishing.

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

Fixes #22268
2024-05-23 12:51:38 -04:00
James Henry
24060dc650
chore(repo): prepopulate verdaccio storage for e2e-ci (#23429) 2024-05-16 10:06:25 -04:00
Jason Jean
df7e40d547
feat(repo): split e2e tests (#22927) 2024-04-25 10:13:03 -04:00
Austin Fahsl
12afa20210
fix(release): respect root .npmrc registry settings for publishing 2024-04-02 13:53:14 -06:00
Austin Fahsl
cbb88f0d29
feat(release): add conventional commits configurability for version and changelog (#22004)
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
2024-03-13 18:19:24 -06:00
Austin Fahsl
38179ad278
feat(js): replace publish script with nx release config (#21474) 2024-03-05 17:53:07 -05:00
Leosvel Pérez Espinosa
7c998db5ed
cleanup(release): update outdated snapshots in e2e tests (#22126) 2024-03-04 15:05:17 +04:00
Austin Fahsl
8bde48fc7a
fix(release): skip lock file update if workspaces are not enabled (#22055) 2024-03-01 10:15:55 -07:00
Austin Fahsl
7eec91289c
feat(release): interpolate workspaceRoot in changelog path (#22058) 2024-03-01 10:15:35 -07:00
Austin Fahsl
d705372f57
fix(release): currentVersionResolver git-tag should prefer merged tags (#22082) 2024-02-29 13:58:48 -07:00
Miroslav Jonaš
ecf70adbce
fix(core): align terminal output padding and remove leading arrow (#21809) 2024-02-20 17:43:46 +01:00
Austin Fahsl
b625a79cca
fix(release): move github release creation to git tasks (#21510) 2024-02-13 17:32:35 -07:00
James Henry
30d10d72f7
Revert "feat(core): remove leading arrow from output headlines" (#21800) 2024-02-13 09:40:24 -05:00