@stacksjs/buddy 0.70.252 → 0.70.253

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.
@@ -1535,6 +1535,12 @@ export function deploy(buddy) {
1535
1535
  };
1536
1536
  buddy.command("deploy [env]", descriptions.deploy).option("--domain", descriptions.domain, { default: void 0 }).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--prod", descriptions.production, { default: !0 }).option("--dev", descriptions.development, { default: !1 }).option("--yes", descriptions.yes, { default: !1 }).option("--site <name>", "Deploy only this one site to the existing server (multi-tenant surgical add)", { default: void 0 }).option("--staging", descriptions.staging, { default: !1 }).option("--docker", "Also build an OCI image with pantry (native, no Docker daemon) and push it to the pantry registry", { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (envArg, options) => {
1537
1537
  log.debug("Running `buddy deploy` ...", options);
1538
+ if (process.argv.includes("--dry-run") || options.dryRun === !0) {
1539
+ log.error("`buddy deploy --dry-run` is not supported.");
1540
+ log.info("Deploy has no preview mode: provisioning, release shipping, and DNS all mutate real infrastructure.");
1541
+ log.info("To see what would ship without touching the server, inspect `config/cloud.ts` sites, or run `buddy deploy --site <name>` to narrow a real deploy to one site.");
1542
+ process.exit(ExitCode.FatalError);
1543
+ }
1538
1544
  await ensureDeployPrerequisites(options.verbose === !0);
1539
1545
  const deployEnv = envArg || (options.staging ? "staging" : options.dev ? "development" : "production"), deployEnvName = deployEnv === "prod" ? "production" : deployEnv === "dev" ? "development" : deployEnv;
1540
1546
  process.env.APP_ENV = deployEnvName;
@@ -8,6 +8,13 @@ export declare function shouldUsePrettyDevUrls(input: {
8
8
  systemAuthorized: boolean
9
9
  }): boolean;
10
10
  export declare function normalizeDevelopmentEntryPath(path: string | undefined): string;
11
+ export declare function resolveDevelopmentLaunch(input?: {
12
+ root?: string
13
+ browser?: boolean
14
+ native?: boolean
15
+ site?: boolean
16
+ configuredLaunch?: 'browser' | 'native'
17
+ }): 'browser' | 'native';
11
18
  export declare function resolveDevelopmentEntryPath(input?: {
12
19
  root?: string
13
20
  site?: boolean
@@ -110,6 +110,25 @@ function configuredApplicationPath(root) {
110
110
  return;
111
111
  }
112
112
  }
113
+ function configuredDevelopmentLaunch(root) {
114
+ const environmentValue = process.env.STACKS_DEV_LAUNCH?.trim().toLowerCase();
115
+ if (environmentValue === "browser" || environmentValue === "native")
116
+ return environmentValue;
117
+ try {
118
+ const value = readFileSync(join(root, "config/app.ts"), "utf8").match(/\bdevLaunch\s*:\s*(['"`])(browser|native)\1/)?.[2];
119
+ return value === "browser" || value === "native" ? value : void 0;
120
+ } catch {
121
+ return;
122
+ }
123
+ }
124
+ export function resolveDevelopmentLaunch(input = {}) {
125
+ if (input.browser || input.site)
126
+ return "browser";
127
+ if (input.native)
128
+ return "native";
129
+ const root = input.root ?? projectPath();
130
+ return input.configuredLaunch ?? configuredDevelopmentLaunch(root) ?? "browser";
131
+ }
113
132
  function viewSource(root, route) {
114
133
  const base = join(root, "resources/views", route);
115
134
  for (const extension of ["stx", "vue", "html"]) {
@@ -188,11 +207,12 @@ export function dev(buddy) {
188
207
  interactive: "Get asked which development server to start",
189
208
  select: "Which development server are you trying to start?",
190
209
  withLocalhost: "Include the localhost URL in the output",
210
+ browser: "Open the application in a browser instead of its configured native window",
191
211
  site: "Open the marketing site instead of the application",
192
212
  project: "Target a specific project",
193
213
  verbose: "Enable verbose output"
194
214
  };
195
- buddy.command("dev [server]", descriptions.dev).option("-f, --frontend", descriptions.frontend).option("-a, --api", descriptions.api).option("-c, --components", descriptions.components).option("-d, --dashboard", descriptions.dashboard).option("-k, --desktop", descriptions.desktop).option("-n, --native", descriptions.native).option("-o, --docs", descriptions.docs).option("-s, --system-tray", descriptions.systemTray).option("-i, --interactive", descriptions.interactive, { default: !1 }).option("-l, --with-localhost", descriptions.withLocalhost, { default: !1 }).option("--site", descriptions.site, { default: !1 }).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (server, options) => {
215
+ buddy.command("dev [server]", descriptions.dev).option("-f, --frontend", descriptions.frontend).option("-a, --api", descriptions.api).option("-c, --components", descriptions.components).option("-d, --dashboard", descriptions.dashboard).option("-k, --desktop", descriptions.desktop).option("-n, --native", descriptions.native).option("-o, --docs", descriptions.docs).option("-s, --system-tray", descriptions.systemTray).option("-i, --interactive", descriptions.interactive, { default: !1 }).option("-l, --with-localhost", descriptions.withLocalhost, { default: !1 }).option("--browser", descriptions.browser, { default: !1 }).option("--site", descriptions.site, { default: !1 }).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (server, options) => {
196
216
  const perf = Bun.nanoseconds();
197
217
  process.env.STACKS_DEV_ENTRY_PATH = resolveDevelopmentEntryPath({ site: options.site });
198
218
  const target = server || (options.frontend ? "frontend" : void 0) || (options.api ? "api" : void 0) || (options.components ? "components" : void 0) || (options.dashboard ? "dashboard" : void 0) || (options.desktop ? "desktop" : void 0) || (options.native ? "native" : void 0) || (options.systemTray || options["system-tray"] ? "system-tray" : void 0) || (options.docs ? "docs" : void 0);
@@ -215,7 +235,7 @@ export function dev(buddy) {
215
235
  await a.runDashboardDevServer(serverOptions);
216
236
  break;
217
237
  case "desktop":
218
- await a.runDesktopDevServer(serverOptions);
238
+ await startDevelopmentServer({ ...serverOptions, native: !0 }, perf);
219
239
  break;
220
240
  case "system-tray":
221
241
  await a.runSystemTrayDevServer(serverOptions);
@@ -239,7 +259,7 @@ export function dev(buddy) {
239
259
  frontend: () => a.runFrontendDevServer(options),
240
260
  api: () => a.runApiDevServer(options),
241
261
  dashboard: () => a.runDashboardDevServer(options),
242
- desktop: () => a.runDesktopDevServer(options),
262
+ desktop: () => startDevelopmentServer({ ...options, native: !0 }, perf),
243
263
  native: () => startDevelopmentServer({ ...options, native: !0 }, perf),
244
264
  components: () => a.runComponentsDevServer(options),
245
265
  docs: () => a.runDocsDevServer(options)
@@ -281,14 +301,8 @@ export function dev(buddy) {
281
301
  await startDevelopmentServer({ ...options, native: !0 }, perf);
282
302
  });
283
303
  buddy.command("dev:desktop", descriptions.desktop).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
284
- const perf = await intro("buddy dev:desktop"), result = await (await actions()).runAction(Action.DevDesktop, options);
285
- if (result.isErr) {
286
- await outro("While running the dev:desktop command, there was an issue", { startTime: perf, useSeconds: !0 }, result.error);
287
- process.exit(ExitCode.FatalError);
288
- }
289
- console.log("");
290
- await outro("Exited", { startTime: perf, useSeconds: !0 });
291
- process.exit(ExitCode.Success);
304
+ const perf = await intro("buddy dev:desktop");
305
+ await startDevelopmentServer({ ...options, native: !0 }, perf);
292
306
  });
293
307
  buddy.command("dev:api", descriptions.api).option("-p, --project [project]", descriptions.project, { default: !1 }).option("--no-watch-types", "Skip the model/config type-regeneration watcher", { default: !1 }).option("--verbose", descriptions.verbose, { default: !1 }).action(async (options) => {
294
308
  const a = await actions();
@@ -311,7 +325,11 @@ export function dev(buddy) {
311
325
  onUnknownSubcommand(buddy, "dev");
312
326
  }
313
327
  export async function startDevelopmentServer(_options, _startTime) {
314
- const options = _options, startedAt = _startTime, appUrl = process.env.APP_URL ?? "stacks.localhost", nativeMode = options.native === !0, entryPath = resolveDevelopmentEntryPath({ site: options.site });
328
+ const options = _options, startedAt = _startTime, appUrl = process.env.APP_URL ?? "stacks.localhost", nativeMode = resolveDevelopmentLaunch({
329
+ browser: options.browser,
330
+ native: options.native,
331
+ site: options.site
332
+ }) === "native", entryPath = resolveDevelopmentEntryPath({ site: options.site });
315
333
  process.env.STACKS_DEV_ENTRY_PATH = entryPath;
316
334
  const proxyManagedExternally = process.env.STACKS_PROXY_MANAGED === "1", preferredFrontendPort = Number(process.env.PORT) || 3000, preferredApiPort = Number(process.env.PORT_API) || 3008, preferredDocsPort = Number(process.env.PORT_DOCS) || 3006, preferredDashboardPort = Number(process.env.PORT_ADMIN) || 3002;
317
335
  if (process.env.STACKS_DEV_NO_KILL !== "1")
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.252",
5
+ "version": "0.70.253",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -88,53 +88,53 @@
88
88
  "prepublishOnly": "bun run build"
89
89
  },
90
90
  "dependencies": {
91
- "@stacksjs/actions": "^0.70.252",
92
- "@stacksjs/ai": "^0.70.252",
93
- "@stacksjs/alias": "^0.70.252",
94
- "@stacksjs/arrays": "^0.70.252",
95
- "@stacksjs/auth": "^0.70.252",
96
- "@stacksjs/build": "^0.70.252",
97
- "@stacksjs/cache": "^0.70.252",
98
- "@stacksjs/cli": "^0.70.252",
91
+ "@stacksjs/actions": "^0.70.253",
92
+ "@stacksjs/ai": "^0.70.253",
93
+ "@stacksjs/alias": "^0.70.253",
94
+ "@stacksjs/arrays": "^0.70.253",
95
+ "@stacksjs/auth": "^0.70.253",
96
+ "@stacksjs/build": "^0.70.253",
97
+ "@stacksjs/cache": "^0.70.253",
98
+ "@stacksjs/cli": "^0.70.253",
99
99
  "@stacksjs/clapp": "^0.2.12",
100
- "@stacksjs/cloud": "^0.70.252",
101
- "@stacksjs/collections": "^0.70.252",
102
- "@stacksjs/config": "^0.70.252",
103
- "@stacksjs/database": "^0.70.252",
104
- "@stacksjs/desktop-build": "^0.70.252",
105
- "@stacksjs/dns": "^0.70.252",
106
- "@stacksjs/email": "^0.70.252",
107
- "@stacksjs/enums": "^0.70.252",
108
- "@stacksjs/error-handling": "^0.70.252",
109
- "@stacksjs/events": "^0.70.252",
110
- "@stacksjs/git": "^0.70.252",
100
+ "@stacksjs/cloud": "^0.70.253",
101
+ "@stacksjs/collections": "^0.70.253",
102
+ "@stacksjs/config": "^0.70.253",
103
+ "@stacksjs/database": "^0.70.253",
104
+ "@stacksjs/desktop-build": "^0.70.253",
105
+ "@stacksjs/dns": "^0.70.253",
106
+ "@stacksjs/email": "^0.70.253",
107
+ "@stacksjs/enums": "^0.70.253",
108
+ "@stacksjs/error-handling": "^0.70.253",
109
+ "@stacksjs/events": "^0.70.253",
110
+ "@stacksjs/git": "^0.70.253",
111
111
  "@stacksjs/gitit": "^0.2.5",
112
- "@stacksjs/health": "^0.70.252",
112
+ "@stacksjs/health": "^0.70.253",
113
113
  "@stacksjs/dnsx": "^0.2.3",
114
114
  "@stacksjs/httx": "^0.1.10",
115
- "@stacksjs/image": "^0.70.252",
116
- "@stacksjs/lint": "^0.70.252",
117
- "@stacksjs/logging": "^0.70.252",
118
- "@stacksjs/notifications": "^0.70.252",
119
- "@stacksjs/objects": "^0.70.252",
120
- "@stacksjs/orm": "^0.70.252",
121
- "@stacksjs/path": "^0.70.252",
122
- "@stacksjs/skills": "^0.70.252",
123
- "@stacksjs/payments": "^0.70.252",
124
- "@stacksjs/realtime": "^0.70.252",
125
- "@stacksjs/router": "^0.70.252",
115
+ "@stacksjs/image": "^0.70.253",
116
+ "@stacksjs/lint": "^0.70.253",
117
+ "@stacksjs/logging": "^0.70.253",
118
+ "@stacksjs/notifications": "^0.70.253",
119
+ "@stacksjs/objects": "^0.70.253",
120
+ "@stacksjs/orm": "^0.70.253",
121
+ "@stacksjs/path": "^0.70.253",
122
+ "@stacksjs/skills": "^0.70.253",
123
+ "@stacksjs/payments": "^0.70.253",
124
+ "@stacksjs/realtime": "^0.70.253",
125
+ "@stacksjs/router": "^0.70.253",
126
126
  "@stacksjs/rpx": "^0.11.42",
127
- "@stacksjs/search-engine": "^0.70.252",
128
- "@stacksjs/security": "^0.70.252",
129
- "@stacksjs/server": "^0.70.252",
130
- "@stacksjs/storage": "^0.70.252",
131
- "@stacksjs/strings": "^0.70.252",
132
- "@stacksjs/testing": "^0.70.252",
133
- "@stacksjs/tunnel": "^0.70.252",
134
- "@stacksjs/types": "^0.70.252",
135
- "@stacksjs/ui": "^0.70.252",
136
- "@stacksjs/utils": "^0.70.252",
137
- "@stacksjs/validation": "^0.70.252",
127
+ "@stacksjs/search-engine": "^0.70.253",
128
+ "@stacksjs/security": "^0.70.253",
129
+ "@stacksjs/server": "^0.70.253",
130
+ "@stacksjs/storage": "^0.70.253",
131
+ "@stacksjs/strings": "^0.70.253",
132
+ "@stacksjs/testing": "^0.70.253",
133
+ "@stacksjs/tunnel": "^0.70.253",
134
+ "@stacksjs/types": "^0.70.253",
135
+ "@stacksjs/ui": "^0.70.253",
136
+ "@stacksjs/utils": "^0.70.253",
137
+ "@stacksjs/validation": "^0.70.253",
138
138
  "@stacksjs/ts-cloud": "^0.7.92",
139
139
  "ajv": "^8.20.0",
140
140
  "ajv-formats": "^3.0.1",