@stacksjs/actions 0.58.27 → 0.58.43

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.
@@ -2,24 +2,20 @@
2
2
  // src/build/core.ts
3
3
  import process from "process";
4
4
  import {glob} from "@stacksjs/storage";
5
+ import {dim, italic, log} from "@stacksjs/cli";
5
6
  import {corePath} from "@stacksjs/path";
6
7
  import {ExitCode} from "@stacksjs/types";
7
- import {dim, italic, log, runCommand} from "@stacksjs/cli";
8
+ var {$ } = globalThis.Bun;
8
9
  log.info("Building core packages");
9
- var dirs = await glob([corePath("*")], { onlyDirectories: true });
10
+ var dirs = (await glob([corePath("*")], { onlyDirectories: true })).sort();
10
11
  if (dirs.length === 0) {
11
12
  log.info("No core packages found");
12
13
  process.exit(ExitCode.FatalError);
13
14
  }
14
- dirs.forEach(async (folder) => {
15
- log.info("\uD83C\uDFD7\uFE0F Building...");
16
- log.info(`\uD83D\uDCE6 ${italic(dim(folder))}`);
17
- const result = await runCommand("bun --bun run build", {
18
- cwd: folder
19
- });
20
- if (result.isErr()) {
21
- log.error(`Failed to build ${italic(folder)}`);
22
- process.exit(ExitCode.FatalError);
23
- }
24
- log.success("\u2705 Build complete");
25
- });
15
+ for (const folder of dirs) {
16
+ log.info(`\uD83C\uDFD7\uFE0F Building ${italic(dim(folder))}`);
17
+ $.cwd(folder);
18
+ await $`bun run build`;
19
+ log.success(`${italic(dim(folder))} built`);
20
+ console.log(``);
21
+ }
@@ -24,7 +24,7 @@ await runCommand("bun zip/api.ts", {
24
24
  await runCommand("bun zip.ts", {
25
25
  cwd: p.cloudPath()
26
26
  });
27
- log.info("Preparing deployment...");
27
+ log.info("Preparing Deployment...");
28
28
  var profile = process.env.AWS_PROFILE || "stacks";
29
29
  await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
30
30
  cwd: p.cloudPath()
@@ -5,7 +5,7 @@ import {parseOptions, runCommand} from "@stacksjs/cli";
5
5
  var options = parseOptions();
6
6
  if (options.verbose)
7
7
  console.log("dev components options", options);
8
- await runCommand(`bunx --bun vite --config ${vitePath("src/components.ts")}`, {
8
+ await runCommand(`bunx vite --config ${vitePath("src/components.ts")}`, {
9
9
  ...options,
10
10
  cwd: frameworkPath()
11
11
  });
@@ -71,6 +71,14 @@ async function runComponentsDevServer(options) {
71
71
  log2.info("Starting your Library Engine...");
72
72
  await runAction(Action.DevComponents, options);
73
73
  }
74
+ async function runDashboardDevServer(options) {
75
+ log2.info("Starting your Dashboard...");
76
+ await runAction(Action.DevDashboard, options);
77
+ }
78
+ async function runSystemTrayDevServer(options) {
79
+ log2.info("Starting your System Tray...");
80
+ await runAction(Action.DevSystemTray, options);
81
+ }
74
82
  async function runDesktopDevServer(options) {
75
83
  log2.info("Starting your Desktop Engine...");
76
84
  await runAction(Action.DevDesktop, options);
@@ -80,10 +88,12 @@ async function runDocsDevServer(options) {
80
88
  await runAction(Action.DevDocs, options);
81
89
  }
82
90
  export {
91
+ runSystemTrayDevServer,
83
92
  runFrontendDevServer,
84
93
  runDocsDevServer,
85
94
  runDevServer,
86
95
  runDesktopDevServer,
96
+ runDashboardDevServer,
87
97
  runComponentsDevServer,
88
98
  runBackendDevServer,
89
99
  runApiDevServer
@@ -6,7 +6,7 @@ import {log} from "@stacksjs/logging";
6
6
  import {customElementsDataPath} from "@stacksjs/path";
7
7
  import {writeTextFile} from "@stacksjs/storage";
8
8
 
9
- // /home/runner/work/stacks/stacks/config/library.ts
9
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
10
10
  var library_default = {
11
11
  name: "hello-world",
12
12
  owner: "@stacksjs",
@@ -10,7 +10,7 @@ import {writeTextFile} from "@stacksjs/storage";
10
10
  import {determineResetPreset} from "@stacksjs/utils";
11
11
  import {ExitCode} from "@stacksjs/types";
12
12
 
13
- // /home/runner/work/stacks/stacks/config/library.ts
13
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
14
14
  var library_default = {
15
15
  name: "hello-world",
16
16
  owner: "@stacksjs",
@@ -70,18 +70,18 @@ async function createLibraryEntryPoint(type) {
70
70
  await createFunctionLibraryEntryPoint();
71
71
  }
72
72
  async function createVueLibraryEntryPoint(type = "vue-components") {
73
- log.info("Creating the Vue component library entry point...");
73
+ log.info("Creating Vue Component Library Entry Point...");
74
74
  await writeTextFile({
75
75
  path: libraryEntryPath(type),
76
76
  data: generateEntryPointData(type)
77
77
  }).catch((err) => {
78
- log.error("There was an error generating the Vue component library entry point.", err);
78
+ log.error("There was an error generating the Vue Component Library Entry Point.", err);
79
79
  process.exit(ExitCode.FatalError);
80
80
  });
81
- log.success("Created the Vue component library entry point");
81
+ log.success("Created Vue Component Library Entry Point");
82
82
  }
83
83
  async function createWebComponentLibraryEntryPoint(type = "web-components") {
84
- log.info("Creating the Web Component library entry point...");
84
+ log.info("Creating Web Component Library Entry Point...");
85
85
  await writeTextFile({
86
86
  path: libraryEntryPath(type),
87
87
  data: generateEntryPointData(type)
@@ -89,18 +89,18 @@ async function createWebComponentLibraryEntryPoint(type = "web-components") {
89
89
  log.error("There was an error generating the Web Component library entry point", err);
90
90
  process.exit(ExitCode.FatalError);
91
91
  });
92
- log.success("Created Web Component library entry point");
92
+ log.success("Created Web Component Library Entry Point");
93
93
  }
94
94
  async function createFunctionLibraryEntryPoint(type = "functions") {
95
- log.info("Creating the Function library entry point...");
95
+ log.info("Creating Function Library Entry Point...");
96
96
  await writeTextFile({
97
97
  path: libraryEntryPath(type),
98
98
  data: generateEntryPointData(type)
99
99
  }).catch((err) => {
100
- log.error("There was an error generating Function library entry point", err);
100
+ log.error("There was an error generating Function Library Entry Point", err);
101
101
  process.exit(ExitCode.FatalError);
102
102
  });
103
- log.success("Created Functions library entry point");
103
+ log.success("Created Functions Library Entry Point");
104
104
  }
105
105
  function generateEntryPointData(type) {
106
106
  let arr = [];
@@ -6,7 +6,7 @@ import {log} from "@stacksjs/logging";
6
6
  import {customElementsDataPath} from "@stacksjs/path";
7
7
  import {writeTextFile} from "@stacksjs/storage";
8
8
 
9
- // /home/runner/work/stacks/stacks/config/library.ts
9
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
10
10
  var library_default = {
11
11
  name: "hello-world",
12
12
  owner: "@stacksjs",
@@ -8,7 +8,7 @@ import {writeTextFile} from "@stacksjs/storage";
8
8
  import {determineResetPreset} from "@stacksjs/utils";
9
9
  import {ExitCode} from "@stacksjs/types";
10
10
 
11
- // /home/runner/work/stacks/stacks/config/library.ts
11
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
12
12
  var library_default = {
13
13
  name: "hello-world",
14
14
  owner: "@stacksjs",
@@ -68,18 +68,18 @@ async function createLibraryEntryPoint(type) {
68
68
  await createFunctionLibraryEntryPoint();
69
69
  }
70
70
  async function createVueLibraryEntryPoint(type = "vue-components") {
71
- log.info("Creating the Vue component library entry point...");
71
+ log.info("Creating Vue Component Library Entry Point...");
72
72
  await writeTextFile({
73
73
  path: libraryEntryPath(type),
74
74
  data: generateEntryPointData(type)
75
75
  }).catch((err) => {
76
- log.error("There was an error generating the Vue component library entry point.", err);
76
+ log.error("There was an error generating the Vue Component Library Entry Point.", err);
77
77
  process.exit(ExitCode.FatalError);
78
78
  });
79
- log.success("Created the Vue component library entry point");
79
+ log.success("Created Vue Component Library Entry Point");
80
80
  }
81
81
  async function createWebComponentLibraryEntryPoint(type = "web-components") {
82
- log.info("Creating the Web Component library entry point...");
82
+ log.info("Creating Web Component Library Entry Point...");
83
83
  await writeTextFile({
84
84
  path: libraryEntryPath(type),
85
85
  data: generateEntryPointData(type)
@@ -87,18 +87,18 @@ async function createWebComponentLibraryEntryPoint(type = "web-components") {
87
87
  log.error("There was an error generating the Web Component library entry point", err);
88
88
  process.exit(ExitCode.FatalError);
89
89
  });
90
- log.success("Created Web Component library entry point");
90
+ log.success("Created Web Component Library Entry Point");
91
91
  }
92
92
  async function createFunctionLibraryEntryPoint(type = "functions") {
93
- log.info("Creating the Function library entry point...");
93
+ log.info("Creating Function Library Entry Point...");
94
94
  await writeTextFile({
95
95
  path: libraryEntryPath(type),
96
96
  data: generateEntryPointData(type)
97
97
  }).catch((err) => {
98
- log.error("There was an error generating Function library entry point", err);
98
+ log.error("There was an error generating Function Library Entry Point", err);
99
99
  process.exit(ExitCode.FatalError);
100
100
  });
101
- log.success("Created Functions library entry point");
101
+ log.success("Created Functions Library Entry Point");
102
102
  }
103
103
  function generateEntryPointData(type) {
104
104
  let arr = [];
@@ -4,7 +4,7 @@ import {log} from "@stacksjs/logging";
4
4
  import {writeTextFile} from "@stacksjs/storage";
5
5
  import {packageJsonPath} from "@stacksjs/path";
6
6
 
7
- // /home/runner/work/stacks/stacks/config/library.ts
7
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
8
8
  var library_default = {
9
9
  name: "hello-world",
10
10
  owner: "@stacksjs",
@@ -125,7 +125,7 @@ async function generatePackageJson(type) {
125
125
  prettyName = "Web Component library";
126
126
  else if (type === "functions")
127
127
  prettyName = "Function Library";
128
- log.success(`Created the ${prettyName} package.json file`);
128
+ log.success(`Created ${prettyName} package.json file`);
129
129
  } catch (err) {
130
130
  log.error(`There was an error creating the ${prettyName} package.json`, err);
131
131
  }
@@ -4,7 +4,7 @@ import {log} from "@stacksjs/logging";
4
4
  import {customElementsDataPath} from "@stacksjs/path";
5
5
  import {writeTextFile} from "@stacksjs/storage";
6
6
 
7
- // /home/runner/work/stacks/stacks/config/library.ts
7
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
8
8
  var library_default = {
9
9
  name: "hello-world",
10
10
  owner: "@stacksjs",
package/dist/src/index.js CHANGED
@@ -71,6 +71,14 @@ async function runComponentsDevServer(options) {
71
71
  log2.info("Starting your Library Engine...");
72
72
  await runAction(Action.DevComponents, options);
73
73
  }
74
+ async function runDashboardDevServer(options) {
75
+ log2.info("Starting your Dashboard...");
76
+ await runAction(Action.DevDashboard, options);
77
+ }
78
+ async function runSystemTrayDevServer(options) {
79
+ log2.info("Starting your System Tray...");
80
+ await runAction(Action.DevSystemTray, options);
81
+ }
74
82
  async function runDesktopDevServer(options) {
75
83
  log2.info("Starting your Desktop Engine...");
76
84
  await runAction(Action.DevDesktop, options);
@@ -274,7 +282,7 @@ async function makeComponent(options) {
274
282
  const name = options.name;
275
283
  log6.info("Creating your component...");
276
284
  await createComponent(options);
277
- log6.success(`Created the ${italic2(name)} component`);
285
+ log6.success(`Created ${italic2(name)} component`);
278
286
  } catch (error) {
279
287
  log6.error("There was an error creating your component", error);
280
288
  process3.exit();
@@ -302,7 +310,7 @@ function makeDatabase(options) {
302
310
  const name = options.name;
303
311
  log6.info(`Creating your ${italic2(name)} database...`);
304
312
  createDatabase(options);
305
- log6.success(`Created the ${italic2(name)} database`);
313
+ log6.success(`Created ${italic2(name)} database`);
306
314
  } catch (error) {
307
315
  log6.error("There was an error creating your database", error);
308
316
  process3.exit();
@@ -316,7 +324,7 @@ function factory(options) {
316
324
  const name = options.name;
317
325
  log6.info(`Creating your ${italic2(name)} factory...`);
318
326
  createDatabase(options);
319
- log6.success(`Created the ${italic2(name)} factory`);
327
+ log6.success(`Created ${italic2(name)} factory`);
320
328
  } catch (error) {
321
329
  log6.error("There was an error creating your factory", error);
322
330
  process3.exit();
@@ -330,7 +338,7 @@ async function makeNotification(options) {
330
338
  const name = options.name;
331
339
  log6.info(`Creating your ${italic2(name)} notification...`);
332
340
  await createNotification(options);
333
- log6.success(`Created the ${italic2(name)} notification`);
341
+ log6.success(`Created ${italic2(name)} notification`);
334
342
  } catch (error) {
335
343
  log6.error("There was an error creating your notification", error);
336
344
  process3.exit();
@@ -341,7 +349,7 @@ async function makePage(options) {
341
349
  const name = options.name;
342
350
  log6.info("Creating your page...");
343
351
  await createPage(options);
344
- log6.success(`Created the ${name} page`);
352
+ log6.success(`Created ${name} page`);
345
353
  } catch (error) {
346
354
  log6.error("There was an error creating your page", error);
347
355
  process3.exit();
@@ -369,7 +377,7 @@ async function makeFunction(options) {
369
377
  const name = options.name;
370
378
  log6.info("Creating your function...");
371
379
  await createFunction(options);
372
- log6.success(`Created the ${name} function`);
380
+ log6.success(`Created ${name} function`);
373
381
  } catch (error) {
374
382
  log6.error("There was an error creating your function", error);
375
383
  process3.exit();
@@ -399,7 +407,7 @@ async function makeLanguage(options) {
399
407
  const name = options.name;
400
408
  log6.info("Creating your translation file...");
401
409
  await createLanguage(options);
402
- log6.success(`Created the ${name} translation file`);
410
+ log6.success(`Created ${name} translation file`);
403
411
  } catch (error) {
404
412
  log6.error("There was an error creating your language.", error);
405
413
  process3.exit();
@@ -526,12 +534,14 @@ class Action3 {
526
534
  }
527
535
  }
528
536
  export {
537
+ runSystemTrayDevServer,
529
538
  make as runMake,
530
539
  runFrontendDevServer,
531
540
  examples as runExample,
532
541
  runDocsDevServer,
533
542
  runDevServer,
534
543
  runDesktopDevServer,
544
+ runDashboardDevServer,
535
545
  runComponentsDevServer,
536
546
  commit as runCommit,
537
547
  runBackendDevServer,
@@ -3,6 +3,6 @@
3
3
  import {log, runCommands} from "@stacksjs/cli";
4
4
  import {projectPath} from "@stacksjs/path";
5
5
  import {NpmScript} from "@stacksjs/enums";
6
- log.info("Ensuring code style...");
6
+ log.info("Ensuring Code Style...");
7
7
  await runCommands([NpmScript.LintFix], { cwd: projectPath() });
8
8
  log.success("Linted");
@@ -1,21 +1,17 @@
1
1
  // @bun
2
2
  // src/lint/index.ts
3
3
  import process from "process";
4
- import {runCommands} from "@stacksjs/cli";
5
- import {projectPath} from "@stacksjs/path";
6
4
  import {ExitCode} from "@stacksjs/types";
7
5
  import {NpmScript} from "@stacksjs/enums";
8
- async function lintAction() {
9
- const result = await runCommands([
10
- NpmScript.Lint,
11
- NpmScript.LintPackageJson
12
- ], { cwd: projectPath(), verbose: true });
13
- if (Array.isArray(result)) {
14
- if (result.map((r) => r.isErr()).includes(true))
15
- process.exit(ExitCode.FatalError);
16
- }
17
- process.exit(ExitCode.Success);
6
+ import {log, runCommands} from "@stacksjs/cli";
7
+ import {projectPath} from "@stacksjs/path";
8
+ log.info("Ensuring Code Style...");
9
+ var result = await runCommands([
10
+ NpmScript.Lint,
11
+ NpmScript.LintPackageJson
12
+ ], { cwd: projectPath() });
13
+ if (Array.isArray(result)) {
14
+ if (result.map((r) => r.isErr()).includes(true))
15
+ process.exit(ExitCode.FatalError);
18
16
  }
19
- export {
20
- lintAction as default
21
- };
17
+ log.success("Linted");
package/dist/src/make.js CHANGED
@@ -29,7 +29,7 @@ async function makeComponent(options) {
29
29
  const name = options.name;
30
30
  log.info("Creating your component...");
31
31
  await createComponent(options);
32
- log.success(`Created the ${italic(name)} component`);
32
+ log.success(`Created ${italic(name)} component`);
33
33
  } catch (error) {
34
34
  log.error("There was an error creating your component", error);
35
35
  process.exit();
@@ -57,7 +57,7 @@ function makeDatabase(options) {
57
57
  const name = options.name;
58
58
  log.info(`Creating your ${italic(name)} database...`);
59
59
  createDatabase(options);
60
- log.success(`Created the ${italic(name)} database`);
60
+ log.success(`Created ${italic(name)} database`);
61
61
  } catch (error) {
62
62
  log.error("There was an error creating your database", error);
63
63
  process.exit();
@@ -71,7 +71,7 @@ function factory(options) {
71
71
  const name = options.name;
72
72
  log.info(`Creating your ${italic(name)} factory...`);
73
73
  createDatabase(options);
74
- log.success(`Created the ${italic(name)} factory`);
74
+ log.success(`Created ${italic(name)} factory`);
75
75
  } catch (error) {
76
76
  log.error("There was an error creating your factory", error);
77
77
  process.exit();
@@ -85,7 +85,7 @@ async function makeNotification(options) {
85
85
  const name = options.name;
86
86
  log.info(`Creating your ${italic(name)} notification...`);
87
87
  await createNotification(options);
88
- log.success(`Created the ${italic(name)} notification`);
88
+ log.success(`Created ${italic(name)} notification`);
89
89
  } catch (error) {
90
90
  log.error("There was an error creating your notification", error);
91
91
  process.exit();
@@ -96,7 +96,7 @@ async function makePage(options) {
96
96
  const name = options.name;
97
97
  log.info("Creating your page...");
98
98
  await createPage(options);
99
- log.success(`Created the ${name} page`);
99
+ log.success(`Created ${name} page`);
100
100
  } catch (error) {
101
101
  log.error("There was an error creating your page", error);
102
102
  process.exit();
@@ -124,7 +124,7 @@ async function makeFunction(options) {
124
124
  const name = options.name;
125
125
  log.info("Creating your function...");
126
126
  await createFunction(options);
127
- log.success(`Created the ${name} function`);
127
+ log.success(`Created ${name} function`);
128
128
  } catch (error) {
129
129
  log.error("There was an error creating your function", error);
130
130
  process.exit();
@@ -154,7 +154,7 @@ async function makeLanguage(options) {
154
154
  const name = options.name;
155
155
  log.info("Creating your translation file...");
156
156
  await createLanguage(options);
157
- log.success(`Created the ${name} translation file`);
157
+ log.success(`Created ${name} translation file`);
158
158
  } catch (error) {
159
159
  log.error("There was an error creating your language.", error);
160
160
  process.exit();
@@ -73,6 +73,14 @@ async function runComponentsDevServer(options) {
73
73
  log2.info("Starting your Library Engine...");
74
74
  await runAction(Action.DevComponents, options);
75
75
  }
76
+ async function runDashboardDevServer(options) {
77
+ log2.info("Starting your Dashboard...");
78
+ await runAction(Action.DevDashboard, options);
79
+ }
80
+ async function runSystemTrayDevServer(options) {
81
+ log2.info("Starting your System Tray...");
82
+ await runAction(Action.DevSystemTray, options);
83
+ }
76
84
  async function runDesktopDevServer(options) {
77
85
  log2.info("Starting your Desktop Engine...");
78
86
  await runAction(Action.DevDesktop, options);
@@ -276,7 +284,7 @@ async function makeComponent(options) {
276
284
  const name = options.name;
277
285
  log6.info("Creating your component...");
278
286
  await createComponent(options);
279
- log6.success(`Created the ${italic2(name)} component`);
287
+ log6.success(`Created ${italic2(name)} component`);
280
288
  } catch (error) {
281
289
  log6.error("There was an error creating your component", error);
282
290
  process3.exit();
@@ -304,7 +312,7 @@ function makeDatabase(options) {
304
312
  const name = options.name;
305
313
  log6.info(`Creating your ${italic2(name)} database...`);
306
314
  createDatabase(options);
307
- log6.success(`Created the ${italic2(name)} database`);
315
+ log6.success(`Created ${italic2(name)} database`);
308
316
  } catch (error) {
309
317
  log6.error("There was an error creating your database", error);
310
318
  process3.exit();
@@ -318,7 +326,7 @@ function factory(options) {
318
326
  const name = options.name;
319
327
  log6.info(`Creating your ${italic2(name)} factory...`);
320
328
  createDatabase(options);
321
- log6.success(`Created the ${italic2(name)} factory`);
329
+ log6.success(`Created ${italic2(name)} factory`);
322
330
  } catch (error) {
323
331
  log6.error("There was an error creating your factory", error);
324
332
  process3.exit();
@@ -332,7 +340,7 @@ async function makeNotification(options) {
332
340
  const name = options.name;
333
341
  log6.info(`Creating your ${italic2(name)} notification...`);
334
342
  await createNotification(options);
335
- log6.success(`Created the ${italic2(name)} notification`);
343
+ log6.success(`Created ${italic2(name)} notification`);
336
344
  } catch (error) {
337
345
  log6.error("There was an error creating your notification", error);
338
346
  process3.exit();
@@ -343,7 +351,7 @@ async function makePage(options) {
343
351
  const name = options.name;
344
352
  log6.info("Creating your page...");
345
353
  await createPage(options);
346
- log6.success(`Created the ${name} page`);
354
+ log6.success(`Created ${name} page`);
347
355
  } catch (error) {
348
356
  log6.error("There was an error creating your page", error);
349
357
  process3.exit();
@@ -371,7 +379,7 @@ async function makeFunction(options) {
371
379
  const name = options.name;
372
380
  log6.info("Creating your function...");
373
381
  await createFunction(options);
374
- log6.success(`Created the ${name} function`);
382
+ log6.success(`Created ${name} function`);
375
383
  } catch (error) {
376
384
  log6.error("There was an error creating your function", error);
377
385
  process3.exit();
@@ -401,7 +409,7 @@ async function makeLanguage(options) {
401
409
  const name = options.name;
402
410
  log6.info("Creating your translation file...");
403
411
  await createLanguage(options);
404
- log6.success(`Created the ${name} translation file`);
412
+ log6.success(`Created ${name} translation file`);
405
413
  } catch (error) {
406
414
  log6.error("There was an error creating your language.", error);
407
415
  process3.exit();
@@ -1 +1,63 @@
1
1
  // @bun
2
+ // src/helpers/utils.ts
3
+ import * as storage from "@stacksjs/storage";
4
+ import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
5
+ import {log} from "@stacksjs/logging";
6
+ import * as p from "@stacksjs/path";
7
+ import {err, handleError} from "@stacksjs/error-handling";
8
+ var parseOptions = function(options) {
9
+ if (!options)
10
+ return "";
11
+ const parsedOptions = Object.entries(options).map(([key, value]) => {
12
+ if (key.length === 1)
13
+ return `-${key}=${value}`;
14
+ if (typeof value === "boolean" && value)
15
+ return `--${key}`;
16
+ return `--${key}=${typeof value === "string" && value.includes(" ") ? `"${value}"` : value}`;
17
+ });
18
+ return parsedOptions.filter(Boolean).join(" ").replace("----=", "");
19
+ };
20
+ async function runAction(action, options) {
21
+ if (!hasAction(action))
22
+ return err(handleError(`The specified action "${action}" does not exist`));
23
+ const opts = parseOptions(options);
24
+ const path = p.relativeActionsPath(`${action}.ts`);
25
+ const cmd = `bun --bun ${`${path} ${opts}`}`;
26
+ const o = {
27
+ cwd: options?.cwd || p.projectPath(),
28
+ ...options
29
+ };
30
+ if (options?.verbose) {
31
+ log.debug("Running cmd:", underline(italic(cmd)));
32
+ log.debug("Running action:", underline(italic(`./actions/${action}.ts`)));
33
+ log.debug("with action options of:", o);
34
+ }
35
+ return await runCommand(cmd, o);
36
+ }
37
+ async function runActions(actions, options) {
38
+ if (!actions.length)
39
+ return err("No actions were specified");
40
+ for (const action of actions) {
41
+ if (!hasAction(action))
42
+ return err(`The specified action "${action}" does not exist`);
43
+ }
44
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
+ return await runCommands(commands, options);
46
+ }
47
+ function hasAction(action) {
48
+ if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
49
+ return true;
50
+ return storage.isFile(p.actionsPath(`${action}.ts`));
51
+ }
52
+ // src/upgrade/index.ts
53
+ import process from "process";
54
+ import {ExitCode, parseArgs} from "@stacksjs/cli";
55
+ import {Action} from "@stacksjs/enums";
56
+ var options = parseArgs();
57
+ if (options?.framework || options?.all)
58
+ await updateFramework(options);
59
+ if (options?.dependencies || options?.all)
60
+ await updateDependencies(options);
61
+ if (options?.bun || options?.all)
62
+ await runAction(Action.UpgradeBun, options);
63
+ process.exit(ExitCode.InvalidArgument);
@@ -6,29 +6,34 @@ import {log} from "@stacksjs/logging";
6
6
  import {projectPath} from "@stacksjs/path";
7
7
  import * as storage from "@stacksjs/storage";
8
8
  // package.json
9
- var version = "0.58.27";
9
+ var version = "0.58.43";
10
10
 
11
11
  // src/upgrade.ts
12
- function checkForUncommittedChanges(options) {
12
+ function checkForUncommittedChanges(options2) {
13
13
  try {
14
14
  } catch (error) {
15
15
  if (error.status === 1) {
16
- if (!options?.force) {
16
+ if (!options2?.force) {
17
17
  }
18
18
  }
19
19
  }
20
20
  }
21
- async function downloadFrameworkUpdate(options) {
21
+ async function downloadFrameworkUpdate(options2) {
22
22
  const tempFolderName = "updates";
23
23
  const tempUpdatePath = projectPath(tempFolderName);
24
24
  if (storage.doesFolderExist(tempUpdatePath))
25
25
  await deleteFolder(tempUpdatePath);
26
26
  log.info("Downloading framework updates...");
27
- await runCommand(`giget stacks ${tempFolderName}`, options);
27
+ await runCommand(`giget stacks ${tempFolderName}`, options2);
28
28
  log.success(`Your framework updated correctly to version: v${version}`);
29
29
  }
30
30
  async function updateDependencies() {
31
31
  const perf = await intro("buddy upgrade:dependencies");
32
+ const result = await runCommand(NpmScript.UpgradeDependencies, options);
33
+ if (result.isErr()) {
34
+ outro("While running the upgrade:dependencies command, there was an issue", { startTime: perf, useSeconds: true }, result.error);
35
+ process.exit();
36
+ }
32
37
  await outro("Freshly updated your dependencies.", { startTime: perf, useSeconds: true });
33
38
  process.exit();
34
39
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.58.27",
4
+ "version": "0.58.43",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",