@varlet/release 2.2.3-alpha.1779710113111 → 2.2.4-alpha.1779719506772

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
@@ -162,7 +162,6 @@ Usage: vr publish [flags...]
162
162
  Flags:
163
163
  --check-remote-version Check remote version
164
164
  --npm-tag string npm tag
165
- --otp string npm one-time password
166
165
  ```
167
166
 
168
167
  _Example_:
@@ -175,8 +174,6 @@ pnpm exec vr publish
175
174
  pnpm exec vr publish --check-remote-version
176
175
  # Specify the npm dist-tag
177
176
  pnpm exec vr publish --npm-tag alpha
178
- # Publish with npm two-factor authentication
179
- pnpm exec vr publish --otp 123456
180
177
  ```
181
178
 
182
179
  **Node API**:
@@ -188,7 +185,6 @@ publish({
188
185
  preRelease?: boolean // Pre-release indicator, will add the '--tag alpha' option
189
186
  checkRemoteVersion?: boolean // Check if the same version exists on the remote npm before publishing
190
187
  npmTag?: string // NPM tag to publish
191
- otp?: string // npm one-time password
192
188
  cwd?: string // Working directory, defaults to process.cwd()
193
189
  })
194
190
  ```
package/README.zh-CN.md CHANGED
@@ -162,7 +162,6 @@ _标志参考_:
162
162
  标志:
163
163
  --check-remote-version 检查远程版本
164
164
  --npm-tag string npm tag
165
- --otp string npm 一次性验证码
166
165
  ```
167
166
 
168
167
  _使用示例_:
@@ -175,8 +174,6 @@ pnpm exec vr publish
175
174
  pnpm exec vr publish --check-remote-version
176
175
  # 指定 npm 的 dist-tag
177
176
  pnpm exec vr publish --npm-tag alpha
178
- # 使用 npm 双因素认证验证码发布
179
- pnpm exec vr publish --otp 123456
180
177
  ```
181
178
 
182
179
  **Node 调用**:
@@ -188,7 +185,6 @@ publish({
188
185
  preRelease?: boolean // 预发布标示,将添加 '--tag alpha' 选项
189
186
  checkRemoteVersion?: boolean // 发布前检查远程 npm 上是否已存在相同版本
190
187
  npmTag?: string // 发布的 npm tag
191
- otp?: string // npm 一次性验证码
192
188
  cwd?: string // 工作目录,默认为 process.cwd()
193
189
  })
194
190
  ```
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-DZZGwlLR.js";
2
+ import { c as release, i as lockfileCheck, p as commitLint, s as publish, u as changelog } from "./src-BCjkyQSx.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.3-alpha.1779710112907",
8
+ version: "2.2.4-alpha.1779719506772",
9
9
  commands: [
10
10
  command({
11
11
  name: "release",
@@ -53,11 +53,6 @@ cli({
53
53
  type: String,
54
54
  alias: "t",
55
55
  description: "Npm tag"
56
- },
57
- otp: {
58
- type: String,
59
- alias: "o",
60
- description: "Npm one-time password"
61
56
  }
62
57
  },
63
58
  help: { description: "Publish to npm" }
package/dist/index.d.ts CHANGED
@@ -15,14 +15,12 @@ interface PublishCommandOptions {
15
15
  preRelease?: boolean;
16
16
  checkRemoteVersion?: boolean;
17
17
  npmTag?: string;
18
- otp?: string;
19
18
  cwd?: string;
20
19
  }
21
20
  declare function publish({
22
21
  preRelease,
23
22
  checkRemoteVersion,
24
23
  npmTag,
25
- otp,
26
24
  cwd
27
25
  }: PublishCommandOptions): Promise<void>;
28
26
  declare function getPackageJsons(cwd?: string): PackageJsonEntry[];
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-DZZGwlLR.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-BCjkyQSx.js";
2
2
  export { COMMIT_HEADER_RE, COMMIT_MESSAGE_RE, changelog, checkLockfileSync, commitLint, getCommitMessage, getLockfilePath, getPackageJsons, installDependencies, isSameVersion, isVersionCommitMessage, lockfileCheck, publish, release, updateVersion };
@@ -1,7 +1,7 @@
1
1
  import { createWriteStream, globSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
3
  import { styleText } from "node:util";
4
- import { cancel, confirm, isCancel, select, spinner, text } from "@clack/prompts";
4
+ import { cancel, confirm, isCancel, select, spinner } from "@clack/prompts";
5
5
  import { logger } from "rslog";
6
6
  import semver from "semver";
7
7
  import { x } from "tinyexec";
@@ -261,7 +261,7 @@ async function isSameVersion(version, cwd = process.cwd()) {
261
261
  }
262
262
  }
263
263
  }
264
- async function publish({ preRelease, checkRemoteVersion, npmTag, otp, cwd = process.cwd() }) {
264
+ async function publish({ preRelease, checkRemoteVersion, npmTag, cwd = process.cwd() }) {
265
265
  const s = spinner();
266
266
  s.start("Publishing all packages");
267
267
  const args = [
@@ -277,10 +277,12 @@ async function publish({ preRelease, checkRemoteVersion, npmTag, otp, cwd = proc
277
277
  }
278
278
  if (preRelease) args.push("--tag", "alpha");
279
279
  else if (npmTag) args.push("--tag", npmTag);
280
- const normalizedOtp = otp?.trim();
281
- if (normalizedOtp) args.push("--otp", normalizedOtp);
282
280
  try {
283
- const ret = await x("pnpm", args, { throwOnError: true });
281
+ console.log(process.stdin.isTTY);
282
+ const ret = await x("pnpm", args, {
283
+ throwOnError: true,
284
+ nodeOptions: { stdio: "inherit" }
285
+ });
284
286
  s.stop("Publish all packages successfully");
285
287
  logStdout(ret);
286
288
  } catch (error) {
@@ -367,12 +369,6 @@ async function getReleaseVersion(currentVersion) {
367
369
  };
368
370
  }
369
371
  }
370
- async function getPublishOtp() {
371
- return unwrapPromptResult(await text({
372
- message: "Please input npm otp",
373
- placeholder: "Press enter to skip"
374
- })).trim();
375
- }
376
372
  async function restorePackageJsons(cwd = process.cwd()) {
377
373
  const paths = getPackageJsons(cwd).map(({ filePath }) => filePath);
378
374
  if (paths.length > 0) await execGit("restore", ...paths);
@@ -385,10 +381,7 @@ async function release(options) {
385
381
  logger.error("Your package is missing the version field");
386
382
  return;
387
383
  }
388
- if (!await isWorktreeEmpty()) {
389
- logger.error("Git worktree is not empty, please commit changed");
390
- return;
391
- }
384
+ if (!await isWorktreeEmpty()) logger.error("Git worktree is not empty, please commit changed");
392
385
  if (!await confirmRefs(options.remote)) return;
393
386
  if (!options.skipNpmPublish && !await confirmRegistry()) return;
394
387
  const { isPreRelease, expectVersion } = await getReleaseVersion(currentVersion);
@@ -398,15 +391,11 @@ async function release(options) {
398
391
  }
399
392
  updateVersion(expectVersion, cwd);
400
393
  if (options.task) await options.task(expectVersion, currentVersion);
401
- if (!options.skipNpmPublish) {
402
- const otp = await getPublishOtp();
403
- await publish({
404
- preRelease: isPreRelease,
405
- npmTag: options.npmTag,
406
- otp,
407
- cwd
408
- });
409
- }
394
+ if (!options.skipNpmPublish) await publish({
395
+ preRelease: isPreRelease,
396
+ npmTag: options.npmTag,
397
+ cwd
398
+ });
410
399
  if (!isPreRelease) {
411
400
  if (!options.skipChangelog) await changelog({ cwd });
412
401
  await pushGit(expectVersion, options.remote, options.skipGitTag);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/release",
3
- "version": "2.2.3-alpha.1779710113111",
3
+ "version": "2.2.4-alpha.1779719506772",
4
4
  "description": "publish all packages, generate changelogs and check commit messages",
5
5
  "keywords": [
6
6
  "changelog",
@@ -29,16 +29,6 @@
29
29
  "default": "./dist/index.js"
30
30
  }
31
31
  },
32
- "scripts": {
33
- "build": "vp pack",
34
- "commit-lint": "node dist/cli.js commit-lint",
35
- "dev": "vp pack --watch",
36
- "release": "vp pack && vp test run && node scripts/release.js",
37
- "release:dev": "vp pack && node scripts/release.js",
38
- "test": "vp test",
39
- "test:coverage": "vp test run --coverage",
40
- "type-check": "tsgo --noEmit"
41
- },
42
32
  "dependencies": {
43
33
  "@clack/prompts": "^1.4.0",
44
34
  "cleye": "^2.6.0",
@@ -53,11 +43,20 @@
53
43
  "@types/semver": "^7.7.1",
54
44
  "@typescript/native-preview": "7.0.0-dev.20260524.1",
55
45
  "@vitest/coverage-v8": "^4.1.5",
56
- "vite-plus": "catalog:"
46
+ "vite-plus": "latest"
57
47
  },
58
48
  "engines": {
59
49
  "node": "^20.19.0 || >=22.12.0",
60
50
  "pnpm": ">=10.0"
61
51
  },
62
- "packageManager": "pnpm@11.1.3"
63
- }
52
+ "scripts": {
53
+ "build": "vp pack",
54
+ "commit-lint": "node dist/cli.js commit-lint",
55
+ "dev": "vp pack --watch",
56
+ "release": "vp pack && vp test run && node scripts/release.js",
57
+ "release:dev": "vp pack && node scripts/release.js",
58
+ "test": "vp test",
59
+ "test:coverage": "vp test run --coverage",
60
+ "type-check": "tsgo --noEmit"
61
+ }
62
+ }