Skip to content

v2.3.0

Choose a tag to compare

@LouisMazel LouisMazel released this 18 Nov 20:41
· 27 commits to develop since this release

compare changes

🚀 Features

  • Install relizy with relizy init: it adds relizy to the devDependencies and installs it with your project's package manager, so you can start with npx relizy init. It also asks which AI agents to set up, defaults the registry to the one in your npm config (.npmrc), and lists the tokens to set in .env to release from your machine (a34383f)

  • Add release profiles: a named way of releasing (beta, canary, latest...) defined once in profiles and selected with --profile <name>, instead of repeating flags in every CI job. A profile sets config sections (bump, changelog, publish, release, social, prComment, ai, safetyCheck) over the config file, and the flags of a run still win: defaults, config file, profile, then options. release.canary (--canary) and bump.suffix (--suffix) are now config options a profile can set. Without a release flag, bump.type of the config applies instead of always being release. loadRelizyConfig({ profile }) and the profile option of every command apply a profile, listProfiles(config) lists them with what they change, and an unknown profile fails with the profiles available (1ebdb43)

  • Add the profile input to the GitHub action and the GitLab component, which runs relizy with --profile for the release and the merge preview (5f74877)

  • Preview the release of a profile with the MCP server: preview_release and preview_changelog take a profile argument, and a canary profile previews a canary version. get_project lists the profiles of the config with what they set, with secrets masked (b270084)

  • Expose a structured preview, progress events, the option catalog and config overlays (2d110f8)

    • previewRelease and previewChangelog return the planned release as data
    • The onProgress option and RELIZY_REPORTER=json (NDJSON) report the steps of the commands
    • getConfigOptions lists the config options with their types and defaults
    • The config accepts an absolute path (--config, configFile, configName)
    • release and mergePreview accept config and overrides, and hooks are chained
  • Let an application confirm the bump plan and provide the npm one-time password (edd19c4)

    • onConfirm on release() and bump() validates the computed versions instead of the prompt, before anything is written. Returning false cancels the run as a refused prompt
    • onOtp on release() and publish() provides the one-time password the registry asks for, instead of the prompt
  • Give the data of each step in the progress events (6c8d692)

    • step:done and step:failed carry data typed by step: the checks, the bumped versions, the changelog entries, the published packages, the release commit and its tags, the push, the provider releases, the posts and the pull request commented
    • step:item follows the publish package by package and the posts platform by platform
    • The safety checks of a release run to the end, so each one has its status
  • Expose the migration check from relizy 1 in the API: checkMigration() returns what the MCP server's check_migration lists, as data. Each finding has its severity, files and lines, fix and migration guide page, plus the version the project upgrades from. A config that relizy 2 cannot load gives a blocking finding, alongside the checks that don't need the config (30c724e)

  • Give the merge preview as data for an application (a7b5d2d)

    • The report of mergePreview() gives the detected pull request, the branch, each released package with its versions, reason and commits, the packages of a squash merge, the publish, and what was posted
    • The changelog option adds the changelog entries of the release, without the hooks
    • A MergePreviewError carries the report with the problems
    • With comment and check set to false, the preview is only computed
  • core: Add getGitPushTarget(cwd), which tells where git push pushes the current branch (its upstream, else origin), and getPosixRelativePath(from, to), which gives a relative path with / separators on every platform (2fbefcc)

  • Tell a simulated publish and simulated posts in the step data: in a dry run, the dryRun flag of the publish and social step data shows that published and posted are what the run would do. The steps document that a name can come with several steps (the three publish steps of relizy publish, and the merge-preview steps) (b349bbc)

  • Accept the path of a config in checkMigration: configName is a name or a path relative to the project, as with --config and the other API functions (348e78a)

  • Add --no-commitlint to relizy merge-preview, which skips the lint of the pull request's commits for a run. From the API: mergePreview({ commitlint: false }) (c1aaaf5)

  • relizy: Sync the branches after the release. Right after the push, relizy release merges the released branch into the branches of the matching sync.rules (from as a name or a glob such as release/*), by push or pull request (mode: 'pull-request'). Other branches and canaries sync nothing, and a conflict never fails the release (259402f)

    import { defineConfig } from 'relizy'
    
    export default defineConfig({
      sync: {
        rules: [{ from: 'main', to: ['develop'] }],
      },
    })

    relizy sync syncs the branches alone, and --sync <branch...> and --no-sync change the sync for one run. See Branch Sync.

  • relizy: Add includeDepsCommits to keep the chore(deps) commits. They are left out of the release by default (dependency updates from Renovate or Dependabot). With includeDepsCommits: true, they are kept like other chore commits: listed in the changelogs, and bumping when chore has a semver (b864aa7)

    import { defineConfig } from 'relizy'
    
    export default defineConfig({
      includeDepsCommits: true,
    })
  • relizy: Add the recreate mode to the PR comments. With prComment.mode: 'recreate', relizy posts a new comment, then deletes the previous one, so the pull request keeps a single relizy comment at the bottom of the conversation. The merge preview follows it too. --pr-comment-mode <mode> overrides the mode for a run, on relizy release, relizy pr-comment and relizy merge-preview (2354778)

    import { defineConfig } from 'relizy'
    
    export default defineConfig({
      prComment: {
        mode: 'recreate',
      },
    })

🩹 Fixes

  • Detect the repository of an SSH remote in GitLab subgroups: an origin remote like git@gitlab.example.com:group/sub/project.git is read with its whole path, so changelog compare links and merge request comments work without repo in the config. relizy warns when the repository field of package.json or the origin remote is found but cannot be read, instead of silently producing https://undefined/... links (7c571d6)
  • Ask which AI agents to set up in relizy mcp init (1c2e775)
    • In a terminal, relizy mcp init asks which AI agents to set up, with the detected ones checked
    • --targets with an agent other than Claude Code also writes the rules in AGENTS.md, read by Codex, Cline and Zed
    • The output tells what changed for each agent, then the next steps
  • Show the whole error of a failed release (f836652)
    • The PR comment and the CI job summary give the step where the release stopped and its whole error, without the versions it did not release
    • They still list what already left the machine: the published packages and the pushed commit
    • The error of a hook names it, as in before:publish hook failed: ...
  • Leave the skipped steps out of the markdown summary: the pull request comment, the GitHub Actions run summary and release.report.markdown only list the steps that ran. The terminal still shows them (43f7990)
  • relizy: Apply bump.type of the config when the CLI gets no release type flag. Without --major, --minor, --prerelease..., the CLI no longer forces the release type: bump.type of the config or of the profile applies, as it already did through the API. A flag still wins over it. Impact: a config setting bump.type to another value now releases that type on every relizy release and relizy bump without a flag, and release-type: auto of the GitHub Action and the GitLab component no longer follows the commits alone when the config sets a type. To get the bump computed from the commits again, remove bump.type from the config (or put it in a profile) (4e3ea91)
  • Mask the secrets of the profiles listed by listProfiles: tokens, API keys and webhook URLs set by a profile (social.slack.credentials.token, social.twitter.credentials, the keys of ai.providers) were returned in clear in options and settings. They are now masked, as in the config debug logs (7d866ee)
  • Check the options of each section of a profile: an unknown option (bump: { typo: 'beta' }) is a warning naming the options of the section, and an invalid value (bump: { type: 'beta' }, release: { canary: 'yes' }) fails to load the config with the expected values (7bc3ea4)
  • Take the preid and the dist-tag of a canary from a canary profile only: relizy release --profile beta --canary published the canary with the preid and dist-tag of beta. A canary now takes bump.preid and publish.tag from its profile only when the profile is a canary one (it sets release.canary), otherwise canary as without a profile. --preid and --tag still win (071f22a)
  • Resolve release.canary to false by default, as the docs announce. It is false unless a profile or --canary turns it on (377e41d)
  • Keep the options of the run as set by the user when a profile is applied: they no longer count as not set by the user (isSetInUserConfig), so e.g. the commitlint option given to the API is seen by the merge preview again. This also applies when a profile is applied to an already resolved config (9580591)
  • Report the canary of a merge preview: with a canary profile, the report of relizy merge-preview now says canary: true instead of always canary: false (0adedf7)
  • Load a config importing relizy from a project that does not install it: the config gets the running relizy, so it loads when relizy is installed elsewhere and run by an application. The packages also export a default condition, for loaders resolving with require (52bbfb9)
  • Count only the overrides with a value as set by the user with a profile or hooks (a2da3b1)
  • Keep what each run records apart when an application runs several at once: the step data, the links and AI rewrites of a release, and the files a release restores live in the state of the run (runWithEvents), so two runs at the same time never mix them (10505e0)
  • Never let an async event listener cause an unhandled rejection: listeners may be async (void | Promise<void>), are not awaited, and their rejection is ignored as a throw (d93513a)
  • Name the step of link events as the other events do: provider-release and pr-comment, as the hooks name them (the release report keeps its own names) (3080106)
  • Capture the logs per call and keep the log level of the application: previews, the MCP server, the CLI output and RELIZY_REPORTER=json route logs through one capture, so two previews running at the same time each get their own warnings. previewRelease(), previewChangelog() and checkMigration() restore the logger's level when done, and previews follow the logLevel of the overrides (e1ba197)
  • Give the full hash of the commits of the release preview: PreviewCommit.hash is now the full hash (it was the short one), and shortHash is the short one. The squash commit simulated by a merge preview has no hash (ffcd990)
  • Cancel the publish when the application gives no one-time password: onOtp can answer with a string or a promise, and an empty or missing password cancels the publish with a RelizyCancelError instead of a failed registry publish. Packages published before stay published (43a1d20)
  • Fail at once instead of prompting with RELIZY_REPORTER=json: stdout only carries events, so relizy release and relizy bump without --yes nor onConfirm fail before computing anything, as they do without a terminal. Any other prompt (a one-time password) fails with what to do instead of writing into the events (b078375)
  • Rewrite only relizy and its exported subpaths in a config: a config importing relizy gets the running relizy, and relizy/cli gets its bin. Other imports are left as they are. Without the running relizy or its build (relizy bundled in another program), the config gets the project's relizy (feffbdc)
  • Tell the real reason of a skipped step: a skipped step (step:skipped, the skipped safety checks) now gives the flag of the run (--no-social), canary mode (canary), or the config or profile option (release.social: false), instead of a flag that was not passed (3773054)
  • Leave the tag out of the bump plan of relizy bump: relizy bump creates no tag, so the packages of its ConfirmPlan have none (475d063)
  • Mask the secrets of the config option defaults: a default of getConfigOptions() read from the environment (a token, a webhook) is masked as redactSecrets of @relizy/core does, at its place in the config (c27892e)
  • relizy: Refuse a profile applied over a config resolved with another one (4c54972)
  • relizy: Pin the workspace dependencies of a canary to the exact version. A canary published ^2.3.0-0.canary-<sha> ranges for its workspace dependencies, which also match older canaries (the sha compares as text), so installing a canary could pull an older canary of its dependencies. Workspace ranges of a canary are now published as the exact version, and restored after the release (5478ed8)
  • Keep the versions of the markdown report title as code: GitLab turned the sha of a canary version in the release comment title into a commit link with its own short sha. Versions in the title are now written as code, as in the package tables (7c8be3b)
  • Stop failing the merge preview on the commitlint of the commits: commits failing the project's commitlint are now warnings, listed in a "Commits not following the commit convention" section of the comment, the terminal and mergePreview.commitlint of the report. relizy release does not lint commits, so feat: 3.1.0 still releases a feature. mergePreview.check now defaults to auto: the commit status relizy/merge-preview is only set on GitHub. On GitLab, the failed job already fails the pipeline; set check: true to keep the status there (89062e3)
  • relizy: List the commits outside every package in the root changelog again. Since 2.1.0, the root changelog of a unified or selective monorepo only listed commits of released packages, so commits changing only the CI, the scripts or the lockfile were left out. They are listed again, and still release nothing. Commits of ignored and private packages, and of other version groups, stay out of the root changelog (2744245)

💅 Refactors

  • Share isPlainObject between the config and the profiles (716c9e4)
  • Build the MCP server's preview tools on previewRelease and previewChangelog: preview_release and preview_changelog render the data of these functions, so the API and the agents share one release computation. The server's tools import the package sets from their module (b4e8ad7)
  • Pass the command run to the CLI output: createCommandUi takes the command run (release, merge-preview) instead of reading it from the displayed title, for command:start and the prompts (fcf35dd)
  • Use the push target and relative paths of @relizy/core: the push step data reads getGitPushTarget, and relizy's relative paths go through getPosixRelativePath (42623c4)

📖 Documentation

  • Document the answers of an application, the step names and the merge preview report (b526d3e)
    • An error thrown by onConfirm fails the run, and a RelizyCancelError cancels it. onConfirm is not called with bump.yes
    • The API docs cover the empty password of onOtp, the dryRun of step data, the merge-preview steps, the full hash of PreviewCommit, the reasons of a skipped step, the config path of checkMigration, the relizy a config gets, pullRequest and pullRequestDetails, and the report written by a merge preview that is only computed
  • relizy: Document the sections a profile can set (1f34b75)
  • relizy: Document the types of the events, the steps and the merge preview (447fa14)

📦 Build

  • core: Upgrade @maz-ui/node to 5.7.0-beta.0 (c98f13d)

  • deps: Update 6 of my packages (a2506c5)

    • @maz-ui/eslint-config ^5.4.0 -> ^5.5.0
    • @maz-ui/icons ^5.5.0 -> ^5.6.0
    • @maz-ui/themes ^5.5.0 -> ^5.6.0
    • @maz-ui/translations ^5.5.0 -> ^5.6.0
    • @maz-ui/utils ^5.5.0 -> ^5.6.0
    • maz-ui ^5.5.0 -> ^5.6.0
  • deps: Update the maz-ui packages to 5.7.0-beta (28a46bf)

🌊 Types

  • Export the ProfileOptions type of the profiles (36e80ef)

🧪 Tests

  • Cover the errors of the command hooks (4700ea2)
  • relizy: Cover the release preview of unified and grouped monorepos (abc8f05)
  • Expect the canary preid when releasing a canary with a profile (730a6fe)
  • Cover an onConfirm that throws, and bump.yes in the config (46bb757)
  • Update thresholds (4355e51)

❤️ Contributors