@varlet/release 2.2.1 → 2.2.2

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
@@ -20,6 +20,8 @@
20
20
 
21
21
  > `Varlet Release` requires `Node.js` ^20.19.0 || >=22.12.0 and `esm` only.
22
22
 
23
+ If you are upgrading from `v1` to `v2`, read the [migration guide](./MIGRATION.md) first.
24
+
23
25
  ## Quick Start
24
26
 
25
27
  Install dependencies:
package/README.zh-CN.md CHANGED
@@ -20,6 +20,8 @@
20
20
 
21
21
  > `Varlet Release` 需要 `Node.js` ^20.19.0 || >=22.12.0,并且仅支持 `esm`。
22
22
 
23
+ 从 `v1` 升级到 `v2` 时,请先阅读 [迁移指南](./MIGRATION.zh-CN.md)。
24
+
23
25
  ## 快速开始
24
26
 
25
27
  安装依赖:
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { c as release, i as lockfileCheck, p as commitLint, s as publish, u as changelog } from "./src-DwRUa0a2.js";
2
+ import { c as release, i as lockfileCheck, p as commitLint, s as publish, u as changelog } from "./src-Cz2-oOom.js";
3
3
  import { cli, command } from "cleye";
4
4
  //#endregion
5
5
  //#region src/cli.ts
6
6
  cli({
7
7
  name: "vr",
8
- version: "2.2.1",
8
+ version: "2.2.2",
9
9
  commands: [
10
10
  command({
11
11
  name: "release",
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as getPackageJsons, c as release, d as COMMIT_HEADER_RE, f as COMMIT_MESSAGE_RE, h as isVersionCommitMessage, i as lockfileCheck, l as updateVersion, m as getCommitMessage, n as getLockfilePath, o as isSameVersion, p as commitLint, r as installDependencies, s as publish, t as checkLockfileSync, u as changelog } from "./src-DwRUa0a2.js";
1
+ import { a as getPackageJsons, c as release, d as COMMIT_HEADER_RE, f as COMMIT_MESSAGE_RE, h as isVersionCommitMessage, i as lockfileCheck, l as updateVersion, m as getCommitMessage, n as getLockfilePath, o as isSameVersion, p as commitLint, r as installDependencies, s as publish, t as checkLockfileSync, u as changelog } from "./src-Cz2-oOom.js";
2
2
  export { COMMIT_HEADER_RE, COMMIT_MESSAGE_RE, changelog, checkLockfileSync, commitLint, getCommitMessage, getLockfilePath, getPackageJsons, installDependencies, isSameVersion, isVersionCommitMessage, lockfileCheck, publish, release, updateVersion };
@@ -1,4 +1,4 @@
1
- import { createWriteStream, existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
1
+ import { createWriteStream, globSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
3
  import { styleText } from "node:util";
4
4
  import { cancel, confirm, isCancel, select, spinner } from "@clack/prompts";
@@ -283,7 +283,7 @@ async function publish({ preRelease, checkRemoteVersion, npmTag, cwd = process.c
283
283
  logStdout(ret);
284
284
  } catch (error) {
285
285
  s.cancel("Publish all packages failed");
286
- throw error?.output?.stderr ?? error;
286
+ throw error?.output?.stderr || error?.output?.stdout || error;
287
287
  }
288
288
  }
289
289
  async function pushGit(version, remote = "origin", skipGitTag = false) {
@@ -300,13 +300,7 @@ async function pushGit(version, remote = "origin", skipGitTag = false) {
300
300
  logStdout(ret);
301
301
  }
302
302
  function getPackageJsons(cwd = process.cwd()) {
303
- const packageJsonPaths = [resolve(cwd, "package.json")];
304
- const packagesDir = resolve(cwd, "packages");
305
- if (existsSync(packagesDir)) for (const name of readdirSync(packagesDir)) {
306
- const pkgPath = resolve(packagesDir, name, "package.json");
307
- if (existsSync(pkgPath)) packageJsonPaths.push(pkgPath);
308
- }
309
- return packageJsonPaths.map((path) => ({
303
+ return ["package.json", "packages/*/package.json"].flatMap((pattern) => globSync(pattern, { cwd }).map((relativePath) => resolve(cwd, relativePath))).map((path) => ({
310
304
  filePath: path,
311
305
  config: readJSONSync(path)
312
306
  }));
@@ -329,7 +323,7 @@ async function confirmVersion(currentVersion, expectVersion) {
329
323
  return unwrapPromptResult(await select({
330
324
  message: "Version confirm",
331
325
  options: [{
332
- label: `All packages version ${currentVersion} -> ${expectVersion}`,
326
+ label: `All packages version ${styleText("red", currentVersion)} -> ${styleText("green", expectVersion)}`,
333
327
  value: "confirm"
334
328
  }, {
335
329
  label: "Back to previous step",
@@ -351,7 +345,7 @@ function computeExpectVersion(currentVersion, type) {
351
345
  }
352
346
  async function getReleaseType(currentVersion) {
353
347
  return unwrapPromptResult(await select({
354
- message: `Please select release type, current version ${currentVersion}`,
348
+ message: `Please select release type`,
355
349
  options: RELEASE_TYPES.map((type) => {
356
350
  return {
357
351
  label: `${type} (${computeExpectVersion(currentVersion, type)})`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/release",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "publish all packages, generate changelogs and check commit messages",
5
5
  "keywords": [
6
6
  "changelog",
@@ -30,20 +30,19 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@clack/prompts": "^1.2.0",
34
- "cleye": "^2.3.0",
33
+ "@clack/prompts": "^1.3.0",
34
+ "cleye": "^2.6.0",
35
35
  "rslog": "^2.1.1",
36
36
  "semver": "^7.7.4",
37
37
  "standard-changelog": "^7.0.1",
38
- "tinyexec": "^1.1.1"
38
+ "tinyexec": "^1.1.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@configurajs/vite-plus": "^0.2.2",
41
+ "@configurajs/vite-plus": "^0.2.6",
42
42
  "@types/node": "^22.14.0",
43
43
  "@types/semver": "^7.7.1",
44
- "@typescript/native-preview": "7.0.0-dev.20260410.1",
45
- "@vitest/coverage-v8": "^4.1.4",
46
- "conventional-changelog-angular": "^8.3.1",
44
+ "@typescript/native-preview": "7.0.0-dev.20260504.1",
45
+ "@vitest/coverage-v8": "^4.1.5",
47
46
  "vite-plus": "latest"
48
47
  },
49
48
  "engines": {