@stacksjs/buddy 0.70.69 → 0.70.71

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.
@@ -1,7 +1,19 @@
1
+ import { existsSync } from "node:fs";
1
2
  import process from "node:process";
2
3
  import { intro, log, onUnknownSubcommand, outro, runCommand } from "@stacksjs/cli";
3
4
  import { path } from "@stacksjs/path";
4
5
  import { ExitCode } from "@stacksjs/types";
6
+ function lintActionCommand(entry) {
7
+ const vendored = path.projectPath(`storage/framework/core/actions/src/lint/${entry}.ts`);
8
+ if (existsSync(vendored))
9
+ return `bun storage/framework/core/actions/src/lint/${entry}.ts`;
10
+ try {
11
+ const pkgJson = Bun.resolveSync("@stacksjs/actions/package.json", path.projectPath()), dist = path.resolve(path.dirname(pkgJson), `dist/lint/${entry}.js`);
12
+ if (existsSync(dist))
13
+ return `bun ${dist}`;
14
+ } catch {}
15
+ return `bun storage/framework/core/actions/src/lint/${entry}.ts`;
16
+ }
5
17
  function exitOnFailure(result, label) {
6
18
  if (!result || typeof result !== "object" || !("isErr" in result))
7
19
  return;
@@ -22,7 +34,7 @@ export function lint(buddy) {
22
34
  };
23
35
  buddy.command("lint", descriptions.lint).option("-f, --fix", descriptions.lintFix, { default: !1 }).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
24
36
  log.debug("Running `buddy lint` ...", options);
25
- const startTime = await intro("buddy lint"), result = options.fix ? await runCommand("bun storage/framework/core/actions/src/lint/fix.ts", { cwd: path.projectPath() }) : await runCommand("bun storage/framework/core/actions/src/lint/index.ts", { cwd: path.projectPath() });
37
+ const startTime = await intro("buddy lint"), result = options.fix ? await runCommand(lintActionCommand("fix"), { cwd: path.projectPath() }) : await runCommand(lintActionCommand("index"), { cwd: path.projectPath() });
26
38
  exitOnFailure(result, "lint");
27
39
  await outro("Linted your project", { startTime, useSeconds: !0 });
28
40
  });
@@ -30,7 +42,7 @@ export function lint(buddy) {
30
42
  log.debug("Running `buddy lint:fix` ...", options);
31
43
  const startTime = await intro("buddy lint:fix");
32
44
  log.info("Fixing lint errors...");
33
- const result = await runCommand("bun storage/framework/core/actions/src/lint/fix.ts", { cwd: path.projectPath() });
45
+ const result = await runCommand(lintActionCommand("fix"), { cwd: path.projectPath() });
34
46
  exitOnFailure(result, "lint:fix");
35
47
  await outro("Fixed lint errors", { startTime, useSeconds: !0 });
36
48
  });
@@ -9,6 +9,7 @@ export function upgrade(buddy) {
9
9
  version: "Install a specific version (e.g., 0.70.23)",
10
10
  canary: "Upgrade to the latest canary (bleeding-edge `main`) build",
11
11
  stable: "Switch to the latest vetted stable release",
12
+ dryRun: "Preview the upgrade (which dependencies would change) without writing or installing",
12
13
  force: "Force re-download, bypassing cache and version checks",
13
14
  from: "Sync from a local stacks checkout (e.g. ~/Code/stacks). Skips GitHub.",
14
15
  noPostinstall: "Skip post-sync hooks (auto-imports, bun install, migrate)",
@@ -20,7 +21,7 @@ export function upgrade(buddy) {
20
21
  project: "Target a specific project",
21
22
  all: "Upgrade framework, dependencies, Bun, and binary"
22
23
  };
23
- buddy.command("upgrade", descriptions.upgrade).option("-v, --version <version>", descriptions.version).option("--canary", descriptions.canary, { default: !1 }).option("--stable", descriptions.stable, { default: !1 }).option("-f, --force", descriptions.force, { default: !1 }).option("--from <path>", descriptions.from).option("--no-postinstall", descriptions.noPostinstall).option("--verbose", descriptions.verbose, { default: !1 }).alias("update").example("buddy upgrade").example("buddy update").example("buddy upgrade --from ~/Code/stacks").example("buddy upgrade --version 0.70.23").example("buddy upgrade --canary").example("buddy upgrade --stable").example("buddy upgrade --force").action(async (options) => {
24
+ buddy.command("upgrade", descriptions.upgrade).option("-v, --version <version>", descriptions.version).option("--canary", descriptions.canary, { default: !1 }).option("--stable", descriptions.stable, { default: !1 }).option("--dry-run", descriptions.dryRun, { default: !1 }).option("-f, --force", descriptions.force, { default: !1 }).option("--from <path>", descriptions.from).option("--no-postinstall", descriptions.noPostinstall).option("--verbose", descriptions.verbose, { default: !1 }).alias("update").example("buddy upgrade").example("buddy update").example("buddy upgrade --from ~/Code/stacks").example("buddy upgrade --version 0.70.23").example("buddy upgrade --dry-run").example("buddy upgrade --canary").example("buddy upgrade --stable").example("buddy upgrade --force").action(async (options) => {
24
25
  log.debug("Running `buddy upgrade` ...", options);
25
26
  const opts = { ...options };
26
27
  if (opts.postinstall === !1) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.70.69",
4
+ "version": "0.70.71",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [