@shipstatic/drop 2.10.4-beta.10 → 2.10.4-beta.11

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.cjs CHANGED
@@ -934,6 +934,8 @@ function isZipFile(file) {
934
934
  }
935
935
 
936
936
  // src/process.ts
937
+ var CANT_DEPLOY = "Can't deploy this";
938
+ var COULDNT_PREPARE = "Couldn't prepare the files";
937
939
  function toValidatable(file) {
938
940
  return { name: file.path, size: file.size };
939
941
  }
@@ -985,7 +987,7 @@ async function processFiles(input, { limits, onStatus }) {
985
987
  if (!hasIndex) {
986
988
  const details = needsBuild ? "No index.html found \u2014 every web project needs an index.html entry point" : "No index.html at root \u2014 the entry point must be in the top-level directory";
987
989
  return failure({
988
- title: "Validation Failed",
990
+ title: CANT_DEPLOY,
989
991
  details,
990
992
  sourceName,
991
993
  needsBuild,
@@ -1014,15 +1016,15 @@ async function processFiles(input, { limits, onStatus }) {
1014
1016
  }));
1015
1017
  if (!validation.canDeploy) {
1016
1018
  return failure({
1017
- title: "Validation Failed",
1018
- details: `${ship.pluralize(validation.errors.length, "file", "files", true)} failed validation`,
1019
- errors: validation.errors.map((e) => `${e.file}: ${e.message}`),
1019
+ title: CANT_DEPLOY,
1020
+ details: `${ship.pluralize(validation.errors.length, "file", "files", true)} refused`,
1021
+ errors: validation.errors.map((e) => e.message),
1020
1022
  files: validated,
1021
1023
  sourceName
1022
1024
  });
1023
1025
  }
1024
1026
  const readyCount = validated.filter((f) => f.status === FileValidationStatus.READY).length;
1025
- const warnings = validation.warnings.map((w) => `${w.file}: ${w.message}`);
1027
+ const warnings = validation.warnings.map((w) => w.message);
1026
1028
  if (readyCount > 0) {
1027
1029
  let details = `${ship.pluralize(readyCount, "file", "files", true)} ready`;
1028
1030
  if (validation.warnings.length > 0) {
@@ -1036,30 +1038,22 @@ async function processFiles(input, { limits, onStatus }) {
1036
1038
  status: { title: "Ready", details, ...warnings.length ? { warnings } : {} }
1037
1039
  };
1038
1040
  }
1039
- if (validation.errors.length === 0 && validation.warnings.length > 0) {
1040
- return {
1041
- phase: "ready",
1042
- files: validated,
1043
- sourceName,
1044
- needsBuild: false,
1045
- status: {
1046
- title: "All files excluded",
1047
- details: `${ship.pluralize(validation.warnings.length, "file", "files", true)} excluded (empty files cannot be deployed)`,
1048
- warnings
1049
- }
1050
- };
1051
- }
1052
- return failure({
1053
- title: "No Valid Files",
1054
- details: "None of the provided files could be processed.",
1041
+ return {
1042
+ phase: "ready",
1055
1043
  files: validated,
1056
- sourceName
1057
- });
1044
+ sourceName,
1045
+ needsBuild: false,
1046
+ status: {
1047
+ title: "All files excluded",
1048
+ details: `${ship.pluralize(validation.warnings.length, "file", "files", true)} excluded (empty files cannot be deployed)`,
1049
+ warnings
1050
+ }
1051
+ };
1058
1052
  } catch (error) {
1059
1053
  const message = error instanceof Error ? error.message : String(error);
1060
1054
  const isValidation = isShipError(error);
1061
1055
  return failure({
1062
- title: isValidation ? "Validation Failed" : "Processing Failed",
1056
+ title: isValidation ? CANT_DEPLOY : COULDNT_PREPARE,
1063
1057
  details: isValidation ? message : `Failed to process files: ${message}`,
1064
1058
  sourceName
1065
1059
  });
@@ -1169,7 +1163,7 @@ function useDrop({ ship }) {
1169
1163
  ...initialState,
1170
1164
  phase: "error",
1171
1165
  status: {
1172
- title: "Processing Failed",
1166
+ title: COULDNT_PREPARE,
1173
1167
  details: error instanceof Error ? error.message : String(error)
1174
1168
  }
1175
1169
  });