@varlet/release 0.2.3 → 0.2.5

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
@@ -71,6 +71,7 @@ npx vr publish
71
71
  | -s --skip-npm-publish | Skip npm publish |
72
72
  | -sc --skip-changelog | Skip generate changelog |
73
73
  | -sgt --skip-git-tag | Skip git tag |
74
+ | -nt --npm-tag \<npmTag\> | npm tag |
74
75
 
75
76
  #### changelog
76
77
 
@@ -90,9 +91,10 @@ npx vr publish
90
91
 
91
92
  #### publish
92
93
 
93
- | 参数 | 说明 |
94
+ | Params | Instructions |
94
95
  | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
95
96
  | -c --check-remote-version | Detects whether the remote version of the npm package is the same as the package version to be published locally, and if it is, skip the release |
97
+ | -nt --npm-tag \<npmTag\> | npm tag |
96
98
 
97
99
  ### Custom Handle
98
100
 
@@ -124,14 +126,16 @@ release({ task })
124
126
  interface PublishCommandOptions {
125
127
  preRelease?: boolean
126
128
  checkRemoteVersion?: boolean
129
+ npmTag?: string
127
130
  }
128
- function publish({ preRelease, checkRemoteVersion }: PublishCommandOptions): Promise<void>
131
+ function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>
129
132
  function updateVersion(version: string): void
130
133
  interface ReleaseCommandOptions {
131
134
  remote?: string
132
135
  skipNpmPublish?: boolean
133
136
  skipChangelog?: boolean
134
137
  skipGitTag?: boolean
138
+ npmTag?: string
135
139
  task?(): Promise<void>
136
140
  }
137
141
  function release(options: ReleaseCommandOptions): Promise<void>
package/README.zh-CN.md CHANGED
@@ -71,6 +71,7 @@ npx vr publish
71
71
  | -s --skip-npm-publish | 跳过 npm 发布 |
72
72
  | -sc --skip-changelog | 跳过生成变更日志 |
73
73
  | -sgt --skip-git-tag | 跳过 git tag |
74
+ | -nt --npm-tag \<npmTag\> | npm tag |
74
75
 
75
76
  #### changelog
76
77
 
@@ -93,6 +94,7 @@ npx vr publish
93
94
  | 参数 | 说明 |
94
95
  | ------------------------- | --------------------------------------------------------------------- |
95
96
  | -c --check-remote-version | 检测npm包的远程版本是否与要在本地发布的包版本相同,如果是,则跳过发布 |
97
+ | -nt --npm-tag \<npmTag\> | npm tag |
96
98
 
97
99
  ### 自定义处理
98
100
 
@@ -124,14 +126,16 @@ release({ task })
124
126
  interface PublishCommandOptions {
125
127
  preRelease?: boolean
126
128
  checkRemoteVersion?: boolean
129
+ npmTag?: string
127
130
  }
128
- function publish({ preRelease, checkRemoteVersion }: PublishCommandOptions): Promise<void>
131
+ function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>
129
132
  function updateVersion(version: string): void
130
133
  interface ReleaseCommandOptions {
131
134
  remote?: string
132
135
  skipNpmPublish?: boolean
133
136
  skipChangelog?: boolean
134
137
  skipGitTag?: boolean
138
+ npmTag?: string
135
139
  task?(): Promise<void>
136
140
  }
137
141
  function release(options: ReleaseCommandOptions): Promise<void>
package/bin/index.js CHANGED
@@ -10,12 +10,14 @@ program
10
10
  .option('-s --skip-npm-publish', 'Skip npm publish')
11
11
  .option('-sc --skip-changelog', 'Skip generate changelog')
12
12
  .option('-sgt --skip-git-tag', 'Skip git tag')
13
+ .option('-nt --npm-tag <npmTag>', 'Npm tag')
13
14
  .description('Release all packages and generate changelogs')
14
15
  .action(async (options) => release(options))
15
16
 
16
17
  program
17
18
  .command('publish')
18
19
  .option('-c --check-remote-version', 'Check remote version')
20
+ .option('-nt --npm-tag <npmTag>', 'Npm tag')
19
21
  .description('Publish to npm')
20
22
  .action(async (options) => publish(options))
21
23
 
package/dist/index.cjs CHANGED
@@ -100,7 +100,7 @@ async function isWorktreeEmpty() {
100
100
  const ret = await (0, import_execa.execa)("git", ["status", "--porcelain"]);
101
101
  return !ret.stdout;
102
102
  }
103
- async function publish({ preRelease, checkRemoteVersion }) {
103
+ async function publish({ preRelease, checkRemoteVersion, npmTag }) {
104
104
  const s = (0, import_nanospinner2.createSpinner)("Publishing all packages").start();
105
105
  const args = ["-r", "publish", "--no-git-checks", "--access", "public"];
106
106
  if (checkRemoteVersion) {
@@ -119,6 +119,8 @@ async function publish({ preRelease, checkRemoteVersion }) {
119
119
  }
120
120
  if (preRelease) {
121
121
  args.push("--tag", "alpha");
122
+ } else if (npmTag) {
123
+ args.push("--tag", npmTag);
122
124
  }
123
125
  const ret = await (0, import_execa.execa)("pnpm", args);
124
126
  if (ret.stderr && ret.stderr.includes("npm ERR!")) {
@@ -235,7 +237,7 @@ async function release(options) {
235
237
  await options.task();
236
238
  }
237
239
  if (!options.skipNpmPublish) {
238
- await publish({ preRelease: isPreRelease });
240
+ await publish({ preRelease: isPreRelease, npmTag: options.npmTag });
239
241
  }
240
242
  if (!isPreRelease) {
241
243
  if (!options.skipChangelog) {
package/dist/index.d.cts CHANGED
@@ -1,11 +1,13 @@
1
1
  interface PublishCommandOptions {
2
2
  preRelease?: boolean;
3
3
  checkRemoteVersion?: boolean;
4
+ npmTag?: string;
4
5
  }
5
- declare function publish({ preRelease, checkRemoteVersion }: PublishCommandOptions): Promise<void>;
6
+ declare function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>;
6
7
  declare function updateVersion(version: string): void;
7
8
  interface ReleaseCommandOptions {
8
9
  remote?: string;
10
+ npmTag?: string;
9
11
  skipNpmPublish?: boolean;
10
12
  skipChangelog?: boolean;
11
13
  skipGitTag?: boolean;
@@ -30,4 +32,4 @@ interface CommitLintCommandOptions {
30
32
  }
31
33
  declare function commitLint(options: CommitLintCommandOptions): void;
32
34
 
33
- export { COMMIT_MESSAGE_RE, type ChangelogCommandOptions, type CommitLintCommandOptions, type ReleaseCommandOptions, changelog, commitLint, getCommitMessage, isVersionCommitMessage, publish, release, updateVersion };
35
+ export { COMMIT_MESSAGE_RE, type ChangelogCommandOptions, type CommitLintCommandOptions, type PublishCommandOptions, type ReleaseCommandOptions, changelog, commitLint, getCommitMessage, isVersionCommitMessage, publish, release, updateVersion };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  interface PublishCommandOptions {
2
2
  preRelease?: boolean;
3
3
  checkRemoteVersion?: boolean;
4
+ npmTag?: string;
4
5
  }
5
- declare function publish({ preRelease, checkRemoteVersion }: PublishCommandOptions): Promise<void>;
6
+ declare function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>;
6
7
  declare function updateVersion(version: string): void;
7
8
  interface ReleaseCommandOptions {
8
9
  remote?: string;
10
+ npmTag?: string;
9
11
  skipNpmPublish?: boolean;
10
12
  skipChangelog?: boolean;
11
13
  skipGitTag?: boolean;
@@ -30,4 +32,4 @@ interface CommitLintCommandOptions {
30
32
  }
31
33
  declare function commitLint(options: CommitLintCommandOptions): void;
32
34
 
33
- export { COMMIT_MESSAGE_RE, type ChangelogCommandOptions, type CommitLintCommandOptions, type ReleaseCommandOptions, changelog, commitLint, getCommitMessage, isVersionCommitMessage, publish, release, updateVersion };
35
+ export { COMMIT_MESSAGE_RE, type ChangelogCommandOptions, type CommitLintCommandOptions, type PublishCommandOptions, type ReleaseCommandOptions, changelog, commitLint, getCommitMessage, isVersionCommitMessage, publish, release, updateVersion };
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ async function isWorktreeEmpty() {
57
57
  const ret = await execa("git", ["status", "--porcelain"]);
58
58
  return !ret.stdout;
59
59
  }
60
- async function publish({ preRelease, checkRemoteVersion }) {
60
+ async function publish({ preRelease, checkRemoteVersion, npmTag }) {
61
61
  const s = createSpinner2("Publishing all packages").start();
62
62
  const args = ["-r", "publish", "--no-git-checks", "--access", "public"];
63
63
  if (checkRemoteVersion) {
@@ -76,6 +76,8 @@ async function publish({ preRelease, checkRemoteVersion }) {
76
76
  }
77
77
  if (preRelease) {
78
78
  args.push("--tag", "alpha");
79
+ } else if (npmTag) {
80
+ args.push("--tag", npmTag);
79
81
  }
80
82
  const ret = await execa("pnpm", args);
81
83
  if (ret.stderr && ret.stderr.includes("npm ERR!")) {
@@ -192,7 +194,7 @@ async function release(options) {
192
194
  await options.task();
193
195
  }
194
196
  if (!options.skipNpmPublish) {
195
- await publish({ preRelease: isPreRelease });
197
+ await publish({ preRelease: isPreRelease, npmTag: options.npmTag });
196
198
  }
197
199
  if (!isPreRelease) {
198
200
  if (!options.skipChangelog) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@varlet/release",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.5",
5
5
  "description": "release all packages and generate changelogs",
6
6
  "keywords": [
7
7
  "varlet",