@exadev/semantic-release-workspace 1.3.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -206,7 +206,7 @@ Run it from the workspace root (or pass `--root <directory>`). A dry run analyse
206
206
  | `--commit-strategy <mode>` | `per-package` (default) or `single` — see [Commit strategies](#commit-strategies) |
207
207
  | `--gate-publish` | Tag and push each due package, but defer publishing — see [Gating publish](#gating-publish). Requires `--gate-state-file`; rejected with `--commit-strategy single` |
208
208
  | `--gate-state-file <path>` | With `--gate-publish`: where to write the state a later `resume` run needs |
209
- | `--config <file>` | A config file (`.json`, `.yaml`, `.yml`, `.js`, `.cjs`, or `.ts`, loaded via [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig)) providing any of the above; explicit flags win |
209
+ | `--config <file>` | A config file (`.json`, `.yaml`, `.yml`, `.js`, `.cjs`, `.mjs`, `.ts`, `.cts`, or `.mts`, loaded via [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig)) providing any of the above through its default export; explicit flags win. TypeScript files are run by Node's own type stripping, so they may use only erasable type syntax (annotations and `import type`, not `enum` or `namespace`) |
210
210
 
211
211
  `resume` (a separate subcommand, not a `release` flag) finishes publishing what a `--gate-publish` run tagged and pushed:
212
212
 
@@ -255,6 +255,7 @@ Every stage is also exported individually — `discoverWorkspace`, `buildDepende
255
255
 
256
256
  ### Repository requirements
257
257
 
258
+ - Node 22.18 or later on the 22 line, or Node 24 and later: the range the config loader (cosmiconfig) supports, and the first 22 release that strips TypeScript types without a flag.
258
259
  - A git repository with a pushable `origin` (semantic-release verifies push access even in dry runs, and pushes tags and release commits in real ones). The workspace does not need to sit at the repository's toplevel -- discovery resolves its own prefix within the repository and scopes commit filtering against it -- but it does need to sit inside one.
259
260
  - A git identity (`user.name`/`user.email`) in CI for the `[skip ci]` bump commits, or the semantic-release-bot fallback identity is used automatically.
260
261
  - A branch checkout, not a detached HEAD: dependency-bump commits are pushed to the current branch by name, so a detached HEAD stops the run with a `WorkspaceStateError` rather than pushing `HEAD:HEAD` at the remote. CI checkouts that default to a detached HEAD need the branch checked out explicitly.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module";
3
3
  import { readFile, writeFile } from "node:fs/promises";
4
- import { cosmiconfigSync } from "cosmiconfig";
4
+ import { cosmiconfig } from "cosmiconfig";
5
5
  import { Command, InvalidArgumentError } from "commander";
6
6
  import { dirname, relative, resolve, sep } from "node:path";
7
7
  import { detachRelease, resumeRelease } from "@exadev/release-gate";
@@ -14,7 +14,7 @@ import { generateNotes } from "@semantic-release/release-notes-generator";
14
14
  import semanticRelease from "semantic-release";
15
15
  import { pathToFileURL } from "node:url";
16
16
  //#region package.json
17
- var version = "1.3.8";
17
+ var version = "2.0.0";
18
18
  //#endregion
19
19
  //#region src/errors.ts
20
20
  /**
@@ -1477,7 +1477,7 @@ const NO_CONFIG_FILE = {
1477
1477
  gatePublish: void 0
1478
1478
  };
1479
1479
  async function runRelease(flags) {
1480
- const file = flags.config === void 0 ? NO_CONFIG_FILE : readReleaseConfigFile(flags.config);
1480
+ const file = flags.config === void 0 ? NO_CONFIG_FILE : await readReleaseConfigFile(flags.config);
1481
1481
  const gatePublish = flags.gatePublish ?? file.gatePublish ?? false;
1482
1482
  if (gatePublish && flags.gateStateFile === void 0) throw new InvalidArgumentError("--gate-publish requires --gate-state-file, since that is where the state a later \"resume\" run needs gets written");
1483
1483
  const outcome = await releaseWorkspace({
@@ -1534,19 +1534,19 @@ function parsePluginSpec(raw) {
1534
1534
  if (!isPluginSpecTuple(parsed)) throw new InvalidArgumentError("--plugin must be a module name or a JSON array of [name, config]");
1535
1535
  return parsed;
1536
1536
  }
1537
- function readConfigFile(path) {
1538
- const explorer = cosmiconfigSync("semantic-release-workspace");
1537
+ async function readConfigFile(path) {
1538
+ const explorer = cosmiconfig("semantic-release-workspace");
1539
1539
  let result;
1540
1540
  try {
1541
- result = explorer.load(path);
1541
+ result = await explorer.load(path);
1542
1542
  } catch (cause) {
1543
1543
  throw new InvalidArgumentError(`--config file ${path} could not be loaded: ${cause instanceof Error ? cause.message : String(cause)}`);
1544
1544
  }
1545
1545
  if (result === null || result.isEmpty === true) throw new InvalidArgumentError(`--config file ${path} is empty`);
1546
1546
  return result.config;
1547
1547
  }
1548
- function readReleaseConfigFile(path) {
1549
- const parsed = readConfigFile(path);
1548
+ async function readReleaseConfigFile(path) {
1549
+ const parsed = await readConfigFile(path);
1550
1550
  if (!isJsonObject(parsed)) throw new InvalidArgumentError(`--config file ${path} must contain a JSON object`);
1551
1551
  for (const key of Object.keys(parsed)) if (!CONFIG_OPTION_KEYS.has(key)) throw new InvalidArgumentError(`--config file ${path} has an unknown option "${key}"; recognised options: ${[...CONFIG_OPTION_KEYS].join(", ")}`);
1552
1552
  const { dryRun, branches, plugins, analyzeCommits, generateNotes, commitStrategy, gatePublish } = parsed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exadev/semantic-release-workspace",
3
- "version": "1.3.8",
3
+ "version": "2.0.0",
4
4
  "description": "Independent per-package semantic-release orchestration for pnpm workspaces, without lockstep versioning.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "sideEffects": false,
47
47
  "engines": {
48
- "node": ">=20"
48
+ "node": "^22.18 || >=24"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "turbo run _build",
@@ -79,7 +79,7 @@
79
79
  "dependencies": {
80
80
  "@exadev/release-gate": "^1.0.0",
81
81
  "commander": "^15.0.0",
82
- "cosmiconfig": "^9.0.2",
82
+ "cosmiconfig": "^10.0.1",
83
83
  "tinyglobby": "^0.2.17",
84
84
  "validate-npm-package-name": "^8.0.0",
85
85
  "yaml": "^2.9.0"