@peiyanlu/cli-utils 0.0.6 → 0.0.7

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/dist/index.cjs CHANGED
@@ -4,6 +4,7 @@ let node_os = require("node:os");
4
4
  let node_path = require("node:path");
5
5
  let node_child_process = require("node:child_process");
6
6
  let node_util = require("node:util");
7
+ let semver = require("semver");
7
8
 
8
9
  //#region src/enums.ts
9
10
  let PkgManager = /* @__PURE__ */ function(PkgManager$1) {
@@ -42,6 +43,9 @@ const red = (text) => (0, node_util.styleText)(["red"], text);
42
43
 
43
44
  //#endregion
44
45
  //#region src/shell.ts
46
+ const formatErr = (caller, cmd, err) => {
47
+ return `${red(caller)} ${dim(cmd)}${eol()}${err}`;
48
+ };
45
49
  /** 异步执行 `spawn` 获取字符串类型的结果 */
46
50
  const spawnAsync = (cmd, args, options) => {
47
51
  return new Promise((resolve$2, reject) => {
@@ -65,7 +69,7 @@ const spawnAsync = (cmd, args, options) => {
65
69
  child.on("error", reject);
66
70
  child.on("close", (code) => {
67
71
  if (code !== 0) {
68
- const msg = `${red("spawnAsync")} ${dim(fullCmd)} ${stderr}`;
72
+ const msg = formatErr("spawnAsync", fullCmd, stderr);
69
73
  if (error === "log") {
70
74
  console.error(msg);
71
75
  return resolve$2(void 0);
@@ -96,7 +100,8 @@ const execAsync = (cmd, argsOrOptions, maybeOptions) => {
96
100
  }
97
101
  (0, node_child_process.exec)(command, { ...others }, (err, stdout, stderr) => {
98
102
  if (err) {
99
- const msg = `${red("execAsync")} ${dim(command)} ${stderr || err.message}`;
103
+ const detail = stderr?.toString?.() || err?.message || "";
104
+ const msg = formatErr("execAsync", command, detail);
100
105
  if (error === "log") {
101
106
  console.error(msg);
102
107
  return resolve$2(void 0);
@@ -121,8 +126,7 @@ const spawnSyncWithString = (cmd, args, options) => {
121
126
  ...others
122
127
  });
123
128
  if (status !== 0 || err) {
124
- const detail = err?.message || stderr?.toString?.() || "";
125
- const msg = `${red("spawnSync")} ${dim(fullCmd)} ${detail}`;
129
+ const msg = formatErr("spawnSync", fullCmd, err?.message || stderr?.toString?.() || "");
126
130
  if (error === "log") {
127
131
  console.error(msg);
128
132
  return;
@@ -156,7 +160,7 @@ const execSyncWithString = (cmd, argsOrOptions, maybeOptions) => {
156
160
  return trim ? stdout.trim() : stdout;
157
161
  } catch (e) {
158
162
  const stderr = e?.stderr?.toString?.() || e?.message || "";
159
- const msg = `${red("execSync")} ${dim(command)} ${stderr}`;
163
+ const msg = formatErr("execSync", command, stderr);
160
164
  if (error === "log") {
161
165
  console.error(msg);
162
166
  return;
@@ -1108,7 +1112,35 @@ const publishPackage = (options) => {
1108
1112
  ...registryArg(registry),
1109
1113
  "--workspaces=false",
1110
1114
  ...args
1111
- ], { cwd });
1115
+ ], {
1116
+ cwd,
1117
+ error: "throw"
1118
+ });
1119
+ };
1120
+
1121
+ //#endregion
1122
+ //#region src/version.ts
1123
+ const isPrerelease = (version) => {
1124
+ return Boolean((0, semver.prerelease)(version));
1125
+ };
1126
+ const isValid = (version) => {
1127
+ return Boolean((0, semver.valid)(version));
1128
+ };
1129
+ const cleanVersion = (version) => {
1130
+ return (0, semver.clean)(version) ?? version;
1131
+ };
1132
+ const parseVersion = (raw) => {
1133
+ const version = isValid(raw) ? raw : (0, semver.coerce)(raw)?.toString();
1134
+ if (!version) return {};
1135
+ const { prerelease: prerelease$1 } = (0, semver.parse)(version);
1136
+ const isPrerelease$1 = Boolean(prerelease$1.length);
1137
+ const [preId, preBase] = prerelease$1.map(String);
1138
+ return {
1139
+ version,
1140
+ isPrerelease: isPrerelease$1,
1141
+ preId,
1142
+ preBase
1143
+ };
1112
1144
  };
1113
1145
 
1114
1146
  //#endregion
@@ -1122,6 +1154,7 @@ exports.YesOrNo = YesOrNo;
1122
1154
  exports.accessArg = accessArg;
1123
1155
  exports.bumpPackageVersion = bumpPackageVersion;
1124
1156
  exports.checkVersion = checkVersion;
1157
+ exports.cleanVersion = cleanVersion;
1125
1158
  exports.coloredChangeset = coloredChangeset;
1126
1159
  exports.copyDirAsync = copyDirAsync;
1127
1160
  exports.countCommitsSinceLatestTag = countCommitsSinceLatestTag;
@@ -1174,13 +1207,16 @@ exports.hasUpstreamBranch = hasUpstreamBranch;
1174
1207
  exports.hasWriteAccess = hasWriteAccess;
1175
1208
  exports.isEmpty = isEmpty;
1176
1209
  exports.isGitRepo = isGitRepo;
1210
+ exports.isPrerelease = isPrerelease;
1177
1211
  exports.isRemoteName = isRemoteName;
1178
1212
  exports.isTestFile = isTestFile;
1213
+ exports.isValid = isValid;
1179
1214
  exports.isValidPackageName = isValidPackageName;
1180
1215
  exports.isWorkingDirClean = isWorkingDirClean;
1181
1216
  exports.joinUrl = joinUrl;
1182
1217
  exports.parseArgs = parseArgs;
1183
1218
  exports.parseGitHubRepo = parseGitHubRepo;
1219
+ exports.parseVersion = parseVersion;
1184
1220
  exports.pingRegistry = pingRegistry;
1185
1221
  exports.pkgFromUserAgent = pkgFromUserAgent;
1186
1222
  exports.publishPackage = publishPackage;
package/dist/index.d.cts CHANGED
@@ -522,4 +522,20 @@ declare const publishPackage: (options?: {
522
522
  cwd?: string;
523
523
  }) => Promise<string | undefined>;
524
524
  //#endregion
525
- export { CliOptions, ConfirmResult, CopyOptions, DEFAULT_ACCESS, DEFAULT_REGISTRY, DEFAULT_TAG, ExecAsyncWithStringOptions, ExecResultOptions, ExecSyncWithStringOptions, HttpLibrary, PkgInfo, PkgManager, SpawnAsyncWithStringOptions, SpawnSyncWithStringOptions, YesOrNo, accessArg, bumpPackageVersion, checkVersion, coloredChangeset, copyDirAsync, countCommitsSinceLatestTag, deleteTag, deleteTagSync, discardAll, discardAllSync, discardFile, editFile, editJsonFile, emptyDir, eol, execAsync, execSyncWithString, fetchAllBranch, getAccess, getAllRemotes, getAuthenticatedUser, getCurrentBranch, getDefaultRemote, getDistTags, getFullHash, getGitConfig, getGitRemoteUrl, getGithubReleaseUrl, getGithubUrl, getLatestTag, getLocalTags, getLog, getOtherRemotes, getPackageInfo, getPackageUrl, getPreviousTag, getPublishedVersion, getRegistry, getRemote, getRemoteForBranch, getRemoteTags, getSortedTags, getStatus, getUpstreamArgs, gitAddAll, gitAddTracked, gitCommit, gitCommitAmend, gitTagAnnotated, gitTagLightweight, gitUndo, hasUpstreamBranch, hasWriteAccess, isEmpty, isGitRepo, isRemoteName, isTestFile, isValidPackageName, isWorkingDirClean, joinUrl, parseArgs, parseGitHubRepo, pingRegistry, pkgFromUserAgent, publishPackage, pushBranch, pushTag, readJsonFile, readSubDirs, registryArg, resetHard, resetHardSync, resetMixed, resetSoft, resolveChangelogRange, restoreAll, restoreAllSync, restoreFile, restoreFileFromCommit, restoreFromCommit, revertCommit, runCliForTest, runGit, runGitSync, runNode, runNodeSync, runNpm, runNpmSync, space, spawnAsync, spawnSyncWithString, stringifyArgs, tagArg, toValidPackageName, toValidProjectName, trimTemplate, unstageAll, unstageFile };
525
+ //#region src/version.d.ts
526
+ declare const isPrerelease: (version: string) => boolean;
527
+ declare const isValid: (version: string) => boolean;
528
+ declare const cleanVersion: (version: string) => string;
529
+ declare const parseVersion: (raw: string) => {
530
+ version?: undefined;
531
+ isPrerelease?: undefined;
532
+ preId?: undefined;
533
+ preBase?: undefined;
534
+ } | {
535
+ version: string;
536
+ isPrerelease: boolean;
537
+ preId: string;
538
+ preBase: string;
539
+ };
540
+ //#endregion
541
+ export { CliOptions, ConfirmResult, CopyOptions, DEFAULT_ACCESS, DEFAULT_REGISTRY, DEFAULT_TAG, ExecAsyncWithStringOptions, ExecResultOptions, ExecSyncWithStringOptions, HttpLibrary, PkgInfo, PkgManager, SpawnAsyncWithStringOptions, SpawnSyncWithStringOptions, YesOrNo, accessArg, bumpPackageVersion, checkVersion, cleanVersion, coloredChangeset, copyDirAsync, countCommitsSinceLatestTag, deleteTag, deleteTagSync, discardAll, discardAllSync, discardFile, editFile, editJsonFile, emptyDir, eol, execAsync, execSyncWithString, fetchAllBranch, getAccess, getAllRemotes, getAuthenticatedUser, getCurrentBranch, getDefaultRemote, getDistTags, getFullHash, getGitConfig, getGitRemoteUrl, getGithubReleaseUrl, getGithubUrl, getLatestTag, getLocalTags, getLog, getOtherRemotes, getPackageInfo, getPackageUrl, getPreviousTag, getPublishedVersion, getRegistry, getRemote, getRemoteForBranch, getRemoteTags, getSortedTags, getStatus, getUpstreamArgs, gitAddAll, gitAddTracked, gitCommit, gitCommitAmend, gitTagAnnotated, gitTagLightweight, gitUndo, hasUpstreamBranch, hasWriteAccess, isEmpty, isGitRepo, isPrerelease, isRemoteName, isTestFile, isValid, isValidPackageName, isWorkingDirClean, joinUrl, parseArgs, parseGitHubRepo, parseVersion, pingRegistry, pkgFromUserAgent, publishPackage, pushBranch, pushTag, readJsonFile, readSubDirs, registryArg, resetHard, resetHardSync, resetMixed, resetSoft, resolveChangelogRange, restoreAll, restoreAllSync, restoreFile, restoreFileFromCommit, restoreFromCommit, revertCommit, runCliForTest, runGit, runGitSync, runNode, runNodeSync, runNpm, runNpmSync, space, spawnAsync, spawnSyncWithString, stringifyArgs, tagArg, toValidPackageName, toValidProjectName, trimTemplate, unstageAll, unstageFile };
package/dist/index.d.mts CHANGED
@@ -522,4 +522,20 @@ declare const publishPackage: (options?: {
522
522
  cwd?: string;
523
523
  }) => Promise<string | undefined>;
524
524
  //#endregion
525
- export { CliOptions, ConfirmResult, CopyOptions, DEFAULT_ACCESS, DEFAULT_REGISTRY, DEFAULT_TAG, ExecAsyncWithStringOptions, ExecResultOptions, ExecSyncWithStringOptions, HttpLibrary, PkgInfo, PkgManager, SpawnAsyncWithStringOptions, SpawnSyncWithStringOptions, YesOrNo, accessArg, bumpPackageVersion, checkVersion, coloredChangeset, copyDirAsync, countCommitsSinceLatestTag, deleteTag, deleteTagSync, discardAll, discardAllSync, discardFile, editFile, editJsonFile, emptyDir, eol, execAsync, execSyncWithString, fetchAllBranch, getAccess, getAllRemotes, getAuthenticatedUser, getCurrentBranch, getDefaultRemote, getDistTags, getFullHash, getGitConfig, getGitRemoteUrl, getGithubReleaseUrl, getGithubUrl, getLatestTag, getLocalTags, getLog, getOtherRemotes, getPackageInfo, getPackageUrl, getPreviousTag, getPublishedVersion, getRegistry, getRemote, getRemoteForBranch, getRemoteTags, getSortedTags, getStatus, getUpstreamArgs, gitAddAll, gitAddTracked, gitCommit, gitCommitAmend, gitTagAnnotated, gitTagLightweight, gitUndo, hasUpstreamBranch, hasWriteAccess, isEmpty, isGitRepo, isRemoteName, isTestFile, isValidPackageName, isWorkingDirClean, joinUrl, parseArgs, parseGitHubRepo, pingRegistry, pkgFromUserAgent, publishPackage, pushBranch, pushTag, readJsonFile, readSubDirs, registryArg, resetHard, resetHardSync, resetMixed, resetSoft, resolveChangelogRange, restoreAll, restoreAllSync, restoreFile, restoreFileFromCommit, restoreFromCommit, revertCommit, runCliForTest, runGit, runGitSync, runNode, runNodeSync, runNpm, runNpmSync, space, spawnAsync, spawnSyncWithString, stringifyArgs, tagArg, toValidPackageName, toValidProjectName, trimTemplate, unstageAll, unstageFile };
525
+ //#region src/version.d.ts
526
+ declare const isPrerelease: (version: string) => boolean;
527
+ declare const isValid: (version: string) => boolean;
528
+ declare const cleanVersion: (version: string) => string;
529
+ declare const parseVersion: (raw: string) => {
530
+ version?: undefined;
531
+ isPrerelease?: undefined;
532
+ preId?: undefined;
533
+ preBase?: undefined;
534
+ } | {
535
+ version: string;
536
+ isPrerelease: boolean;
537
+ preId: string;
538
+ preBase: string;
539
+ };
540
+ //#endregion
541
+ export { CliOptions, ConfirmResult, CopyOptions, DEFAULT_ACCESS, DEFAULT_REGISTRY, DEFAULT_TAG, ExecAsyncWithStringOptions, ExecResultOptions, ExecSyncWithStringOptions, HttpLibrary, PkgInfo, PkgManager, SpawnAsyncWithStringOptions, SpawnSyncWithStringOptions, YesOrNo, accessArg, bumpPackageVersion, checkVersion, cleanVersion, coloredChangeset, copyDirAsync, countCommitsSinceLatestTag, deleteTag, deleteTagSync, discardAll, discardAllSync, discardFile, editFile, editJsonFile, emptyDir, eol, execAsync, execSyncWithString, fetchAllBranch, getAccess, getAllRemotes, getAuthenticatedUser, getCurrentBranch, getDefaultRemote, getDistTags, getFullHash, getGitConfig, getGitRemoteUrl, getGithubReleaseUrl, getGithubUrl, getLatestTag, getLocalTags, getLog, getOtherRemotes, getPackageInfo, getPackageUrl, getPreviousTag, getPublishedVersion, getRegistry, getRemote, getRemoteForBranch, getRemoteTags, getSortedTags, getStatus, getUpstreamArgs, gitAddAll, gitAddTracked, gitCommit, gitCommitAmend, gitTagAnnotated, gitTagLightweight, gitUndo, hasUpstreamBranch, hasWriteAccess, isEmpty, isGitRepo, isPrerelease, isRemoteName, isTestFile, isValid, isValidPackageName, isWorkingDirClean, joinUrl, parseArgs, parseGitHubRepo, parseVersion, pingRegistry, pkgFromUserAgent, publishPackage, pushBranch, pushTag, readJsonFile, readSubDirs, registryArg, resetHard, resetHardSync, resetMixed, resetSoft, resolveChangelogRange, restoreAll, restoreAllSync, restoreFile, restoreFileFromCommit, restoreFromCommit, revertCommit, runCliForTest, runGit, runGitSync, runNode, runNodeSync, runNpm, runNpmSync, space, spawnAsync, spawnSyncWithString, stringifyArgs, tagArg, toValidPackageName, toValidProjectName, trimTemplate, unstageAll, unstageFile };
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import { EOL } from "node:os";
4
4
  import { join, resolve } from "node:path";
5
5
  import { exec, execSync, spawn, spawnSync } from "node:child_process";
6
6
  import { styleText } from "node:util";
7
+ import { clean, coerce, parse, prerelease, valid } from "semver";
7
8
 
8
9
  //#region src/enums.ts
9
10
  let PkgManager = /* @__PURE__ */ function(PkgManager$1) {
@@ -42,6 +43,9 @@ const red = (text) => styleText(["red"], text);
42
43
 
43
44
  //#endregion
44
45
  //#region src/shell.ts
46
+ const formatErr = (caller, cmd, err) => {
47
+ return `${red(caller)} ${dim(cmd)}${eol()}${err}`;
48
+ };
45
49
  /** 异步执行 `spawn` 获取字符串类型的结果 */
46
50
  const spawnAsync = (cmd, args, options) => {
47
51
  return new Promise((resolve$1, reject) => {
@@ -65,7 +69,7 @@ const spawnAsync = (cmd, args, options) => {
65
69
  child.on("error", reject);
66
70
  child.on("close", (code) => {
67
71
  if (code !== 0) {
68
- const msg = `${red("spawnAsync")} ${dim(fullCmd)} ${stderr}`;
72
+ const msg = formatErr("spawnAsync", fullCmd, stderr);
69
73
  if (error === "log") {
70
74
  console.error(msg);
71
75
  return resolve$1(void 0);
@@ -96,7 +100,8 @@ const execAsync = (cmd, argsOrOptions, maybeOptions) => {
96
100
  }
97
101
  exec(command, { ...others }, (err, stdout, stderr) => {
98
102
  if (err) {
99
- const msg = `${red("execAsync")} ${dim(command)} ${stderr || err.message}`;
103
+ const detail = stderr?.toString?.() || err?.message || "";
104
+ const msg = formatErr("execAsync", command, detail);
100
105
  if (error === "log") {
101
106
  console.error(msg);
102
107
  return resolve$1(void 0);
@@ -121,8 +126,7 @@ const spawnSyncWithString = (cmd, args, options) => {
121
126
  ...others
122
127
  });
123
128
  if (status !== 0 || err) {
124
- const detail = err?.message || stderr?.toString?.() || "";
125
- const msg = `${red("spawnSync")} ${dim(fullCmd)} ${detail}`;
129
+ const msg = formatErr("spawnSync", fullCmd, err?.message || stderr?.toString?.() || "");
126
130
  if (error === "log") {
127
131
  console.error(msg);
128
132
  return;
@@ -156,7 +160,7 @@ const execSyncWithString = (cmd, argsOrOptions, maybeOptions) => {
156
160
  return trim ? stdout.trim() : stdout;
157
161
  } catch (e) {
158
162
  const stderr = e?.stderr?.toString?.() || e?.message || "";
159
- const msg = `${red("execSync")} ${dim(command)} ${stderr}`;
163
+ const msg = formatErr("execSync", command, stderr);
160
164
  if (error === "log") {
161
165
  console.error(msg);
162
166
  return;
@@ -1108,8 +1112,36 @@ const publishPackage = (options) => {
1108
1112
  ...registryArg(registry),
1109
1113
  "--workspaces=false",
1110
1114
  ...args
1111
- ], { cwd });
1115
+ ], {
1116
+ cwd,
1117
+ error: "throw"
1118
+ });
1119
+ };
1120
+
1121
+ //#endregion
1122
+ //#region src/version.ts
1123
+ const isPrerelease = (version) => {
1124
+ return Boolean(prerelease(version));
1125
+ };
1126
+ const isValid = (version) => {
1127
+ return Boolean(valid(version));
1128
+ };
1129
+ const cleanVersion = (version) => {
1130
+ return clean(version) ?? version;
1131
+ };
1132
+ const parseVersion = (raw) => {
1133
+ const version = isValid(raw) ? raw : coerce(raw)?.toString();
1134
+ if (!version) return {};
1135
+ const { prerelease: prerelease$1 } = parse(version);
1136
+ const isPrerelease$1 = Boolean(prerelease$1.length);
1137
+ const [preId, preBase] = prerelease$1.map(String);
1138
+ return {
1139
+ version,
1140
+ isPrerelease: isPrerelease$1,
1141
+ preId,
1142
+ preBase
1143
+ };
1112
1144
  };
1113
1145
 
1114
1146
  //#endregion
1115
- export { ConfirmResult, DEFAULT_ACCESS, DEFAULT_REGISTRY, DEFAULT_TAG, HttpLibrary, PkgManager, YesOrNo, accessArg, bumpPackageVersion, checkVersion, coloredChangeset, copyDirAsync, countCommitsSinceLatestTag, deleteTag, deleteTagSync, discardAll, discardAllSync, discardFile, editFile, editJsonFile, emptyDir, eol, execAsync, execSyncWithString, fetchAllBranch, getAccess, getAllRemotes, getAuthenticatedUser, getCurrentBranch, getDefaultRemote, getDistTags, getFullHash, getGitConfig, getGitRemoteUrl, getGithubReleaseUrl, getGithubUrl, getLatestTag, getLocalTags, getLog, getOtherRemotes, getPackageInfo, getPackageUrl, getPreviousTag, getPublishedVersion, getRegistry, getRemote, getRemoteForBranch, getRemoteTags, getSortedTags, getStatus, getUpstreamArgs, gitAddAll, gitAddTracked, gitCommit, gitCommitAmend, gitTagAnnotated, gitTagLightweight, gitUndo, hasUpstreamBranch, hasWriteAccess, isEmpty, isGitRepo, isRemoteName, isTestFile, isValidPackageName, isWorkingDirClean, joinUrl, parseArgs, parseGitHubRepo, pingRegistry, pkgFromUserAgent, publishPackage, pushBranch, pushTag, readJsonFile, readSubDirs, registryArg, resetHard, resetHardSync, resetMixed, resetSoft, resolveChangelogRange, restoreAll, restoreAllSync, restoreFile, restoreFileFromCommit, restoreFromCommit, revertCommit, runCliForTest, runGit, runGitSync, runNode, runNodeSync, runNpm, runNpmSync, space, spawnAsync, spawnSyncWithString, stringifyArgs, tagArg, toValidPackageName, toValidProjectName, trimTemplate, unstageAll, unstageFile };
1147
+ export { ConfirmResult, DEFAULT_ACCESS, DEFAULT_REGISTRY, DEFAULT_TAG, HttpLibrary, PkgManager, YesOrNo, accessArg, bumpPackageVersion, checkVersion, cleanVersion, coloredChangeset, copyDirAsync, countCommitsSinceLatestTag, deleteTag, deleteTagSync, discardAll, discardAllSync, discardFile, editFile, editJsonFile, emptyDir, eol, execAsync, execSyncWithString, fetchAllBranch, getAccess, getAllRemotes, getAuthenticatedUser, getCurrentBranch, getDefaultRemote, getDistTags, getFullHash, getGitConfig, getGitRemoteUrl, getGithubReleaseUrl, getGithubUrl, getLatestTag, getLocalTags, getLog, getOtherRemotes, getPackageInfo, getPackageUrl, getPreviousTag, getPublishedVersion, getRegistry, getRemote, getRemoteForBranch, getRemoteTags, getSortedTags, getStatus, getUpstreamArgs, gitAddAll, gitAddTracked, gitCommit, gitCommitAmend, gitTagAnnotated, gitTagLightweight, gitUndo, hasUpstreamBranch, hasWriteAccess, isEmpty, isGitRepo, isPrerelease, isRemoteName, isTestFile, isValid, isValidPackageName, isWorkingDirClean, joinUrl, parseArgs, parseGitHubRepo, parseVersion, pingRegistry, pkgFromUserAgent, publishPackage, pushBranch, pushTag, readJsonFile, readSubDirs, registryArg, resetHard, resetHardSync, resetMixed, resetSoft, resolveChangelogRange, restoreAll, restoreAllSync, restoreFile, restoreFileFromCommit, restoreFromCommit, revertCommit, runCliForTest, runGit, runGitSync, runNode, runNodeSync, runNpm, runNpmSync, space, spawnAsync, spawnSyncWithString, stringifyArgs, tagArg, toValidPackageName, toValidProjectName, trimTemplate, unstageAll, unstageFile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peiyanlu/cli-utils",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Shared utils for building interactive Node.js CLI applications.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,6 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@release-it/conventional-changelog": "^10.0.2",
23
23
  "@types/node": "^24.10.3",
24
+ "@types/semver": "^7.7.1",
24
25
  "@vitest/coverage-v8": "^4.0.15",
25
26
  "release-it": "^19.0.2",
26
27
  "release-it-pnpm": "^4.6.6",
@@ -54,6 +55,9 @@
54
55
  "url": "https://github.com/peiyanlu/cli-utils/issues"
55
56
  },
56
57
  "homepage": "https://github.com/peiyanlu/cli-utils#readme",
58
+ "dependencies": {
59
+ "semver": "^7.7.3"
60
+ },
57
61
  "scripts": {
58
62
  "dev": "tsdown -w",
59
63
  "build": "tsdown",