@sanity/plugin-kit

7.0.28.0.0
dist/verify-common-CzG3zw3J.js
+dist/verify-common-CzG3zw3J.jsNew file
+39
Index: package/dist/verify-common-CzG3zw3J.js
===================================================================
--- package/dist/verify-common-CzG3zw3J.js
+++ package/dist/verify-common-CzG3zw3J.js
@@ -0,0 +1,39 @@
+import { n as sharedFlags_default, t as log_default } from "./log-DgQL-Rv9.js";
+import chalk from "chalk";
+import outdent from "outdent";
+const verifyFlags = {
+	...sharedFlags_default,
+	single: {
+		default: !1,
+		type: "boolean"
+	}
+};
+function disableCheckText(checkKey) {
+	return chalk.grey(outdent`
+              To skip this validation add the following to your package.json:
+              "sanityPlugin": {
+                 "verifyPackage": {
+                    "${checkKey}": false
+                 }
+              }
+          `.trimStart());
+}
+function createValidator(verifyConfig, flags, errors) {
+	return async function(checkKey, task) {
+		if (verifyConfig[checkKey] !== !1) {
+			let result = await task();
+			if (result?.length) {
+				result.push(disableCheckText(checkKey));
+				let errorMessage = result.join("\n\n");
+				errors.push(errorMessage), log_default.error("\n" + errorMessage + "\n----------------------------------------------------------");
+			}
+		}
+		if (flags.single && errors.length) throw Error(outdent`Detected outstanding upgrade issues.
+
+        Fail-fast (--single) mode enabled, stopping validation here.
+        `);
+	};
+}
+export { verifyFlags as n, createValidator as t };
+
+//# sourceMappingURL=verify-common-CzG3zw3J.js.map
\ No newline at end of file