@sanity/plugin-kit
7.0.28.0.0
dist/verify-package-Bfi7IL_f.js−
dist/verify-package-Bfi7IL_f.jsDeleted−89
Index: package/dist/verify-package-Bfi7IL_f.js
===================================================================
--- package/dist/verify-package-Bfi7IL_f.js
+++ package/dist/verify-package-Bfi7IL_f.js
@@ -1,89 +0,0 @@
-import { a as urls, t as cliName } from "./constants-BDxElAZy.js";
-import { t as log_default } from "./log-DgQL-Rv9.js";
-import { C as validatePackageName, D as validateSanityDependencies, E as validatePkgUtilsVersion, O as validateScripts, S as validateNodeEngine, T as validatePkgUtilsDependency, _ as validateBabelConfig, a as getPackage, b as validateEsmOnly, g as disallowDuplicatePrettierConfig, h as disallowDuplicateEslintConfig, j as validateTsConfig, k as validateSrcIndexFile, v as validateBannedFiles, w as validatePackageType, x as validateIncompatiblePlugin, y as validateDeprecatedDependencies } from "./package-YDElb3ND.js";
-import { t as loadPackageConfig } from "./load-package-config-CNQRvdGW.js";
-import { a as validateImports, i as readTSConfig, n as runTscMaybe, r as verifyFlags, t as createValidator } from "./verify-common-cNJ4BLlQ.js";
-import meow from "meow";
-import chalk from "chalk";
-import path from "path";
-import outdent from "outdent";
-async function verifyPackage({ basePath, flags }) {
- let errors = [], packageJson = await getPackage({
- basePath,
- validate: !1
- }), verifyConfig = packageJson.sanityPlugin?.verifyPackage || {};
- for (let hardError of [...validatePackageType(packageJson), ...validatePkgUtilsVersion({ basePath })]) errors.push(hardError), log_default.error(`\n${hardError}`);
- let packageConfig;
- try {
- packageConfig = await loadPackageConfig({ basePath });
- } catch (err) {
- log_default.debug("Failed to load package.config: %s", err);
- }
- let outDir = packageConfig?.dist ?? "dist", tsconfig = packageConfig?.tsconfig ?? "tsconfig.json", validation = createValidator(verifyConfig, flags, errors), ts = await readTSConfig({
- basePath,
- filename: tsconfig
- });
- if (await validation("packageName", async () => validatePackageName(packageJson)), await validation("esmOnly", async () => validateEsmOnly(packageJson)), await validation("pkg-utils", async () => validatePkgUtilsDependency(packageJson)), await validation("srcIndex", async () => validateSrcIndexFile(basePath)), await validation("bannedFiles", async () => validateBannedFiles(packageJson)), await validation("scripts", async () => validateScripts(packageJson)), await validation("nodeEngine", async () => validateNodeEngine(packageJson)), await validation("duplicateConfig", async () => disallowDuplicateEslintConfig(basePath, packageJson)), await validation("duplicateConfig", async () => disallowDuplicatePrettierConfig(basePath, packageJson)), ts && await validation("tsconfig", async () => validateTsConfig(ts, {
- basePath,
- outDir,
- tsconfig
- })), await validation("incompatiblePlugin", async () => validateIncompatiblePlugin({
- basePath,
- packageJson
- })), await validation("babelConfig", async () => validateBabelConfig({ basePath })), await validation("dependencies", async () => validateSanityDependencies(packageJson)), await validation("deprecatedDependencies", async () => validateDeprecatedDependencies(packageJson)), await validation("eslintImports", async () => validateImports({ basePath })), errors.length) throw Error(outdent`
- Detected validation issues!
- To make this package Sanity v3 compatible, fix the issues starting from the top, or disable any checks you deem unnecessary.
-
- These issues assume the package uses @sanity/plugin-kit defaults for development and building.
- Refer to ${urls.pluginReadme} for configuration options.
-
- More information is available here:
- - Studio migration guide: ${urls.migrationGuideStudio}
- - Plugin migration guide: ${urls.migrationGuidePlugin}
- - Reference documentation: ${urls.refDocs}
-
- ${chalk.grey(`To fail-fast on first detected issue run:\nnpx ${cliName} verify-package --single`)}
- `.trimStart());
- await runTscMaybe(verifyConfig, ts), log_default.success(outdent`
- No outstanding upgrade issues detected.
-
- Suggested next steps:
- - Use plugin-kit to build and develop the plugin according to ${urls.pluginReadme}.
- - Build the plugin and fix any compilation errors
- - Test the plugin using the link-watch command
- `.trim());
-}
-const help = `
-Usage
- $ ${cliName} verify-package [dir] [<args>]
-
-Options
- --single Enables fail-fast mode: Will only output the first validation that fails.
- --silent Do not print info and warning messages
- --verbose Log everything. This option conflicts with --silent
- --version Output the version number
- --help Output usage information
-
-Each check will describe how they can be individually disabled.
-
-Examples
- # Verify Sanity plugin package in current directory
- $ ${cliName} verify-package
-
- # Verify Sanity plugin package in my-plugin directory in silent mode
- $ ${cliName} verify-package my-plugin-directory --silent
-`;
-function run({ argv }) {
- let cli = meow(help, {
- flags: verifyFlags,
- argv,
- description: "Verify that a Sanity plugin package is v3 compatible, and print upgrade steps if not."
- });
- return verifyPackage({
- basePath: path.resolve(cli.input[0] || process.cwd()),
- flags: cli.flags
- });
-}
-export { run as default };
-
-//# sourceMappingURL=verify-package-Bfi7IL_f.js.map
\ No newline at end of file