@vltpkg/cli-sdk 1.0.5 → 1.0.6

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.
@@ -127,7 +127,7 @@ export const command = async (conf) => {
127
127
  cause: asError(err),
128
128
  });
129
129
  }
130
- if (response.statusCode !== 200 && response.statusCode !== 201) {
130
+ if (response.statusCode < 200 || response.statusCode >= 300) {
131
131
  throw error('failed to update deprecation status', {
132
132
  url: packageUrl,
133
133
  response,
@@ -13,6 +13,7 @@ import { createHostContextsMap } from "../query-host-contexts.js";
13
13
  import { minimatch } from 'minimatch';
14
14
  import { resolveRegistry } from "../require-registry.js";
15
15
  import { registryErrorMessage } from "../registry-error-message.js";
16
+ import { stderr } from "../output.js";
16
17
  export const needsRegistry = true;
17
18
  export const usage = () => commandUsage({
18
19
  command: 'publish',
@@ -264,7 +265,10 @@ const commandSingle = async (location, conf) => {
264
265
  cause: asError(err),
265
266
  });
266
267
  }
267
- if (response.statusCode !== 200 && response.statusCode !== 201) {
268
+ // Any 2xx response is a successful publish. The npm registry may
269
+ // respond with a 202 Accepted when processing is deferred (e.g. for
270
+ // publish-time malware scanning).
271
+ if (response.statusCode < 200 || response.statusCode >= 300) {
268
272
  let advice = '';
269
273
  if (response.statusCode === 409) {
270
274
  advice = `\n⚠️ ${name}@${version} already exists in the registry. Bump the version and try again.`;
@@ -278,6 +282,12 @@ const commandSingle = async (location, conf) => {
278
282
  response,
279
283
  });
280
284
  }
285
+ // On deferred publishes the registry explains the delay in an
286
+ // npm-notice header, e.g. "Your package is being processed and may
287
+ // take a few minutes to become available."
288
+ const notice = response.getHeaderString('npm-notice');
289
+ if (notice)
290
+ stderr(`⚠️ ${notice}`);
281
291
  }
282
292
  await run({
283
293
  ...runOptions,
@@ -141,7 +141,7 @@ export const command = async (conf) => {
141
141
  cause: asError(err),
142
142
  });
143
143
  }
144
- if (response.statusCode !== 200 && response.statusCode !== 201) {
144
+ if (response.statusCode < 200 || response.statusCode >= 300) {
145
145
  throw error('Failed to unpublish package version', {
146
146
  url: putUrl,
147
147
  response,
@@ -188,7 +188,7 @@ export const command = async (conf) => {
188
188
  cause: asError(err),
189
189
  });
190
190
  }
191
- if (response.statusCode !== 200 && response.statusCode !== 201) {
191
+ if (response.statusCode < 200 || response.statusCode >= 300) {
192
192
  throw error('Failed to unpublish package', {
193
193
  url: deleteUrl,
194
194
  response,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/cli-sdk",
3
3
  "description": "The source for the vlt CLI",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -14,30 +14,30 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@resvg/resvg-wasm": "^2.6.2",
17
- "@vltpkg/config": "1.0.5",
18
- "@vltpkg/dep-id": "1.0.5",
19
- "@vltpkg/dot-prop": "1.0.5",
20
- "@vltpkg/error-cause": "1.0.5",
21
- "@vltpkg/git": "1.0.5",
22
- "@vltpkg/graph": "1.0.5",
23
- "@vltpkg/graph-run": "1.0.5",
24
- "@vltpkg/init": "1.0.5",
25
- "@vltpkg/output": "1.0.5",
26
- "@vltpkg/package-info": "1.0.5",
27
- "@vltpkg/package-json": "1.0.5",
28
- "@vltpkg/promise-spawn": "1.0.5",
29
- "@vltpkg/query": "1.0.5",
30
- "@vltpkg/registry-client": "1.0.5",
31
- "@vltpkg/rollback-remove": "1.0.5",
32
- "@vltpkg/run": "1.0.5",
33
- "@vltpkg/security-archive": "1.0.5",
34
- "@vltpkg/spec": "1.0.5",
35
- "@vltpkg/types": "1.0.5",
36
- "@vltpkg/url-open": "1.0.5",
37
- "@vltpkg/vlt-json": "1.0.5",
38
- "@vltpkg/vlx": "1.0.5",
39
- "@vltpkg/workspaces": "1.0.5",
40
- "@vltpkg/xdg": "1.0.5",
17
+ "@vltpkg/config": "1.0.6",
18
+ "@vltpkg/dep-id": "1.0.6",
19
+ "@vltpkg/dot-prop": "1.0.6",
20
+ "@vltpkg/error-cause": "1.0.6",
21
+ "@vltpkg/git": "1.0.6",
22
+ "@vltpkg/graph": "1.0.6",
23
+ "@vltpkg/graph-run": "1.0.6",
24
+ "@vltpkg/init": "1.0.6",
25
+ "@vltpkg/output": "1.0.6",
26
+ "@vltpkg/package-info": "1.0.6",
27
+ "@vltpkg/package-json": "1.0.6",
28
+ "@vltpkg/promise-spawn": "1.0.6",
29
+ "@vltpkg/query": "1.0.6",
30
+ "@vltpkg/registry-client": "1.0.6",
31
+ "@vltpkg/rollback-remove": "1.0.6",
32
+ "@vltpkg/run": "1.0.6",
33
+ "@vltpkg/security-archive": "1.0.6",
34
+ "@vltpkg/spec": "1.0.6",
35
+ "@vltpkg/types": "1.0.6",
36
+ "@vltpkg/url-open": "1.0.6",
37
+ "@vltpkg/vlt-json": "1.0.6",
38
+ "@vltpkg/vlx": "1.0.6",
39
+ "@vltpkg/workspaces": "1.0.6",
40
+ "@vltpkg/xdg": "1.0.6",
41
41
  "ansi-to-pre": "^1.0.6",
42
42
  "beautiful-mermaid": "^1.1.3",
43
43
  "chalk": "^5.6.2",