@varlet/release 0.2.3 → 0.2.4
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 +6 -2
- package/README.zh-CN.md +5 -1
- package/bin/index.js +2 -0
- package/dist/index.cjs +5 -2
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -2
- package/package.json +1 -1
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) {
|
|
@@ -120,6 +120,9 @@ async function publish({ preRelease, checkRemoteVersion }) {
|
|
|
120
120
|
if (preRelease) {
|
|
121
121
|
args.push("--tag", "alpha");
|
|
122
122
|
}
|
|
123
|
+
if (npmTag) {
|
|
124
|
+
args.push("--tag", npmTag);
|
|
125
|
+
}
|
|
123
126
|
const ret = await (0, import_execa.execa)("pnpm", args);
|
|
124
127
|
if (ret.stderr && ret.stderr.includes("npm ERR!")) {
|
|
125
128
|
throw new Error("\n" + ret.stderr);
|
|
@@ -235,7 +238,7 @@ async function release(options) {
|
|
|
235
238
|
await options.task();
|
|
236
239
|
}
|
|
237
240
|
if (!options.skipNpmPublish) {
|
|
238
|
-
await publish({ preRelease: isPreRelease });
|
|
241
|
+
await publish({ preRelease: isPreRelease, npmTag: options.npmTag });
|
|
239
242
|
}
|
|
240
243
|
if (!isPreRelease) {
|
|
241
244
|
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) {
|
|
@@ -77,6 +77,9 @@ async function publish({ preRelease, checkRemoteVersion }) {
|
|
|
77
77
|
if (preRelease) {
|
|
78
78
|
args.push("--tag", "alpha");
|
|
79
79
|
}
|
|
80
|
+
if (npmTag) {
|
|
81
|
+
args.push("--tag", npmTag);
|
|
82
|
+
}
|
|
80
83
|
const ret = await execa("pnpm", args);
|
|
81
84
|
if (ret.stderr && ret.stderr.includes("npm ERR!")) {
|
|
82
85
|
throw new Error("\n" + ret.stderr);
|
|
@@ -192,7 +195,7 @@ async function release(options) {
|
|
|
192
195
|
await options.task();
|
|
193
196
|
}
|
|
194
197
|
if (!options.skipNpmPublish) {
|
|
195
|
-
await publish({ preRelease: isPreRelease });
|
|
198
|
+
await publish({ preRelease: isPreRelease, npmTag: options.npmTag });
|
|
196
199
|
}
|
|
197
200
|
if (!isPreRelease) {
|
|
198
201
|
if (!options.skipChangelog) {
|