@sanity/plugin-kit

10.0.710.0.8
dist/link-watch-VeZRlVvN.js
dist/link-watch-VeZRlVvN.jsDeleted
−93
Index: package/dist/link-watch-VeZRlVvN.js
===================================================================
--- package/dist/link-watch-VeZRlVvN.js
+++ package/dist/link-watch-VeZRlVvN.js
@@ -1,93 +0,0 @@
-import "./constants-BIVJp2Jy.js";
-import { n as sharedFlags_default, t as log_default } from "./log-2MbSIFbq.js";
-import { A as mkdir, O as fileExists, R as outdent, a as getPackage } from "./package-8cUY5BVf.js";
-import { t as binname } from "./package-D_QwsQ0E.js";
-import { t as loadPackageConfig } from "./load-package-config-BJhZa2CW.js";
-import meow from "meow";
-import { styleText } from "node:util";
-import path from "path";
-import fs from "fs";
-import concurrently from "concurrently";
-import nodemon from "nodemon";
-async function linkWatch({ basePath }) {
-	let packageJson = JSON.parse(fs.readFileSync(path.join(basePath, "package.json"), "utf8")), outDir = (await loadPackageConfig({ basePath }))?.dist ?? "dist", watch = {
-		command: "npm run watch",
-		extensions: "ts,js,png,svg,gif,jpeg,css",
-		...packageJson.sanityPlugin?.linkWatch
-	}, nodemonSettings = {
-		watch: [outDir],
-		ext: watch.extensions,
-		exec: "yalc push --changed"
-	};
-	nodemon(nodemonSettings);
-	let folder = path.join(basePath, outDir);
-	await fileExists(folder) || await mkdir(folder);
-	let pkg = await getPackage({
-		basePath,
-		validate: !1
-	});
-	concurrently([watch.command]), nodemon.on("start", function() {
-		log_default.info(outdent`
-        Watching ${outDir} for changes to files with extensions: ${watch.extensions}
-
-        To test this package in Sanity Studio or another package, in a separate shell run:
-        cd /path/to/sanity/studio-or-package
-
-        Then, run one of the below commands, based on the package manager used in studio-or-package:
-
-        ## yarn
-        ${styleText("greenBright", `yalc add --link ${pkg.name} && yarn install`)}
-
-        ## npm
-        ${styleText("greenBright", `npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
-      `.trimStart());
-	}).on("quit", function() {
-		process.exit();
-	}).on("restart", function(files) {
-		log_default.info("Found changes in files:", styleText("magentaBright", (files ?? []).join(", "))), log_default.info("Pushing new yalc package...");
-	});
-}
-const help = `
-Usage
-  $ ${binname} link-watch [<args>]
-
-Options
-  --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
-
-Configuration
-To override the default watch command configuration, provide an override in package.json under sanityPlugin:
-{
-  "sanityPlugin": {
-    "watchCommand": "microbundle watch --format modern,esm,cjs --jsx React.createElement --jsxImportSource react --css inline",
-    "linkWatch": {
-      "command": "npm run watch",
-      "extensions": "js,png,svg,gif,jpeg,css"
-    }
-  }
-}
-
-Examples
-  # Run the watch command and pushes any changes to yalc
-  $ ${binname} link-watch
-`, flags = {
-	...sharedFlags_default,
-	watch: {
-		type: "boolean",
-		default: !1
-	}
-};
-function run({ argv }) {
-	let cli = meow(help, {
-		importMeta: import.meta,
-		flags,
-		argv,
-		description: "Run the watch command and pushes any changes to yalc"
-	});
-	return linkWatch({ basePath: path.resolve(cli.input[0] || process.cwd()) });
-}
-export { run as default };
-
-//# sourceMappingURL=link-watch-VeZRlVvN.js.map
\ No newline at end of file