stacks 0.58.55 → 0.58.57

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 (101) hide show
  1. package/core/actions/dist/src/upgrade.js +1 -1
  2. package/core/actions/package.json +1 -1
  3. package/core/ai/package.json +1 -1
  4. package/core/alias/package.json +1 -1
  5. package/core/analytics/package.json +1 -1
  6. package/core/api/package.json +1 -1
  7. package/core/arrays/package.json +1 -1
  8. package/core/auth/package.json +1 -1
  9. package/core/buddy/dist/{chunk-d52e40a990b45728.js → chunk-e9c0ec1a3b7be088.js} +120 -92
  10. package/core/buddy/dist/cli.js +1 -1
  11. package/core/buddy/dist/index.js +1 -1
  12. package/core/buddy/package.json +1 -1
  13. package/core/buddy/src/commands/configure.ts +38 -27
  14. package/core/buddy/src/commands/deploy.ts +81 -56
  15. package/core/buddy/src/commands/setup.ts +11 -9
  16. package/core/build/package.json +1 -1
  17. package/core/bun-create/bud/package.json +1 -1
  18. package/core/bun-create/buddy/package.json +1 -1
  19. package/core/bun-create/stack/package.json +1 -1
  20. package/core/bun-create/stacks/package.json +1 -1
  21. package/core/bun-create/stx/package.json +1 -1
  22. package/core/bun-plugin-yaml/package.json +1 -1
  23. package/core/cache/package.json +1 -1
  24. package/core/chat/package.json +1 -1
  25. package/core/cli/dist/index.js +7 -1
  26. package/core/cli/package.json +1 -1
  27. package/core/cli/src/exec.ts +8 -0
  28. package/core/cloud/deploy.ts +3 -2
  29. package/core/cloud/dist/index.js +131 -70
  30. package/core/cloud/package.json +1 -1
  31. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +1 -1
  32. package/core/cloud/src/cloud/index.ts +76 -50
  33. package/core/cloud/src/cloud/queue.ts +86 -29
  34. package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
  35. package/core/collections/package.json +1 -1
  36. package/core/config/package.json +1 -1
  37. package/core/database/package.json +1 -1
  38. package/core/datetime/package.json +1 -1
  39. package/core/desktop/package.json +1 -1
  40. package/core/development/package.json +1 -1
  41. package/core/dns/package.json +1 -1
  42. package/core/docs/package.json +1 -1
  43. package/core/email/package.json +1 -1
  44. package/core/enums/package.json +1 -1
  45. package/core/env/package.json +1 -1
  46. package/core/env/src/types.ts +1 -1
  47. package/core/error-handling/package.json +1 -1
  48. package/core/eslint-config/package.json +1 -1
  49. package/core/events/package.json +1 -1
  50. package/core/faker/package.json +1 -1
  51. package/core/git/package.json +1 -1
  52. package/core/health/package.json +1 -1
  53. package/core/http/package.json +1 -1
  54. package/core/lint/package.json +1 -1
  55. package/core/logging/dist/index.js +161 -4
  56. package/core/logging/package.json +1 -1
  57. package/core/logging/src/index.ts +55 -12
  58. package/core/notifications/package.json +1 -1
  59. package/core/objects/package.json +1 -1
  60. package/core/orm/package.json +1 -1
  61. package/core/path/dist/index.js +1 -1
  62. package/core/path/package.json +1 -1
  63. package/core/path/src/index.ts +1 -1
  64. package/core/payments/package.json +1 -1
  65. package/core/push/package.json +1 -1
  66. package/core/query-builder/package.json +1 -1
  67. package/core/queue/dist/index.js +3 -1
  68. package/core/queue/package.json +1 -1
  69. package/core/queue/src/index.ts +3 -1
  70. package/core/raycast/package.json +1 -1
  71. package/core/realtime/package.json +1 -1
  72. package/core/repl/package.json +1 -1
  73. package/core/router/package.json +1 -1
  74. package/core/scheduler/package.json +1 -1
  75. package/core/search-engine/package.json +1 -1
  76. package/core/security/package.json +1 -1
  77. package/core/server/package.json +1 -1
  78. package/core/signals/package.json +1 -1
  79. package/core/slug/package.json +1 -1
  80. package/core/sms/package.json +1 -1
  81. package/core/storage/package.json +1 -1
  82. package/core/strings/package.json +1 -1
  83. package/core/tables/package.json +1 -1
  84. package/core/testing/package.json +1 -1
  85. package/core/tinker/package.json +1 -1
  86. package/core/tunnel/package.json +1 -1
  87. package/core/types/dist/index.js +8 -3
  88. package/core/types/package.json +1 -1
  89. package/core/types/src/configure.ts +7 -0
  90. package/core/types/src/cron-jobs.ts +8 -3
  91. package/core/ui/package.json +1 -1
  92. package/core/utils/dist/index.js +1 -1
  93. package/core/utils/package.json +1 -1
  94. package/core/validation/package.json +1 -1
  95. package/core/vite/dist/index.js +1 -1
  96. package/core/vite/package.json +1 -1
  97. package/core/whois/package.json +1 -1
  98. package/core/x-ray/package.json +1 -1
  99. package/core/zsh-buddy/package.json +1 -1
  100. package/ide/vscode/package.json +1 -1
  101. package/package.json +1 -1
@@ -3,7 +3,7 @@ import process from 'node:process'
3
3
  import { ExitCode } from '@stacksjs/types'
4
4
  import type { CLI, DeployOptions } from '@stacksjs/types'
5
5
  import { runAction } from '@stacksjs/actions'
6
- import { intro, italic, log, outro } from '@stacksjs/cli'
6
+ import { intro, italic, log, outro, runCommand } from '@stacksjs/cli'
7
7
  import { Action } from '@stacksjs/enums'
8
8
  import { app } from '@stacksjs/config'
9
9
  import { addDomain, hasUserDomainBeenAddedToCloud } from '@stacksjs/dns'
@@ -25,72 +25,24 @@ export function deploy(buddy: CLI) {
25
25
  const domain = options.domain || app.url
26
26
 
27
27
  if (!domain) {
28
- log.info('We could not identify a domain to deploy to.')
29
- log.info('Please set your .env or ./config/app.ts properly.')
30
- console.log('')
31
- log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
32
- console.log('')
33
- log.info(' ➡️ Example: `buddy deploy --domain example.com`')
34
- console.log('')
28
+ log.info('No domain found in your .env or ./config/app.ts')
29
+ log.info('Please ensure your domain is properly configured.')
30
+ log.info('For more info, check out the docs or join our Discord.')
35
31
  process.exit(ExitCode.FatalError)
36
32
  }
37
33
 
38
- // TODO: we can improve this check at some point, otherwise domains that legitimately include the word localhost will fail
39
- // TODO: add check for whether the local APP_ENV is getting deployed, if so, ask if the user meant to deploy `dev`
40
- if (domain.includes('localhost')) {
41
- log.info('You are deploying to a local environment.')
42
- log.info('Please set your .env or ./config/app.ts properly.')
43
- console.log('')
44
- log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
45
- console.log('')
46
- log.info(' ➡️ Example: `buddy deploy --domain example.com`')
47
- console.log('')
48
- process.exit(ExitCode.FatalError)
49
- }
50
-
51
- if (await hasUserDomainBeenAddedToCloud(domain)) {
52
- log.info('Domain is properly configured')
53
- log.info('Your cloud is deploying...')
54
-
55
- log.info(`${italic('This may take a while...')}`)
56
- options.domain = domain
34
+ await checkIfAwsIsConfigured()
57
35
 
58
- // now that we know the domain has been added to the users (AWS) cloud, we can deploy
59
- const result = await runAction(Action.Deploy, options)
60
-
61
- if (result.isErr()) {
62
- await outro('While running the `buddy deploy`, there was an issue', { startTime, useSeconds: true }, result.error)
63
- process.exit(ExitCode.FatalError)
64
- }
65
-
66
- await outro('Deployment succeeded.', { startTime, useSeconds: true })
67
-
68
- process.exit(ExitCode.Success)
69
- }
36
+ options.domain = await configureDomain(domain, options, startTime)
70
37
 
71
- // if the domain hasn't been added to the user's (AWS) cloud, we will add it for them
72
- // and then exit the process with prompts for the user to update their nameservers
73
- console.log('')
74
- log.info(` 👋 It appears to be your first ${italic(domain)} deployment.`)
75
- console.log('')
76
- log.info(italic('Let’s ensure it is all connected properly.'))
77
- log.info(italic('One moment...'))
78
- console.log('')
79
-
80
- options.domain = domain
81
- const result = await addDomain({
82
- ...options,
83
- deploy: true,
84
- startTime,
85
- })
38
+ const result = await runAction(Action.Deploy, options)
86
39
 
87
40
  if (result.isErr()) {
88
41
  await outro('While running the `buddy deploy`, there was an issue', { startTime, useSeconds: true }, result.error)
89
42
  process.exit(ExitCode.FatalError)
90
43
  }
91
44
 
92
- await outro('Added your domain.', { startTime, useSeconds: true })
93
- process.exit(ExitCode.Success)
45
+ await outro('Project deployed.', { startTime, useSeconds: true })
94
46
  })
95
47
 
96
48
  buddy.on('deploy:*', () => {
@@ -98,3 +50,76 @@ export function deploy(buddy: CLI) {
98
50
  process.exit(1)
99
51
  })
100
52
  }
53
+
54
+ async function configureDomain(domain: string, options: DeployOptions, startTime: number) {
55
+ if (!domain) {
56
+ log.info('We could not identify a domain to deploy to.')
57
+ log.info('Please set your .env or ./config/app.ts properly.')
58
+ console.log('')
59
+ log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
60
+ console.log('')
61
+ log.info(' ➡️ Example: `buddy deploy --domain example.com`')
62
+ console.log('')
63
+ process.exit(ExitCode.FatalError)
64
+ }
65
+
66
+ // TODO: we can improve this check at some point, otherwise domains that legitimately include the word localhost will fail
67
+ // TODO: add check for whether the local APP_ENV is getting deployed, if so, ask if the user meant to deploy `dev`
68
+ if (domain.includes('localhost')) {
69
+ log.info('You are deploying to a local environment.')
70
+ log.info('Please set your .env or ./config/app.ts properly.')
71
+ console.log('')
72
+ log.info('Alternatively, specify a domain to deploy via the `--domain` flag.')
73
+ console.log('')
74
+ log.info(' ➡️ Example: `buddy deploy --domain example.com`')
75
+ console.log('')
76
+ process.exit(ExitCode.FatalError)
77
+ }
78
+
79
+ if (await hasUserDomainBeenAddedToCloud(domain)) {
80
+ log.info('Domain is properly configured')
81
+ log.info('Your cloud is deploying...')
82
+
83
+ log.info(`${italic('This may take a while...')}`)
84
+
85
+ return domain
86
+ }
87
+
88
+ // if the domain hasn't been added to the user's (AWS) cloud, we will add it for them
89
+ // and then exit the process with prompts for the user to update their nameservers
90
+ console.log('')
91
+ log.info(` 👋 It appears to be your first ${italic(domain)} deployment.`)
92
+ console.log('')
93
+ log.info(italic('Let’s ensure it is all connected properly.'))
94
+ log.info(italic('One moment...'))
95
+ console.log('')
96
+
97
+ const result = await addDomain({
98
+ ...options,
99
+ deploy: true,
100
+ startTime,
101
+ })
102
+
103
+ if (result.isErr()) {
104
+ await outro('While running the `buddy deploy`, there was an issue', { startTime, useSeconds: true }, result.error)
105
+ process.exit(ExitCode.FatalError)
106
+ }
107
+
108
+ await outro('Added your domain.', { startTime, useSeconds: true })
109
+ process.exit(ExitCode.Success)
110
+ }
111
+
112
+ async function checkIfAwsIsConfigured() {
113
+ log.info('Ensuring AWS is configured...')
114
+ const result = await runCommand('buddy configure:aws --quiet', {
115
+ silent: true,
116
+ })
117
+
118
+ if (result.isErr()) {
119
+ log.error('AWS is not configured properly.')
120
+ log.error('Please run `buddy configure:aws` to set up your AWS credentials.')
121
+ process.exit(ExitCode.FatalError)
122
+ }
123
+
124
+ log.success('AWS is configured')
125
+ }
@@ -79,9 +79,11 @@ export function setup(buddy: CLI) {
79
79
  }
80
80
  }
81
81
 
82
- log.success('Oh My Zsh setup complete.')
82
+ log.success('Oh My Zsh setup complete')
83
83
  log.info('To see changes reflect, you may need to:')
84
- log.info('⌘⇧P workbench.action.reloadWindow')
84
+ // if on vscode show the message
85
+ // log.info('⌘⇧P workbench.action.reloadWindow')
86
+ // else show the message
85
87
  })
86
88
 
87
89
  buddy.on('setup:*', () => {
@@ -149,14 +151,14 @@ async function initializeProject(options: CliOptions): Promise<void> {
149
151
 
150
152
  log.info('Ensuring AWS is connected...')
151
153
 
152
- // const awsResult = await runCommand('buddy configure:aws', {
153
- // cwd: options.cwd || p.projectPath(),
154
- // })
154
+ const awsResult = await runCommand('buddy configure:aws', {
155
+ cwd: options.cwd || p.projectPath(),
156
+ })
155
157
 
156
- // if (awsResult.isErr()) {
157
- // handleError(awsResult.error)
158
- // process.exit(ExitCode.FatalError)
159
- // }
158
+ if (awsResult.isErr()) {
159
+ handleError(awsResult.error)
160
+ process.exit(ExitCode.FatalError)
161
+ }
160
162
 
161
163
  log.success('Configured AWS')
162
164
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/build",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
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.55",
4
+ "version": "0.58.57",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/buddy",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stack",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stacks",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bun-examples/stx",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "Your project description.",
6
6
  "author": "your-name <your-email>",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-yaml",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "A Bun plugin to load yaml files",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cache",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "Caching the Stacks way.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/chat",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "Easily interact with chat APIs.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -14,7 +14,7 @@ async function installStack(name, options) {
14
14
  // src/cli.ts
15
15
  import cac from "cac";
16
16
  // package.json
17
- var version = "0.58.55";
17
+ var version = "0.58.57";
18
18
 
19
19
  // src/cli.ts
20
20
  function cli(name, options) {
@@ -58,6 +58,12 @@ async function exec(command, options) {
58
58
  process.exit(exitCode);
59
59
  }
60
60
  });
61
+ if (options?.stdin === "pipe" && options.input) {
62
+ if (proc.stdin) {
63
+ proc.stdin.write(options.input);
64
+ proc.stdin.end();
65
+ }
66
+ }
61
67
  const exited = await proc.exited;
62
68
  if (exited === ExitCode.Success)
63
69
  return ok(proc);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cli",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "TypeScript framework for CLI artisans. Build beautiful console apps with ease.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -46,6 +46,14 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
46
46
  },
47
47
  })
48
48
 
49
+ // Check if we need to write to stdin
50
+ if (options?.stdin === 'pipe' && options.input) {
51
+ if (proc.stdin) {
52
+ proc.stdin.write(options.input)
53
+ proc.stdin.end()
54
+ }
55
+ }
56
+
49
57
  const exited = await proc.exited
50
58
  if (exited === ExitCode.Success)
51
59
  return ok(proc)
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-new */
2
1
  import 'source-map-support/register'
3
2
  import process from 'node:process'
4
3
  import { config } from '@stacksjs/config'
@@ -76,9 +75,11 @@ export const options = {
76
75
  timestamp,
77
76
  } satisfies CloudOptions
78
77
 
79
- new Cloud(app, name, {
78
+ const cloud = new Cloud(app, name, {
80
79
  ...options,
81
80
  description: `The Stacks Cloud`,
82
81
  })
83
82
 
83
+ await cloud.init()
84
+
84
85
  app.synth()
@@ -1795,107 +1795,168 @@ class ComputeStack {
1795
1795
 
1796
1796
  // src/cloud/queue.ts
1797
1797
  import {aws_ec2 as ec24} from "aws-cdk-lib";
1798
+ import {pascalCase, slug as slug2} from "@stacksjs/strings";
1799
+ import {fs} from "@stacksjs/storage";
1800
+ import {path as path6} from "@stacksjs/path";
1798
1801
  import {Rule, Schedule} from "aws-cdk-lib/aws-events";
1799
1802
  import {EcsTask} from "aws-cdk-lib/aws-events-targets";
1800
1803
 
1801
1804
  class QueueStack {
1805
+ scope;
1806
+ props;
1802
1807
  constructor(scope, props) {
1803
- const rule = new Rule(scope, "QueueRule", {
1804
- ruleName: `${props.appName}-${props.appEnv}-queue-rule`,
1805
- schedule: Schedule.cron({ minute: "*", hour: "*", month: "*", weekDay: "*", year: "*" })
1806
- });
1807
- rule.addTarget(new EcsTask({
1808
- cluster: props.cluster,
1809
- taskDefinition: props.taskDefinition,
1810
- containerOverrides: [
1811
- {
1812
- containerName: `${props.appName}-${props.appEnv}-api`,
1813
- environment: [
1814
- {
1815
- name: "QUEUE_WORKER",
1816
- value: "true"
1817
- },
1818
- {
1819
- name: "JOB",
1820
- value: "DummyJob.ts"
1808
+ this.scope = scope;
1809
+ this.props = props;
1810
+ }
1811
+ async init() {
1812
+ const jobsDir = path6.jobsPath();
1813
+ try {
1814
+ const files = await fs.readdir(jobsDir);
1815
+ for (const file of files) {
1816
+ if (file.endsWith(".ts")) {
1817
+ const filePath = path6.jobsPath(file);
1818
+ const jobModule = await this.loadJobModule(filePath);
1819
+ const rate = jobModule.default.rate || "* * * * *";
1820
+ const schedule = Schedule.cron(this.cronScheduleFromRate(rate));
1821
+ const id = `QueueRule${pascalCase(file.replace(".ts", ""))}`;
1822
+ const rule = new Rule(this.scope, id, {
1823
+ ruleName: `${this.props.appName}-${this.props.appEnv}-queue-rule-${slug2(file.replace(".ts", ""))}`,
1824
+ schedule
1825
+ });
1826
+ rule.addTarget(new EcsTask({
1827
+ cluster: this.props.cluster,
1828
+ taskDefinition: this.props.taskDefinition,
1829
+ containerOverrides: [
1830
+ {
1831
+ containerName: `${this.props.appName}-${this.props.appEnv}-api`,
1832
+ environment: [
1833
+ {
1834
+ name: "QUEUE_WORKER",
1835
+ value: "true"
1836
+ },
1837
+ {
1838
+ name: "JOB",
1839
+ value: file
1840
+ }
1841
+ ]
1842
+ }
1843
+ ],
1844
+ retryAttempts: 3,
1845
+ subnetSelection: {
1846
+ subnetType: ec24.SubnetType.PUBLIC
1821
1847
  }
1822
- ]
1848
+ }));
1823
1849
  }
1824
- ],
1825
- retryAttempts: 3,
1826
- subnetSelection: {
1827
- subnetType: ec24.SubnetType.PUBLIC
1828
1850
  }
1829
- }));
1851
+ } catch (err2) {
1852
+ console.error("Error reading the jobs directory:", err2);
1853
+ }
1854
+ }
1855
+ cronScheduleFromRate(rate) {
1856
+ const parts = rate.split(" ");
1857
+ return {
1858
+ minute: parts[0],
1859
+ hour: parts[1],
1860
+ month: parts[2],
1861
+ weekDay: parts[3],
1862
+ year: parts[4]
1863
+ };
1864
+ }
1865
+ async loadJobModule(filePath) {
1866
+ const jobModule = await import(filePath);
1867
+ return jobModule;
1830
1868
  }
1831
1869
  }
1832
1870
 
1833
1871
  // src/cloud/index.ts
1834
1872
  class Cloud extends Stack2 {
1873
+ dns;
1874
+ security;
1875
+ storage;
1876
+ network;
1877
+ fileSystem;
1878
+ jumpBox;
1879
+ docs;
1880
+ email;
1881
+ redirects;
1882
+ permissions;
1883
+ ai;
1884
+ cli;
1885
+ api;
1886
+ cdn;
1887
+ queue;
1888
+ deployment;
1889
+ scope;
1890
+ props;
1835
1891
  constructor(scope, id, props) {
1836
1892
  super(scope, id, props);
1837
- const dns2 = new DnsStack(this, props);
1838
- const security2 = new SecurityStack(this, {
1893
+ this.scope = scope;
1894
+ this.props = props;
1895
+ this.dns = new DnsStack(this, props);
1896
+ this.security = new SecurityStack(this, {
1839
1897
  ...props,
1840
- zone: dns2.zone
1898
+ zone: this.dns.zone
1841
1899
  });
1842
- const storage5 = new StorageStack(this, {
1900
+ this.storage = new StorageStack(this, {
1843
1901
  ...props,
1844
- kmsKey: security2.kmsKey
1902
+ kmsKey: this.security.kmsKey
1845
1903
  });
1846
- const network2 = new NetworkStack(this, props);
1847
- const fileSystem = new FileSystemStack(this, {
1904
+ this.network = new NetworkStack(this, props);
1905
+ this.fileSystem = new FileSystemStack(this, {
1848
1906
  ...props,
1849
- vpc: network2.vpc
1907
+ vpc: this.network.vpc
1850
1908
  });
1851
- new JumpBoxStack(this, {
1909
+ this.jumpBox = new JumpBoxStack(this, {
1852
1910
  ...props,
1853
- vpc: network2.vpc,
1854
- fileSystem: fileSystem.fileSystem
1911
+ vpc: this.network.vpc,
1912
+ fileSystem: this.fileSystem.fileSystem
1855
1913
  });
1856
- const docs2 = new DocsStack(this, props);
1857
- new EmailStack(this, {
1914
+ this.docs = new DocsStack(this, props);
1915
+ this.email = new EmailStack(this, {
1858
1916
  ...props,
1859
- zone: dns2.zone
1917
+ zone: this.dns.zone
1860
1918
  });
1861
- new RedirectsStack(this, props);
1862
- new PermissionsStack(this);
1863
- let api;
1919
+ this.redirects = new RedirectsStack(this, props);
1920
+ this.permissions = new PermissionsStack(this);
1921
+ this.ai = new AiStack(this, props);
1922
+ this.cli = new CliStack(this, props);
1923
+ }
1924
+ async init() {
1864
1925
  if (config20.cloud.api?.deploy) {
1865
- api = new ComputeStack(this, {
1926
+ const props = this.props;
1927
+ this.api = new ComputeStack(this, {
1866
1928
  ...props,
1867
- vpc: network2.vpc,
1868
- fileSystem: fileSystem.fileSystem,
1869
- zone: dns2.zone,
1870
- certificate: security2.certificate
1929
+ vpc: this.network.vpc,
1930
+ fileSystem: this.fileSystem.fileSystem,
1931
+ zone: this.dns.zone,
1932
+ certificate: this.security.certificate
1871
1933
  });
1872
- new QueueStack(this, {
1934
+ this.queue = new QueueStack(this, {
1873
1935
  ...props,
1874
- cluster: api.cluster,
1875
- taskDefinition: api.taskDefinition
1936
+ cluster: this.api.cluster,
1937
+ taskDefinition: this.api.taskDefinition
1938
+ });
1939
+ await this.queue.init();
1940
+ this.cdn = new CdnStack(this, {
1941
+ ...props,
1942
+ publicBucket: this.storage.publicBucket,
1943
+ logBucket: this.storage.logBucket,
1944
+ certificate: this.security.certificate,
1945
+ firewall: this.security.firewall,
1946
+ originRequestFunction: this.docs.originRequestFunction,
1947
+ zone: this.dns.zone,
1948
+ cliSetupUrl: this.cli.cliSetupUrl,
1949
+ askAiUrl: this.ai.askAiUrl,
1950
+ summarizeAiUrl: this.ai.summarizeAiUrl,
1951
+ lb: this.api?.lb
1952
+ });
1953
+ this.deployment = new DeploymentStack(this, {
1954
+ ...props,
1955
+ publicBucket: this.storage.publicBucket,
1956
+ privateBucket: this.storage.privateBucket,
1957
+ cdn: this.cdn.distribution
1876
1958
  });
1877
1959
  }
1878
- const ai2 = new AiStack(this, props);
1879
- const cli2 = new CliStack(this, props);
1880
- const cdn2 = new CdnStack(this, {
1881
- ...props,
1882
- publicBucket: storage5.publicBucket,
1883
- logBucket: storage5.logBucket,
1884
- certificate: security2.certificate,
1885
- firewall: security2.firewall,
1886
- originRequestFunction: docs2.originRequestFunction,
1887
- zone: dns2.zone,
1888
- cliSetupUrl: cli2.cliSetupUrl,
1889
- askAiUrl: ai2.askAiUrl,
1890
- summarizeAiUrl: ai2.summarizeAiUrl,
1891
- lb: api?.lb
1892
- });
1893
- new DeploymentStack(this, {
1894
- ...props,
1895
- publicBucket: storage5.publicBucket,
1896
- privateBucket: storage5.privateBucket,
1897
- cdn: cdn2.distribution
1898
- });
1899
1960
  }
1900
1961
  }
1901
1962
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cloud",
3
3
  "type": "module",
4
- "version": "0.58.55",
4
+ "version": "0.58.57",
5
5
  "description": "The Stacks cloud/serverless integration & implementation.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-sdk-layer",
3
- "version": "0.58.55",
3
+ "version": "0.58.57",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",