@shipstatic/drop 2.13.0-beta.0 → 2.13.0-beta.2

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
@@ -86,9 +86,6 @@ var CLIENT_ONLY_ERROR_TYPES = /* @__PURE__ */ new Set([
86
86
  ErrorType.Config
87
87
  ]);
88
88
  new Set(Object.values(ErrorType).filter((t) => !CLIENT_ONLY_ERROR_TYPES.has(t)));
89
- function isShipError(error) {
90
- return error !== null && typeof error === "object" && "name" in error && error.name === "ShipError" && "status" in error;
91
- }
92
89
  var WEB_FILE_EXTENSIONS = [
93
90
  // Markup & documents
94
91
  "html",
@@ -271,7 +268,7 @@ function segments(file) {
271
268
  return filePath(file).replace(/\\/g, "/").split("/").filter(Boolean);
272
269
  }
273
270
  function rebase(line, base) {
274
- const pattern = line.replace(/(?<!\\) +$/, "");
271
+ const pattern = line.replace(/(\\ )? *$/, (_, escaped) => escaped ?? "");
275
272
  if (pattern === "" || pattern.startsWith("#")) return null;
276
273
  if (base === "") return pattern;
277
274
  const negated = pattern.startsWith("!");
@@ -1026,7 +1023,7 @@ async function processFiles(input, { limits, onStatus }) {
1026
1023
  };
1027
1024
  }
1028
1025
  if (finalFiles.length > 0 && !finalFiles.some((f) => f.path === "index.html")) {
1029
- const details = "No index.html at root \u2014 the entry point must be in the top-level directory";
1026
+ const details = "There's no index.html at the top of what you chose. It's the page visitors see first, so your site needs one there.";
1030
1027
  return failure({
1031
1028
  title: CANT_DEPLOY,
1032
1029
  details,
@@ -1077,10 +1074,9 @@ async function processFiles(input, { limits, onStatus }) {
1077
1074
  };
1078
1075
  } catch (error) {
1079
1076
  const message = error instanceof Error ? error.message : String(error);
1080
- const isValidation = isShipError(error);
1081
1077
  return failure({
1082
- title: isValidation ? CANT_DEPLOY : COULDNT_PREPARE,
1083
- details: isValidation ? message : `Failed to process files: ${message}`,
1078
+ title: COULDNT_PREPARE,
1079
+ details: message,
1084
1080
  sourceName
1085
1081
  });
1086
1082
  }