@shipstatic/drop 0.2.16 → 0.2.18
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 +59 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +59 -23
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/{useDrop-CRUVkVzW.d.cts → useDrop-DbGbhh56.d.cts} +2 -1
- package/dist/{useDrop-CRUVkVzW.d.ts → useDrop-DbGbhh56.d.ts} +2 -1
- package/package.json +6 -7
package/dist/index.cjs
CHANGED
|
@@ -11702,7 +11702,7 @@ var require_mime_db = __commonJS({
|
|
|
11702
11702
|
}
|
|
11703
11703
|
});
|
|
11704
11704
|
|
|
11705
|
-
// node_modules/.pnpm/@shipstatic+types@0.
|
|
11705
|
+
// node_modules/.pnpm/@shipstatic+types@0.5.0/node_modules/@shipstatic/types/dist/index.js
|
|
11706
11706
|
var ErrorType;
|
|
11707
11707
|
(function(ErrorType2) {
|
|
11708
11708
|
ErrorType2["Validation"] = "validation_failed";
|
|
@@ -11722,10 +11722,15 @@ var ErrorType;
|
|
|
11722
11722
|
auth: /* @__PURE__ */ new Set([ErrorType.Authentication])
|
|
11723
11723
|
});
|
|
11724
11724
|
var FileValidationStatus = {
|
|
11725
|
+
/** File is pending validation */
|
|
11725
11726
|
PENDING: "pending",
|
|
11727
|
+
/** File failed during processing (before validation) */
|
|
11726
11728
|
PROCESSING_ERROR: "processing_error",
|
|
11727
|
-
|
|
11729
|
+
/** File was excluded by validation warning (not an error) */
|
|
11730
|
+
EXCLUDED: "excluded",
|
|
11731
|
+
/** File failed validation (blocks deployment) */
|
|
11728
11732
|
VALIDATION_FAILED: "validation_failed",
|
|
11733
|
+
/** File passed validation and is ready for deployment */
|
|
11729
11734
|
READY: "ready"
|
|
11730
11735
|
};
|
|
11731
11736
|
|
|
@@ -12019,40 +12024,72 @@ function useDrop(options) {
|
|
|
12019
12024
|
status: validation.files[idx]?.status || processedFile.status,
|
|
12020
12025
|
statusMessage: validation.files[idx]?.statusMessage || processedFile.statusMessage
|
|
12021
12026
|
}));
|
|
12022
|
-
if (validation.
|
|
12027
|
+
if (!validation.canDeploy) {
|
|
12028
|
+
const errorMessages = validation.errors.map(
|
|
12029
|
+
(err) => `${err.file}: ${err.message}`
|
|
12030
|
+
);
|
|
12023
12031
|
setState({
|
|
12024
12032
|
value: "error",
|
|
12025
12033
|
files: filesWithStatus,
|
|
12026
12034
|
sourceName: detectedSourceName,
|
|
12027
12035
|
status: {
|
|
12028
|
-
title:
|
|
12029
|
-
details: validation.
|
|
12030
|
-
errors:
|
|
12036
|
+
title: "Validation Failed",
|
|
12037
|
+
details: `${validation.errors.length} file(s) failed validation`,
|
|
12038
|
+
errors: errorMessages
|
|
12031
12039
|
}
|
|
12032
12040
|
});
|
|
12033
|
-
onValidationError?.(
|
|
12041
|
+
onValidationError?.({
|
|
12042
|
+
error: "Validation Failed",
|
|
12043
|
+
details: `${validation.errors.length} error(s)`,
|
|
12044
|
+
errors: errorMessages,
|
|
12045
|
+
isClientError: true
|
|
12046
|
+
});
|
|
12034
12047
|
} else if (validation.validFiles.length > 0) {
|
|
12048
|
+
let details = `${validation.validFiles.length} file(s) ready`;
|
|
12049
|
+
if (validation.warnings.length > 0) {
|
|
12050
|
+
details += ` (${validation.warnings.length} empty file(s) excluded)`;
|
|
12051
|
+
}
|
|
12035
12052
|
setState({
|
|
12036
12053
|
value: "ready",
|
|
12037
12054
|
files: filesWithStatus,
|
|
12038
12055
|
sourceName: detectedSourceName,
|
|
12039
|
-
status: {
|
|
12056
|
+
status: {
|
|
12057
|
+
title: "Ready",
|
|
12058
|
+
details,
|
|
12059
|
+
warnings: validation.warnings.length > 0 ? validation.warnings.map((w) => `${w.file}: ${w.message}`) : void 0
|
|
12060
|
+
}
|
|
12040
12061
|
});
|
|
12041
|
-
onFilesReady?.(filesWithStatus.filter(
|
|
12062
|
+
onFilesReady?.(filesWithStatus.filter(
|
|
12063
|
+
(f, idx) => validation.files[idx]?.status === "ready"
|
|
12064
|
+
));
|
|
12042
12065
|
} else {
|
|
12043
|
-
const
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12066
|
+
const hasOnlyWarnings = validation.errors.length === 0 && validation.warnings.length > 0;
|
|
12067
|
+
if (hasOnlyWarnings) {
|
|
12068
|
+
setState({
|
|
12069
|
+
value: "ready",
|
|
12070
|
+
files: filesWithStatus,
|
|
12071
|
+
sourceName: detectedSourceName,
|
|
12072
|
+
status: {
|
|
12073
|
+
title: "All files excluded",
|
|
12074
|
+
details: `${validation.warnings.length} file(s) excluded (empty files cannot be deployed)`,
|
|
12075
|
+
warnings: validation.warnings.map((w) => `${w.file}: ${w.message}`)
|
|
12076
|
+
}
|
|
12077
|
+
});
|
|
12078
|
+
} else {
|
|
12079
|
+
const noValidError = {
|
|
12080
|
+
error: "No Valid Files",
|
|
12081
|
+
details: "None of the provided files could be processed.",
|
|
12082
|
+
errors: [],
|
|
12083
|
+
isClientError: true
|
|
12084
|
+
};
|
|
12085
|
+
setState({
|
|
12086
|
+
value: "error",
|
|
12087
|
+
files: filesWithStatus,
|
|
12088
|
+
sourceName: detectedSourceName,
|
|
12089
|
+
status: { title: noValidError.error, details: noValidError.details }
|
|
12090
|
+
});
|
|
12091
|
+
onValidationError?.(noValidError);
|
|
12092
|
+
}
|
|
12056
12093
|
}
|
|
12057
12094
|
} catch (error) {
|
|
12058
12095
|
const processingError = {
|
|
@@ -12094,7 +12131,6 @@ function useDrop(options) {
|
|
|
12094
12131
|
const errorStatuses = [
|
|
12095
12132
|
FILE_STATUSES.VALIDATION_FAILED,
|
|
12096
12133
|
FILE_STATUSES.PROCESSING_ERROR,
|
|
12097
|
-
FILE_STATUSES.EMPTY_FILE,
|
|
12098
12134
|
FILE_STATUSES.ERROR
|
|
12099
12135
|
];
|
|
12100
12136
|
const hasErrors = prev.files.some((f) => errorStatuses.includes(f.status));
|