@shipstatic/drop 2.14.1-beta.1 → 2.15.0-beta.0
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 +6 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -28
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -267,7 +267,7 @@ function applyStatus(files, status, statusMessage) {
|
|
|
267
267
|
return files.map((f) => ({
|
|
268
268
|
...f,
|
|
269
269
|
status,
|
|
270
|
-
...
|
|
270
|
+
...{}
|
|
271
271
|
}));
|
|
272
272
|
}
|
|
273
273
|
var NEVER_SOURCE = /* @__PURE__ */ new Set(["node_modules", ".git", "__MACOSX"]);
|
|
@@ -1037,15 +1037,6 @@ async function processFiles(input, { limits, onStatus }) {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
};
|
|
1039
1039
|
}
|
|
1040
|
-
if (finalFiles.length > 0 && !finalFiles.some((f) => f.path === "index.html")) {
|
|
1041
|
-
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.";
|
|
1042
|
-
return failure({
|
|
1043
|
-
title: CANT_DEPLOY,
|
|
1044
|
-
details,
|
|
1045
|
-
sourceName,
|
|
1046
|
-
files: applyStatus(finalFiles, FileValidationStatus.VALIDATION_FAILED, details)
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
1040
|
const validation = ship.validateFiles(finalFiles.map(toValidatable), limits);
|
|
1050
1041
|
const validated = finalFiles.map((file, i) => ({
|
|
1051
1042
|
...file,
|
|
@@ -1056,36 +1047,23 @@ async function processFiles(input, { limits, onStatus }) {
|
|
|
1056
1047
|
const issues = validation.errors.map((e) => e.message);
|
|
1057
1048
|
return failure({
|
|
1058
1049
|
title: CANT_DEPLOY,
|
|
1059
|
-
...issues.length === 1 ? { details: issues[0] } : { details: `${issues.length}
|
|
1050
|
+
...issues.length === 1 ? { details: issues[0] } : { details: `${issues.length} things to fix`, errors: issues },
|
|
1060
1051
|
files: validated,
|
|
1061
1052
|
sourceName
|
|
1062
1053
|
});
|
|
1063
1054
|
}
|
|
1064
1055
|
const readyCount = validated.filter((f) => f.status === FileValidationStatus.READY).length;
|
|
1065
1056
|
const warnings = validation.warnings.map((w) => w.message);
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
details += ` (${ship.pluralize(validation.warnings.length, "empty file", "empty files", true)} excluded)`;
|
|
1070
|
-
}
|
|
1071
|
-
return {
|
|
1072
|
-
phase: "ready",
|
|
1073
|
-
files: validated,
|
|
1074
|
-
sourceName,
|
|
1075
|
-
needsBuild: false,
|
|
1076
|
-
status: { title: "Ready", details, ...warnings.length ? { warnings } : {} }
|
|
1077
|
-
};
|
|
1057
|
+
let details = `${ship.pluralize(readyCount, "file", "files", true)} ready`;
|
|
1058
|
+
if (validation.warnings.length > 0) {
|
|
1059
|
+
details += ` (${ship.pluralize(validation.warnings.length, "empty file", "empty files", true)} excluded)`;
|
|
1078
1060
|
}
|
|
1079
1061
|
return {
|
|
1080
1062
|
phase: "ready",
|
|
1081
1063
|
files: validated,
|
|
1082
1064
|
sourceName,
|
|
1083
1065
|
needsBuild: false,
|
|
1084
|
-
status: {
|
|
1085
|
-
title: "All files excluded",
|
|
1086
|
-
details: `${ship.pluralize(validation.warnings.length, "file", "files", true)} excluded (empty files cannot be deployed)`,
|
|
1087
|
-
warnings
|
|
1088
|
-
}
|
|
1066
|
+
status: { title: "Ready", details, ...warnings.length ? { warnings } : {} }
|
|
1089
1067
|
};
|
|
1090
1068
|
} catch (error) {
|
|
1091
1069
|
const message = error instanceof Error ? error.message : String(error);
|