@shipstatic/drop 2.15.1-beta.0 → 2.15.1-beta.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/dist/index.js CHANGED
@@ -3,89 +3,6 @@ import ignore from 'ignore';
3
3
  import { useState, useRef, useMemo, useCallback } from 'react';
4
4
 
5
5
  // src/process.ts
6
- var ErrorType = {
7
- /**
8
- * Validation failed. Input shape is wrong.
9
- *
10
- * Carries 400 when an API judged it — including a client-side pre-check of a
11
- * rule the server enforces too, which keeps the error identical wherever it
12
- * was caught. **Statusless** when a client rejects something no API judges,
13
- * such as a CLI's own command grammar: `status` is documented "(API
14
- * contexts)" on `ErrorResponse`, so there is none to report.
15
- */
16
- Validation: "validation_failed",
17
- /** Resource not found (404). */
18
- NotFound: "not_found",
19
- /** Authenticated but not allowed (403). User lacks permission for this action. */
20
- Forbidden: "forbidden",
21
- /** Rate limit exceeded (429). */
22
- RateLimit: "rate_limit_exceeded",
23
- /** Authentication required or failed (401). Missing/invalid credentials. */
24
- Authentication: "authentication_failed",
25
- /** Business rule violation. Catch-all for 4xx state-rule errors that aren't more specific. */
26
- Business: "business_logic_error",
27
- /** API server error (500). Generic server-side fault. */
28
- Api: "internal_server_error",
29
- /**
30
- * The platform is closed for maintenance (503). A deliberate operator
31
- * state, not a fault — nothing errored; the API is refusing work on
32
- * purpose, and deployed sites keep serving throughout.
33
- *
34
- * Distinct from `Api` at 503, which the platform already uses for a
35
- * dependency that failed. A consumer has to tell
36
- * "we closed the door" from "something broke": the two get opposite words
37
- * and opposite retry behaviour.
38
- */
39
- Maintenance: "maintenance",
40
- /**
41
- * The project could not be built as submitted (422). The platform ran the
42
- * caller's own instructions, the dependency install and then the build
43
- * script, and they failed. So the verdict is the caller's: deterministic,
44
- * not worth a retry, and answered with the evidence. `details` is a
45
- * `BuildFailureDetails`, and the message is the one sentence the builder
46
- * authored for the person who will fix the project.
47
- *
48
- * Distinct from `Api` at 500, which is what the platform answers when it
49
- * could not RUN the build at all (the sandbox failed to start, a host
50
- * fault). A consumer has to tell "your project cannot be built" from "we
51
- * could not build it": the two get opposite words, opposite retry
52
- * behaviour, and only the second pages an operator.
53
- */
54
- Build: "build_failed",
55
- /** Network/connection error. Client-side only — set by HTTP clients on fetch failure; never produced server-side. */
56
- Network: "network_error",
57
- /**
58
- * A deadline expired before the exchange completed. Client-side only — set
59
- * by HTTP clients when a timeout signal fires; never produced server-side.
60
- *
61
- * A member of the NETWORK category rather than a sibling of it:
62
- * `isNetworkError()` answers "nothing was exchanged", which is true of a
63
- * deadline exactly as it is of a refused connection, so every consumer that
64
- * retries, declines to report, or declines to relay a wire message on that
65
- * category is already right about a timeout. The distinct TYPE exists for
66
- * the one decision the category cannot make — what to SAY. "Check your
67
- * internet connection" is the wrong sentence for a five-minute deploy
68
- * ceiling, and a surface can only tell the two apart by type.
69
- *
70
- * The same relationship every comparable SDK ships:
71
- * `APIConnectionTimeoutError extends APIConnectionError`.
72
- */
73
- Timeout: "timeout_error",
74
- /** Operation was cancelled. Client-side only — set on `AbortSignal` abort; never produced server-side. */
75
- Cancelled: "operation_cancelled",
76
- /** File operation error. Client-side only — set by SDK during local file processing; never produced server-side. */
77
- File: "file_error",
78
- /** Configuration error. Client-side only — set by SDK during config parsing/validation; never produced server-side. */
79
- Config: "config_error"
80
- };
81
- var CLIENT_ONLY_ERROR_TYPES = /* @__PURE__ */ new Set([
82
- ErrorType.Network,
83
- ErrorType.Timeout,
84
- ErrorType.Cancelled,
85
- ErrorType.File,
86
- ErrorType.Config
87
- ]);
88
- new Set(Object.values(ErrorType).filter((t) => !CLIENT_ONLY_ERROR_TYPES.has(t)));
89
6
  var WEB_FILE_EXTENSIONS = [
90
7
  // Markup & documents
91
8
  "html",
@@ -169,7 +86,7 @@ var WEB_FILE_EXTENSIONS = [
169
86
  // Archive — a whole site in one file
170
87
  "zip"
171
88
  ];
172
- var WEB_FILE_ACCEPT = WEB_FILE_EXTENSIONS.map((ext) => `.${ext}`).join(",");
89
+ var WEB_FILE_ACCEPT = /* @__PURE__ */ (() => WEB_FILE_EXTENSIONS.map((ext) => `.${ext}`).join(","))();
173
90
  var UNBUILT_PROJECT_MARKERS = /* @__PURE__ */ new Set([
174
91
  "node_modules",
175
92
  "package.json"
@@ -178,41 +95,6 @@ function hasUnbuiltMarker(filePath2) {
178
95
  const segments2 = filePath2.replace(/\\/g, "/").split("/").filter(Boolean);
179
96
  return segments2.some((s) => UNBUILT_PROJECT_MARKERS.has(s));
180
97
  }
181
- var BILLING_RETURNS = {
182
- checkout: ["upgrading", "true"],
183
- portal: ["billing", "returned"]
184
- };
185
- var marker = (kind) => BILLING_RETURNS[kind].join("=");
186
- var withNext = (door, next) => next ? `${door}?next=${encodeURIComponent(next)}` : door;
187
- function consolePaths(account) {
188
- const base = "";
189
- const at = (path) => `${base}${path}`;
190
- return {
191
- dashboard: () => "/",
192
- newSite: () => at("/new"),
193
- deployments: Object.assign(() => at("/deployments"), {
194
- upload: () => at("/deployments/upload")
195
- }),
196
- domains: Object.assign(() => at("/domains"), {
197
- connect: (domain) => at(`/domains/${domain}/connect`),
198
- deployment: (domain) => at(`/domains/${domain}/deployment`)
199
- }),
200
- settings: (fragment) => at(fragment ? `/settings#${fragment}` : "/settings"),
201
- /** The claim of an anonymous deployment into this account; the API mails the bare form. */
202
- claim: (code) => at(`/claim/${code}`),
203
- /** Settings, marked as the landing of a Stripe Customer Portal return. */
204
- settingsAfterBilling: () => at(`/settings?${marker("portal")}`),
205
- upgrade: (plan) => at(plan ? `/upgrade/${plan}` : "/upgrade"),
206
- success: () => at("/success"),
207
- /** The success page, marked as the landing of a Stripe Checkout return. */
208
- successAfterCheckout: () => at(`/success?${marker("checkout")}`),
209
- apiKey: () => at("/api-key")
210
- };
211
- }
212
- Object.assign(({ next } = {}) => withNext("/login", next), {
213
- link: ({ token, next }) => withNext(`/login/link/${token}`, next)
214
- });
215
- `https://my.shipstatic.com${consolePaths().apiKey()}`;
216
98
  var FileValidationStatus = {
217
99
  /** File is pending validation */
218
100
  PENDING: "pending",