@stacksjs/buddy 0.70.88 → 0.70.91

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.
Files changed (143) hide show
  1. package/dist/cli.d.ts +1 -0
  2. package/dist/cli.js +165 -0
  3. package/dist/commands/about.d.ts +2 -0
  4. package/dist/commands/about.js +35 -0
  5. package/dist/commands/add.d.ts +2 -0
  6. package/dist/commands/add.js +33 -0
  7. package/dist/commands/auth.d.ts +2 -0
  8. package/dist/commands/auth.js +68 -0
  9. package/dist/commands/build.d.ts +2 -0
  10. package/dist/commands/build.js +153 -0
  11. package/dist/commands/cd.d.ts +20 -0
  12. package/dist/commands/cd.js +39 -0
  13. package/dist/commands/changelog.d.ts +2 -0
  14. package/dist/commands/changelog.js +32 -0
  15. package/dist/commands/clean.d.ts +2 -0
  16. package/dist/commands/clean.js +37 -0
  17. package/dist/commands/cloud.d.ts +2 -0
  18. package/dist/commands/cloud.js +503 -0
  19. package/dist/commands/commit.d.ts +2 -0
  20. package/dist/commands/commit.js +16 -0
  21. package/dist/commands/completion.d.ts +2 -0
  22. package/dist/commands/completion.js +143 -0
  23. package/dist/commands/config-migrate.d.ts +26 -0
  24. package/dist/commands/config-migrate.js +94 -0
  25. package/dist/commands/configure.d.ts +2 -0
  26. package/dist/commands/configure.js +48 -0
  27. package/dist/commands/create.d.ts +2 -0
  28. package/dist/commands/create.js +141 -0
  29. package/dist/commands/deploy.d.ts +107 -0
  30. package/dist/commands/deploy.js +1492 -0
  31. package/dist/commands/dev.d.ts +10 -0
  32. package/dist/commands/dev.js +915 -0
  33. package/dist/commands/dns.d.ts +2 -0
  34. package/dist/commands/dns.js +102 -0
  35. package/dist/commands/doctor.d.ts +2 -0
  36. package/dist/commands/doctor.js +285 -0
  37. package/dist/commands/domains.d.ts +2 -0
  38. package/dist/commands/domains.js +159 -0
  39. package/dist/commands/email.d.ts +2 -0
  40. package/dist/commands/email.js +524 -0
  41. package/dist/commands/env.d.ts +2 -0
  42. package/dist/commands/env.js +246 -0
  43. package/dist/commands/extension.d.ts +8 -0
  44. package/dist/commands/extension.js +78 -0
  45. package/dist/commands/features.d.ts +180 -0
  46. package/dist/commands/features.js +422 -0
  47. package/dist/commands/fresh.d.ts +2 -0
  48. package/dist/commands/fresh.js +39 -0
  49. package/dist/commands/generate.d.ts +2 -0
  50. package/dist/commands/generate.js +104 -0
  51. package/dist/commands/http.d.ts +2 -0
  52. package/dist/commands/http.js +33 -0
  53. package/dist/commands/index.d.ts +53 -0
  54. package/dist/commands/index.js +53 -0
  55. package/dist/commands/install.d.ts +2 -0
  56. package/dist/commands/install.js +22 -0
  57. package/dist/commands/key.d.ts +2 -0
  58. package/dist/commands/key.js +23 -0
  59. package/dist/commands/lint.d.ts +2 -0
  60. package/dist/commands/lint.js +46 -0
  61. package/dist/commands/list.d.ts +2 -0
  62. package/dist/commands/list.js +108 -0
  63. package/dist/commands/mail.d.ts +4 -0
  64. package/dist/commands/mail.js +752 -0
  65. package/dist/commands/maintenance.d.ts +2 -0
  66. package/dist/commands/maintenance.js +141 -0
  67. package/dist/commands/make.d.ts +2 -0
  68. package/dist/commands/make.js +375 -0
  69. package/dist/commands/migrate-project.d.ts +2 -0
  70. package/dist/commands/migrate-project.js +49 -0
  71. package/dist/commands/migrate.d.ts +4 -0
  72. package/dist/commands/migrate.js +455 -0
  73. package/dist/commands/outdated.d.ts +2 -0
  74. package/dist/commands/outdated.js +19 -0
  75. package/dist/commands/package.d.ts +2 -0
  76. package/dist/commands/package.js +17 -0
  77. package/dist/commands/phone.d.ts +2 -0
  78. package/dist/commands/phone.js +188 -0
  79. package/dist/commands/ports.d.ts +2 -0
  80. package/dist/commands/ports.js +118 -0
  81. package/dist/commands/prepublish.d.ts +2 -0
  82. package/dist/commands/prepublish.js +17 -0
  83. package/dist/commands/projects.d.ts +2 -0
  84. package/dist/commands/projects.js +29 -0
  85. package/dist/commands/publish.d.ts +2 -0
  86. package/dist/commands/publish.js +172 -0
  87. package/dist/commands/queue.d.ts +2 -0
  88. package/dist/commands/queue.js +248 -0
  89. package/dist/commands/release.d.ts +2 -0
  90. package/dist/commands/release.js +30 -0
  91. package/dist/commands/route.d.ts +2 -0
  92. package/dist/commands/route.js +21 -0
  93. package/dist/commands/saas.d.ts +2 -0
  94. package/dist/commands/saas.js +25 -0
  95. package/dist/commands/schedule.d.ts +2 -0
  96. package/dist/commands/schedule.js +61 -0
  97. package/dist/commands/search.d.ts +2 -0
  98. package/dist/commands/search.js +84 -0
  99. package/dist/commands/seed.d.ts +2 -0
  100. package/dist/commands/seed.js +71 -0
  101. package/dist/commands/serve.d.ts +25 -0
  102. package/dist/commands/serve.js +182 -0
  103. package/dist/commands/setup.d.ts +12 -0
  104. package/dist/commands/setup.js +215 -0
  105. package/dist/commands/share.d.ts +2 -0
  106. package/dist/commands/share.js +214 -0
  107. package/dist/commands/sms.d.ts +2 -0
  108. package/dist/commands/sms.js +328 -0
  109. package/dist/commands/stacks.d.ts +2 -0
  110. package/dist/commands/stacks.js +69 -0
  111. package/dist/commands/telemetry.d.ts +2 -0
  112. package/dist/commands/telemetry.js +74 -0
  113. package/dist/commands/test.d.ts +2 -0
  114. package/dist/commands/test.js +130 -0
  115. package/dist/commands/tinker.d.ts +2 -0
  116. package/dist/commands/tinker.js +37 -0
  117. package/dist/commands/types.d.ts +2 -0
  118. package/dist/commands/types.js +18 -0
  119. package/dist/commands/upgrade.d.ts +2 -0
  120. package/dist/commands/upgrade.js +98 -0
  121. package/dist/commands/version.d.ts +2 -0
  122. package/dist/commands/version.js +16 -0
  123. package/dist/config.d.ts +43 -0
  124. package/dist/config.js +223 -0
  125. package/dist/custom-cli.d.ts +1 -0
  126. package/dist/custom-cli.js +23 -0
  127. package/dist/index.d.ts +1 -0
  128. package/dist/index.js +1 -0
  129. package/dist/lazy-commands.d.ts +61 -0
  130. package/dist/lazy-commands.js +188 -0
  131. package/dist/migrators/index.d.ts +9 -0
  132. package/dist/migrators/index.js +62 -0
  133. package/dist/migrators/laravel/index.d.ts +2 -0
  134. package/dist/migrators/laravel/index.js +148 -0
  135. package/dist/migrators/laravel/migrations.d.ts +52 -0
  136. package/dist/migrators/laravel/migrations.js +232 -0
  137. package/dist/migrators/laravel/models.d.ts +34 -0
  138. package/dist/migrators/laravel/models.js +134 -0
  139. package/dist/migrators/rails/index.d.ts +2 -0
  140. package/dist/migrators/rails/index.js +11 -0
  141. package/dist/migrators/types.d.ts +44 -0
  142. package/dist/migrators/types.js +0 -0
  143. package/package.json +2 -2
@@ -0,0 +1,53 @@
1
+ export * from "./about";
2
+ export * from "./auth";
3
+ export * from "./build";
4
+ export * from "./cd";
5
+ export * from "./changelog";
6
+ export * from "./clean";
7
+ export * from "./cloud";
8
+ export * from "./commit";
9
+ export * from "./completion";
10
+ export * from "./config-migrate";
11
+ export * from "./configure";
12
+ export * from "./create";
13
+ export * from "./deploy";
14
+ export * from "./dev";
15
+ export * from "./dns";
16
+ export * from "./doctor";
17
+ export * from "./domains";
18
+ export * from "./email";
19
+ export * from "./env";
20
+ export * from "./features";
21
+ export * from "./fresh";
22
+ export * from "./generate";
23
+ export * from "./http";
24
+ export * from "./install";
25
+ export * from "./key";
26
+ export * from "./lint";
27
+ export * from "./list";
28
+ export * from "./mail";
29
+ export * from "./make";
30
+ export * from "./migrate";
31
+ export * from "./migrate-project";
32
+ export * from "./outdated";
33
+ export * from "./phone";
34
+ export * from "./ports";
35
+ export * from "./prepublish";
36
+ export * from "./projects";
37
+ export * from "./publish";
38
+ export * from "./queue";
39
+ export * from "./release";
40
+ export * from "./route";
41
+ export * from "./saas";
42
+ export * from "./schedule";
43
+ export * from "./search";
44
+ export * from "./seed";
45
+ export * from "./serve";
46
+ export * from "./setup";
47
+ export * from "./sms";
48
+ export * from "./telemetry";
49
+ export * from "./test";
50
+ export * from "./tinker";
51
+ export * from "./types";
52
+ export * from "./upgrade";
53
+ export * from "./version";
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function install(buddy: CLI): void;
@@ -0,0 +1,22 @@
1
+ import process from "node:process";
2
+ import { log, onUnknownSubcommand, runCommand } from "@stacksjs/cli";
3
+ import { path as p } from "@stacksjs/path";
4
+ import { ExitCode } from "@stacksjs/types";
5
+ export function install(buddy) {
6
+ const descriptions = {
7
+ install: "Install your dependencies",
8
+ project: "Target a specific project",
9
+ verbose: "Enable verbose output"
10
+ };
11
+ buddy.command("install", descriptions.install).option("-p, --project [project]", descriptions.project, { default: !1 }).option("-v, --verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
12
+ log.debug("Running `buddy install` ...", options);
13
+ if ((await runCommand("bun install", {
14
+ ...options,
15
+ cwd: p.projectPath()
16
+ })).isErr) {
17
+ log.error("bun install failed");
18
+ process.exit(ExitCode.FatalError);
19
+ }
20
+ });
21
+ onUnknownSubcommand(buddy, "install");
22
+ }
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function key(buddy: CLI): void;
@@ -0,0 +1,23 @@
1
+ import process from "node:process";
2
+ import { runAction } from "@stacksjs/actions";
3
+ import { intro, log, onUnknownSubcommand, outro } from "@stacksjs/cli";
4
+ import { Action } from "@stacksjs/enums";
5
+ import { ExitCode } from "@stacksjs/types";
6
+ export function key(buddy) {
7
+ const descriptions = {
8
+ command: "Generate & set the application key.",
9
+ project: "Target a specific project",
10
+ verbose: "Enable verbose output"
11
+ };
12
+ buddy.command("key:generate", descriptions.command).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
13
+ log.debug("Running `buddy key:generate` ...", options);
14
+ await intro("buddy key:generate");
15
+ const result = await runAction(Action.KeyGenerate, options);
16
+ if (result.isErr) {
17
+ log.error("Failed to set random application key.", result.error);
18
+ process.exit(ExitCode.FatalError);
19
+ }
20
+ await outro("Random application key set.");
21
+ });
22
+ onUnknownSubcommand(buddy, "key");
23
+ }
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function lint(buddy: CLI): void;
@@ -0,0 +1,46 @@
1
+ import process from "node:process";
2
+ import { intro, log, onUnknownSubcommand, outro } from "@stacksjs/cli";
3
+ import { ExitCode } from "@stacksjs/types";
4
+ async function runStyleAction(entry, label, options) {
5
+ const actions = await import("@stacksjs/actions"), { ok } = await actions[entry](options);
6
+ if (!ok) {
7
+ log.error(`${label} reported failure`);
8
+ process.exit(ExitCode.FatalError);
9
+ }
10
+ }
11
+ export function lint(buddy) {
12
+ const descriptions = {
13
+ lint: "Automagically lints your project codebase",
14
+ lintFix: "Automagically fixes all lint errors",
15
+ format: "Format your project codebase",
16
+ formatCheck: "Check formatting without making changes",
17
+ project: "Target a specific project",
18
+ verbose: "Enable verbose output"
19
+ };
20
+ 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) => {
21
+ log.debug("Running `buddy lint` ...", options);
22
+ const startTime = await intro("buddy lint");
23
+ await runStyleAction(options.fix ? "lintFix" : "lintProject", "lint");
24
+ await outro("Linted your project", { startTime, useSeconds: !0 });
25
+ });
26
+ buddy.command("lint:fix", descriptions.lintFix).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
27
+ log.debug("Running `buddy lint:fix` ...", options);
28
+ const startTime = await intro("buddy lint:fix");
29
+ log.info("Fixing lint errors...");
30
+ await runStyleAction("lintFix", "lint:fix");
31
+ await outro("Fixed lint errors", { startTime, useSeconds: !0 });
32
+ });
33
+ buddy.command("format", descriptions.format).option("-w, --write", "Write changes to files", { default: !1 }).option("-c, --check", descriptions.formatCheck, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
34
+ log.debug("Running `buddy format` ...", options);
35
+ const startTime = await intro("buddy format");
36
+ await runStyleAction("formatProject", "format", options.check ? { check: !0 } : { write: !0 });
37
+ await outro("Formatted your project", { startTime, useSeconds: !0 });
38
+ });
39
+ buddy.command("format:check", descriptions.formatCheck).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
40
+ log.debug("Running `buddy format:check` ...", options);
41
+ const startTime = await intro("buddy format:check");
42
+ await runStyleAction("formatProject", "format:check", { check: !0 });
43
+ await outro("Format check complete", { startTime, useSeconds: !0 });
44
+ });
45
+ onUnknownSubcommand(buddy, "lint");
46
+ }
@@ -0,0 +1,2 @@
1
+ import type { CLI } from '@stacksjs/types';
2
+ export declare function list(buddy: CLI): void;
@@ -0,0 +1,108 @@
1
+ import process from "node:process";
2
+ import { log } from "@stacksjs/logging";
3
+ import { onUnknownSubcommand } from "@stacksjs/cli";
4
+ export function list(buddy) {
5
+ const descriptions = {
6
+ list: "List all available Buddy commands",
7
+ project: "Target a specific project",
8
+ verbose: "Enable verbose output",
9
+ filter: "Filter commands by name or group",
10
+ namespace: "Filter commands by namespace (e.g., make, env, db)",
11
+ grouped: "Group commands by category",
12
+ format: "Output format (text, json)"
13
+ };
14
+ buddy.command("list", descriptions.list).option("-p, --project [project]", descriptions.project, { default: !1 }).option("-f, --filter [filter]", descriptions.filter).option("-n, --namespace [namespace]", descriptions.namespace).option("-g, --grouped", descriptions.grouped, { default: !0 }).option("--format [format]", descriptions.format, { default: "text" }).option("--verbose", descriptions.verbose, { default: !1 }).example("buddy list").example("buddy list --filter=make").example("buddy list --namespace=make").example("buddy list --namespace=env").example("buddy list --no-grouped").example("buddy list --format=json").action(async (options) => {
15
+ log.debug("Running `buddy list` ...", options);
16
+ const { bold, dim, green } = await import("@stacksjs/cli"), commands = buddy.commands || [];
17
+ let filteredCommands = commands;
18
+ if (options.filter) {
19
+ const filterStr = String(options.filter).toLowerCase();
20
+ filteredCommands = commands.filter((cmd) => {
21
+ const name = cmd.name || "", desc = cmd.description || "";
22
+ return name.toLowerCase().includes(filterStr) || desc.toLowerCase().includes(filterStr);
23
+ });
24
+ }
25
+ if (options.namespace) {
26
+ const namespaceStr = String(options.namespace).toLowerCase();
27
+ filteredCommands = filteredCommands.filter((cmd) => {
28
+ return (cmd.namespace || "").toLowerCase() === namespaceStr;
29
+ });
30
+ }
31
+ if (filteredCommands.length === 0) {
32
+ if (options.format === "json")
33
+ console.log(JSON.stringify({ commands: [], total: 0 }, null, 2));
34
+ else {
35
+ console.log(dim("No commands found"));
36
+ if (options.filter)
37
+ console.log(dim(`Try removing the filter: ${options.filter}`));
38
+ }
39
+ return;
40
+ }
41
+ if (options.format === "json") {
42
+ const jsonOutput = filteredCommands.map((cmd) => ({
43
+ name: cmd.name || "",
44
+ description: cmd.description || "",
45
+ aliases: cmd.aliasNames || []
46
+ }));
47
+ console.log(JSON.stringify({ commands: jsonOutput, total: jsonOutput.length }, null, 2));
48
+ return;
49
+ }
50
+ if (options.grouped) {
51
+ const groups = new Map;
52
+ for (const cmd of filteredCommands) {
53
+ const name = cmd.name || "";
54
+ if (!name)
55
+ continue;
56
+ let group = "General";
57
+ if (name.includes(":"))
58
+ group = name.split(":")[0] ?? "General";
59
+ else if (["dev", "build", "test", "lint"].includes(name))
60
+ group = "Development";
61
+ else if (["deploy", "release", "publish"].includes(name))
62
+ group = "Deployment";
63
+ else if (["migrate", "seed", "fresh"].includes(name))
64
+ group = "Database";
65
+ else if (["doctor", "about", "version"].includes(name))
66
+ group = "Info";
67
+ if (!groups.has(group))
68
+ groups.set(group, []);
69
+ groups.get(group).push(cmd);
70
+ }
71
+ console.log("");
72
+ console.log(bold(green("Available Commands:")));
73
+ console.log("");
74
+ const sortedGroups = Array.from(groups.entries()).sort((a, b) => {
75
+ const order = ["Development", "General", "Info"], aIndex = order.indexOf(a[0]), bIndex = order.indexOf(b[0]);
76
+ if (aIndex >= 0 && bIndex >= 0)
77
+ return aIndex - bIndex;
78
+ if (aIndex >= 0)
79
+ return -1;
80
+ if (bIndex >= 0)
81
+ return 1;
82
+ return a[0].localeCompare(b[0]);
83
+ });
84
+ for (const [group, cmds] of sortedGroups) {
85
+ console.log(bold(`${group}:`));
86
+ cmds.sort((a, b) => (a.name || "").localeCompare(b.name || ""));
87
+ for (const cmd of cmds) {
88
+ const name = (cmd.name || "").padEnd(20), desc = cmd.description || "";
89
+ console.log(` ${green(name)} ${dim(desc)}`);
90
+ }
91
+ console.log("");
92
+ }
93
+ } else {
94
+ console.log("");
95
+ console.log(bold(green("Available Commands:")));
96
+ console.log("");
97
+ filteredCommands.sort((a, b) => (a.name || "").localeCompare(b.name || ""));
98
+ for (const cmd of filteredCommands) {
99
+ const name = (cmd.name || "").padEnd(20), desc = cmd.description || "";
100
+ console.log(` ${green(name)} ${dim(desc)}`);
101
+ }
102
+ console.log("");
103
+ }
104
+ console.log(dim(`Total: ${filteredCommands.length} commands`));
105
+ console.log("");
106
+ });
107
+ onUnknownSubcommand(buddy, "list");
108
+ }
@@ -0,0 +1,4 @@
1
+ import { CLI } from '@stacksjs/clapp';
2
+ export declare function resolveDirectMailHost(env?: NodeJS.ProcessEnv): string | undefined;
3
+ export declare function sanitizeLineCount(value?: string): string;
4
+ export declare function mailCommands(buddy: CLI): void;