stacks 0.58.28 → 0.58.30

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 (233) hide show
  1. package/core/README.md +1 -1
  2. package/core/actions/dist/src/deploy/index.js +1 -1
  3. package/core/actions/dist/src/dev/components.js +1 -1
  4. package/core/actions/dist/src/dev/index.js +10 -0
  5. package/core/actions/dist/src/generate/lib-entries.js +3 -3
  6. package/core/actions/dist/src/helpers/lib-entries.js +3 -3
  7. package/core/actions/dist/src/index.js +10 -0
  8. package/core/actions/dist/src/lint/fix.js +1 -1
  9. package/core/actions/dist/src/release.js +8 -0
  10. package/core/actions/dist/src/upgrade.js +1 -1
  11. package/core/actions/package.json +1 -1
  12. package/core/actions/src/build/docs.ts +7 -0
  13. package/core/actions/src/deploy/index.ts +1 -1
  14. package/core/actions/src/dev/api.ts +2 -2
  15. package/core/actions/src/dev/components.ts +1 -1
  16. package/core/actions/src/dev/dashboard.ts +7 -0
  17. package/core/actions/src/dev/desktop.ts +3 -3
  18. package/core/actions/src/dev/index.ts +10 -0
  19. package/core/actions/src/dev/system-tray.ts +6 -0
  20. package/core/actions/src/helpers/lib-entries.ts +3 -3
  21. package/core/actions/src/lint/fix.ts +1 -1
  22. package/core/ai/package.json +3 -3
  23. package/core/alias/package.json +1 -1
  24. package/core/analytics/package.json +1 -1
  25. package/core/api/package.json +1 -1
  26. package/core/arrays/package.json +1 -1
  27. package/core/auth/package.json +1 -1
  28. package/core/buddy/README.md +2 -2
  29. package/core/buddy/dist/{chunk-b75e6db0012faa55.js → chunk-0455e53fab4244b1.js} +1 -4
  30. package/core/buddy/dist/{chunk-fd47b42fb923a4be.js → chunk-61e8f138963fc709.js} +173 -137
  31. package/core/buddy/dist/cli.js +2 -2
  32. package/core/buddy/dist/index.js +2 -2
  33. package/core/buddy/package.json +1 -1
  34. package/core/buddy/src/commands/add.ts +4 -0
  35. package/core/buddy/src/commands/build.ts +12 -1
  36. package/core/buddy/src/commands/changelog.ts +2 -0
  37. package/core/buddy/src/commands/clean.ts +2 -0
  38. package/core/buddy/src/commands/cloud.ts +6 -0
  39. package/core/buddy/src/commands/commit.ts +2 -0
  40. package/core/buddy/src/commands/configure.ts +3 -0
  41. package/core/buddy/src/commands/create.ts +8 -8
  42. package/core/buddy/src/commands/deploy.ts +24 -23
  43. package/core/buddy/src/commands/dev.ts +50 -10
  44. package/core/buddy/src/commands/dns.ts +2 -0
  45. package/core/buddy/src/commands/domains.ts +2 -0
  46. package/core/buddy/src/commands/example.ts +4 -0
  47. package/core/buddy/src/commands/fresh.ts +2 -0
  48. package/core/buddy/src/commands/generate.ts +12 -3
  49. package/core/buddy/src/commands/http.ts +2 -0
  50. package/core/buddy/src/commands/install.ts +2 -0
  51. package/core/buddy/src/commands/key.ts +4 -2
  52. package/core/buddy/src/commands/lint.ts +3 -0
  53. package/core/buddy/src/commands/make.ts +11 -1
  54. package/core/buddy/src/commands/migrate.ts +3 -0
  55. package/core/buddy/src/commands/prepublish.ts +2 -0
  56. package/core/buddy/src/commands/release.ts +2 -0
  57. package/core/buddy/src/commands/seed.ts +2 -0
  58. package/core/buddy/src/commands/setup.ts +33 -34
  59. package/core/buddy/src/commands/test.ts +2 -0
  60. package/core/buddy/src/commands/tinker.ts +2 -0
  61. package/core/buddy/src/commands/types.ts +3 -0
  62. package/core/buddy/src/commands/upgrade.ts +6 -0
  63. package/core/build/package.json +1 -1
  64. package/core/bun-create/bud/package.json +3 -2
  65. package/core/bun-create/buddy/package.json +2 -2
  66. package/core/bun-create/stack/package.json +2 -2
  67. package/core/bun-create/stacks/package.json +2 -2
  68. package/core/bun-create/stx/package.json +2 -2
  69. package/core/bun-plugin-yaml/dist/index.js +1 -19
  70. package/core/bun-plugin-yaml/package.json +1 -1
  71. package/core/bun-plugin-yaml/src/index.ts +1 -1
  72. package/core/cache/package.json +2 -2
  73. package/core/chat/package.json +1 -1
  74. package/core/cli/dist/index.js +24 -23
  75. package/core/cli/package.json +1 -1
  76. package/core/cli/src/helpers.ts +21 -31
  77. package/core/cli/src/run.ts +9 -7
  78. package/core/cloud/buddy +2 -0
  79. package/core/cloud/package.json +33 -33
  80. package/core/cloud/src/cloud/ai.ts +45 -36
  81. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +10 -10
  82. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  83. package/core/cloud/src/cloud/cdn.ts +44 -5
  84. package/core/cloud/src/cloud/cli.ts +45 -0
  85. package/core/cloud/src/cloud/compute.ts +1 -1
  86. package/core/cloud/src/cloud/index.ts +6 -1
  87. package/core/cloud/src/cloud/lambda/cli-setup/index.js +67 -0
  88. package/core/cloud/src/index.ts +1 -0
  89. package/core/cloud/src/runtime/example/lambda.ts +1 -1
  90. package/core/cloud/src/runtime/runtime.ts +1 -0
  91. package/core/cloud/src/runtime/server.ts +1 -1
  92. package/core/collections/package.json +1 -1
  93. package/core/config/dist/index.js +130 -122
  94. package/core/config/package.json +1 -1
  95. package/core/config/src/overrides.ts +0 -2
  96. package/core/database/package.json +2 -2
  97. package/core/database/src/kysely-bun-worker/driver.ts +1 -0
  98. package/core/database/src/kysely-bun-worker/worker.ts +1 -1
  99. package/core/datetime/package.json +1 -1
  100. package/core/desktop/dist/index.js +6 -0
  101. package/core/desktop/package.json +5 -5
  102. package/core/desktop/src/index.ts +2 -0
  103. package/core/desktop/src/system-tray.ts +1 -0
  104. package/core/development/package.json +1 -1
  105. package/core/dns/package.json +7 -7
  106. package/core/docs/build.ts +1 -1
  107. package/core/docs/dist/index.js +29878 -9995
  108. package/core/docs/package.json +6 -5
  109. package/core/docs/src/index.ts +7 -1
  110. package/core/docs/src/meta.ts +32 -0
  111. package/core/docs/src/scripts/pwa.ts +116 -0
  112. package/core/email/email-forwarder.cjs +1 -0
  113. package/core/email/package.json +3 -3
  114. package/core/email/src/server/converter.ts +1 -0
  115. package/core/email/src/server/inbound.ts +1 -0
  116. package/core/email/src/server/outbound.ts +6 -4
  117. package/core/enums/dist/index.js +4 -2
  118. package/core/enums/package.json +1 -1
  119. package/core/enums/src/index.ts +4 -2
  120. package/core/env/package.json +1 -1
  121. package/core/error-handling/package.json +1 -1
  122. package/core/eslint-config/package.json +18 -18
  123. package/core/eslint-config/src/configs/comments.ts +1 -1
  124. package/core/eslint-config/src/configs/imports.ts +9 -0
  125. package/core/eslint-config/src/configs/svelte.ts +1 -0
  126. package/core/eslint-config/src/configs/unicorn.ts +1 -1
  127. package/core/eslint-config/src/configs/vue.ts +0 -1
  128. package/core/eslint-config/src/factory.ts +2 -8
  129. package/core/events/package.json +1 -1
  130. package/core/faker/package.json +2 -2
  131. package/core/git/dist/index.js +40 -0
  132. package/core/git/package.json +3 -3
  133. package/core/git/src/index.ts +62 -0
  134. package/core/health/package.json +1 -1
  135. package/core/http/package.json +1 -1
  136. package/core/lint/package.json +1 -1
  137. package/core/logging/dist/index.js +0 -6
  138. package/core/logging/package.json +1 -1
  139. package/core/music/package.json +3 -3
  140. package/core/notifications/package.json +2 -2
  141. package/core/objects/package.json +1 -1
  142. package/core/orm/package.json +1 -1
  143. package/core/path/dist/index.js +6 -3
  144. package/core/path/package.json +1 -1
  145. package/core/path/src/index.ts +7 -3
  146. package/core/payments/dist/index.js +2 -5
  147. package/core/payments/package.json +3 -3
  148. package/core/push/package.json +1 -1
  149. package/core/query-builder/package.json +1 -1
  150. package/core/queue/package.json +1 -1
  151. package/core/raycast/package.json +5 -0
  152. package/core/raycast/src/index.ts +0 -0
  153. package/core/realtime/package.json +1 -1
  154. package/core/repl/package.json +1 -1
  155. package/core/router/dist/index.js +16 -496
  156. package/core/router/package.json +1 -1
  157. package/core/router/src/middleware.ts +16 -14
  158. package/core/scheduler/package.json +1 -1
  159. package/core/search-engine/package.json +2 -2
  160. package/core/security/dist/index.js +3 -6
  161. package/core/security/package.json +2 -2
  162. package/core/server/dist/index.js +6 -2
  163. package/core/server/package.json +2 -2
  164. package/core/server/src/config.ts +14 -9
  165. package/core/signals/package.json +1 -1
  166. package/core/slug/package.json +1 -1
  167. package/core/sms/package.json +1 -1
  168. package/core/storage/dist/index.js +28 -10
  169. package/core/storage/package.json +1 -1
  170. package/core/storage/src/files.ts +10 -2
  171. package/core/storage/src/zip.ts +1 -1
  172. package/core/strings/package.json +3 -3
  173. package/core/stx +2 -0
  174. package/core/tables/package.json +3 -3
  175. package/core/testing/package.json +3 -3
  176. package/core/tinker/package.json +1 -1
  177. package/core/tsconfig.json +4 -9
  178. package/core/tunnel/package.json +1 -1
  179. package/core/types/dist/index.js +3 -1
  180. package/core/types/package.json +13 -13
  181. package/core/types/src/cli.ts +3 -3
  182. package/core/types/src/cloud.ts +4 -1
  183. package/core/types/src/dns.ts +1 -1
  184. package/core/types/src/native.ts +0 -0
  185. package/core/types/src/stacks.ts +0 -10
  186. package/core/ui/package.json +8 -8
  187. package/core/utils/dist/index.js +1 -1
  188. package/core/utils/package.json +1 -1
  189. package/core/validation/package.json +1 -1
  190. package/core/vite/README.md +1 -1
  191. package/core/vite/build.ts +1 -1
  192. package/core/vite/dist/index.js +211 -203
  193. package/core/vite/package.json +5 -5
  194. package/core/vite/src/components.ts +1 -1
  195. package/core/vite/src/dashboard.ts +100 -0
  196. package/core/vite/src/desktop.ts +2 -58
  197. package/core/vite/src/example-vue.ts +1 -1
  198. package/core/vite/src/example-wc.ts +1 -1
  199. package/core/vite/src/functions.ts +1 -1
  200. package/core/vite/src/index.ts +9 -11
  201. package/core/vite/src/plugin/auto-imports.ts +1 -1
  202. package/core/vite/src/plugin/layouts.ts +6 -7
  203. package/core/vite/src/plugin/router.ts +3 -1
  204. package/core/vite/src/system-tray.ts +100 -0
  205. package/core/vite/src/views.ts +13 -2
  206. package/core/vite/src/web-components.ts +1 -1
  207. package/core/whois/dist/index.js +1 -2
  208. package/core/whois/package.json +1 -1
  209. package/core/whois/src/index.ts +10 -8
  210. package/core/x-ray/package.json +1 -1
  211. package/core/zsh-buddy/README.md +51 -0
  212. package/core/zsh-buddy/package.json +29 -0
  213. package/ide/dictionary.txt +12 -0
  214. package/ide/jetbrains/.idea/stacks.iml +0 -1
  215. package/ide/vscode/.vscode/settings.json +7 -2
  216. package/ide/vscode/package.json +2 -4
  217. package/package.json +12 -7
  218. package/core/cloud/src/server/.dockerignore +0 -15
  219. package/core/cloud/src/server/Dockerfile +0 -21
  220. package/core/cloud/src/server/index.ts +0 -3
  221. package/core/cloud/src/server/package.json +0 -12
  222. package/core/cloud/src/server/runtime.ts +0 -828
  223. package/core/scripts/build +0 -58
  224. package/core/scripts/ensure +0 -33
  225. package/core/scripts/fresh +0 -14
  226. package/core/scripts/link +0 -14
  227. package/core/scripts/move-built-src-files.ts +0 -28
  228. package/core/scripts/move-dts-files.ts +0 -35
  229. package/core/scripts/publish +0 -43
  230. package/core/scripts/setup +0 -176
  231. package/core/tables/vite.config.ts +0 -84
  232. package/core/vite/src/plugin/index.ts +0 -21
  233. /package/core/vite/src/{stacks.ts → plugins.ts} +0 -0
@@ -8,11 +8,13 @@ import { Action } from '@stacksjs/enums'
8
8
  export function fresh(buddy: CLI) {
9
9
  const descriptions = {
10
10
  fresh: 'Reinstalls your npm dependencies',
11
+ project: 'Target a specific project',
11
12
  verbose: 'Enable verbose output',
12
13
  }
13
14
 
14
15
  buddy
15
16
  .command('fresh', descriptions.fresh)
17
+ .option('-p, --project', descriptions.project, { default: false })
16
18
  .option('--verbose', descriptions.verbose, { default: false })
17
19
  .action(async (options: FreshOptions) => {
18
20
  const perf = await intro('buddy fresh')
@@ -23,8 +23,9 @@ export function generate(buddy: CLI) {
23
23
  customData: 'Generate VS Code custom data (custom-elements.json) for IDEs',
24
24
  ideHelpers: 'Generate IDE helpers',
25
25
  componentMeta: 'Generate component meta information',
26
- tea: 'Generate the Tea configuration file',
26
+ pkgx: 'Generate the pkgx configuration file',
27
27
  select: 'What are you trying to generate?',
28
+ project: 'Target a specific project',
28
29
  verbose: 'Enable verbose output',
29
30
  }
30
31
 
@@ -36,7 +37,8 @@ export function generate(buddy: CLI) {
36
37
  .option('-c, --custom-data', descriptions.customData)
37
38
  .option('-i, --ide-helpers', descriptions.ideHelpers)
38
39
  .option('-c, --component-meta', descriptions.componentMeta)
39
- .option('-tc, --tea-config', descriptions.tea)
40
+ .option('-p, --pkgx', descriptions.pkgx)
41
+ .option('-p, --project', descriptions.project, { default: false })
40
42
  .option('--verbose', descriptions.verbose, { default: false })
41
43
  .action(async (options: GeneratorOptions) => {
42
44
  if (hasNoOptions(options)) {
@@ -66,6 +68,7 @@ export function generate(buddy: CLI) {
66
68
 
67
69
  buddy
68
70
  .command('generate:types', descriptions.types)
71
+ .option('-p, --project', descriptions.project, { default: false })
69
72
  .option('--verbose', descriptions.verbose, { default: false })
70
73
  .alias('types:generate')
71
74
  .action(async (options: GeneratorOptions) => {
@@ -74,6 +77,7 @@ export function generate(buddy: CLI) {
74
77
 
75
78
  buddy
76
79
  .command('generate:entries', descriptions.entries)
80
+ .option('-p, --project', descriptions.project, { default: false })
77
81
  .option('--verbose', descriptions.verbose, { default: false })
78
82
  .action(async (options: GeneratorOptions) => {
79
83
  await generateLibEntries(options)
@@ -81,6 +85,7 @@ export function generate(buddy: CLI) {
81
85
 
82
86
  buddy
83
87
  .command('generate:web-types', descriptions.webTypes)
88
+ .option('-p, --project', descriptions.project, { default: false })
84
89
  .option('--verbose', descriptions.verbose, { default: false })
85
90
  .action(async (options: GeneratorOptions) => {
86
91
  await generateWebTypes(options)
@@ -88,6 +93,7 @@ export function generate(buddy: CLI) {
88
93
 
89
94
  buddy
90
95
  .command('generate:vscode-custom-data', descriptions.customData)
96
+ .option('-p, --project', descriptions.project, { default: false })
91
97
  .option('--verbose', descriptions.verbose, { default: false })
92
98
  .action(async (options: GeneratorOptions) => {
93
99
  await generateVsCodeCustomData(options)
@@ -95,6 +101,7 @@ export function generate(buddy: CLI) {
95
101
 
96
102
  buddy
97
103
  .command('generate:ide-helpers', descriptions.ideHelpers)
104
+ .option('-p, --project', descriptions.project, { default: false })
98
105
  .option('--verbose', descriptions.verbose, { default: false })
99
106
  .action(async (options: GeneratorOptions) => {
100
107
  await generateIdeHelpers(options)
@@ -102,13 +109,15 @@ export function generate(buddy: CLI) {
102
109
 
103
110
  buddy
104
111
  .command('generate:component-meta', descriptions.componentMeta)
112
+ .option('-p, --project', descriptions.project, { default: false })
105
113
  .option('--verbose', descriptions.verbose, { default: false })
106
114
  .action(async (options: GeneratorOptions) => {
107
115
  await generateComponentMeta(options)
108
116
  })
109
117
 
110
118
  buddy
111
- .command('generate:tea-config', descriptions.tea)
119
+ .command('generate:pkgx-config', descriptions.pkgx)
120
+ .option('-p, --project', descriptions.project, { default: false })
112
121
  .option('--verbose', descriptions.verbose, { default: false })
113
122
  .action(() => {
114
123
  generatePkgxConfig()
@@ -30,11 +30,13 @@ interface HttpOptions {
30
30
  export function http(buddy: CLI) {
31
31
  const descriptions = {
32
32
  http: 'Send an HTTP request to a domain',
33
+ project: 'Target a specific project',
33
34
  verbose: 'Enable verbose output',
34
35
  }
35
36
 
36
37
  buddy
37
38
  .command('http [domain]', descriptions.http)
39
+ .option('-p, --project', descriptions.project, { default: false })
38
40
  // .option('--verbose', descriptions.verbose, { default: false })
39
41
  .action(async (domain: string | undefined, options: HttpOptions) => {
40
42
  // Convert options object to command-line options string
@@ -6,11 +6,13 @@ import { path as p } from '@stacksjs/path'
6
6
  export function install(buddy: CLI) {
7
7
  const descriptions = {
8
8
  install: 'Install your dependencies',
9
+ project: 'Target a specific project',
9
10
  verbose: 'Enable verbose output',
10
11
  }
11
12
 
12
13
  buddy
13
14
  .command('install', descriptions.install)
15
+ .option('-p, --project', descriptions.project, { default: false })
14
16
  .option('-v, --verbose', descriptions.verbose, { default: false })
15
17
  .action(async (options: InstallOptions) => {
16
18
  await runCommand('bun install', {
@@ -7,14 +7,16 @@ import { runAction } from '@stacksjs/actions'
7
7
  export function key(buddy: CLI) {
8
8
  const descriptions = {
9
9
  command: 'Generate & set the application key.',
10
+ project: 'Target a specific project',
10
11
  verbose: 'Enable verbose output',
11
12
  }
12
13
 
13
14
  buddy
14
15
  .command('key:generate', descriptions.command)
16
+ .option('-p, --project', descriptions.project, { default: false })
15
17
  .option('--verbose', descriptions.verbose, { default: false })
16
18
  .action(async (options: KeyOptions) => {
17
- const startTime = await intro('buddy key:generate')
19
+ await intro('buddy key:generate')
18
20
  const result = await runAction(Action.KeyGenerate, options)
19
21
 
20
22
  if (result.isErr()) {
@@ -22,7 +24,7 @@ export function key(buddy: CLI) {
22
24
  process.exit()
23
25
  }
24
26
 
25
- await outro('Random application key set.', { startTime })
27
+ await outro('Random application key set.')
26
28
  })
27
29
 
28
30
  buddy.on('key:*', () => {
@@ -8,12 +8,14 @@ export function lint(buddy: CLI) {
8
8
  const descriptions = {
9
9
  lint: 'Automagically lints your project codebase',
10
10
  lintFix: 'Automagically fixes all lint errors',
11
+ project: 'Target a specific project',
11
12
  verbose: 'Enable verbose output',
12
13
  }
13
14
 
14
15
  buddy
15
16
  .command('lint', descriptions.lint)
16
17
  .option('-f, --fix', descriptions.lintFix, { default: false })
18
+ .option('-p, --project', descriptions.project, { default: false })
17
19
  .option('--verbose', descriptions.verbose, { default: false })
18
20
  .action(async (options: LintOptions) => {
19
21
  const startTime = await intro('buddy lint')
@@ -29,6 +31,7 @@ export function lint(buddy: CLI) {
29
31
 
30
32
  buddy
31
33
  .command('lint:fix', descriptions.lintFix)
34
+ .option('-p, --project', descriptions.project, { default: false })
32
35
  .option('--verbose', descriptions.verbose, { default: false })
33
36
  .action(async (options: LintOptions) => {
34
37
  log.info('Fixing lint errors...')
@@ -29,6 +29,7 @@ export function make(buddy: CLI) {
29
29
  notification: 'Create a new notification',
30
30
  stack: 'Create a new new stack',
31
31
  select: 'What are you trying to make?',
32
+ project: 'Target a specific project',
32
33
  verbose: 'Enable verbose output',
33
34
  }
34
35
 
@@ -43,6 +44,7 @@ export function make(buddy: CLI) {
43
44
  .option('-f, --factory', descriptions.factory, { default: false })
44
45
  .option('-n, --notification', descriptions.notification, { default: false })
45
46
  .option('-s, --stack', descriptions.stack, { default: false })
47
+ .option('-p, --project', descriptions.project, { default: false })
46
48
  .option('--verbose', descriptions.verbose, { default: false })
47
49
  .action(async (options: MakeOptions) => {
48
50
  const name = buddy.args[0]
@@ -86,6 +88,7 @@ export function make(buddy: CLI) {
86
88
  buddy
87
89
  .command('make:component', descriptions.component)
88
90
  .option('-n, --name', 'The name of the component')
91
+ .option('-p, --project', descriptions.project, { default: false })
89
92
  .option('--verbose', descriptions.verbose, { default: false })
90
93
  .action(async (options: MakeOptions) => {
91
94
  const name = buddy.args[0] || options.name
@@ -102,6 +105,7 @@ export function make(buddy: CLI) {
102
105
  buddy
103
106
  .command('make:database', descriptions.database)
104
107
  .option('-n, --name', 'The name of the database')
108
+ .option('-p, --project', descriptions.project, { default: false })
105
109
  .option('--verbose', descriptions.verbose, { default: false })
106
110
  .action((options: MakeOptions) => {
107
111
  const name = buddy.args[0] || options.name
@@ -118,6 +122,7 @@ export function make(buddy: CLI) {
118
122
  buddy
119
123
  .command('make:factory', descriptions.factory)
120
124
  .option('-n, --name', 'The name of the factory')
125
+ .option('-p, --project', descriptions.project, { default: false })
121
126
  .option('--verbose', descriptions.verbose, { default: false })
122
127
  .action((options: MakeOptions) => {
123
128
  const name = buddy.args[0] || options.name
@@ -135,6 +140,7 @@ export function make(buddy: CLI) {
135
140
  .command('make:view', descriptions.page)
136
141
  .alias('make:page')
137
142
  .option('-n, --name', 'The name of the page')
143
+ .option('-p, --project', descriptions.project, { default: false })
138
144
  .option('--verbose', descriptions.verbose, { default: false })
139
145
  .action(async (options: MakeOptions) => {
140
146
  const name = buddy.args[0] || options.name
@@ -151,6 +157,7 @@ export function make(buddy: CLI) {
151
157
  buddy
152
158
  .command('make:function', descriptions.function)
153
159
  .option('-n, --name', 'The name of the function')
160
+ .option('-p, --project', descriptions.project, { default: false })
154
161
  .option('--verbose', descriptions.verbose, { default: false })
155
162
  .action(async (options: MakeOptions) => {
156
163
  await makeFunction(options)
@@ -159,6 +166,7 @@ export function make(buddy: CLI) {
159
166
  buddy
160
167
  .command('make:lang', descriptions.language)
161
168
  .option('-n, --name', 'The name of the language')
169
+ .option('-p, --project', descriptions.project, { default: false })
162
170
  .option('--verbose', descriptions.verbose, { default: false })
163
171
  .action(async (options: MakeOptions) => {
164
172
  const name = buddy.args[0] || options.name
@@ -178,6 +186,7 @@ export function make(buddy: CLI) {
178
186
  .option('-e, --email', 'Is it an email notification?', { default: true })
179
187
  .option('-c, --chat', 'Is it a chat notification?', { default: false })
180
188
  .option('-s, --sms', 'Is it a SMS notification?', { default: false })
189
+ .option('-p, --project', descriptions.project, { default: false })
181
190
  .option('--verbose', descriptions.verbose, { default: false })
182
191
  .action(async (options: MakeOptions) => {
183
192
  const perf = await intro('buddy make:notification')
@@ -204,6 +213,7 @@ export function make(buddy: CLI) {
204
213
  buddy
205
214
  .command('make:stack', descriptions.stack)
206
215
  .option('-n, --name', 'The name of the stack')
216
+ .option('-p, --project', descriptions.project, { default: false })
207
217
  .option('--verbose', descriptions.verbose, { default: false })
208
218
  .action((options: MakeOptions) => {
209
219
  const name = buddy.args[0] || options.name
@@ -255,5 +265,5 @@ export function make(buddy: CLI) {
255
265
  }
256
266
 
257
267
  function hasNoOptions(options: MakeOptions) {
258
- return !options.component && !options.page && !options.function && !options.language && !options.database && !options.migration && !options.factory && !options.notification && !options.stack
268
+ return !options.component && !options.page && !options.function && !options.language && !options.database && !options.migration && !options.notification && !options.stack
259
269
  }
@@ -9,11 +9,13 @@ export function migrate(buddy: CLI) {
9
9
  const descriptions = {
10
10
  migrate: 'Migrates your database',
11
11
  dns: 'Writes the DNS records for a domain to ./config/dns.ts',
12
+ project: 'Target a specific project',
12
13
  verbose: 'Enable verbose output',
13
14
  }
14
15
 
15
16
  buddy
16
17
  .command('migrate', descriptions.migrate)
18
+ .option('-p, --project', descriptions.project, { default: false })
17
19
  .option('--verbose', descriptions.verbose, { default: false })
18
20
  .action(async (options: MigrateOptions) => {
19
21
  const perf = await intro('buddy migrate')
@@ -32,6 +34,7 @@ export function migrate(buddy: CLI) {
32
34
 
33
35
  buddy
34
36
  .command('migrate:dns', descriptions.migrate)
37
+ .option('-p, --project', descriptions.project, { default: false })
35
38
  .option('--verbose', descriptions.verbose, { default: false })
36
39
  .action(async (options: MigrateOptions) => {
37
40
  const perf = await intro('buddy migrate')
@@ -6,11 +6,13 @@ import { runAction } from '@stacksjs/actions'
6
6
  export function prepublish(buddy: CLI) {
7
7
  const descriptions = {
8
8
  command: 'Run your prepublish script',
9
+ project: 'Target a specific project',
9
10
  verbose: 'Enable verbose output',
10
11
  }
11
12
 
12
13
  buddy
13
14
  .command('prepublish', descriptions.command)
15
+ .option('-p, --project', descriptions.project, { default: false })
14
16
  .option('--verbose', descriptions.verbose, { default: false })
15
17
  .action(async (options: PrepublishOptions) => {
16
18
  await runAction(Action.Prepublish, options)
@@ -7,12 +7,14 @@ import { runAction } from '@stacksjs/actions'
7
7
 
8
8
  const descriptions = {
9
9
  release: 'Release a new version of your libraries/packages',
10
+ project: 'Target a specific project',
10
11
  verbose: 'Enable verbose output',
11
12
  }
12
13
 
13
14
  export function release(buddy: CLI) {
14
15
  buddy
15
16
  .command('release', descriptions.release)
17
+ .option('-p, --project', descriptions.project, { default: false })
16
18
  .option('--verbose', descriptions.verbose, { default: false })
17
19
  .action(async (options: ReleaseOptions) => {
18
20
  const startTime = await intro('buddy release')
@@ -8,11 +8,13 @@ import { Action } from '@stacksjs/enums'
8
8
  export function seed(buddy: CLI) {
9
9
  const descriptions = {
10
10
  seed: 'Seed your database',
11
+ project: 'Target a specific project',
11
12
  verbose: 'Enable verbose output',
12
13
  }
13
14
 
14
15
  buddy
15
16
  .command('seed', descriptions.seed)
17
+ .option('-p, --project', descriptions.project, { default: false })
16
18
  .option('--verbose', descriptions.verbose, { default: false })
17
19
  .action(async (options: SeedOptions) => {
18
20
  const perf = await intro('buddy seed')
@@ -1,27 +1,30 @@
1
1
  import process from 'node:process'
2
2
  import { path as p } from '@stacksjs/path'
3
3
  import { handleError } from '@stacksjs/error-handling'
4
+ import { storage } from '@stacksjs/storage'
4
5
  import { log, runCommand } from '@stacksjs/cli'
5
6
  import { ExitCode } from '@stacksjs/types'
6
7
  import type { CLI, CliOptions } from '@stacksjs/types'
7
8
 
8
9
  export function setup(buddy: CLI) {
9
10
  const descriptions = {
10
- ensure: 'This command ensures your project is setup correctly',
11
- setup: 'This command sets up your project for the first time',
11
+ setup: 'This command ensures your project is setup correctly',
12
+ project: 'Target a specific project',
12
13
  verbose: 'Enable verbose output',
13
14
  }
14
15
 
15
16
  buddy
16
17
  .command('setup', descriptions.setup)
17
18
  .alias('ensure')
19
+ .option('-p, --project', descriptions.project, { default: false })
18
20
  .option('--verbose', descriptions.verbose, { default: false })
19
21
  .action(async (options: CliOptions) => {
20
- if (await ensurePkgxIsInstalled())
21
- await optimizePkgxDeps()
22
- else
22
+ if (!await isPkgxInstalled())
23
23
  await installPkgx()
24
24
 
25
+ // ensure the minimal amount of deps are written to ./pkgx.yaml
26
+ await optimizePkgxDeps()
27
+
25
28
  await initializeProject(options)
26
29
  })
27
30
 
@@ -31,7 +34,7 @@ export function setup(buddy: CLI) {
31
34
  })
32
35
  }
33
36
 
34
- async function ensurePkgxIsInstalled(): Promise<boolean> {
37
+ async function isPkgxInstalled(): Promise<boolean> {
35
38
  const result = await runCommand('pkgx --version', { silent: true })
36
39
 
37
40
  if (result.isOk())
@@ -41,7 +44,7 @@ async function ensurePkgxIsInstalled(): Promise<boolean> {
41
44
  }
42
45
 
43
46
  async function installPkgx(): Promise<void> {
44
- const result = await runCommand('./scripts/setup')
47
+ const result = await runCommand(p.frameworkPath('scripts/pkgx-install'))
45
48
 
46
49
  if (result.isOk())
47
50
  return
@@ -51,8 +54,7 @@ async function installPkgx(): Promise<void> {
51
54
  }
52
55
 
53
56
  async function initializeProject(options: CliOptions): Promise<void> {
54
- log.info('Installing node_modules...')
55
- await new Promise(resolve => setTimeout(resolve, 1500))
57
+ log.info('Installing dependencies...')
56
58
 
57
59
  const result = await runCommand('bun install', {
58
60
  cwd: options.cwd || p.projectPath(),
@@ -64,19 +66,21 @@ async function initializeProject(options: CliOptions): Promise<void> {
64
66
  }
65
67
 
66
68
  log.success('Installed node_modules')
67
- log.info('Ensuring .env exists...')
69
+ log.info('Ensuring .env exists...')
68
70
 
69
- const envResult = await runCommand('cp .env.example .env', {
70
- cwd: options.cwd || p.projectPath(),
71
- })
71
+ if (storage.doesNotExist(p.projectPath('.env'))) {
72
+ const envResult = await runCommand('cp .env.example .env', {
73
+ cwd: options.cwd || p.projectPath(),
74
+ })
72
75
 
73
- if (envResult.isErr()) {
74
- handleError(envResult.error)
75
- process.exit(ExitCode.FatalError)
76
- }
76
+ if (envResult.isErr()) {
77
+ handleError(envResult.error)
78
+ process.exit(ExitCode.FatalError)
79
+ }
77
80
 
78
- log.success('.env exists')
79
- log.info('⏳ Generating application key...')
81
+ log.success('.env created')
82
+ }
83
+ else { log.success('.env existed') }
80
84
 
81
85
  const keyResult = await runCommand('buddy key:generate', {
82
86
  cwd: options.cwd || p.projectPath(),
@@ -87,28 +91,23 @@ async function initializeProject(options: CliOptions): Promise<void> {
87
91
  process.exit(ExitCode.FatalError)
88
92
  }
89
93
 
90
- log.success('Generated application key')
91
- log.info('⏳ Ensuring AWS is connected...')
94
+ log.info('Ensuring AWS is connected...')
92
95
 
93
- const awsResult = await runCommand('buddy configure:aws', {
94
- cwd: options.cwd || p.projectPath(),
95
- })
96
+ // const awsResult = await runCommand('buddy configure:aws', {
97
+ // cwd: options.cwd || p.projectPath(),
98
+ // })
96
99
 
97
- if (awsResult.isErr()) {
98
- handleError(awsResult.error)
99
- process.exit(ExitCode.FatalError)
100
- }
100
+ // if (awsResult.isErr()) {
101
+ // handleError(awsResult.error)
102
+ // process.exit(ExitCode.FatalError)
103
+ // }
101
104
 
102
105
  log.success('Configured AWS')
103
- await new Promise(resolve => setTimeout(resolve, 300))
104
106
 
105
- // 1. ensure the IDE is setup by making sure .vscode etc exists, and if not, copy them over
106
- // 2. ensure the project
107
+ // TODO: ensure the IDE is setup by making sure .vscode etc exists, and if not, copy them over
107
108
 
108
109
  log.success('Project is setup')
109
- await new Promise(resolve => setTimeout(resolve, 300))
110
-
111
- log.info('🎉 Happy coding!')
110
+ log.info('Happy coding! 💙')
112
111
  }
113
112
 
114
113
  export async function optimizePkgxDeps(): Promise<void> {
@@ -14,12 +14,14 @@ export function test(buddy: CLI) {
14
14
  unit: 'Runs your unit tests',
15
15
  feature: 'Runs your feature tests',
16
16
  showReport: 'Show the test report',
17
+ project: 'Target a specific project',
17
18
  verbose: 'Enable verbose output',
18
19
  }
19
20
 
20
21
  buddy
21
22
  .command('test', descriptions.command)
22
23
  .option('--ui', descriptions.ui, { default: false })
24
+ .option('-p, --project', descriptions.project, { default: false })
23
25
  .option('--verbose', descriptions.verbose, { default: true })
24
26
  .action(async (options: TestOptions) => {
25
27
  const perf = await intro('buddy test')
@@ -8,11 +8,13 @@ import { Action } from '@stacksjs/enums'
8
8
  export function tinker(buddy: CLI) {
9
9
  const descriptions = {
10
10
  tinker: 'Tinker with your code',
11
+ project: 'Target a specific project',
11
12
  verbose: 'Enable verbose output',
12
13
  }
13
14
 
14
15
  buddy
15
16
  .command('tinker', descriptions.tinker)
17
+ .option('-p, --project', descriptions.project, { default: false })
16
18
  .option('--verbose', descriptions.verbose, { default: false })
17
19
  .action(async (options: TinkerOptions) => {
18
20
  const perf = await intro('buddy tinker')
@@ -6,11 +6,13 @@ export function types(buddy: CLI) {
6
6
  const descriptions = {
7
7
  generate: 'Generate the types of & for your library/libraries',
8
8
  fix: 'wip',
9
+ project: 'Target a specific project',
9
10
  verbose: 'Enable verbose output',
10
11
  }
11
12
 
12
13
  buddy
13
14
  .command('types:generate', descriptions.generate)
15
+ .option('-p, --project', descriptions.project, { default: false })
14
16
  .option('--verbose', descriptions.verbose, { default: false })
15
17
  .action(async () => {
16
18
  await generateTypes()
@@ -18,6 +20,7 @@ export function types(buddy: CLI) {
18
20
 
19
21
  buddy
20
22
  .command('types:fix', descriptions.fix)
23
+ .option('-p, --project', descriptions.project, { default: false })
21
24
  .option('--verbose', descriptions.verbose, { default: false })
22
25
  .action(async () => {
23
26
  // await fixTypes()
@@ -15,6 +15,7 @@ export function upgrade(buddy: CLI) {
15
15
  all: 'Upgrade Node, package manager, project dependencies, and framework',
16
16
  force: 'Overwrite possible local updates with remote framework updates',
17
17
  select: 'What are you trying to upgrade?',
18
+ project: 'Target a specific project',
18
19
  verbose: 'Enable verbose output',
19
20
  }
20
21
 
@@ -25,6 +26,7 @@ export function upgrade(buddy: CLI) {
25
26
  .option('-b, --bun', descriptions.bun, { default: false })
26
27
  .option('-a, --all', descriptions.all, { default: false })
27
28
  .option('-f, --force', descriptions.force, { default: false })
29
+ .option('-p, --project', descriptions.project, { default: false })
28
30
  .option('--verbose', descriptions.verbose, { default: false })
29
31
  .alias('update')
30
32
  .example('buddy upgrade -a --verbose')
@@ -65,6 +67,7 @@ export function upgrade(buddy: CLI) {
65
67
 
66
68
  buddy
67
69
  .command('upgrade:framework', descriptions.framework)
70
+ .option('-p, --project', descriptions.project, { default: false })
68
71
  .option('--verbose', descriptions.verbose, { default: false })
69
72
  .example('buddy upgrade:framework --verbose')
70
73
  .action(async (options: UpgradeOptions) => {
@@ -74,6 +77,7 @@ export function upgrade(buddy: CLI) {
74
77
 
75
78
  buddy
76
79
  .command('upgrade:dependencies', descriptions.dependencies)
80
+ .option('-p, --project', descriptions.project, { default: false })
77
81
  .option('--verbose', descriptions.verbose, { default: false })
78
82
  .alias('upgrade:deps')
79
83
  .example('buddy upgrade:dependencies --verbose')
@@ -83,6 +87,7 @@ export function upgrade(buddy: CLI) {
83
87
 
84
88
  buddy
85
89
  .command('upgrade:bun', descriptions.bun)
90
+ .option('-p, --project', descriptions.project, { default: false })
86
91
  .option('--verbose', descriptions.verbose, { default: false })
87
92
  .action(async (options: UpgradeOptions) => {
88
93
  const perf = await intro('buddy upgrade:bun')
@@ -98,6 +103,7 @@ export function upgrade(buddy: CLI) {
98
103
 
99
104
  buddy
100
105
  .command('upgrade:all', descriptions.all)
106
+ .option('-p, --project', descriptions.project, { default: false })
101
107
  .option('--verbose', descriptions.verbose, { default: false })
102
108
  .action(async (options: UpgradeOptions) => {
103
109
  await runAction(Action.Upgrade, options)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/build",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "The Stacks framework build tools and configurations.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/bud",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "scripts": {
41
41
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
42
42
  "stacks": "bun run buddy",
43
- "setup": "./storage/framework/core/scripts/setup.sh",
43
+ "setup": "./storage/framework/scripts/setup.sh",
44
44
  "fresh": "bun run buddy fresh",
45
45
  "clean": "bun run buddy clean",
46
46
  "upgrade": "bun run buddy upgrade",
@@ -51,6 +51,7 @@
51
51
  "dev": "bun run buddy dev",
52
52
  "dev:views": "bun run buddy dev:views",
53
53
  "dev:api": "bun run buddy dev:api",
54
+ "dev:dashboard": "bun run buddy dev:dashboard",
54
55
  "dev:docs": "bun run buddy dev:docs",
55
56
  "dev:functions": "bun run buddy dev:functions",
56
57
  "dev:components": "bun run buddy dev:components",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/buddy",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "scripts": {
41
41
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
42
42
  "stacks": "bun run buddy",
43
- "setup": "./storage/framework/core/scripts/setup.sh",
43
+ "setup": "./storage/framework/scripts/setup.sh",
44
44
  "fresh": "bun run buddy fresh",
45
45
  "clean": "bun run buddy clean",
46
46
  "upgrade": "bun run buddy upgrade",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stack",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "scripts": {
41
41
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
42
42
  "stacks": "bun run buddy",
43
- "setup": "./storage/framework/core/scripts/setup.sh",
43
+ "setup": "./storage/framework/scripts/setup.sh",
44
44
  "fresh": "bun run buddy fresh",
45
45
  "clean": "bun run buddy clean",
46
46
  "upgrade": "bun run buddy upgrade",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stacks",
3
3
  "type": "module",
4
- "version": "0.58.28",
4
+ "version": "0.58.30",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "scripts": {
41
41
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
42
42
  "stacks": "bun run buddy",
43
- "setup": "./storage/framework/core/scripts/setup.sh",
43
+ "setup": "./storage/framework/scripts/setup.sh",
44
44
  "fresh": "bun run buddy fresh",
45
45
  "clean": "bun run buddy clean",
46
46
  "upgrade": "bun run buddy upgrade",