Skip to content

Commit

Permalink
chore(root): Fix release script to bypass NX issues
Browse files Browse the repository at this point in the history
- Group filtering works better than project filtering during the NX release due to a bug on the NX side when filtering by projects. NX includes all filtered projects and their dependencies, and that's an undesired behavior.
- Introduce first-release param in the CLI.
  • Loading branch information
SokratisVidros committed Dec 30, 2024
1 parent 9c65e66 commit d7f5cf2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions scripts/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import inquirer from 'inquirer';
import yargs from 'yargs/yargs';
import { execa } from 'execa';

const projects = ['tag:type:package'];
const groups = ['packages'];

(async () => {
const { dryRun, verbose, from, ...rest } = yargs(hideBin(process.argv))
const { dryRun, verbose, from, firstRelease, ...rest } = yargs(hideBin(process.argv))
.version(false)
.option('dryRun', {
alias: 'd',
Expand All @@ -34,6 +34,11 @@ const projects = ['tag:type:package'];
'The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that.',
type: 'string',
})
.option('first-release', {
description: 'Whether or not this is the first release, defaults to false',
type: 'boolean',
default: false,
})
.help()
.parse();

Expand All @@ -45,22 +50,23 @@ const projects = ['tag:type:package'];
}

const { workspaceVersion, projectsVersionData } = await releaseVersion({
projects,
groups,
specifier,
dryRun,
verbose,
firstRelease: false,
firstRelease,
});

await releaseChangelog({
projects,
groups,
specifier,
versionData: projectsVersionData,
version: workspaceVersion,
dryRun,
verbose,
from,
interactive: 'projects',
firstRelease,
});

await execa({
Expand All @@ -77,10 +83,11 @@ const projects = ['tag:type:package'];
]);

await releasePublish({
projects,
groups,
specifier: 'patch',
dryRun,
verbose,
otp: answers.otp,
firstRelease,
});
})();

0 comments on commit d7f5cf2

Please sign in to comment.