@stacksjs/buddy 0.70.69 → 0.70.70

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
  });
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.70",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [