@stacksjs/buddy 0.70.159 → 0.70.161
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.
- package/README.md +3 -5
- package/dist/cli.js +5 -30
- package/dist/commands/build.d.ts +2 -1
- package/dist/commands/build.js +40 -33
- package/dist/commands/create.js +1 -2
- package/dist/commands/dev.js +1 -2
- package/dist/commands/list.d.ts +25 -0
- package/dist/commands/list.js +47 -15
- package/dist/commands/setup.d.ts +1 -0
- package/dist/commands/setup.js +15 -1
- package/dist/global-options.d.ts +4 -1
- package/dist/global-options.js +2 -2
- package/dist/project-setup.d.ts +1 -0
- package/dist/project-setup.js +35 -0
- package/package.json +43 -43
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ buddy build:views # builds SSG views
|
|
|
126
126
|
buddy build:desktop # builds Desktop application
|
|
127
127
|
buddy build:library # builds any or all libraries
|
|
128
128
|
buddy build:functions # builds function library
|
|
129
|
-
buddy build:components # builds
|
|
129
|
+
buddy build:components # builds the STX component library and Web Component library
|
|
130
130
|
buddy build:web-components # builds framework agnostic Web Component library (i.e. Custom Elements)
|
|
131
131
|
buddy build:all # builds all your code
|
|
132
132
|
|
|
@@ -192,7 +192,6 @@ buddy cloud:add --jump-box # adds a jump box to your cloud setup
|
|
|
192
192
|
|
|
193
193
|
# select the example to run (follow CLI prompts)
|
|
194
194
|
buddy example # prompts you to select which example to run
|
|
195
|
-
buddy example:vue # runs the Vue example
|
|
196
195
|
buddy example:web-components # runs the Web Component example
|
|
197
196
|
|
|
198
197
|
# you likely won’t need to run these commands as they are auto-triggered, but they are available
|
|
@@ -250,7 +249,7 @@ _Develop dynamic UIs with helpers for atomic design, and much more._
|
|
|
250
249
|
- 🖥️ **Desktop** _transforms your web app into a desktop app, plus more_
|
|
251
250
|
- 📝 **Documentation** _markdown-based documentation, auto-generated_
|
|
252
251
|
- 📚 **Library** _auto-builds & manages component & function libraries_
|
|
253
|
-
- ⚡️ Powered by Bun,
|
|
252
|
+
- ⚡️ Powered by Bun, STX, Tauri, Crosswind, and BunPress
|
|
254
253
|
|
|
255
254
|
### Backend Development
|
|
256
255
|
|
|
@@ -274,7 +273,6 @@ _Develop serverless (or server) functions with countless helpers to build scalab
|
|
|
274
273
|
- 💾 **Storage** _a secure-by-default File API that feels right_
|
|
275
274
|
- 🧪 **Tinker** _a powerful TypeScript REPL_
|
|
276
275
|
- 🌪️ **Validation** _e2e type-safety (true frontend & backend harmony)_
|
|
277
|
-
- 🎯 **X-Ray** _all you need to debug, log & analyze_
|
|
278
276
|
|
|
279
277
|
### Cloud Development
|
|
280
278
|
|
|
@@ -314,7 +312,7 @@ Convention over configuration, while staying wholly configurable. _No more boile
|
|
|
314
312
|
- 🚗 **Auto Imports** _your components & functions, including date, string, array, & object helpers_
|
|
315
313
|
- ⏩ **Code Snippets** _goodbye to the boilerplate code—thank you Sarah Drasner_
|
|
316
314
|
- 🔤 **Spell Checker** _be notified once there are typos_
|
|
317
|
-
- 🛠️ **Essential Utilities** _powers at your fingertips. Collections,
|
|
315
|
+
- 🛠️ **Essential Utilities** _powers at your fingertips. Collections, STX composables, and more_
|
|
318
316
|
- 👥 **Team Management** _manage your team & their permissions_
|
|
319
317
|
- 🧪 **Streamlined Testing** _unit & e2e tests powered by Bun, Vitest & Playwright_
|
|
320
318
|
|
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import process from "node:process";
|
|
|
3
3
|
import { cli, log } from "@stacksjs/cli";
|
|
4
4
|
import { path as p } from "@stacksjs/path";
|
|
5
5
|
import { registerGlobalOptions } from "./global-options";
|
|
6
|
+
import { shouldSkipAppKeyCheck } from "./project-setup";
|
|
6
7
|
try {
|
|
7
8
|
const { isSupportedBunVersion, minimumBunVersion } = await import("@stacksjs/utils"), currentBunVersion = typeof Bun < "u" ? Bun.version : process.versions.bun;
|
|
8
9
|
if (currentBunVersion && !isSupportedBunVersion(currentBunVersion)) {
|
|
@@ -10,35 +11,7 @@ try {
|
|
|
10
11
|
process.exit(1);
|
|
11
12
|
}
|
|
12
13
|
} catch {}
|
|
13
|
-
const args = process.argv.slice(2), requestedCommand = args[0] || "help", isHelpFlag = args.includes("--help") || args.includes("-h"), isVersionOnly = ["--version", "-V", "version"].includes(requestedCommand), isHelpMode = requestedCommand === "help" || isHelpFlag && args.length <= 2, skipAppKeyCheck =
|
|
14
|
-
"build",
|
|
15
|
-
"lint",
|
|
16
|
-
"lint:fix",
|
|
17
|
-
"test",
|
|
18
|
-
"test:types",
|
|
19
|
-
"test:unit",
|
|
20
|
-
"test:feature",
|
|
21
|
-
"typecheck",
|
|
22
|
-
"types:fix",
|
|
23
|
-
"types:generate",
|
|
24
|
-
"clean",
|
|
25
|
-
"fresh",
|
|
26
|
-
"about",
|
|
27
|
-
"doctor",
|
|
28
|
-
"setup",
|
|
29
|
-
"setup:ssl",
|
|
30
|
-
"setup:oh-my-zsh",
|
|
31
|
-
"deploy",
|
|
32
|
-
"serve",
|
|
33
|
-
"new",
|
|
34
|
-
"create",
|
|
35
|
-
"migrate",
|
|
36
|
-
"seed",
|
|
37
|
-
"generate",
|
|
38
|
-
"make",
|
|
39
|
-
"key:generate",
|
|
40
|
-
"scaffold:crud"
|
|
41
|
-
].some((cmd) => requestedCommand === cmd || requestedCommand.startsWith(`${cmd}:`)) || isHelpFlag || isHelpMode, needsFullSetup = !isVersionOnly;
|
|
14
|
+
const args = process.argv.slice(2), requestedCommand = args[0] || "help", isHelpFlag = args.includes("--help") || args.includes("-h"), isVersionOnly = ["--version", "-V", "version"].includes(requestedCommand), isHelpMode = requestedCommand === "help" || isHelpFlag && args.length <= 2, skipAppKeyCheck = shouldSkipAppKeyCheck(requestedCommand, { isHelpFlag, isHelpMode }), needsFullSetup = !isVersionOnly;
|
|
42
15
|
if (needsFullSetup) {
|
|
43
16
|
const reportFatal = (label, error) => {
|
|
44
17
|
log.debug(`Buddy ${label}`);
|
|
@@ -55,7 +28,9 @@ if (needsFullSetup) {
|
|
|
55
28
|
}
|
|
56
29
|
async function main() {
|
|
57
30
|
const buddy = cli("buddy");
|
|
58
|
-
registerGlobalOptions(buddy
|
|
31
|
+
registerGlobalOptions(buddy, {
|
|
32
|
+
version: requestedCommand !== "upgrade" && requestedCommand !== "update"
|
|
33
|
+
});
|
|
59
34
|
const configPath = "./buddy.config.js";
|
|
60
35
|
try {
|
|
61
36
|
await Bun.file(configPath).text();
|
package/dist/commands/build.d.ts
CHANGED
package/dist/commands/build.js
CHANGED
|
@@ -28,39 +28,9 @@ export function build(buddy) {
|
|
|
28
28
|
project: "Target a specific project",
|
|
29
29
|
verbose: "Enable verbose output"
|
|
30
30
|
};
|
|
31
|
-
buddy.command("build [type]", descriptions.build).option("-c, --components", descriptions.components).option("-w, --web-components", descriptions.webComponents).option("-e, --elements", descriptions.elements).option("-f, --functions", descriptions.functions).option("-p, --views", descriptions.pages).option("--pages", descriptions.pages).option("-d, --docs", descriptions.docs).option("-b, --buddy", descriptions.buddy, { default: !1 }).option("-s, --stacks", descriptions.framework, { default: !1 }).option("--project [project]", descriptions.project, { default: !1 }).option("--server", descriptions.server, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (server, options) => {
|
|
31
|
+
buddy.command("build [type]", descriptions.build).option("-c, --components", descriptions.components).option("-w, --web-components", descriptions.webComponents).option("-e, --elements", descriptions.elements).option("-f, --functions", descriptions.functions).option("-k, --desktop", descriptions.desktop).option("-p, --views", descriptions.pages).option("--pages", descriptions.pages).option("-d, --docs", descriptions.docs).option("-b, --buddy", descriptions.buddy, { default: !1 }).option("-s, --stacks", descriptions.framework, { default: !1 }).option("--project [project]", descriptions.project, { default: !1 }).option("--server", descriptions.server, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (server, options) => {
|
|
32
32
|
log.debug("Running `buddy build` ...", options);
|
|
33
|
-
|
|
34
|
-
case "components":
|
|
35
|
-
options.components = !0;
|
|
36
|
-
break;
|
|
37
|
-
case "web-components":
|
|
38
|
-
options.webComponents = !0;
|
|
39
|
-
break;
|
|
40
|
-
case "functions":
|
|
41
|
-
options.functions = !0;
|
|
42
|
-
break;
|
|
43
|
-
case "views":
|
|
44
|
-
options.views = !0;
|
|
45
|
-
break;
|
|
46
|
-
case "docs":
|
|
47
|
-
options.docs = !0;
|
|
48
|
-
break;
|
|
49
|
-
case "buddy":
|
|
50
|
-
options.buddy = !0;
|
|
51
|
-
break;
|
|
52
|
-
case "cli":
|
|
53
|
-
options.buddy = !0;
|
|
54
|
-
break;
|
|
55
|
-
case "stacks":
|
|
56
|
-
options.stacks = !0;
|
|
57
|
-
break;
|
|
58
|
-
case "server":
|
|
59
|
-
options.server = !0;
|
|
60
|
-
break;
|
|
61
|
-
default:
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
33
|
+
applyBuildTarget(server, options);
|
|
64
34
|
if (hasNoOptions(options)) {
|
|
65
35
|
if (!isCI && hasTTY && process.stdin.isTTY) {
|
|
66
36
|
const answers = await multiselect({
|
|
@@ -70,6 +40,7 @@ export function build(buddy) {
|
|
|
70
40
|
{ label: "Components", value: "components" },
|
|
71
41
|
{ label: "Web Components", value: "webComponents" },
|
|
72
42
|
{ label: "Functions", value: "functions" },
|
|
43
|
+
{ label: "Desktop application", value: "desktop" },
|
|
73
44
|
{ label: "Documentation", value: "docs" },
|
|
74
45
|
{ label: "Stacks framework", value: "stacks" },
|
|
75
46
|
{ label: "Buddy CLI", value: "buddy" },
|
|
@@ -84,6 +55,8 @@ export function build(buddy) {
|
|
|
84
55
|
options.webComponents = !0;
|
|
85
56
|
if (selected.has("functions"))
|
|
86
57
|
options.functions = !0;
|
|
58
|
+
if (selected.has("desktop"))
|
|
59
|
+
options.desktop = !0;
|
|
87
60
|
if (selected.has("docs"))
|
|
88
61
|
options.docs = !0;
|
|
89
62
|
if (selected.has("stacks"))
|
|
@@ -107,6 +80,8 @@ export function build(buddy) {
|
|
|
107
80
|
succeeded = await runBuildAction(Action.BuildWebComponentLib, "web component library") && succeeded;
|
|
108
81
|
if (options.functions)
|
|
109
82
|
succeeded = await runBuildAction(Action.BuildFunctionLib, "function library") && succeeded;
|
|
83
|
+
if (options.desktop)
|
|
84
|
+
succeeded = await runBuildAction(Action.BuildDesktop, "desktop application") && succeeded;
|
|
110
85
|
if (options.views)
|
|
111
86
|
succeeded = await runBuildAction(Action.BuildViews, "frontend") && succeeded;
|
|
112
87
|
if (options.stacks)
|
|
@@ -188,7 +163,39 @@ export function build(buddy) {
|
|
|
188
163
|
onUnknownSubcommand(buddy, "build");
|
|
189
164
|
}
|
|
190
165
|
function hasNoOptions(options) {
|
|
191
|
-
return !options.components && !options.webComponents && !options.elements && !options.functions && !options.views && !options.docs && !options.stacks && !options.buddy && !options.server;
|
|
166
|
+
return !options.components && !options.webComponents && !options.elements && !options.functions && !options.desktop && !options.views && !options.docs && !options.stacks && !options.buddy && !options.server;
|
|
167
|
+
}
|
|
168
|
+
export function applyBuildTarget(target, options) {
|
|
169
|
+
switch (target) {
|
|
170
|
+
case "components":
|
|
171
|
+
options.components = !0;
|
|
172
|
+
break;
|
|
173
|
+
case "web-components":
|
|
174
|
+
options.webComponents = !0;
|
|
175
|
+
break;
|
|
176
|
+
case "functions":
|
|
177
|
+
options.functions = !0;
|
|
178
|
+
break;
|
|
179
|
+
case "desktop":
|
|
180
|
+
options.desktop = !0;
|
|
181
|
+
break;
|
|
182
|
+
case "views":
|
|
183
|
+
options.views = !0;
|
|
184
|
+
break;
|
|
185
|
+
case "docs":
|
|
186
|
+
options.docs = !0;
|
|
187
|
+
break;
|
|
188
|
+
case "buddy":
|
|
189
|
+
case "cli":
|
|
190
|
+
options.buddy = !0;
|
|
191
|
+
break;
|
|
192
|
+
case "stacks":
|
|
193
|
+
options.stacks = !0;
|
|
194
|
+
break;
|
|
195
|
+
case "server":
|
|
196
|
+
options.server = !0;
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
192
199
|
}
|
|
193
200
|
async function runBuildAction(action, target) {
|
|
194
201
|
const result = await runAction(action);
|
package/dist/commands/create.js
CHANGED
|
@@ -15,7 +15,6 @@ export function create(buddy) {
|
|
|
15
15
|
ui: "Are you building a UI?",
|
|
16
16
|
components: "Are you building UI components?",
|
|
17
17
|
webComponents: "Automagically built optimized custom elements/web components?",
|
|
18
|
-
vue: "Automagically built a Vue component library?",
|
|
19
18
|
views: "How about views?",
|
|
20
19
|
functions: "Are you developing functions/composables?",
|
|
21
20
|
api: "Are you building an API?",
|
|
@@ -27,7 +26,7 @@ export function create(buddy) {
|
|
|
27
26
|
minimal: "Skip optional feature bundles (cms, commerce, dashboard, marketing, monitoring, realtime, queue) \u2014 bare-bones API/SPA starter that can re-add them later via `./buddy <feature>:install`.",
|
|
28
27
|
verbose: "Enable verbose output"
|
|
29
28
|
};
|
|
30
|
-
buddy.command("new [name]", descriptions.command).alias("create [name]").option("-n, --name [name]", descriptions.name, { default: !1 }).option("-u, --ui", descriptions.ui, { default: !0 }).option("-c, --components", descriptions.components, { default: !0 }).option("-w, --web-components", descriptions.webComponents, { default: !0 }).option("
|
|
29
|
+
buddy.command("new [name]", descriptions.command).alias("create [name]").option("-n, --name [name]", descriptions.name, { default: !1 }).option("-u, --ui", descriptions.ui, { default: !0 }).option("-c, --components", descriptions.components, { default: !0 }).option("-w, --web-components", descriptions.webComponents, { default: !0 }).option("-p, --views", descriptions.views, { default: !0 }).option("-f, --functions", descriptions.functions, { default: !0 }).option("-a, --api", descriptions.api, { default: !0 }).option("-d, --database", descriptions.database, { default: !0 }).option("-ca, --cache", descriptions.cache, { default: !1 }).option("-e, --email", descriptions.email, { default: !1 }).option("-P, --project [project]", descriptions.project, { default: !1 }).option("-m, --minimal", descriptions.minimal, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (name, options) => {
|
|
31
30
|
log.debug("Running `buddy new <name>` ...", options);
|
|
32
31
|
const startTime = await intro("buddy new");
|
|
33
32
|
name = name ?? options.name;
|
package/dist/commands/dev.js
CHANGED
|
@@ -159,7 +159,7 @@ export function dev(buddy) {
|
|
|
159
159
|
});
|
|
160
160
|
buddy.command("dev:components", descriptions.components).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
|
|
161
161
|
const perf = await intro("buddy dev:components"), result = await runCommand("bun run dev", {
|
|
162
|
-
cwd: libsPath("components/
|
|
162
|
+
cwd: libsPath("components/stx")
|
|
163
163
|
});
|
|
164
164
|
if (options.verbose)
|
|
165
165
|
log.info("buddy dev:components result", result);
|
|
@@ -277,7 +277,6 @@ export async function startDevelopmentServer(_options, _startTime) {
|
|
|
277
277
|
process.on("SIGTERM", cleanup);
|
|
278
278
|
process.on("SIGHUP", cleanup);
|
|
279
279
|
const quietOpts = { ...options, quiet: !0 }, a = await actions(), ports = [
|
|
280
|
-
{ name: "Frontend", port: frontendPort },
|
|
281
280
|
{ name: "API", port: apiPort }
|
|
282
281
|
], readinessTimeoutMs = 30000;
|
|
283
282
|
let readyAnnounced = !1;
|
package/dist/commands/list.d.ts
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
1
|
import type { CLI } from '@stacksjs/types';
|
|
2
|
+
import type { Command } from '@stacksjs/clapp';
|
|
2
3
|
export declare function list(buddy: CLI): void;
|
|
4
|
+
export declare function commandInventoryEntry(command: Command): BuddyCommandInventoryEntry;
|
|
5
|
+
export declare interface BuddyCommandInventoryOption {
|
|
6
|
+
name: string
|
|
7
|
+
flags: string[]
|
|
8
|
+
description: string
|
|
9
|
+
required: boolean
|
|
10
|
+
boolean: boolean
|
|
11
|
+
negated: boolean
|
|
12
|
+
default?: unknown
|
|
13
|
+
}
|
|
14
|
+
export declare interface BuddyCommandInventoryEntry {
|
|
15
|
+
name: string
|
|
16
|
+
description: string
|
|
17
|
+
aliases: string[]
|
|
18
|
+
namespace?: string
|
|
19
|
+
usage: string
|
|
20
|
+
arguments: Array<{
|
|
21
|
+
name: string
|
|
22
|
+
required: boolean
|
|
23
|
+
variadic: boolean
|
|
24
|
+
}>
|
|
25
|
+
options: BuddyCommandInventoryOption[]
|
|
26
|
+
examples: string[]
|
|
27
|
+
}
|
package/dist/commands/list.js
CHANGED
|
@@ -9,16 +9,17 @@ export function list(buddy) {
|
|
|
9
9
|
filter: "Filter commands by name or group",
|
|
10
10
|
namespace: "Filter commands by namespace (e.g., make, env, db)",
|
|
11
11
|
grouped: "Group commands by category",
|
|
12
|
-
format: "Output format (text, json)"
|
|
12
|
+
format: "Output format (text, json)",
|
|
13
|
+
json: "Output the complete command inventory as JSON"
|
|
13
14
|
};
|
|
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
|
+
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("-J, --json", descriptions.json, { default: !1 }).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").example("buddy list --json").action(async (options) => {
|
|
15
16
|
log.debug("Running `buddy list` ...", options);
|
|
16
17
|
const { bold, dim, green } = await import("@stacksjs/cli"), commands = buddy.commands || [];
|
|
17
18
|
let filteredCommands = commands;
|
|
18
19
|
if (options.filter) {
|
|
19
20
|
const filterStr = String(options.filter).toLowerCase();
|
|
20
21
|
filteredCommands = commands.filter((cmd) => {
|
|
21
|
-
const name = cmd
|
|
22
|
+
const name = canonicalCommandName(cmd), desc = cmd.description || "";
|
|
22
23
|
return name.toLowerCase().includes(filterStr) || desc.toLowerCase().includes(filterStr);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
@@ -29,7 +30,7 @@ export function list(buddy) {
|
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
if (filteredCommands.length === 0) {
|
|
32
|
-
if (options
|
|
33
|
+
if (usesJsonOutput(options))
|
|
33
34
|
console.log(JSON.stringify({ commands: [], total: 0 }, null, 2));
|
|
34
35
|
else {
|
|
35
36
|
console.log(dim("No commands found"));
|
|
@@ -38,19 +39,15 @@ export function list(buddy) {
|
|
|
38
39
|
}
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
if (options
|
|
42
|
-
const jsonOutput = filteredCommands.map((
|
|
43
|
-
name: cmd.name || "",
|
|
44
|
-
description: cmd.description || "",
|
|
45
|
-
aliases: cmd.aliasNames || []
|
|
46
|
-
}));
|
|
42
|
+
if (usesJsonOutput(options)) {
|
|
43
|
+
const jsonOutput = filteredCommands.map(commandInventoryEntry).sort((a, b) => a.name.localeCompare(b.name));
|
|
47
44
|
console.log(JSON.stringify({ commands: jsonOutput, total: jsonOutput.length }, null, 2));
|
|
48
45
|
return;
|
|
49
46
|
}
|
|
50
47
|
if (options.grouped) {
|
|
51
48
|
const groups = new Map;
|
|
52
49
|
for (const cmd of filteredCommands) {
|
|
53
|
-
const name = cmd
|
|
50
|
+
const name = canonicalCommandName(cmd);
|
|
54
51
|
if (!name)
|
|
55
52
|
continue;
|
|
56
53
|
let group = "General";
|
|
@@ -83,9 +80,9 @@ export function list(buddy) {
|
|
|
83
80
|
});
|
|
84
81
|
for (const [group, cmds] of sortedGroups) {
|
|
85
82
|
console.log(bold(`${group}:`));
|
|
86
|
-
cmds.sort((a, b) => (a
|
|
83
|
+
cmds.sort((a, b) => canonicalCommandName(a).localeCompare(canonicalCommandName(b)));
|
|
87
84
|
for (const cmd of cmds) {
|
|
88
|
-
const name = (cmd
|
|
85
|
+
const name = canonicalCommandName(cmd).padEnd(20), desc = cmd.description || "";
|
|
89
86
|
console.log(` ${green(name)} ${dim(desc)}`);
|
|
90
87
|
}
|
|
91
88
|
console.log("");
|
|
@@ -94,9 +91,9 @@ export function list(buddy) {
|
|
|
94
91
|
console.log("");
|
|
95
92
|
console.log(bold(green("Available Commands:")));
|
|
96
93
|
console.log("");
|
|
97
|
-
filteredCommands.sort((a, b) => (a
|
|
94
|
+
filteredCommands.sort((a, b) => canonicalCommandName(a).localeCompare(canonicalCommandName(b)));
|
|
98
95
|
for (const cmd of filteredCommands) {
|
|
99
|
-
const name = (cmd
|
|
96
|
+
const name = canonicalCommandName(cmd).padEnd(20), desc = cmd.description || "";
|
|
100
97
|
console.log(` ${green(name)} ${dim(desc)}`);
|
|
101
98
|
}
|
|
102
99
|
console.log("");
|
|
@@ -106,3 +103,38 @@ export function list(buddy) {
|
|
|
106
103
|
});
|
|
107
104
|
onUnknownSubcommand(buddy, "list");
|
|
108
105
|
}
|
|
106
|
+
export function commandInventoryEntry(command) {
|
|
107
|
+
const entry = {
|
|
108
|
+
name: canonicalCommandName(command),
|
|
109
|
+
description: command.description,
|
|
110
|
+
aliases: [...command.aliasNames],
|
|
111
|
+
usage: command.usageLine,
|
|
112
|
+
arguments: command.args.map((argument) => ({
|
|
113
|
+
name: argument.value,
|
|
114
|
+
required: argument.required,
|
|
115
|
+
variadic: argument.variadic
|
|
116
|
+
})),
|
|
117
|
+
options: command.options.map((option) => ({
|
|
118
|
+
name: option.name,
|
|
119
|
+
flags: declaredOptionFlags(option.rawName),
|
|
120
|
+
description: option.description,
|
|
121
|
+
required: option.required === !0,
|
|
122
|
+
boolean: option.isBoolean === !0,
|
|
123
|
+
negated: option.negated,
|
|
124
|
+
...option.config.default === void 0 ? {} : { default: option.config.default }
|
|
125
|
+
})),
|
|
126
|
+
examples: command.examples.map((example) => typeof example === "string" ? example : example("buddy"))
|
|
127
|
+
};
|
|
128
|
+
if (command.namespace)
|
|
129
|
+
entry.namespace = command.namespace;
|
|
130
|
+
return entry;
|
|
131
|
+
}
|
|
132
|
+
function canonicalCommandName(command) {
|
|
133
|
+
return command.namespace ? `${command.namespace}:${command.name}` : command.name;
|
|
134
|
+
}
|
|
135
|
+
function declaredOptionFlags(rawName) {
|
|
136
|
+
return [...rawName.matchAll(/-{1,2}([\w-]+)/g)].map((match) => match[1]);
|
|
137
|
+
}
|
|
138
|
+
function usesJsonOutput(options) {
|
|
139
|
+
return options.json === !0 || options.format === "json";
|
|
140
|
+
}
|
package/dist/commands/setup.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare function ensurePantryInstalled(): Promise<void>;
|
|
|
4
4
|
export declare function ensurePantryDependencies(cwd: string): Promise<void>;
|
|
5
5
|
export declare function ensureNodeDependencies(cwd: string): Promise<void>;
|
|
6
6
|
export declare function ensureAppKey(cwd: string): Promise<void>;
|
|
7
|
+
export declare function ensureIdeSettings(cwd: string): void;
|
|
7
8
|
export declare function pantryDatabasePackage(connection: string): DatabasePackage | undefined;
|
|
8
9
|
/**
|
|
9
10
|
* Reads config/deps.ts dependencies and merges in environment-detected
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { cpSync, existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { runAction } from "@stacksjs/actions";
|
|
@@ -172,6 +172,7 @@ async function initializeProject(options) {
|
|
|
172
172
|
if (!options.skipKeygen)
|
|
173
173
|
await ensureAppKey(cwd);
|
|
174
174
|
await runInitialMigration(cwd);
|
|
175
|
+
ensureIdeSettings(cwd);
|
|
175
176
|
if (!options.skipAws) {
|
|
176
177
|
log.info("Ensuring AWS is connected...");
|
|
177
178
|
try {
|
|
@@ -192,6 +193,19 @@ async function initializeProject(options) {
|
|
|
192
193
|
log.success("Project is setup");
|
|
193
194
|
log.info("Run `./buddy doctor` anytime to check your setup. Happy coding! \uD83D\uDC99");
|
|
194
195
|
}
|
|
196
|
+
export function ensureIdeSettings(cwd) {
|
|
197
|
+
const source = p.frameworkPath("defaults/ide/vscode/.vscode"), destination = join(cwd, ".vscode");
|
|
198
|
+
if (existsSync(destination)) {
|
|
199
|
+
log.debug(".vscode already exists; keeping the project settings");
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (!existsSync(source)) {
|
|
203
|
+
log.debug("No bundled VS Code settings found; skipping IDE setup");
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
cpSync(source, destination, { recursive: !0 });
|
|
207
|
+
log.success("Installed project VS Code settings");
|
|
208
|
+
}
|
|
195
209
|
const DB_CONNECTION_PACKAGES = {
|
|
196
210
|
postgres: { name: "postgresql.org", version: "^17.10" },
|
|
197
211
|
mysql: { name: "mysql.com", version: "*" },
|
package/dist/global-options.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { CLI } from '@stacksjs/cli';
|
|
2
2
|
/** Register Buddy's process-wide controls before any command modules load. */
|
|
3
|
-
export declare function registerGlobalOptions(buddy: CLI): void;
|
|
3
|
+
export declare function registerGlobalOptions(buddy: CLI, options?: GlobalOptionRegistration): void;
|
|
4
|
+
declare interface GlobalOptionRegistration {
|
|
5
|
+
version?: boolean
|
|
6
|
+
}
|
package/dist/global-options.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { versionDescriptor } from "./version-info";
|
|
2
|
-
export function registerGlobalOptions(buddy) {
|
|
3
|
-
buddy.version(versionDescriptor, "-V, --version").option("-v, --verbose", "Enable verbose output").option("-q, --quiet", "Suppress non-essential output").option("--debug", "Enable debug output and stack traces").option("--no-interaction", "Do not ask interactive questions").option("--env <environment>", "Target an environment").option("--dry-run", "Preview actions without making changes").option("--force", "Skip confirmation prompts").option("--no-emoji", "Disable emoji in output").option("--no-cache", "Disable command metadata caching");
|
|
2
|
+
export function registerGlobalOptions(buddy, options = {}) {
|
|
3
|
+
(options.version === !1 ? buddy : buddy.version(versionDescriptor, "-V, --version")).option("-v, --verbose", "Enable verbose output").option("-q, --quiet", "Suppress non-essential output").option("--debug", "Enable debug output and stack traces").option("--no-interaction", "Do not ask interactive questions").option("--env <environment>", "Target an environment").option("--dry-run", "Preview actions without making changes").option("--force", "Skip confirmation prompts").option("--no-emoji", "Disable emoji in output").option("--no-cache", "Disable command metadata caching");
|
|
4
4
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shouldSkipAppKeyCheck(requestedCommand: string, mode?: { isHelpFlag?: boolean, isHelpMode?: boolean }): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const APP_KEY_OPTIONAL_COMMANDS = [
|
|
2
|
+
"build",
|
|
3
|
+
"lint",
|
|
4
|
+
"lint:fix",
|
|
5
|
+
"test",
|
|
6
|
+
"test:types",
|
|
7
|
+
"test:unit",
|
|
8
|
+
"test:feature",
|
|
9
|
+
"typecheck",
|
|
10
|
+
"types:fix",
|
|
11
|
+
"types:generate",
|
|
12
|
+
"clean",
|
|
13
|
+
"fresh",
|
|
14
|
+
"about",
|
|
15
|
+
"doctor",
|
|
16
|
+
"list",
|
|
17
|
+
"setup",
|
|
18
|
+
"setup:ssl",
|
|
19
|
+
"setup:oh-my-zsh",
|
|
20
|
+
"deploy",
|
|
21
|
+
"serve",
|
|
22
|
+
"new",
|
|
23
|
+
"create",
|
|
24
|
+
"upgrade",
|
|
25
|
+
"update",
|
|
26
|
+
"migrate",
|
|
27
|
+
"seed",
|
|
28
|
+
"generate",
|
|
29
|
+
"make",
|
|
30
|
+
"key:generate",
|
|
31
|
+
"scaffold:crud"
|
|
32
|
+
];
|
|
33
|
+
export function shouldSkipAppKeyCheck(requestedCommand, mode = {}) {
|
|
34
|
+
return Boolean(mode.isHelpFlag || mode.isHelpMode || APP_KEY_OPTIONAL_COMMANDS.some((command) => requestedCommand === command || requestedCommand.startsWith(`${command}:`)));
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.161",
|
|
6
6
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"pwa",
|
|
33
33
|
"modern",
|
|
34
34
|
"library",
|
|
35
|
-
"
|
|
35
|
+
"stx",
|
|
36
36
|
"web components",
|
|
37
37
|
"typescript",
|
|
38
38
|
"javascript",
|
|
@@ -92,52 +92,52 @@
|
|
|
92
92
|
"prepublishOnly": "bun run build"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@stacksjs/actions": "^0.70.
|
|
96
|
-
"@stacksjs/ai": "^0.70.
|
|
97
|
-
"@stacksjs/alias": "^0.70.
|
|
98
|
-
"@stacksjs/arrays": "^0.70.
|
|
99
|
-
"@stacksjs/auth": "^0.70.
|
|
100
|
-
"@stacksjs/build": "^0.70.
|
|
101
|
-
"@stacksjs/cache": "^0.70.
|
|
102
|
-
"@stacksjs/cli": "^0.70.
|
|
95
|
+
"@stacksjs/actions": "^0.70.161",
|
|
96
|
+
"@stacksjs/ai": "^0.70.161",
|
|
97
|
+
"@stacksjs/alias": "^0.70.161",
|
|
98
|
+
"@stacksjs/arrays": "^0.70.161",
|
|
99
|
+
"@stacksjs/auth": "^0.70.161",
|
|
100
|
+
"@stacksjs/build": "^0.70.161",
|
|
101
|
+
"@stacksjs/cache": "^0.70.161",
|
|
102
|
+
"@stacksjs/cli": "^0.70.161",
|
|
103
103
|
"@stacksjs/clapp": "^0.2.12",
|
|
104
|
-
"@stacksjs/cloud": "^0.70.
|
|
105
|
-
"@stacksjs/collections": "^0.70.
|
|
106
|
-
"@stacksjs/config": "^0.70.
|
|
107
|
-
"@stacksjs/database": "^0.70.
|
|
108
|
-
"@stacksjs/desktop": "^0.70.
|
|
109
|
-
"@stacksjs/dns": "^0.70.
|
|
110
|
-
"@stacksjs/email": "^0.70.
|
|
111
|
-
"@stacksjs/enums": "^0.70.
|
|
112
|
-
"@stacksjs/error-handling": "^0.70.
|
|
113
|
-
"@stacksjs/events": "^0.70.
|
|
114
|
-
"@stacksjs/git": "^0.70.
|
|
104
|
+
"@stacksjs/cloud": "^0.70.161",
|
|
105
|
+
"@stacksjs/collections": "^0.70.161",
|
|
106
|
+
"@stacksjs/config": "^0.70.161",
|
|
107
|
+
"@stacksjs/database": "^0.70.161",
|
|
108
|
+
"@stacksjs/desktop": "^0.70.161",
|
|
109
|
+
"@stacksjs/dns": "^0.70.161",
|
|
110
|
+
"@stacksjs/email": "^0.70.161",
|
|
111
|
+
"@stacksjs/enums": "^0.70.161",
|
|
112
|
+
"@stacksjs/error-handling": "^0.70.161",
|
|
113
|
+
"@stacksjs/events": "^0.70.161",
|
|
114
|
+
"@stacksjs/git": "^0.70.161",
|
|
115
115
|
"@stacksjs/gitit": "^0.2.5",
|
|
116
|
-
"@stacksjs/health": "^0.70.
|
|
116
|
+
"@stacksjs/health": "^0.70.161",
|
|
117
117
|
"@stacksjs/dnsx": "^0.2.3",
|
|
118
118
|
"@stacksjs/httx": "^0.1.10",
|
|
119
|
-
"@stacksjs/lint": "^0.70.
|
|
120
|
-
"@stacksjs/logging": "^0.70.
|
|
121
|
-
"@stacksjs/notifications": "^0.70.
|
|
122
|
-
"@stacksjs/objects": "^0.70.
|
|
123
|
-
"@stacksjs/orm": "^0.70.
|
|
124
|
-
"@stacksjs/path": "^0.70.
|
|
125
|
-
"@stacksjs/payments": "^0.70.
|
|
126
|
-
"@stacksjs/realtime": "^0.70.
|
|
127
|
-
"@stacksjs/router": "^0.70.
|
|
119
|
+
"@stacksjs/lint": "^0.70.161",
|
|
120
|
+
"@stacksjs/logging": "^0.70.161",
|
|
121
|
+
"@stacksjs/notifications": "^0.70.161",
|
|
122
|
+
"@stacksjs/objects": "^0.70.161",
|
|
123
|
+
"@stacksjs/orm": "^0.70.161",
|
|
124
|
+
"@stacksjs/path": "^0.70.161",
|
|
125
|
+
"@stacksjs/payments": "^0.70.161",
|
|
126
|
+
"@stacksjs/realtime": "^0.70.161",
|
|
127
|
+
"@stacksjs/router": "^0.70.161",
|
|
128
128
|
"@stacksjs/rpx": "^0.11.31",
|
|
129
|
-
"@stacksjs/search-engine": "^0.70.
|
|
130
|
-
"@stacksjs/security": "^0.70.
|
|
131
|
-
"@stacksjs/server": "^0.70.
|
|
132
|
-
"@stacksjs/storage": "^0.70.
|
|
133
|
-
"@stacksjs/strings": "^0.70.
|
|
134
|
-
"@stacksjs/testing": "^0.70.
|
|
135
|
-
"@stacksjs/tunnel": "^0.70.
|
|
136
|
-
"@stacksjs/types": "^0.70.
|
|
137
|
-
"@stacksjs/ui": "^0.70.
|
|
138
|
-
"@stacksjs/utils": "^0.70.
|
|
139
|
-
"@stacksjs/validation": "^0.70.
|
|
140
|
-
"@stacksjs/ts-cloud": "^0.7.
|
|
129
|
+
"@stacksjs/search-engine": "^0.70.161",
|
|
130
|
+
"@stacksjs/security": "^0.70.161",
|
|
131
|
+
"@stacksjs/server": "^0.70.161",
|
|
132
|
+
"@stacksjs/storage": "^0.70.161",
|
|
133
|
+
"@stacksjs/strings": "^0.70.161",
|
|
134
|
+
"@stacksjs/testing": "^0.70.161",
|
|
135
|
+
"@stacksjs/tunnel": "^0.70.161",
|
|
136
|
+
"@stacksjs/types": "^0.70.161",
|
|
137
|
+
"@stacksjs/ui": "^0.70.161",
|
|
138
|
+
"@stacksjs/utils": "^0.70.161",
|
|
139
|
+
"@stacksjs/validation": "^0.70.161",
|
|
140
|
+
"@stacksjs/ts-cloud": "^0.7.49"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"better-dx": "^0.2.17"
|