@farming-labs/docs 0.2.27 → 0.2.29

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.
@@ -31,7 +31,8 @@ function parseFlags(argv) {
31
31
  "network",
32
32
  "analytics",
33
33
  "ask-ai",
34
- "deploy"
34
+ "deploy",
35
+ "dry-run"
35
36
  ]);
36
37
  for (let i = 0; i < argv.length; i++) {
37
38
  const arg = argv[i];
@@ -228,22 +229,24 @@ async function main() {
228
229
  printRobotsGenerateHelp();
229
230
  process.exit(1);
230
231
  } else if (parsedCommand.command === "downgrade") {
231
- const { downgrade } = await import("../downgrade-D7zavP20.mjs");
232
+ const { downgrade } = await import("../downgrade-ghVFFHKi.mjs");
232
233
  const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
233
234
  const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
234
235
  await downgrade({
235
236
  framework,
236
- version: typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0
237
+ version: typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0,
238
+ dryRun: flags["dry-run"] === true
237
239
  });
238
240
  } else if (parsedCommand.command === "upgrade") {
239
- const { upgrade } = await import("../upgrade-Dzej61y4.mjs");
241
+ const { upgrade } = await import("../upgrade-aexO-zom.mjs");
240
242
  const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
241
243
  const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
242
244
  const version = typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0;
243
245
  await upgrade({
244
246
  framework,
245
247
  tag: version !== void 0 ? void 0 : args.includes("--beta") ? "beta" : args.includes("--latest") ? "latest" : parsedCommand.tag ?? "latest",
246
- version
248
+ version,
249
+ dryRun: flags["dry-run"] === true
247
250
  });
248
251
  } else if (parsedCommand.command === "--help" || parsedCommand.command === "-h") printHelp();
249
252
  else if (parsedCommand.command === "--version" || parsedCommand.command === "-v") printVersion();
@@ -394,6 +397,7 @@ ${pc.dim("Options for upgrade:")}
394
397
  ${pc.cyan("--version <version>")} Install an exact version (e.g. ${pc.dim("0.1.104")})
395
398
  ${pc.cyan("--latest")} Install latest stable (default)
396
399
  ${pc.cyan("--beta")} Install beta versions
400
+ ${pc.cyan("--dry-run")} Print the install command without changing dependencies
397
401
  ${pc.cyan("upgrade@beta")} Shortcut for ${pc.cyan("upgrade --beta")}
398
402
  ${pc.cyan("upgrade@latest")} Shortcut for ${pc.cyan("upgrade --latest")}
399
403
 
@@ -401,6 +405,7 @@ ${pc.dim("Options for downgrade:")}
401
405
  ${pc.cyan("downgrade")} Install the published version immediately below the current installed version
402
406
  ${pc.cyan("--framework <name>")} Explicit framework (${pc.dim("next")}, ${pc.dim("tanstack-start")}, ${pc.dim("nuxt")}, ${pc.dim("sveltekit")}, ${pc.dim("astro")}); omit to auto-detect
403
407
  ${pc.cyan("--version <version>")} Install an exact lower version (e.g. ${pc.dim("0.1.103")})
408
+ ${pc.cyan("--dry-run")} Print the install command without changing dependencies
404
409
 
405
410
  ${pc.cyan("-h, --help")} Show this help message
406
411
  ${pc.cyan("-v, --version")} Show version
@@ -165,6 +165,11 @@ async function downgrade(options = {}) {
165
165
  const cmd = buildDowngradeCommand(framework, targetVersion, pm);
166
166
  p.log.step(`Downgrading ${preset} docs packages from ${currentVersion} to ${targetVersion}...`);
167
167
  p.log.message(pc.dim(packages.join(", ")));
168
+ if (options.dryRun) {
169
+ p.log.info("Dry run. Would run:\n " + pc.cyan(cmd));
170
+ p.outro(pc.green("Dry run complete. No changes made."));
171
+ return;
172
+ }
168
173
  try {
169
174
  exec(cmd, cwd);
170
175
  p.log.success(`Packages downgraded to ${targetVersion}.`);
@@ -37,6 +37,11 @@ async function upgrade(options = {}) {
37
37
  const packages = getPackagesForFramework(framework);
38
38
  p.log.step(`Upgrading ${preset} docs packages to ${target}...`);
39
39
  p.log.message(pc.dim(packages.join(", ")));
40
+ if (options.dryRun) {
41
+ p.log.info("Dry run. Would run:\n " + pc.cyan(cmd));
42
+ p.outro(pc.green("Dry run complete. No changes made."));
43
+ return;
44
+ }
40
45
  try {
41
46
  exec(cmd, cwd);
42
47
  p.log.success(`Packages upgraded to ${target}.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",