@cluerise/tools 5.3.10 → 5.3.12

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.
@@ -1 +1 @@
1
- v25.2.1
1
+ v25.3.0
@@ -5,6 +5,7 @@ import { existsSync } from "node:fs";
5
5
  import FileSystem from "node:fs/promises";
6
6
  import OS from "node:os";
7
7
  import Path from "node:path";
8
+ import { Writable } from "node:stream";
8
9
  import semanticRelease from "semantic-release";
9
10
  import "@commitlint/load";
10
11
  import { ESLint } from "eslint";
@@ -321,9 +322,11 @@ class Releaser {
321
322
  static #releaseSeparator = /^## /gm;
322
323
  #config;
323
324
  #changelogPath;
324
- constructor(config, changelogPath) {
325
+ #silent;
326
+ constructor(config, changelogPath, silent) {
325
327
  this.#config = config;
326
328
  this.#changelogPath = changelogPath;
329
+ this.#silent = silent;
327
330
  }
328
331
  /**
329
332
  * Initialize a new instance of the Releaser class with the provided configuration.
@@ -333,11 +336,12 @@ class Releaser {
333
336
  */
334
337
  static async init({
335
338
  configPath = "release.config.js",
336
- changelogPath = "CHANGELOG.md"
339
+ changelogPath = "CHANGELOG.md",
340
+ silent = false
337
341
  } = {}) {
338
342
  const configAbsolutePath = Path.join(process.cwd(), configPath);
339
343
  const { default: config } = await import(`file://${configAbsolutePath}`);
340
- return new Releaser(config, changelogPath);
344
+ return new Releaser(config, changelogPath, silent);
341
345
  }
342
346
  /**
343
347
  * Create a new release based on the semantic-release configuration.
@@ -347,7 +351,16 @@ class Releaser {
347
351
  * @returns The next release information or null if no release was created.
348
352
  */
349
353
  async createRelease() {
350
- const result = await semanticRelease(this.#config);
354
+ const silentStream = new Writable({
355
+ write(_chunk, _encoding, callback) {
356
+ callback();
357
+ }
358
+ });
359
+ const result = await semanticRelease(this.#config, {
360
+ stderr: this.#silent ? silentStream : process.stderr,
361
+ stdout: this.#silent ? silentStream : process.stdout
362
+ });
363
+ silentStream.destroy();
351
364
  if (!result) {
352
365
  return null;
353
366
  }
@@ -358,7 +371,16 @@ class Releaser {
358
371
  await FileSystem.writeFile(this.#changelogPath, newChangelog);
359
372
  const linter = new FileLinter({ fix: true });
360
373
  await linter.lint([this.#changelogPath]);
361
- ChildProcess.execFileSync("pnpm", ["version", nextRelease.version, "--allow-same-version", "--no-git-tag-version"]);
374
+ ChildProcess.execFileSync(
375
+ "pnpm",
376
+ [
377
+ "version",
378
+ nextRelease.version,
379
+ "--allow-same-version",
380
+ "--no-git-tag-version",
381
+ this.#silent ? "--silent" : null
382
+ ].filter((arg) => arg !== null)
383
+ );
362
384
  const packageJson = await PackageJson.init();
363
385
  return {
364
386
  name: packageJson.name,
@@ -435,16 +457,18 @@ ${lastReleaseTitle}`);
435
457
  }
436
458
  }
437
459
  const commandNameArgSchema = z.union([z.literal("create"), z.literal("info")]);
438
- const parseReleaseArgs = ([commandArg]) => {
460
+ const parseReleaseArgs = ([commandArg, silentArg]) => {
439
461
  const command = commandNameArgSchema.parse(commandArg);
462
+ const silent = silentArg === "--silent";
440
463
  return {
441
- command
464
+ command,
465
+ silent
442
466
  };
443
467
  };
444
468
  const main = async (args) => {
445
469
  try {
446
- const { command } = parseReleaseArgs(args);
447
- const releaser = await Releaser.init();
470
+ const { command, silent } = parseReleaseArgs(args);
471
+ const releaser = await Releaser.init({ silent });
448
472
  switch (command) {
449
473
  case "create": {
450
474
  const release = await releaser.createRelease();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluerise/tools",
3
- "version": "5.3.10",
3
+ "version": "5.3.12",
4
4
  "description": "Tools for maintaining TypeScript projects.",
5
5
  "author": "Branislav Holý <brano@holy.am>",
6
6
  "repository": "github:cluerise/tools",
@@ -25,27 +25,27 @@
25
25
  "@eslint/js": "9.39.2",
26
26
  "@eslint/json": "0.14.0",
27
27
  "@eslint/markdown": "7.5.1",
28
- "@html-eslint/eslint-plugin": "0.52.1",
29
- "@html-eslint/parser": "0.52.0",
30
- "@typescript-eslint/parser": "8.52.0",
28
+ "@html-eslint/eslint-plugin": "0.53.0",
29
+ "@html-eslint/parser": "0.53.0",
30
+ "@typescript-eslint/parser": "8.53.0",
31
31
  "conventional-changelog-conventionalcommits": "9.1.0",
32
32
  "eslint": "9.39.2",
33
33
  "eslint-config-prettier": "10.1.8",
34
34
  "eslint-import-resolver-typescript": "4.4.4",
35
35
  "eslint-plugin-import": "2.32.0",
36
- "eslint-plugin-prettier": "5.5.4",
36
+ "eslint-plugin-prettier": "5.5.5",
37
37
  "eslint-plugin-simple-import-sort": "12.1.1",
38
38
  "eslint-plugin-unicorn": "62.0.0",
39
- "eslint-plugin-yml": "1.19.1",
39
+ "eslint-plugin-yml": "2.0.0",
40
40
  "glob": "13.0.0",
41
41
  "globals": "17.0.0",
42
42
  "lint-staged": "16.2.7",
43
- "prettier": "3.7.4",
43
+ "prettier": "3.8.0",
44
44
  "prettier-plugin-sh": "0.18.0",
45
45
  "semantic-release": "25.0.2",
46
46
  "semver": "7.7.3",
47
47
  "smol-toml": "1.6.0",
48
- "typescript-eslint": "8.52.0",
48
+ "typescript-eslint": "8.53.0",
49
49
  "zod": "4.3.5"
50
50
  }
51
51
  }