@containerbase/semantic-release-pnpm 1.4.0 → 1.4.1
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/lib/index.js +24 -47
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import { execa } from "execa";
|
|
10
10
|
import "semantic-release";
|
|
11
|
-
import
|
|
11
|
+
import AggregateError from "aggregate-error";
|
|
12
12
|
|
|
13
13
|
// src/get-error.ts
|
|
14
14
|
import SemanticReleaseError from "@semantic-release/error";
|
|
@@ -57,27 +57,6 @@ function getChannel(channel) {
|
|
|
57
57
|
return channel ? validRange(channel) ? `release-${channel}` : channel : "latest";
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// src/get-pkg.ts
|
|
61
|
-
import path from "path";
|
|
62
|
-
import { readPackage } from "read-pkg";
|
|
63
|
-
import AggregateError from "aggregate-error";
|
|
64
|
-
async function getPkg(cwd, pkgRoot) {
|
|
65
|
-
try {
|
|
66
|
-
const pkg = await readPackage({
|
|
67
|
-
cwd: pkgRoot ? path.resolve(cwd, pkgRoot) : cwd
|
|
68
|
-
});
|
|
69
|
-
if (!pkg.name) {
|
|
70
|
-
throw get_error_default("ENOPKGNAME");
|
|
71
|
-
}
|
|
72
|
-
return pkg;
|
|
73
|
-
} catch (error) {
|
|
74
|
-
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
75
|
-
throw new AggregateError([get_error_default("ENOPKG")]);
|
|
76
|
-
}
|
|
77
|
-
throw new AggregateError([error]);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
60
|
// src/index.ts
|
|
82
61
|
async function verifyConditions(_pluginConfig, { cwd = ".", env, stderr, stdout, logger }) {
|
|
83
62
|
logger.log(`Verifying registry access`);
|
|
@@ -101,7 +80,7 @@ async function verifyConditions(_pluginConfig, { cwd = ".", env, stderr, stdout,
|
|
|
101
80
|
);
|
|
102
81
|
for (const line of [...res.stdout, ...res.stderr]) {
|
|
103
82
|
if (line.includes("This command requires you to be logged in to ")) {
|
|
104
|
-
throw new
|
|
83
|
+
throw new AggregateError([get_error_default("EINVALIDNPMAUTH")]);
|
|
105
84
|
}
|
|
106
85
|
}
|
|
107
86
|
}
|
|
@@ -116,33 +95,30 @@ async function prepare(_pluginConfig, {
|
|
|
116
95
|
logger.log("Write version %s to package.json in %s", version, cwd);
|
|
117
96
|
const errors = [];
|
|
118
97
|
try {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
}
|
|
98
|
+
await execa(
|
|
99
|
+
"npm",
|
|
100
|
+
[
|
|
101
|
+
"version",
|
|
102
|
+
version,
|
|
103
|
+
"--no-git-tag-version",
|
|
104
|
+
"--allow-same-version",
|
|
105
|
+
"--ignore-scripts"
|
|
106
|
+
],
|
|
107
|
+
{
|
|
108
|
+
cwd,
|
|
109
|
+
env,
|
|
110
|
+
stdout,
|
|
111
|
+
stderr
|
|
112
|
+
}
|
|
113
|
+
);
|
|
138
114
|
} catch (err) {
|
|
139
|
-
if (err instanceof
|
|
115
|
+
if (err instanceof AggregateError) {
|
|
140
116
|
errors.push(...err.errors);
|
|
141
117
|
}
|
|
142
118
|
errors.push(err);
|
|
143
119
|
}
|
|
144
120
|
if (errors.length > 0) {
|
|
145
|
-
throw new
|
|
121
|
+
throw new AggregateError(errors);
|
|
146
122
|
}
|
|
147
123
|
try {
|
|
148
124
|
await execa(
|
|
@@ -150,11 +126,12 @@ async function prepare(_pluginConfig, {
|
|
|
150
126
|
[
|
|
151
127
|
"-r",
|
|
152
128
|
"exec",
|
|
153
|
-
"
|
|
129
|
+
"npm",
|
|
154
130
|
"version",
|
|
155
131
|
version,
|
|
156
132
|
"--no-git-tag-version",
|
|
157
|
-
"--allow-same-version"
|
|
133
|
+
"--allow-same-version",
|
|
134
|
+
"--ignore-scripts"
|
|
158
135
|
],
|
|
159
136
|
{
|
|
160
137
|
cwd,
|
|
@@ -167,7 +144,7 @@ async function prepare(_pluginConfig, {
|
|
|
167
144
|
errors.push(err);
|
|
168
145
|
}
|
|
169
146
|
if (errors.length > 0) {
|
|
170
|
-
throw new
|
|
147
|
+
throw new AggregateError(errors);
|
|
171
148
|
}
|
|
172
149
|
}
|
|
173
150
|
async function publish(_pluginConfig, {
|