stacks 0.58.58 → 0.58.60

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 (197) hide show
  1. package/core/actions/dist/src/build.js +18 -26
  2. package/core/actions/dist/src/bump.js +9 -3
  3. package/core/actions/dist/src/changelog.js +11 -3
  4. package/core/actions/dist/src/clean.js +2 -2
  5. package/core/actions/dist/src/dev/index.js +18 -26
  6. package/core/actions/dist/src/generate/index.js +18 -26
  7. package/core/actions/dist/src/helpers/index.js +18 -26
  8. package/core/actions/dist/src/helpers/utils.js +18 -26
  9. package/core/actions/dist/src/index.js +26 -34
  10. package/core/actions/dist/src/lint/fix.js +6 -2
  11. package/core/actions/dist/src/release.js +30 -35
  12. package/core/actions/dist/src/upgrade/index.js +18 -26
  13. package/core/actions/dist/src/upgrade.js +10 -7
  14. package/core/actions/package.json +1 -1
  15. package/core/actions/src/action.ts +18 -8
  16. package/core/actions/src/bump.ts +13 -6
  17. package/core/actions/src/changelog.ts +14 -4
  18. package/core/actions/src/clean.ts +2 -2
  19. package/core/actions/src/dev/api.ts +1 -2
  20. package/core/actions/src/domains/add.ts +12 -27
  21. package/core/actions/src/helpers/utils.ts +24 -36
  22. package/core/actions/src/lint/fix.ts +8 -2
  23. package/core/actions/src/migrate/dns.ts +1 -1
  24. package/core/actions/src/release.ts +4 -1
  25. package/core/actions/src/upgrade.ts +5 -2
  26. package/core/ai/dist/index.js +31 -29
  27. package/core/ai/package.json +3 -3
  28. package/core/alias/package.json +1 -1
  29. package/core/analytics/package.json +1 -1
  30. package/core/api/dist/index.js +6 -3
  31. package/core/api/package.json +1 -1
  32. package/core/arrays/package.json +1 -1
  33. package/core/auth/package.json +1 -1
  34. package/core/buddy/dist/chunk-59a9de11428ba763.js +993 -0
  35. package/core/buddy/dist/{chunk-e9c0ec1a3b7be088.js → chunk-6658b07ce4c24cac.js} +604 -512
  36. package/core/buddy/dist/cli.js +3916 -19
  37. package/core/buddy/dist/index.js +2 -5
  38. package/core/buddy/package.json +1 -1
  39. package/core/buddy/src/cli.ts +91 -17
  40. package/core/buddy/src/commands/add.ts +3 -0
  41. package/core/buddy/src/commands/build.ts +18 -3
  42. package/core/buddy/src/commands/changelog.ts +13 -6
  43. package/core/buddy/src/commands/clean.ts +3 -1
  44. package/core/buddy/src/commands/cloud.ts +14 -2
  45. package/core/buddy/src/commands/commit.ts +2 -0
  46. package/core/buddy/src/commands/configure.ts +6 -3
  47. package/core/buddy/src/commands/create.ts +3 -1
  48. package/core/buddy/src/commands/deploy.ts +4 -2
  49. package/core/buddy/src/commands/dev.ts +17 -4
  50. package/core/buddy/src/commands/dns.ts +7 -1
  51. package/core/buddy/src/commands/domains.ts +7 -1
  52. package/core/buddy/src/commands/fresh.ts +4 -2
  53. package/core/buddy/src/commands/generate.ts +36 -26
  54. package/core/buddy/src/commands/http.ts +6 -4
  55. package/core/buddy/src/commands/index.ts +0 -2
  56. package/core/buddy/src/commands/install.ts +3 -1
  57. package/core/buddy/src/commands/key.ts +2 -0
  58. package/core/buddy/src/commands/lint.ts +4 -0
  59. package/core/buddy/src/commands/list.ts +6 -2
  60. package/core/buddy/src/commands/make.ts +52 -30
  61. package/core/buddy/src/commands/migrate.ts +6 -2
  62. package/core/buddy/src/commands/prepublish.ts +3 -0
  63. package/core/buddy/src/commands/release.ts +12 -2
  64. package/core/buddy/src/commands/seed.ts +3 -1
  65. package/core/buddy/src/commands/setup.ts +16 -8
  66. package/core/buddy/src/commands/tinker.ts +3 -1
  67. package/core/buddy/src/commands/types.ts +4 -2
  68. package/core/buddy/src/commands/upgrade.ts +14 -3
  69. package/core/buddy/src/commands/version.ts +7 -0
  70. package/core/build/package.json +1 -1
  71. package/core/bun-create/bud/package.json +1 -1
  72. package/core/bun-create/buddy/package.json +1 -1
  73. package/core/bun-create/stack/package.json +1 -1
  74. package/core/bun-create/stacks/package.json +1 -1
  75. package/core/bun-create/stx/package.json +1 -1
  76. package/core/bun-plugin-yaml/package.json +1 -1
  77. package/core/cache/package.json +2 -2
  78. package/core/chat/package.json +1 -1
  79. package/core/cli/dist/index.js +463 -81
  80. package/core/cli/package.json +1 -1
  81. package/core/cli/src/cli.ts +9 -31
  82. package/core/cli/src/console.ts +19 -19
  83. package/core/cli/src/exec.ts +25 -8
  84. package/core/cli/src/helpers.ts +3 -3
  85. package/core/cli/src/index.ts +1 -1
  86. package/core/cli/src/parse.ts +95 -17
  87. package/core/cli/src/run.ts +7 -7
  88. package/core/cli/src/utils.ts +62 -0
  89. package/core/cloud/dist/index.js +29 -30
  90. package/core/cloud/package.json +32 -32
  91. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
  92. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  93. package/core/cloud/src/cloud/dashboard.ts +86 -85
  94. package/core/cloud/src/cloud/docs.ts +1 -1
  95. package/core/cloud/src/cloud/queue.ts +35 -34
  96. package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
  97. package/core/collections/package.json +1 -1
  98. package/core/config/dist/index.js +52 -30
  99. package/core/config/package.json +1 -1
  100. package/core/config/src/config.ts +1 -1
  101. package/core/config/src/defaults.ts +32 -16
  102. package/core/config/src/overrides.ts +2 -0
  103. package/core/database/package.json +1 -1
  104. package/core/database/src/kysely-bun-worker/worker.ts +0 -1
  105. package/core/datetime/package.json +1 -1
  106. package/core/desktop/package.json +3 -3
  107. package/core/development/package.json +1 -1
  108. package/core/dns/package.json +7 -7
  109. package/core/docs/package.json +1 -1
  110. package/core/email/package.json +4 -3
  111. package/core/email/src/server/converter.ts +19 -19
  112. package/core/email/src/server/inbound.ts +24 -8
  113. package/core/email/src/server/outbound.ts +17 -17
  114. package/core/enums/dist/index.js +2 -2
  115. package/core/enums/package.json +1 -1
  116. package/core/enums/src/index.ts +2 -2
  117. package/core/env/dist/index.js +1 -1
  118. package/core/env/package.json +3 -2
  119. package/core/env/src/utils.ts +1 -0
  120. package/core/error-handling/package.json +1 -1
  121. package/core/eslint-config/build.ts +1 -1
  122. package/core/eslint-config/package.json +12 -10
  123. package/core/eslint-config/test/cli.spec.ts +2 -1
  124. package/core/eslint-config/tsconfig.json +2 -2
  125. package/core/events/package.json +1 -1
  126. package/core/faker/package.json +2 -2
  127. package/core/git/package.json +1 -1
  128. package/core/health/package.json +1 -1
  129. package/core/http/package.json +1 -1
  130. package/core/lint/package.json +1 -1
  131. package/core/logging/build.ts +1 -1
  132. package/core/logging/dist/index.js +44 -1915
  133. package/core/logging/package.json +1 -1
  134. package/core/logging/src/index.ts +79 -13
  135. package/core/notifications/package.json +2 -2
  136. package/core/objects/package.json +1 -1
  137. package/core/orm/package.json +1 -1
  138. package/core/path/dist/index.js +10 -0
  139. package/core/path/package.json +1 -1
  140. package/core/path/src/index.ts +10 -0
  141. package/core/payments/dist/index.js +34 -10
  142. package/core/payments/package.json +2 -2
  143. package/core/push/package.json +1 -1
  144. package/core/query-builder/package.json +1 -1
  145. package/core/queue/package.json +1 -1
  146. package/core/raycast/package.json +1 -1
  147. package/core/realtime/package.json +1 -1
  148. package/core/repl/package.json +1 -1
  149. package/core/router/dist/index.js +517 -14
  150. package/core/router/package.json +1 -1
  151. package/core/router/src/router.ts +10 -3
  152. package/core/scheduler/package.json +2 -1
  153. package/core/scheduler/tests/cron.test.ts +11 -9
  154. package/core/search-engine/package.json +1 -1
  155. package/core/security/package.json +1 -1
  156. package/core/server/package.json +2 -2
  157. package/core/signals/package.json +1 -1
  158. package/core/slug/package.json +1 -1
  159. package/core/sms/package.json +1 -1
  160. package/core/storage/package.json +1 -1
  161. package/core/strings/package.json +1 -1
  162. package/core/tables/package.json +2 -2
  163. package/core/testing/package.json +5 -3
  164. package/core/tinker/package.json +1 -1
  165. package/core/tunnel/package.json +1 -1
  166. package/core/types/dist/index.js +1787 -6
  167. package/core/types/package.json +6 -6
  168. package/core/types/src/ai.ts +1 -0
  169. package/core/types/src/app.ts +1 -1
  170. package/core/types/src/binary.ts +1 -0
  171. package/core/types/src/cli.ts +13 -3
  172. package/core/types/src/docs.ts +6 -2
  173. package/core/types/src/index.ts +1 -0
  174. package/core/types/src/logger.ts +54 -0
  175. package/core/types/src/router.ts +2 -1
  176. package/core/types/src/stacks.ts +10 -0
  177. package/core/ui/package.json +4 -4
  178. package/core/utils/dist/index.js +13 -5
  179. package/core/utils/package.json +2 -2
  180. package/core/utils/src/hash.ts +10 -1
  181. package/core/validation/package.json +1 -1
  182. package/core/vite/dist/index.js +1 -1
  183. package/core/vite/package.json +4 -4
  184. package/core/vite/src/example-wc.ts +1 -4
  185. package/core/vite/src/plugin/auto-imports.ts +1 -2
  186. package/core/vite/src/plugin/components.ts +1 -2
  187. package/core/vite/src/plugin/docs.ts +1 -1
  188. package/core/whois/package.json +3 -3
  189. package/core/x-ray/package.json +1 -1
  190. package/core/zsh-buddy/buddy.plugin.zsh +4 -0
  191. package/core/zsh-buddy/package.json +3 -3
  192. package/ide/dictionary.txt +1 -0
  193. package/ide/vscode/package.json +3 -4
  194. package/package.json +1 -1
  195. package/core/buddy/src/commands/example.ts +0 -66
  196. package/core/buddy/src/commands/inspire.ts +0 -24
  197. package/core/cli/src/utilities.ts +0 -2
@@ -1,48 +1,40 @@
1
1
  // @bun
2
2
  // src/helpers/utils.ts
3
3
  import * as storage from "@stacksjs/storage";
4
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
4
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
5
  import {log} from "@stacksjs/logging";
6
6
  import * as p from "@stacksjs/path";
7
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
8
  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);
9
+ const opts = buddyOptions();
24
10
  const path = p.relativeActionsPath(`${action}.ts`);
25
- const cmd = `bun --bun ${`${path} ${opts}`}`;
26
- const o = {
11
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
+ const optionsWithCwd = {
27
13
  cwd: options?.cwd || p.projectPath(),
28
14
  ...options
29
15
  };
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);
16
+ log.debug("runAction:", cmd);
17
+ log.debug("action options:", optionsWithCwd);
18
+ if (!hasAction(action))
19
+ return err(handleError(`The specified action "${action}" does not exist`));
20
+ return await runCommand(cmd, optionsWithCwd);
36
21
  }
37
22
  async function runActions(actions, options) {
23
+ log.debug("runActions:", actions);
24
+ log.debug("actions options:", options);
38
25
  if (!actions.length)
39
26
  return err("No actions were specified");
40
27
  for (const action of actions) {
41
28
  if (!hasAction(action))
42
29
  return err(`The specified action "${action}" does not exist`);
43
30
  }
44
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
- return await runCommands(commands, options);
31
+ const opts = buddyOptions();
32
+ const o = {
33
+ cwd: options?.cwd || p.projectPath(),
34
+ ...options
35
+ };
36
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
+ return await runCommands(commands, o);
46
38
  }
47
39
  function hasAction(action) {
48
40
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -1,8 +1,14 @@
1
1
  // @bun
2
2
  // src/bump.ts
3
- import {runCommand} from "@stacksjs/cli";
3
+ import {parseOptions, runCommand} from "@stacksjs/cli";
4
4
  import {path as p} from "@stacksjs/path";
5
- await runCommand("buddy changelog --quiet", {
5
+ var options = parseOptions();
6
+ var changelogCommand = options?.dryRun ? "buddy changelog --quiet --dry-run" : "buddy changelog --quiet";
7
+ await runCommand(changelogCommand, {
6
8
  cwd: p.projectPath()
7
9
  });
8
- await runCommand("bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --all", { cwd: p.frameworkPath(), stdin: "inherit" });
10
+ var bumpCommand = options?.dryRun ? "bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --no-push" : "bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --all";
11
+ await runCommand(bumpCommand, {
12
+ cwd: p.frameworkPath(),
13
+ stdin: "inherit"
14
+ });
@@ -1,9 +1,17 @@
1
1
  // @bun
2
2
  // src/changelog.ts
3
- import {execSync, runCommand} from "@stacksjs/cli";
3
+ import {execSync, log, parseOptions, runCommand} from "@stacksjs/cli";
4
4
  import {projectPath} from "@stacksjs/path";
5
+ log.debug("Generating changelog");
5
6
  var fromRevision = await execSync("git describe --abbrev=0 --tags HEAD^");
7
+ log.debug("FromRevision", fromRevision);
6
8
  var toRevision = await execSync("git describe");
7
- await runCommand(`bunx changelogen --output CHANGELOG.md --from ${fromRevision} --to ${toRevision}`, {
8
- cwd: projectPath()
9
+ log.debug("ToRevision", toRevision);
10
+ var options = parseOptions();
11
+ log.debug("Changelog Options", options);
12
+ var command = options?.dryRun ? `bunx changelogen --no-output --from ${fromRevision} --to ${toRevision}` : `bunx changelogen --output CHANGELOG.md --from ${fromRevision} --to ${toRevision}`;
13
+ await runCommand(command, {
14
+ cwd: projectPath(),
15
+ quiet: options?.quiet,
16
+ verbose: options?.verbose
9
17
  });
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/clean.ts
3
3
  import {log} from "@stacksjs/logging";
4
- import {clean} from "@stacksjs/utils";
4
+ import {cleanProject} from "@stacksjs/utils";
5
5
  log.info("Running clean command...");
6
- await clean();
6
+ await cleanProject();
@@ -1,48 +1,40 @@
1
1
  // @bun
2
2
  // src/helpers/utils.ts
3
3
  import * as storage from "@stacksjs/storage";
4
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
4
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
5
  import {log} from "@stacksjs/logging";
6
6
  import * as p from "@stacksjs/path";
7
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
8
  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);
9
+ const opts = buddyOptions();
24
10
  const path = p.relativeActionsPath(`${action}.ts`);
25
- const cmd = `bun --bun ${`${path} ${opts}`}`;
26
- const o = {
11
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
+ const optionsWithCwd = {
27
13
  cwd: options?.cwd || p.projectPath(),
28
14
  ...options
29
15
  };
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);
16
+ log.debug("runAction:", cmd);
17
+ log.debug("action options:", optionsWithCwd);
18
+ if (!hasAction(action))
19
+ return err(handleError(`The specified action "${action}" does not exist`));
20
+ return await runCommand(cmd, optionsWithCwd);
36
21
  }
37
22
  async function runActions(actions, options) {
23
+ log.debug("runActions:", actions);
24
+ log.debug("actions options:", options);
38
25
  if (!actions.length)
39
26
  return err("No actions were specified");
40
27
  for (const action of actions) {
41
28
  if (!hasAction(action))
42
29
  return err(`The specified action "${action}" does not exist`);
43
30
  }
44
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
- return await runCommands(commands, options);
31
+ const opts = buddyOptions();
32
+ const o = {
33
+ cwd: options?.cwd || p.projectPath(),
34
+ ...options
35
+ };
36
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
+ return await runCommands(commands, o);
46
38
  }
47
39
  function hasAction(action) {
48
40
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -1,48 +1,40 @@
1
1
  // @bun
2
2
  // src/helpers/utils.ts
3
3
  import * as storage from "@stacksjs/storage";
4
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
4
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
5
  import {log} from "@stacksjs/logging";
6
6
  import * as p from "@stacksjs/path";
7
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
8
  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);
9
+ const opts = buddyOptions();
24
10
  const path = p.relativeActionsPath(`${action}.ts`);
25
- const cmd = `bun --bun ${`${path} ${opts}`}`;
26
- const o = {
11
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
+ const optionsWithCwd = {
27
13
  cwd: options?.cwd || p.projectPath(),
28
14
  ...options
29
15
  };
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);
16
+ log.debug("runAction:", cmd);
17
+ log.debug("action options:", optionsWithCwd);
18
+ if (!hasAction(action))
19
+ return err(handleError(`The specified action "${action}" does not exist`));
20
+ return await runCommand(cmd, optionsWithCwd);
36
21
  }
37
22
  async function runActions(actions, options) {
23
+ log.debug("runActions:", actions);
24
+ log.debug("actions options:", options);
38
25
  if (!actions.length)
39
26
  return err("No actions were specified");
40
27
  for (const action of actions) {
41
28
  if (!hasAction(action))
42
29
  return err(`The specified action "${action}" does not exist`);
43
30
  }
44
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
- return await runCommands(commands, options);
31
+ const opts = buddyOptions();
32
+ const o = {
33
+ cwd: options?.cwd || p.projectPath(),
34
+ ...options
35
+ };
36
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
+ return await runCommands(commands, o);
46
38
  }
47
39
  function hasAction(action) {
48
40
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -1,48 +1,40 @@
1
1
  // @bun
2
2
  // src/helpers/utils.ts
3
3
  import * as storage from "@stacksjs/storage";
4
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
4
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
5
  import {log} from "@stacksjs/logging";
6
6
  import * as p from "@stacksjs/path";
7
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
8
  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);
9
+ const opts = buddyOptions();
24
10
  const path = p.relativeActionsPath(`${action}.ts`);
25
- const cmd = `bun --bun ${`${path} ${opts}`}`;
26
- const o = {
11
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
+ const optionsWithCwd = {
27
13
  cwd: options?.cwd || p.projectPath(),
28
14
  ...options
29
15
  };
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);
16
+ log.debug("runAction:", cmd);
17
+ log.debug("action options:", optionsWithCwd);
18
+ if (!hasAction(action))
19
+ return err(handleError(`The specified action "${action}" does not exist`));
20
+ return await runCommand(cmd, optionsWithCwd);
36
21
  }
37
22
  async function runActions(actions, options) {
23
+ log.debug("runActions:", actions);
24
+ log.debug("actions options:", options);
38
25
  if (!actions.length)
39
26
  return err("No actions were specified");
40
27
  for (const action of actions) {
41
28
  if (!hasAction(action))
42
29
  return err(`The specified action "${action}" does not exist`);
43
30
  }
44
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
- return await runCommands(commands, options);
31
+ const opts = buddyOptions();
32
+ const o = {
33
+ cwd: options?.cwd || p.projectPath(),
34
+ ...options
35
+ };
36
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
+ return await runCommands(commands, o);
46
38
  }
47
39
  function hasAction(action) {
48
40
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -1,48 +1,40 @@
1
1
  // @bun
2
2
  // src/helpers/utils.ts
3
3
  import * as storage from "@stacksjs/storage";
4
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
4
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
5
  import {log} from "@stacksjs/logging";
6
6
  import * as p from "@stacksjs/path";
7
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
8
  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);
9
+ const opts = buddyOptions();
24
10
  const path = p.relativeActionsPath(`${action}.ts`);
25
- const cmd = `bun --bun ${`${path} ${opts}`}`;
26
- const o = {
11
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
+ const optionsWithCwd = {
27
13
  cwd: options?.cwd || p.projectPath(),
28
14
  ...options
29
15
  };
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);
16
+ log.debug("runAction:", cmd);
17
+ log.debug("action options:", optionsWithCwd);
18
+ if (!hasAction(action))
19
+ return err(handleError(`The specified action "${action}" does not exist`));
20
+ return await runCommand(cmd, optionsWithCwd);
36
21
  }
37
22
  async function runActions(actions, options) {
23
+ log.debug("runActions:", actions);
24
+ log.debug("actions options:", options);
38
25
  if (!actions.length)
39
26
  return err("No actions were specified");
40
27
  for (const action of actions) {
41
28
  if (!hasAction(action))
42
29
  return err(`The specified action "${action}" does not exist`);
43
30
  }
44
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
- return await runCommands(commands, options);
31
+ const opts = buddyOptions();
32
+ const o = {
33
+ cwd: options?.cwd || p.projectPath(),
34
+ ...options
35
+ };
36
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
+ return await runCommands(commands, o);
46
38
  }
47
39
  function hasAction(action) {
48
40
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -1,48 +1,40 @@
1
1
  // @bun
2
2
  // src/helpers/utils.ts
3
3
  import * as storage from "@stacksjs/storage";
4
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
4
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
5
5
  import {log} from "@stacksjs/logging";
6
6
  import * as p from "@stacksjs/path";
7
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
8
  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);
9
+ const opts = buddyOptions();
24
10
  const path = p.relativeActionsPath(`${action}.ts`);
25
- const cmd = `bun --bun ${`${path} ${opts}`}`;
26
- const o = {
11
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
+ const optionsWithCwd = {
27
13
  cwd: options?.cwd || p.projectPath(),
28
14
  ...options
29
15
  };
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);
16
+ log.debug("runAction:", cmd);
17
+ log.debug("action options:", optionsWithCwd);
18
+ if (!hasAction(action))
19
+ return err(handleError(`The specified action "${action}" does not exist`));
20
+ return await runCommand(cmd, optionsWithCwd);
36
21
  }
37
22
  async function runActions(actions, options) {
23
+ log.debug("runActions:", actions);
24
+ log.debug("actions options:", options);
38
25
  if (!actions.length)
39
26
  return err("No actions were specified");
40
27
  for (const action of actions) {
41
28
  if (!hasAction(action))
42
29
  return err(`The specified action "${action}" does not exist`);
43
30
  }
44
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
- return await runCommands(commands, options);
31
+ const opts = buddyOptions();
32
+ const o = {
33
+ cwd: options?.cwd || p.projectPath(),
34
+ ...options
35
+ };
36
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
+ return await runCommands(commands, o);
46
38
  }
47
39
  function hasAction(action) {
48
40
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -254,7 +246,7 @@ async function installPackages(names) {
254
246
 
255
247
  // src/make.ts
256
248
  import process3 from "process";
257
- import {italic as italic2} from "@stacksjs/cli";
249
+ import {italic} from "@stacksjs/cli";
258
250
  import {log as log6} from "@stacksjs/logging";
259
251
  import {createFolder, doesFolderExist, writeTextFile} from "@stacksjs/storage";
260
252
  import {frameworkPath as frameworkPath2, projectPath as projectPath3, resolve} from "@stacksjs/path";
@@ -282,7 +274,7 @@ async function makeComponent(options) {
282
274
  const name = options.name;
283
275
  log6.info("Creating your component...");
284
276
  await createComponent(options);
285
- log6.success(`Created ${italic2(name)} component`);
277
+ log6.success(`Created ${italic(name)} component`);
286
278
  } catch (error) {
287
279
  log6.error("There was an error creating your component", error);
288
280
  process3.exit();
@@ -308,9 +300,9 @@ console.log('Hello World component created')
308
300
  function makeDatabase(options) {
309
301
  try {
310
302
  const name = options.name;
311
- log6.info(`Creating your ${italic2(name)} database...`);
303
+ log6.info(`Creating your ${italic(name)} database...`);
312
304
  createDatabase(options);
313
- log6.success(`Created ${italic2(name)} database`);
305
+ log6.success(`Created ${italic(name)} database`);
314
306
  } catch (error) {
315
307
  log6.error("There was an error creating your database", error);
316
308
  process3.exit();
@@ -322,9 +314,9 @@ function createDatabase(options) {
322
314
  function factory(options) {
323
315
  try {
324
316
  const name = options.name;
325
- log6.info(`Creating your ${italic2(name)} factory...`);
317
+ log6.info(`Creating your ${italic(name)} factory...`);
326
318
  createDatabase(options);
327
- log6.success(`Created ${italic2(name)} factory`);
319
+ log6.success(`Created ${italic(name)} factory`);
328
320
  } catch (error) {
329
321
  log6.error("There was an error creating your factory", error);
330
322
  process3.exit();
@@ -336,9 +328,9 @@ function createFactory(options) {
336
328
  async function makeNotification(options) {
337
329
  try {
338
330
  const name = options.name;
339
- log6.info(`Creating your ${italic2(name)} notification...`);
331
+ log6.info(`Creating your ${italic(name)} notification...`);
340
332
  await createNotification(options);
341
- log6.success(`Created ${italic2(name)} notification`);
333
+ log6.success(`Created ${italic(name)} notification`);
342
334
  } catch (error) {
343
335
  log6.error("There was an error creating your notification", error);
344
336
  process3.exit();
@@ -1,8 +1,12 @@
1
1
  // @bun
2
2
  // src/lint/fix.ts
3
- import {log, runCommands} from "@stacksjs/cli";
3
+ import {log, parseOptions, runCommand} from "@stacksjs/cli";
4
4
  import {projectPath} from "@stacksjs/path";
5
5
  import {NpmScript} from "@stacksjs/enums";
6
6
  log.info("Ensuring Code Style...");
7
- await runCommands([NpmScript.LintFix], { cwd: projectPath() });
7
+ var options = parseOptions();
8
+ await runCommand(NpmScript.LintFix, {
9
+ cwd: projectPath(),
10
+ ...options
11
+ });
8
12
  log.success("Linted");
@@ -3,48 +3,40 @@
3
3
 
4
4
  // src/helpers/utils.ts
5
5
  import * as storage from "@stacksjs/storage";
6
- import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
6
+ import {buddyOptions, runCommand, runCommands} from "@stacksjs/cli";
7
7
  import {log} from "@stacksjs/logging";
8
8
  import * as p from "@stacksjs/path";
9
9
  import {err, handleError} from "@stacksjs/error-handling";
10
- var parseOptions = function(options) {
11
- if (!options)
12
- return "";
13
- const parsedOptions = Object.entries(options).map(([key, value]) => {
14
- if (key.length === 1)
15
- return `-${key}=${value}`;
16
- if (typeof value === "boolean" && value)
17
- return `--${key}`;
18
- return `--${key}=${typeof value === "string" && value.includes(" ") ? `"${value}"` : value}`;
19
- });
20
- return parsedOptions.filter(Boolean).join(" ").replace("----=", "");
21
- };
22
10
  async function runAction(action, options) {
23
- if (!hasAction(action))
24
- return err(handleError(`The specified action "${action}" does not exist`));
25
- const opts = parseOptions(options);
11
+ const opts = buddyOptions();
26
12
  const path = p.relativeActionsPath(`${action}.ts`);
27
- const cmd = `bun --bun ${`${path} ${opts}`}`;
28
- const o = {
13
+ const cmd = `bun --bun ${path} ${opts}`.trimEnd();
14
+ const optionsWithCwd = {
29
15
  cwd: options?.cwd || p.projectPath(),
30
16
  ...options
31
17
  };
32
- if (options?.verbose) {
33
- log.debug("Running cmd:", underline(italic(cmd)));
34
- log.debug("Running action:", underline(italic(`./actions/${action}.ts`)));
35
- log.debug("with action options of:", o);
36
- }
37
- return await runCommand(cmd, o);
18
+ log.debug("runAction:", cmd);
19
+ log.debug("action options:", optionsWithCwd);
20
+ if (!hasAction(action))
21
+ return err(handleError(`The specified action "${action}" does not exist`));
22
+ return await runCommand(cmd, optionsWithCwd);
38
23
  }
39
24
  async function runActions(actions, options) {
25
+ log.debug("runActions:", actions);
26
+ log.debug("actions options:", options);
40
27
  if (!actions.length)
41
28
  return err("No actions were specified");
42
29
  for (const action of actions) {
43
30
  if (!hasAction(action))
44
31
  return err(`The specified action "${action}" does not exist`);
45
32
  }
46
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
47
- return await runCommands(commands, options);
33
+ const opts = buddyOptions();
34
+ const o = {
35
+ cwd: options?.cwd || p.projectPath(),
36
+ ...options
37
+ };
38
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
39
+ return await runCommands(commands, o);
48
40
  }
49
41
  function hasAction(action) {
50
42
  if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
@@ -256,7 +248,7 @@ async function installPackages(names) {
256
248
 
257
249
  // src/make.ts
258
250
  import process3 from "process";
259
- import {italic as italic2} from "@stacksjs/cli";
251
+ import {italic} from "@stacksjs/cli";
260
252
  import {log as log6} from "@stacksjs/logging";
261
253
  import {createFolder, doesFolderExist, writeTextFile} from "@stacksjs/storage";
262
254
  import {frameworkPath as frameworkPath2, projectPath as projectPath3, resolve} from "@stacksjs/path";
@@ -284,7 +276,7 @@ async function makeComponent(options) {
284
276
  const name = options.name;
285
277
  log6.info("Creating your component...");
286
278
  await createComponent(options);
287
- log6.success(`Created ${italic2(name)} component`);
279
+ log6.success(`Created ${italic(name)} component`);
288
280
  } catch (error) {
289
281
  log6.error("There was an error creating your component", error);
290
282
  process3.exit();
@@ -310,9 +302,9 @@ console.log('Hello World component created')
310
302
  function makeDatabase(options) {
311
303
  try {
312
304
  const name = options.name;
313
- log6.info(`Creating your ${italic2(name)} database...`);
305
+ log6.info(`Creating your ${italic(name)} database...`);
314
306
  createDatabase(options);
315
- log6.success(`Created ${italic2(name)} database`);
307
+ log6.success(`Created ${italic(name)} database`);
316
308
  } catch (error) {
317
309
  log6.error("There was an error creating your database", error);
318
310
  process3.exit();
@@ -324,9 +316,9 @@ function createDatabase(options) {
324
316
  function factory(options) {
325
317
  try {
326
318
  const name = options.name;
327
- log6.info(`Creating your ${italic2(name)} factory...`);
319
+ log6.info(`Creating your ${italic(name)} factory...`);
328
320
  createDatabase(options);
329
- log6.success(`Created ${italic2(name)} factory`);
321
+ log6.success(`Created ${italic(name)} factory`);
330
322
  } catch (error) {
331
323
  log6.error("There was an error creating your factory", error);
332
324
  process3.exit();
@@ -338,9 +330,9 @@ function createFactory(options) {
338
330
  async function makeNotification(options) {
339
331
  try {
340
332
  const name = options.name;
341
- log6.info(`Creating your ${italic2(name)} notification...`);
333
+ log6.info(`Creating your ${italic(name)} notification...`);
342
334
  await createNotification(options);
343
- log6.success(`Created ${italic2(name)} notification`);
335
+ log6.success(`Created ${italic(name)} notification`);
344
336
  } catch (error) {
345
337
  log6.error("There was an error creating your notification", error);
346
338
  process3.exit();
@@ -552,5 +544,8 @@ await runActions([
552
544
  Action4.GenerateLibraryEntries,
553
545
  Action4.LintFix,
554
546
  Action4.Bump
555
- ], { cwd: projectPath4(), stdin: "inherit" });
547
+ ], {
548
+ cwd: projectPath4(),
549
+ stdin: "inherit"
550
+ });
556
551
  log7.success(`Successfully released ${app.name}`);