stacks 0.58.48 → 0.58.50

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 (132) hide show
  1. package/core/actions/dist/src/generate/ide-helpers.js +1 -0
  2. package/core/actions/dist/src/generate/lib-entries.js +4 -2
  3. package/core/actions/dist/src/generate/vscode-custom-data.js +1 -0
  4. package/core/actions/dist/src/helpers/lib-entries.js +1 -0
  5. package/core/actions/dist/src/helpers/package-json.js +1 -0
  6. package/core/actions/dist/src/helpers/vscode-custom-data.js +1 -0
  7. package/core/actions/dist/src/index.js +2 -0
  8. package/core/actions/dist/src/release.js +2 -0
  9. package/core/actions/dist/src/upgrade.js +1 -1
  10. package/core/actions/package.json +3 -2
  11. package/core/actions/src/action.ts +2 -0
  12. package/core/actions/src/generate/custom-cli-file.ts +24 -0
  13. package/core/actions/src/generate/lib-entries.ts +3 -2
  14. package/core/ai/dist/index.js +6 -6
  15. package/core/ai/package.json +5 -4
  16. package/core/alias/package.json +3 -2
  17. package/core/analytics/package.json +3 -2
  18. package/core/api/package.json +3 -2
  19. package/core/arrays/package.json +3 -2
  20. package/core/auth/package.json +3 -2
  21. package/core/buddy/dist/{chunk-b32089b9556f373c.js → chunk-91084836e95161e8.js} +1 -1
  22. package/core/buddy/dist/cli.js +13 -1
  23. package/core/buddy/dist/index.js +1 -1
  24. package/core/buddy/package.json +3 -2
  25. package/core/buddy/src/cli.ts +17 -0
  26. package/core/buddy/src/commands/deploy.ts +1 -1
  27. package/core/buddy/src/custom-cli.ts +36 -0
  28. package/core/build/package.json +3 -2
  29. package/core/bun-create/bud/package.json +3 -2
  30. package/core/bun-create/buddy/package.json +3 -2
  31. package/core/bun-create/stack/package.json +3 -2
  32. package/core/bun-create/stacks/package.json +3 -2
  33. package/core/bun-create/stx/package.json +3 -2
  34. package/core/bun-plugin-yaml/dist/index.js +1 -1
  35. package/core/bun-plugin-yaml/package.json +3 -2
  36. package/core/bun-plugin-yaml/src/index.ts +1 -1
  37. package/core/cache/package.json +4 -3
  38. package/core/chat/package.json +3 -2
  39. package/core/cli/dist/index.js +2 -2
  40. package/core/cli/package.json +3 -2
  41. package/core/cli/src/cli.ts +1 -1
  42. package/core/cloud/deploy.ts +2 -2
  43. package/core/cloud/dist/index.js +144 -60
  44. package/core/cloud/package.json +34 -33
  45. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
  46. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  47. package/core/cloud/src/cloud/cdn.ts +5 -5
  48. package/core/cloud/src/cloud/compute.ts +150 -28
  49. package/core/cloud/src/cloud/index.ts +13 -9
  50. package/core/cloud/src/cloud/network.ts +4 -24
  51. package/core/cloud/src/cloud/package/README.md +59 -0
  52. package/core/cloud/src/cloud/package/package.json +63 -0
  53. package/core/cloud/src/cloud/router-layer/nodejs/package.json +15 -0
  54. package/core/cloud/src/runtime/example/lambda.ts +1 -1
  55. package/core/cloud/src/runtime/server.ts +1 -1
  56. package/core/collections/package.json +3 -2
  57. package/core/config/dist/index.js +14 -12
  58. package/core/config/package.json +2 -2
  59. package/core/config/src/config.ts +1 -1
  60. package/core/config/src/defaults.ts +3 -3
  61. package/core/config/src/overrides.ts +22 -22
  62. package/core/database/package.json +3 -2
  63. package/core/database/src/kysely-bun-worker/worker.ts +1 -1
  64. package/core/datetime/package.json +3 -2
  65. package/core/desktop/package.json +3 -2
  66. package/core/development/package.json +1 -1
  67. package/core/dns/package.json +9 -8
  68. package/core/docs/package.json +5 -4
  69. package/core/email/dist/index.js +0 -38
  70. package/core/email/package.json +5 -4
  71. package/core/email/src/send.ts +3 -3
  72. package/core/enums/package.json +1 -1
  73. package/core/env/package.json +1 -1
  74. package/core/error-handling/package.json +3 -2
  75. package/core/eslint-config/package.json +4 -4
  76. package/core/events/package.json +3 -2
  77. package/core/faker/package.json +3 -2
  78. package/core/git/package.json +3 -2
  79. package/core/health/package.json +3 -2
  80. package/core/http/package.json +3 -2
  81. package/core/lint/package.json +5 -4
  82. package/core/logging/package.json +3 -2
  83. package/core/notifications/package.json +3 -2
  84. package/core/objects/package.json +3 -2
  85. package/core/orm/package.json +3 -2
  86. package/core/path/package.json +3 -2
  87. package/core/payments/package.json +3 -2
  88. package/core/push/package.json +3 -2
  89. package/core/query-builder/package.json +3 -2
  90. package/core/queue/dist/index.js +3 -1
  91. package/core/queue/package.json +3 -2
  92. package/core/queue/src/index.ts +4 -2
  93. package/core/raycast/package.json +1 -1
  94. package/core/realtime/package.json +3 -2
  95. package/core/repl/package.json +3 -2
  96. package/core/router/package.json +3 -2
  97. package/core/scheduler/dist/index.js +3 -2
  98. package/core/scheduler/package.json +3 -2
  99. package/core/scheduler/src/index.ts +1 -1
  100. package/core/search-engine/package.json +3 -2
  101. package/core/security/package.json +3 -2
  102. package/core/server/package.json +3 -2
  103. package/core/signals/package.json +3 -2
  104. package/core/slug/package.json +3 -2
  105. package/core/sms/package.json +3 -2
  106. package/core/storage/package.json +3 -2
  107. package/core/storage/src/files.ts +1 -1
  108. package/core/storage/src/zip.ts +1 -1
  109. package/core/strings/package.json +3 -2
  110. package/core/tables/package.json +1 -1
  111. package/core/testing/package.json +5 -4
  112. package/core/tinker/package.json +3 -2
  113. package/core/tsconfig.json +1 -0
  114. package/core/tunnel/package.json +3 -2
  115. package/core/types/package.json +6 -5
  116. package/core/types/src/api.ts +2 -0
  117. package/core/types/src/cli.ts +2 -2
  118. package/core/types/src/cron-jobs.ts +2 -1
  119. package/core/types/src/library.ts +2 -0
  120. package/core/types/src/stacks.ts +6 -6
  121. package/core/ui/package.json +6 -5
  122. package/core/utils/dist/index.js +1 -1
  123. package/core/utils/package.json +3 -2
  124. package/core/validation/package.json +3 -2
  125. package/core/vite/dist/index.js +1 -1
  126. package/core/vite/package.json +3 -2
  127. package/core/whois/package.json +3 -2
  128. package/core/x-ray/package.json +3 -2
  129. package/core/zsh-buddy/package.json +1 -1
  130. package/ide/dictionary.txt +1 -0
  131. package/ide/vscode/package.json +1 -1
  132. package/package.json +1 -1
@@ -15,6 +15,7 @@ var library_default = {
15
15
  author: "Chris Breuer",
16
16
  contributors: ["Chris Breuer <chris@stacksjs.org>"],
17
17
  defaultLanguage: "en",
18
+ releaseable: true,
18
19
  vueComponents: {
19
20
  name: "hello-world-vue",
20
21
  description: "Your Vue component library description",
@@ -19,6 +19,7 @@ var library_default = {
19
19
  author: "Chris Breuer",
20
20
  contributors: ["Chris Breuer <chris@stacksjs.org>"],
21
21
  defaultLanguage: "en",
22
+ releaseable: true,
22
23
  vueComponents: {
23
24
  name: "hello-world-vue",
24
25
  description: "Your Vue component library description",
@@ -155,14 +156,15 @@ function generateEntryPointData(type) {
155
156
 
156
157
  // src/generate/lib-entries.ts
157
158
  import {log as log2} from "@stacksjs/logging";
159
+ import {library as library2} from "@stacksjs/config";
158
160
  import {hasComponents, hasFunctions} from "@stacksjs/storage";
159
- if (hasComponents()) {
161
+ if (library2.releaseable && hasComponents()) {
160
162
  await generateLibEntry("vue-components");
161
163
  await generateLibEntry("web-components");
162
164
  } else {
163
165
  log2.info("No components found. Skipping building component entry points.");
164
166
  }
165
- if (hasFunctions())
167
+ if (library2.releaseable && hasFunctions())
166
168
  await generateLibEntry("functions");
167
169
  else
168
170
  log2.info("No functions found. Skipping building function entry point.");
@@ -15,6 +15,7 @@ var library_default = {
15
15
  author: "Chris Breuer",
16
16
  contributors: ["Chris Breuer <chris@stacksjs.org>"],
17
17
  defaultLanguage: "en",
18
+ releaseable: true,
18
19
  vueComponents: {
19
20
  name: "hello-world-vue",
20
21
  description: "Your Vue component library description",
@@ -17,6 +17,7 @@ var library_default = {
17
17
  author: "Chris Breuer",
18
18
  contributors: ["Chris Breuer <chris@stacksjs.org>"],
19
19
  defaultLanguage: "en",
20
+ releaseable: true,
20
21
  vueComponents: {
21
22
  name: "hello-world-vue",
22
23
  description: "Your Vue component library description",
@@ -13,6 +13,7 @@ var library_default = {
13
13
  author: "Chris Breuer",
14
14
  contributors: ["Chris Breuer <chris@stacksjs.org>"],
15
15
  defaultLanguage: "en",
16
+ releaseable: true,
16
17
  vueComponents: {
17
18
  name: "hello-world-vue",
18
19
  description: "Your Vue component library description",
@@ -13,6 +13,7 @@ var library_default = {
13
13
  author: "Chris Breuer",
14
14
  contributors: ["Chris Breuer <chris@stacksjs.org>"],
15
15
  defaultLanguage: "en",
16
+ releaseable: true,
16
17
  vueComponents: {
17
18
  name: "hello-world-vue",
18
19
  description: "Your Vue component library description",
@@ -526,10 +526,12 @@ export default <Model> {
526
526
  class Action3 {
527
527
  name;
528
528
  description;
529
+ longRunning;
529
530
  handle;
530
531
  constructor({ name, description, handle }) {
531
532
  this.name = name;
532
533
  this.description = description;
534
+ this.longRunning = false;
533
535
  this.handle = handle;
534
536
  }
535
537
  }
@@ -528,10 +528,12 @@ export default <Model> {
528
528
  class Action3 {
529
529
  name;
530
530
  description;
531
+ longRunning;
531
532
  handle;
532
533
  constructor({ name, description, handle }) {
533
534
  this.name = name;
534
535
  this.description = description;
536
+ this.longRunning = false;
535
537
  this.handle = handle;
536
538
  }
537
539
  }
@@ -6,7 +6,7 @@ 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.48";
9
+ var version = "0.58.50";
10
10
 
11
11
  // src/upgrade.ts
12
12
  function checkForUncommittedChanges(options2) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -41,7 +41,8 @@
41
41
  ],
42
42
  "files": [
43
43
  "README.md",
44
- "dist"
44
+ "dist",
45
+ "src"
45
46
  ],
46
47
  "scripts": {
47
48
  "build": "bun --bun build.ts",
@@ -1,11 +1,13 @@
1
1
  export class Action {
2
2
  name: string
3
3
  description: string
4
+ longRunning: boolean
4
5
  handle: () => Promise<string>
5
6
 
6
7
  constructor({ name, description, handle }: { name: string, description: string, handle: () => Promise<string> }) {
7
8
  this.name = name
8
9
  this.description = description
10
+ this.longRunning = false // TODO: Implement long running actions
9
11
  this.handle = handle
10
12
  }
11
13
  }
@@ -0,0 +1,24 @@
1
+ import process from 'node:process'
2
+ import { ExitCode } from '@stacksjs/types'
3
+ import { writeTextFile } from '@stacksjs/storage'
4
+ import { projectPath } from '@stacksjs/path'
5
+ import { cli } from '@stacksjs/config'
6
+
7
+ log.info('Creating Vue Component Library Entry Point...')
8
+
9
+ if (!cli.command) {
10
+ log.error('No command defined in the CLI configuration')
11
+ process.exit(ExitCode.FatalError)
12
+ }
13
+
14
+ await writeTextFile({
15
+ path: projectPath(cli.command),
16
+ data: `#!/usr/bin/env bun
17
+ import('./storage/framework/core/buddy/src/custom-cli')
18
+ `,
19
+ }).catch((err) => {
20
+ log.error('There was an error generating your custom CLI file.', err)
21
+ process.exit(ExitCode.FatalError)
22
+ })
23
+
24
+ log.success('Generated custom CLI file')
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env bun
2
2
  import { log } from '@stacksjs/logging'
3
+ import { library } from '@stacksjs/config'
3
4
  import { hasComponents, hasFunctions } from '@stacksjs/storage'
4
5
  import { generateLibEntry } from '../helpers/lib-entries'
5
6
 
6
- if (hasComponents()) {
7
+ if (library.releaseable && hasComponents()) {
7
8
  await generateLibEntry('vue-components')
8
9
  await generateLibEntry('web-components')
9
10
  }
@@ -11,7 +12,7 @@ else {
11
12
  log.info('No components found. Skipping building component entry points.')
12
13
  }
13
14
 
14
- if (hasFunctions())
15
+ if (library.releaseable && hasFunctions())
15
16
  await generateLibEntry('functions')
16
17
  else
17
18
  log.info('No functions found. Skipping building function entry point.')
@@ -8276,7 +8276,7 @@ var commonParams = {
8276
8276
  var package_default = {
8277
8277
  name: "@aws-sdk/client-bedrock",
8278
8278
  description: "AWS SDK for JavaScript Bedrock Client for Node.js, Browser and React Native",
8279
- version: "3.503.1",
8279
+ version: "3.504.0",
8280
8280
  scripts: {
8281
8281
  build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
8282
8282
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock",
@@ -8295,9 +8295,9 @@ var package_default = {
8295
8295
  dependencies: {
8296
8296
  "@aws-crypto/sha256-browser": "3.0.0",
8297
8297
  "@aws-crypto/sha256-js": "3.0.0",
8298
- "@aws-sdk/client-sts": "3.502.0",
8298
+ "@aws-sdk/client-sts": "3.504.0",
8299
8299
  "@aws-sdk/core": "3.496.0",
8300
- "@aws-sdk/credential-provider-node": "3.503.1",
8300
+ "@aws-sdk/credential-provider-node": "3.504.0",
8301
8301
  "@aws-sdk/middleware-host-header": "3.502.0",
8302
8302
  "@aws-sdk/middleware-logger": "3.502.0",
8303
8303
  "@aws-sdk/middleware-recursion-detection": "3.502.0",
@@ -9332,7 +9332,7 @@ var commonParams2 = {
9332
9332
  var package_default2 = {
9333
9333
  name: "@aws-sdk/client-bedrock-runtime",
9334
9334
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
9335
- version: "3.503.1",
9335
+ version: "3.504.0",
9336
9336
  scripts: {
9337
9337
  build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
9338
9338
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -9351,9 +9351,9 @@ var package_default2 = {
9351
9351
  dependencies: {
9352
9352
  "@aws-crypto/sha256-browser": "3.0.0",
9353
9353
  "@aws-crypto/sha256-js": "3.0.0",
9354
- "@aws-sdk/client-sts": "3.502.0",
9354
+ "@aws-sdk/client-sts": "3.504.0",
9355
9355
  "@aws-sdk/core": "3.496.0",
9356
- "@aws-sdk/credential-provider-node": "3.503.1",
9356
+ "@aws-sdk/credential-provider-node": "3.504.0",
9357
9357
  "@aws-sdk/middleware-host-header": "3.502.0",
9358
9358
  "@aws-sdk/middleware-logger": "3.502.0",
9359
9359
  "@aws-sdk/middleware-recursion-detection": "3.502.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ai",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Stacks Artificial Intelligence.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -40,7 +40,8 @@
40
40
  ],
41
41
  "files": [
42
42
  "README.md",
43
- "dist"
43
+ "dist",
44
+ "src"
44
45
  ],
45
46
  "scripts": {
46
47
  "build": "bun --bun build.ts",
@@ -48,10 +49,10 @@
48
49
  "prepublishOnly": "bun --bun run build"
49
50
  },
50
51
  "peerDependencies": {
51
- "@aws-sdk/client-bedrock-runtime": "^3.503.1"
52
+ "@aws-sdk/client-bedrock-runtime": "^3.504.0"
52
53
  },
53
54
  "dependencies": {
54
- "@aws-sdk/client-bedrock-runtime": "^3.503.1"
55
+ "@aws-sdk/client-bedrock-runtime": "^3.504.0"
55
56
  },
56
57
  "devDependencies": {
57
58
  "@stacksjs/development": "workspace:*"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/alias",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "The Stacks aliases.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -32,7 +32,8 @@
32
32
  ],
33
33
  "files": [
34
34
  "README.md",
35
- "dist"
35
+ "dist",
36
+ "src"
36
37
  ],
37
38
  "scripts": {
38
39
  "build": "bun --bun build.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/analytics",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Stacks Analytics. Privacy-friendly.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -41,7 +41,8 @@
41
41
  ],
42
42
  "files": [
43
43
  "README.md",
44
- "dist"
44
+ "dist",
45
+ "src"
45
46
  ],
46
47
  "scripts": {
47
48
  "build": "bun --bun build.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/api",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "The Stacks array utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -40,7 +40,8 @@
40
40
  ],
41
41
  "files": [
42
42
  "README.md",
43
- "dist"
43
+ "dist",
44
+ "src"
44
45
  ],
45
46
  "scripts": {
46
47
  "build": "bun --bun build.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/arrays",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "The Stacks array utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -40,7 +40,8 @@
40
40
  ],
41
41
  "files": [
42
42
  "README.md",
43
- "dist"
43
+ "dist",
44
+ "src"
44
45
  ],
45
46
  "scripts": {
46
47
  "build": "bun --bun build.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/auth",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "A more simplistic way to authenticate.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -37,7 +37,8 @@
37
37
  ],
38
38
  "files": [
39
39
  "README.md",
40
- "dist"
40
+ "dist",
41
+ "src"
41
42
  ],
42
43
  "scripts": {
43
44
  "build": "bun --bun build.ts",
@@ -591,7 +591,7 @@ function deploy(buddy) {
591
591
  if (await hasUserDomainBeenAddedToCloud(domain)) {
592
592
  log6.success("Your domain is properly configured.");
593
593
  log6.info("Your cloud is deploying...");
594
- console.log(`${italic2("This may take a while...")}`);
594
+ log6.info(`${italic2("This may take a while...")}`);
595
595
  await new Promise((resolve2) => setTimeout(resolve2, 2000));
596
596
  options.domain = domain;
597
597
  const result2 = await runAction5(Action5.Deploy, options);
@@ -18,7 +18,7 @@ lint,
18
18
  release,
19
19
  setup,
20
20
  upgrade
21
- } from "./chunk-b32089b9556f373c.js";
21
+ } from "./chunk-91084836e95161e8.js";
22
22
  import"./chunk-0455e53fab4244b1.js";
23
23
 
24
24
  // src/cli.ts
@@ -26,6 +26,8 @@ import process from "process";
26
26
  import {handleError} from "@stacksjs/error-handling";
27
27
  import {cli as cli2} from "@stacksjs/cli";
28
28
  import {ensureProjectIsInitialized} from "@stacksjs/utils";
29
+ import {path as p} from "@stacksjs/path";
30
+ import {fs} from "@stacksjs/storage";
29
31
  async function main() {
30
32
  const buddy = cli2("buddy");
31
33
  setup(buddy);
@@ -48,6 +50,16 @@ async function main() {
48
50
  release(buddy);
49
51
  setup(buddy);
50
52
  upgrade(buddy);
53
+ const commandsDir = p.appPath("Commands");
54
+ const commandFiles = fs.readdirSync(commandsDir).filter((file) => file.endsWith(".ts"));
55
+ for (const file of commandFiles) {
56
+ const commandPath = `${commandsDir}/${file}`;
57
+ const dynamicImport = await import(commandPath);
58
+ if (typeof dynamicImport.default === "function")
59
+ dynamicImport.default(buddy);
60
+ else
61
+ console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default);
62
+ }
51
63
  buddy.parse();
52
64
  }
53
65
  process.on("uncaughtException", handleError);
@@ -32,7 +32,7 @@ tinker,
32
32
  types,
33
33
  upgrade,
34
34
  version
35
- } from "./chunk-b32089b9556f373c.js";
35
+ } from "./chunk-91084836e95161e8.js";
36
36
  import"./chunk-0455e53fab4244b1.js";
37
37
  export {
38
38
  version,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -61,7 +61,8 @@
61
61
  },
62
62
  "files": [
63
63
  "README.md",
64
- "dist"
64
+ "dist",
65
+ "src"
65
66
  ],
66
67
  "scripts": {
67
68
  "buddy": "bunx ./src/cli.ts",
@@ -2,6 +2,8 @@ import process from 'node:process'
2
2
  import { handleError } from '@stacksjs/error-handling'
3
3
  import { cli } from '@stacksjs/cli'
4
4
  import { ensureProjectIsInitialized } from '@stacksjs/utils'
5
+ import { path as p } from '@stacksjs/path'
6
+ import { fs } from '@stacksjs/storage'
5
7
  import * as cmd from './commands'
6
8
 
7
9
  // setup global error handlers
@@ -44,6 +46,21 @@ async function main() {
44
46
  // cmd.prepublish(buddy)
45
47
  cmd.upgrade(buddy)
46
48
 
49
+ // dynamically import and register commands from ./app/Commands/*
50
+ const commandsDir = p.appPath('Commands')
51
+ const commandFiles = fs.readdirSync(commandsDir).filter(file => file.endsWith('.ts'))
52
+
53
+ for (const file of commandFiles) {
54
+ const commandPath = `${commandsDir}/${file}`
55
+ const dynamicImport = await import(commandPath)
56
+
57
+ // Correctly use the default export function
58
+ if (typeof dynamicImport.default === 'function')
59
+ dynamicImport.default(buddy)
60
+ else
61
+ console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default)
62
+ }
63
+
47
64
  buddy.parse()
48
65
  }
49
66
 
@@ -51,7 +51,7 @@ export function deploy(buddy: CLI) {
51
51
  log.success('Your domain is properly configured.')
52
52
  log.info('Your cloud is deploying...')
53
53
 
54
- console.log(`${italic('This may take a while...')}`)
54
+ log.info(`${italic('This may take a while...')}`)
55
55
  await new Promise(resolve => setTimeout(resolve, 2000))
56
56
  options.domain = domain
57
57
 
@@ -0,0 +1,36 @@
1
+ import process from 'node:process'
2
+ import { handleError } from '@stacksjs/error-handling'
3
+ import { config } from '@stacksjs/config'
4
+ import { cli } from '@stacksjs/cli'
5
+ import { path as p } from '@stacksjs/path'
6
+ import { fs } from '@stacksjs/storage'
7
+
8
+ // setup global error handlers
9
+ process.on('uncaughtException', handleError)
10
+ process.on('unhandledRejection', handleError)
11
+
12
+ async function main() {
13
+ const buddy = cli(config.cli.name)
14
+
15
+ if (!fs.existsSync(p.projectPath(config.cli.command)))
16
+ fs.writeFileSync(p.projectPath(config.cli.command), `import('./storage/framework/core/buddy/src/custom-cli')`)
17
+
18
+ // dynamically import and register commands from ./app/Commands/*
19
+ const commandsDir = p.appPath('Commands')
20
+ const commandFiles = fs.readdirSync(commandsDir).filter(file => file.endsWith('.ts'))
21
+
22
+ for (const file of commandFiles) {
23
+ const commandPath = `${commandsDir}/${file}`
24
+ const dynamicImport = await import(commandPath)
25
+
26
+ // Correctly use the default export function
27
+ if (typeof dynamicImport.default === 'function')
28
+ dynamicImport.default(buddy)
29
+ else
30
+ console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default)
31
+ }
32
+
33
+ buddy.parse()
34
+ }
35
+
36
+ await main()
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/build",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "The Stacks framework build tools and configurations.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -42,7 +42,8 @@
42
42
  ],
43
43
  "files": [
44
44
  "README.md",
45
- "dist"
45
+ "dist",
46
+ "src"
46
47
  ],
47
48
  "scripts": {
48
49
  "build": "bun --bun build.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/bud",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "files": [
37
37
  "README.md",
38
- "dist"
38
+ "dist",
39
+ "src"
39
40
  ],
40
41
  "scripts": {
41
42
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/buddy",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "files": [
37
37
  "README.md",
38
- "dist"
38
+ "dist",
39
+ "src"
39
40
  ],
40
41
  "scripts": {
41
42
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stack",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "files": [
37
37
  "README.md",
38
- "dist"
38
+ "dist",
39
+ "src"
39
40
  ],
40
41
  "scripts": {
41
42
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stacks",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "files": [
37
37
  "README.md",
38
- "dist"
38
+ "dist",
39
+ "src"
39
40
  ],
40
41
  "scripts": {
41
42
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stx",
3
3
  "type": "module",
4
- "version": "0.58.48",
4
+ "version": "0.58.50",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  ],
36
36
  "files": [
37
37
  "README.md",
38
- "dist"
38
+ "dist",
39
+ "src"
39
40
  ],
40
41
  "scripts": {
41
42
  "buddy": "bun --bun ./storage/framework/core/buddy/src/cli.ts",
@@ -2745,7 +2745,7 @@ var init_js_yaml = __esm(() => {
2745
2745
  });
2746
2746
 
2747
2747
  // src/index.ts
2748
- import {plugin} from "node:bun";
2748
+ var {plugin } = globalThis.Bun;
2749
2749
  plugin({
2750
2750
  name: "YAML",
2751
2751
  async setup(build) {