stacks 0.58.58 → 0.58.59

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 (175) 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/dev/index.js +18 -26
  5. package/core/actions/dist/src/generate/index.js +18 -26
  6. package/core/actions/dist/src/helpers/index.js +18 -26
  7. package/core/actions/dist/src/helpers/utils.js +18 -26
  8. package/core/actions/dist/src/index.js +26 -34
  9. package/core/actions/dist/src/lint/fix.js +3 -2
  10. package/core/actions/dist/src/release.js +30 -35
  11. package/core/actions/dist/src/upgrade/index.js +18 -26
  12. package/core/actions/dist/src/upgrade.js +1 -1
  13. package/core/actions/package.json +1 -1
  14. package/core/actions/src/bump.ts +13 -6
  15. package/core/actions/src/changelog.ts +14 -4
  16. package/core/actions/src/helpers/utils.ts +24 -36
  17. package/core/actions/src/lint/fix.ts +3 -2
  18. package/core/actions/src/release.ts +4 -1
  19. package/core/ai/dist/index.js +31 -29
  20. package/core/ai/package.json +3 -3
  21. package/core/alias/package.json +1 -1
  22. package/core/analytics/package.json +1 -1
  23. package/core/api/dist/index.js +6 -3
  24. package/core/api/package.json +1 -1
  25. package/core/arrays/package.json +1 -1
  26. package/core/auth/package.json +1 -1
  27. package/core/buddy/dist/chunk-59a9de11428ba763.js +993 -0
  28. package/core/buddy/dist/{chunk-e9c0ec1a3b7be088.js → chunk-7b24d1e3e585766e.js} +594 -563
  29. package/core/buddy/dist/cli.js +3916 -19
  30. package/core/buddy/dist/index.js +2 -5
  31. package/core/buddy/package.json +1 -1
  32. package/core/buddy/src/cli.ts +91 -17
  33. package/core/buddy/src/commands/add.ts +3 -0
  34. package/core/buddy/src/commands/build.ts +42 -27
  35. package/core/buddy/src/commands/changelog.ts +13 -6
  36. package/core/buddy/src/commands/clean.ts +3 -1
  37. package/core/buddy/src/commands/cloud.ts +14 -2
  38. package/core/buddy/src/commands/commit.ts +2 -0
  39. package/core/buddy/src/commands/configure.ts +6 -3
  40. package/core/buddy/src/commands/create.ts +3 -1
  41. package/core/buddy/src/commands/deploy.ts +3 -1
  42. package/core/buddy/src/commands/dev.ts +50 -36
  43. package/core/buddy/src/commands/dns.ts +7 -1
  44. package/core/buddy/src/commands/domains.ts +7 -1
  45. package/core/buddy/src/commands/fresh.ts +4 -2
  46. package/core/buddy/src/commands/generate.ts +36 -26
  47. package/core/buddy/src/commands/http.ts +6 -4
  48. package/core/buddy/src/commands/index.ts +0 -2
  49. package/core/buddy/src/commands/install.ts +3 -1
  50. package/core/buddy/src/commands/key.ts +2 -0
  51. package/core/buddy/src/commands/lint.ts +4 -0
  52. package/core/buddy/src/commands/list.ts +6 -2
  53. package/core/buddy/src/commands/make.ts +52 -30
  54. package/core/buddy/src/commands/migrate.ts +6 -2
  55. package/core/buddy/src/commands/prepublish.ts +3 -0
  56. package/core/buddy/src/commands/release.ts +12 -2
  57. package/core/buddy/src/commands/seed.ts +3 -1
  58. package/core/buddy/src/commands/setup.ts +16 -8
  59. package/core/buddy/src/commands/tinker.ts +3 -1
  60. package/core/buddy/src/commands/types.ts +4 -2
  61. package/core/buddy/src/commands/upgrade.ts +37 -25
  62. package/core/buddy/src/commands/version.ts +7 -0
  63. package/core/build/package.json +1 -1
  64. package/core/bun-create/bud/package.json +1 -1
  65. package/core/bun-create/buddy/package.json +1 -1
  66. package/core/bun-create/stack/package.json +1 -1
  67. package/core/bun-create/stacks/package.json +1 -1
  68. package/core/bun-create/stx/package.json +1 -1
  69. package/core/bun-plugin-yaml/package.json +1 -1
  70. package/core/cache/package.json +2 -2
  71. package/core/chat/package.json +1 -1
  72. package/core/cli/dist/index.js +462 -87
  73. package/core/cli/package.json +1 -1
  74. package/core/cli/src/cli.ts +9 -31
  75. package/core/cli/src/console.ts +1 -1
  76. package/core/cli/src/exec.ts +28 -14
  77. package/core/cli/src/helpers.ts +3 -3
  78. package/core/cli/src/index.ts +1 -1
  79. package/core/cli/src/parse.ts +95 -17
  80. package/core/cli/src/run.ts +7 -7
  81. package/core/cli/src/utils.ts +62 -0
  82. package/core/cloud/dist/index.js +28 -29
  83. package/core/cloud/package.json +32 -32
  84. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
  85. package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
  86. package/core/cloud/src/cloud/queue.ts +35 -34
  87. package/core/cloud/src/cloud/router-layer/nodejs/package.json +2 -2
  88. package/core/collections/package.json +1 -1
  89. package/core/config/dist/index.js +49 -27
  90. package/core/config/package.json +1 -1
  91. package/core/config/src/config.ts +1 -1
  92. package/core/config/src/defaults.ts +28 -14
  93. package/core/config/src/overrides.ts +2 -0
  94. package/core/database/package.json +1 -1
  95. package/core/datetime/package.json +1 -1
  96. package/core/desktop/package.json +3 -3
  97. package/core/development/package.json +1 -1
  98. package/core/dns/package.json +7 -7
  99. package/core/docs/package.json +1 -1
  100. package/core/email/package.json +3 -3
  101. package/core/enums/dist/index.js +2 -2
  102. package/core/enums/package.json +1 -1
  103. package/core/enums/src/index.ts +2 -2
  104. package/core/env/package.json +3 -2
  105. package/core/env/src/utils.ts +1 -0
  106. package/core/error-handling/package.json +1 -1
  107. package/core/eslint-config/package.json +10 -10
  108. package/core/events/package.json +1 -1
  109. package/core/faker/package.json +2 -2
  110. package/core/git/package.json +1 -1
  111. package/core/health/package.json +1 -1
  112. package/core/http/package.json +1 -1
  113. package/core/lint/package.json +1 -1
  114. package/core/logging/build.ts +1 -1
  115. package/core/logging/dist/index.js +10932 -1773
  116. package/core/logging/package.json +1 -1
  117. package/core/logging/src/index.ts +79 -13
  118. package/core/notifications/package.json +2 -2
  119. package/core/objects/package.json +1 -1
  120. package/core/orm/package.json +1 -1
  121. package/core/path/dist/index.js +10 -0
  122. package/core/path/package.json +1 -1
  123. package/core/path/src/index.ts +10 -0
  124. package/core/payments/dist/index.js +34 -10
  125. package/core/payments/package.json +2 -2
  126. package/core/push/package.json +1 -1
  127. package/core/query-builder/package.json +1 -1
  128. package/core/queue/package.json +1 -1
  129. package/core/raycast/package.json +1 -1
  130. package/core/realtime/package.json +1 -1
  131. package/core/repl/package.json +1 -1
  132. package/core/router/dist/index.js +517 -14
  133. package/core/router/package.json +1 -1
  134. package/core/router/src/router.ts +10 -3
  135. package/core/scheduler/package.json +1 -1
  136. package/core/search-engine/package.json +1 -1
  137. package/core/security/package.json +1 -1
  138. package/core/server/package.json +2 -2
  139. package/core/signals/package.json +1 -1
  140. package/core/slug/package.json +1 -1
  141. package/core/sms/package.json +1 -1
  142. package/core/storage/package.json +1 -1
  143. package/core/strings/package.json +1 -1
  144. package/core/tables/package.json +2 -2
  145. package/core/testing/package.json +1 -1
  146. package/core/tinker/package.json +1 -1
  147. package/core/tunnel/package.json +1 -1
  148. package/core/types/dist/index.js +1787 -6
  149. package/core/types/package.json +6 -6
  150. package/core/types/src/ai.ts +1 -0
  151. package/core/types/src/binary.ts +1 -0
  152. package/core/types/src/cli.ts +13 -3
  153. package/core/types/src/docs.ts +5 -1
  154. package/core/types/src/index.ts +1 -0
  155. package/core/types/src/logger.ts +54 -0
  156. package/core/types/src/router.ts +2 -1
  157. package/core/types/src/stacks.ts +10 -0
  158. package/core/types/src/team.ts +1 -1
  159. package/core/ui/package.json +3 -3
  160. package/core/utils/dist/index.js +8 -2
  161. package/core/utils/package.json +2 -2
  162. package/core/utils/src/hash.ts +10 -1
  163. package/core/validation/package.json +1 -1
  164. package/core/vite/dist/index.js +1 -1
  165. package/core/vite/package.json +4 -4
  166. package/core/whois/package.json +1 -1
  167. package/core/x-ray/package.json +1 -1
  168. package/core/zsh-buddy/buddy.plugin.zsh +4 -0
  169. package/core/zsh-buddy/package.json +1 -1
  170. package/ide/dictionary.txt +1 -0
  171. package/ide/vscode/package.json +1 -1
  172. package/package.json +1 -1
  173. package/core/buddy/src/commands/example.ts +0 -66
  174. package/core/buddy/src/commands/inspire.ts +0 -24
  175. package/core/cli/src/utilities.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cli",
3
3
  "type": "module",
4
- "version": "0.58.58",
4
+ "version": "0.58.59",
5
5
  "description": "TypeScript framework for CLI artisans. Build beautiful console apps with ease.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,8 +1,7 @@
1
1
  // import type { CliOptions } from '@stacksjs/types'
2
- import cac from 'cac'
3
- import { version } from '../package.json'
2
+ import { CAC } from 'cac'
4
3
 
5
- interface ParsedArgv {
4
+ export interface ParsedArgv {
6
5
  args: ReadonlyArray<string>
7
6
  options: {
8
7
  [k: string]: any
@@ -11,8 +10,8 @@ interface ParsedArgv {
11
10
 
12
11
  interface CliOptions {
13
12
  name?: string
14
- version: string
15
- description: string
13
+ // version: string
14
+ // description: string
16
15
  }
17
16
 
18
17
  export function cli(name?: string | CliOptions, options?: CliOptions) {
@@ -21,32 +20,11 @@ export function cli(name?: string | CliOptions, options?: CliOptions) {
21
20
  name = options.name
22
21
  }
23
22
 
24
- const cli = cac(name || 'buddy') // default to extending buddy
25
-
26
- cli.help()
27
- cli.version(options?.version || version)
28
-
29
- return cli
23
+ return new CAC(name || 'buddy')
30
24
  }
31
25
 
32
- export function command(name: string, description: string, options?: CliOptions) {
33
- return cli(options).command(name, description)
34
- }
35
-
36
- export function parseArgs() {
37
- return cli().parse().args
38
- }
26
+ export { CAC }
39
27
 
40
- export function parseOptions(): ParsedArgv['options'] {
41
- const options = cli().parse().options
42
-
43
- // Iterate over the options and convert "true" and "false" strings to boolean
44
- for (const key in options) {
45
- if (options[key] === 'true')
46
- options[key] = true
47
- else if (options[key] === 'false')
48
- options[key] = false
49
- }
50
-
51
- return options
52
- }
28
+ // export function command(name: string, description: string, options?: CliOptions) {
29
+ // return cli(options).command(name, description)
30
+ // }
@@ -76,4 +76,4 @@ export class Prompt {
76
76
 
77
77
  export { prompts, log }
78
78
 
79
- export const prompt = new Prompt()
79
+ export const prompt = () => new Prompt()
@@ -2,6 +2,7 @@ import process from 'node:process'
2
2
  import { type Result, err, handleError, ok } from '@stacksjs/error-handling'
3
3
  import type { CliOptions, StacksError, Subprocess } from '@stacksjs/types'
4
4
  import { ExitCode } from '@stacksjs/types'
5
+ import { log } from './'
5
6
 
6
7
  /**
7
8
  * Execute a command.
@@ -24,19 +25,21 @@ import { ExitCode } from '@stacksjs/types'
24
25
  * ```
25
26
  */
26
27
  export async function exec(command: string | string[], options?: CliOptions): Promise<Result<Subprocess, StacksError>> {
27
- const cmd = Array.isArray(command) ? command : command.match(/(?:[^\s"]+|"[^"]*")+/g)
28
+ const cmd = Array.isArray(command)
29
+ ? command
30
+ : command.match(/(?:[^\s"]+|"[^"]*")+/g)
28
31
 
29
32
  if (!cmd)
30
33
  return err(handleError(`Failed to parse command: ${cmd}`, options))
31
34
 
32
- if (options?.verbose)
33
- // eslint-disable-next-line no-console
34
- console.log('exec', { command, cmd, options })
35
+ log.debug('exec:', Array.isArray(command) ? command.join(' ') : command)
36
+ log.debug('cmd:', cmd)
37
+ log.debug('exec options:', options)
35
38
 
36
39
  const proc = Bun.spawn(cmd, {
37
40
  ...options,
38
- stdout: options?.silent ? 'ignore' : (options?.stdin ? options.stdin : (options?.stdout || 'inherit')),
39
- stderr: options?.silent ? 'ignore' : (options?.stderr || 'inherit'),
41
+ stdout: (options?.silent || options?.quiet) ? 'ignore' : (options?.stdin ? options.stdin : (options?.stdout || 'inherit')),
42
+ stderr: (options?.silent || options?.quiet) ? 'ignore' : (options?.stderr || 'inherit'),
40
43
  detached: options?.background || false,
41
44
  cwd: options?.cwd || import.meta.dir,
42
45
  // env: { ...e, ...options?.env },
@@ -47,12 +50,12 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
47
50
  })
48
51
 
49
52
  // 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
- }
53
+ // if (options?.stdin === 'pipe' && options.input) {
54
+ // if (proc.stdin) {
55
+ // proc.stdin.write(options.input)
56
+ // proc.stdin.end()
57
+ // }
58
+ // }
56
59
 
57
60
  const exited = await proc.exited
58
61
  if (exited === ExitCode.Success)
@@ -78,10 +81,21 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
78
81
  * ```
79
82
  */
80
83
  export async function execSync(command: string | string[], options?: CliOptions): Promise<string> {
81
- const cmd = Array.isArray(command) ? command : command.split(' ')
84
+ log.debug('Running execSync:', command)
85
+ log.debug('execSync Options:', options)
86
+
87
+ const cmd = Array.isArray(command)
88
+ ? command
89
+ : command.match(/(?:[^\s"]+|"[^"]*")+/g)
90
+
91
+ if (!cmd) {
92
+ log.error(`Failed to parse command: ${cmd}`, options)
93
+ process.exit(ExitCode.FatalError)
94
+ }
95
+
82
96
  const proc = Bun.spawnSync(cmd, {
83
97
  ...options,
84
- // stdin: 'inherit',
98
+ stdin: options?.stdin ?? 'inherit',
85
99
  stdout: options?.stdout ?? 'pipe',
86
100
  stderr: options?.stderr ?? 'inherit',
87
101
  cwd: options?.cwd ?? import.meta.dir,
@@ -61,14 +61,14 @@ export function outro(text: string, options?: OutroOptions, error?: Error | stri
61
61
  if (error)
62
62
  log.error(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}] Failed`)
63
63
  else if (opts.type === 'info')
64
- console.log(`${dim(gray(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`))} ${opts.message ?? 'Complete'}`)
64
+ log.info(`${dim(gray(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`))} ${opts.message ?? 'Complete'}`)
65
65
  else
66
- console.log(`${dim(gray(bold(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`)))} ${bold(green(opts.message ?? 'Complete'))}`)
66
+ log.success(`${dim(gray(bold(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`)))} ${bold(green(opts.message ?? 'Complete'))}`)
67
67
  }
68
68
 
69
69
  else {
70
70
  if (opts?.type === 'info')
71
- console.log(text)
71
+ log.info(text)
72
72
 
73
73
  // the following condition triggers in the case of "Cleaned up" messages
74
74
  else if (opts?.type === 'success' && opts?.quiet !== true)
@@ -7,4 +7,4 @@ export * from './parse'
7
7
  export * from './exec'
8
8
  export * from './run'
9
9
  export * from './spinner'
10
- export * from './utilities'
10
+ export * from './utils'
@@ -7,7 +7,10 @@ interface ParsedArgv {
7
7
  }
8
8
  }
9
9
 
10
- function isLongOption(arg: string): boolean {
10
+ function isLongOption(arg?: string): boolean {
11
+ if (!arg)
12
+ return false
13
+
11
14
  return arg.startsWith('--')
12
15
  }
13
16
 
@@ -32,14 +35,14 @@ function parseValue(value: string): string | boolean | number {
32
35
  function parseLongOption(arg: string, argv: string[], index: number, options: { [k: string]: string | boolean | number }): number {
33
36
  const [key, value] = arg.slice(2).split('=')
34
37
  if (value !== undefined) {
35
- options[key] = parseValue(value)
38
+ options[key as string] = parseValue(value)
36
39
  }
37
- else if (index + 1 < argv.length && !argv[index + 1].startsWith('-')) {
38
- options[key] = argv[index + 1]
40
+ else if (index + 1 < argv.length && !argv[index + 1]!.startsWith('-')) {
41
+ options[key as string] = argv[index + 1] as string
39
42
  index++
40
43
  }
41
44
  else {
42
- options[key] = true
45
+ options[key as string] = true
43
46
  }
44
47
  return index
45
48
  }
@@ -47,18 +50,22 @@ function parseLongOption(arg: string, argv: string[], index: number, options: {
47
50
  function parseShortOption(arg: string, argv: string[], index: number, options: { [k: string]: string | boolean | number }): number {
48
51
  const [key, value] = arg.slice(1).split('=')
49
52
 
50
- if (value !== undefined) {
53
+ // Check if key is undefined and handle it
54
+ if (key === undefined)
55
+ return index
56
+
57
+ if (value !== undefined && key !== undefined) {
51
58
  for (let j = 0; j < key.length; j++)
52
- options[key[j]] = parseValue(value)
59
+ options[key[j] as string] = parseValue(value)
53
60
  }
54
61
  else {
55
62
  for (let j = 0; j < key.length; j++) {
56
- if (index + 1 < argv.length && j === key.length - 1 && !argv[index + 1].startsWith('-')) {
57
- options[key[j]] = parseValue(argv[index + 1])
63
+ if (index + 1 < argv.length && j === key.length - 1 && !argv[index + 1]!.startsWith('-')) {
64
+ options[key[j] as string] = parseValue(argv[index + 1]!)
58
65
  index++
59
66
  }
60
67
  else {
61
- options[key[j]] = true
68
+ options[key[j] as string] = true
62
69
  }
63
70
  }
64
71
  }
@@ -75,6 +82,8 @@ export function parseArgv(argv?: string[]): ParsedArgv {
75
82
 
76
83
  for (let i = 0; i < argv.length; i++) {
77
84
  const arg = argv[i]
85
+ if (!arg)
86
+ continue
78
87
  if (isLongOption(arg))
79
88
  i = parseLongOption(arg, argv, i, options)
80
89
  else if (isShortOption(arg))
@@ -86,16 +95,85 @@ export function parseArgv(argv?: string[]): ParsedArgv {
86
95
  return { args, options }
87
96
  }
88
97
 
89
- // export function parseOptions(argv?: string[]): { [k: string]: string | boolean | number } {
90
- // if (argv === undefined)
91
- // argv = process.argv.slice(2)
92
-
93
- // return parseArgv(argv).options
94
- // }
95
-
96
98
  export function parseArgs(argv?: string[]): string[] {
97
99
  if (argv === undefined)
98
100
  argv = process.argv.slice(2)
99
101
 
100
102
  return parseArgv(argv).args
101
103
  }
104
+
105
+ interface CliOptions {
106
+ dryRun?: boolean
107
+ quiet?: boolean
108
+ verbose?: boolean
109
+ [k: string]: string | boolean | number | undefined
110
+ }
111
+
112
+ export function parseOptions(options?: CliOptions): CliOptions | undefined {
113
+ options = options || {}
114
+ const args = process.argv.slice(2)
115
+
116
+ for (let i = 0; i < args.length; i++) {
117
+ const arg = args[i]
118
+ if (arg?.startsWith('--')) {
119
+ const key = arg.substring(2) // remove the --
120
+ const camelCaseKey = key.replace(
121
+ /-([a-z])/gi,
122
+ g => (g[1] ? g[1].toUpperCase() : ''), // convert kebab-case to camelCase
123
+ )
124
+
125
+ if (i + 1 < args.length) { // if the next arg exists
126
+ if (args[i + 1] === 'true' || args[i + 1] === 'false') { // if the next arg is a boolean
127
+ options[camelCaseKey] = args[i + 1] === 'true' // set the value to the boolean
128
+ i++
129
+ }
130
+ else {
131
+ options[camelCaseKey] = args[i + 1]
132
+ i++
133
+ }
134
+ }
135
+ else {
136
+ options[camelCaseKey] = true
137
+ }
138
+ }
139
+ }
140
+
141
+ // if options has no keys, return undefined, e.g. `buddy release`
142
+ if (Object.keys(options).length === 0)
143
+ return undefined
144
+
145
+ // convert the string 'true' or 'false' to a boolean
146
+ Object.keys(options).forEach((key) => {
147
+ if (!options)
148
+ return
149
+
150
+ const value = options[key]
151
+
152
+ if (value === 'true' || value === 'false')
153
+ options[key] = value === 'true'
154
+ })
155
+
156
+ return options
157
+ }
158
+ // interface BuddyOptions {
159
+ // dryRun?: boolean
160
+ // verbose?: boolean
161
+ // }
162
+ export function buddyOptions(options?: any): string {
163
+ if (!options) {
164
+ options = process.argv.slice(2)
165
+ options = Array.from(new Set(options))
166
+ // delete the 0 element if it does not start with a -
167
+ // e.g. is used when buddy changelog --dry-run is used
168
+ if (options[0] && !options[0].startsWith('-'))
169
+ options.shift()
170
+ }
171
+
172
+ if (options?.verbose) {
173
+ log.debug('process.argv', process.argv)
174
+ log.debug('process.argv.slice(2)', process.argv.slice(2))
175
+ log.debug('options inside buddyOptions', options)
176
+ }
177
+
178
+ return options.join(' ')
179
+ }
@@ -1,7 +1,7 @@
1
1
  import type { CliOptions, CommandError, Subprocess } from '@stacksjs/types'
2
2
  import type { Result } from '@stacksjs/error-handling'
3
3
  import { exec, execSync } from './exec'
4
- import { italic, underline } from './utilities'
4
+ import { italic } from './utils'
5
5
  import { log } from './console'
6
6
 
7
7
  /**
@@ -30,15 +30,15 @@ import { log } from './console'
30
30
  * ```
31
31
  */
32
32
  export async function runCommand(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>> {
33
- if (options?.verbose)
34
- log.debug('Running command:', underline(italic(command)), 'with options:', options)
33
+ log.debug('runCommand:', command)
34
+ log.debug('options:', options)
35
35
 
36
36
  return await exec(command, options)
37
37
  }
38
38
 
39
39
  export async function runProcess(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>> {
40
- if (options?.verbose)
41
- log.debug('Running command:', underline(italic(command)), 'with options:', options)
40
+ log.debug('runProcess:', italic(command))
41
+ log.debug('runProcess Options:', options)
42
42
 
43
43
  return await exec(command, options)
44
44
  }
@@ -69,8 +69,8 @@ export async function runProcess(command: string, options?: CliOptions): Promise
69
69
  * ```
70
70
  */
71
71
  export async function runCommandSync(command: string, options?: CliOptions): Promise<string> {
72
- if (options?.verbose)
73
- log.debug('Running command:', underline(italic(command)), 'with options:', options)
72
+ log.debug('runCommandSync:', italic(command))
73
+ log.debug('runCommandSync Options:', options)
74
74
 
75
75
  const result = await execSync(command, options)
76
76
 
@@ -0,0 +1,62 @@
1
+ export * as kolorist from 'kolorist'
2
+
3
+ export {
4
+ stripAnsi,
5
+ centerAlign,
6
+ rightAlign,
7
+ leftAlign,
8
+ align,
9
+ box,
10
+ colors,
11
+ getColor,
12
+ colorize,
13
+ } from 'consola/utils'
14
+
15
+ export {
16
+ ansi256Bg,
17
+ bgBlack,
18
+ bgBlue,
19
+ bgCyan,
20
+ bgGray,
21
+ bgGreen,
22
+ bgLightBlue,
23
+ bgLightCyan,
24
+ bgLightGray,
25
+ bgLightGreen,
26
+ bgLightMagenta,
27
+ bgLightRed,
28
+ bgLightYellow,
29
+ bgMagenta,
30
+ bgRed,
31
+ bgWhite,
32
+ bgYellow,
33
+ black,
34
+ blue,
35
+ bold,
36
+ cyan,
37
+ dim,
38
+ gray,
39
+ green,
40
+ hidden,
41
+ inverse,
42
+ italic,
43
+ lightBlue,
44
+ lightCyan,
45
+ lightGray,
46
+ lightGreen,
47
+ lightMagenta,
48
+ lightRed,
49
+ lightYellow,
50
+ link,
51
+ magenta,
52
+ red,
53
+ reset,
54
+ strikethrough,
55
+ underline,
56
+ white,
57
+ yellow,
58
+ ansi256,
59
+ trueColor,
60
+ trueColorBg,
61
+ stripColors,
62
+ } from 'kolorist'
@@ -1810,26 +1810,25 @@ class QueueStack {
1810
1810
  }
1811
1811
  async init() {
1812
1812
  const jobsDir = path6.jobsPath();
1813
- try {
1814
- const jobFiles = await fs.readdir(jobsDir);
1815
- const actionFiles = await fs.readdir(actionsDir);
1816
- const jobs = [];
1817
- for (const file2 of jobFiles) {
1818
- if (!file2.endsWith(".ts"))
1819
- continue;
1820
- const filePath = path6.jobsPath(file2);
1821
- jobs.push(await this.loadModule(filePath));
1822
- }
1823
- for (const file2 of actionFiles) {
1824
- if (!file2.endsWith(".ts"))
1825
- continue;
1826
- const filePath = path6.actionsPath(file2);
1827
- jobs.push(await this.loadModule(filePath));
1828
- }
1829
- for (const job of jobs)
1830
- await this.createQueueRule(job);
1831
- } catch (err2) {
1832
- console.error("Error reading the jobs directory:", err2);
1813
+ const actionsDir = path6.appPath("Actions");
1814
+ const jobFiles = await fs.readdir(jobsDir);
1815
+ const actionFiles = await fs.readdir(actionsDir);
1816
+ const jobs = [];
1817
+ for (const file of jobFiles) {
1818
+ if (!file.endsWith(".ts"))
1819
+ continue;
1820
+ const jobPath = path6.jobsPath(file);
1821
+ const job = await this.loadModule(jobPath);
1822
+ this.createQueueRule(job, file);
1823
+ jobs.push(job);
1824
+ }
1825
+ for (const file of actionFiles) {
1826
+ if (!file.endsWith(".ts"))
1827
+ continue;
1828
+ const actionPath = path6.appPath(`Actions/${file}`);
1829
+ const action = await this.loadModule(actionPath);
1830
+ this.createQueueRule(action, file);
1831
+ jobs.push(action);
1833
1832
  }
1834
1833
  }
1835
1834
  cronScheduleFromRate(rate) {
@@ -1843,12 +1842,12 @@ class QueueStack {
1843
1842
  };
1844
1843
  }
1845
1844
  async loadModule(filePath) {
1846
- const jobModule2 = await import(filePath);
1847
- return jobModule2;
1845
+ const jobModule = await import(filePath);
1846
+ return jobModule;
1848
1847
  }
1849
- createQueueRule(job) {
1850
- const rate = job.default?.rate;
1851
- if (!rate || job.default?.enabled === false)
1848
+ createQueueRule(module, file) {
1849
+ const rate = module.default?.rate;
1850
+ if (!rate || module.default?.enabled === false)
1852
1851
  return;
1853
1852
  const schedule = Schedule.cron(this.cronScheduleFromRate(rate));
1854
1853
  const id = `QueueRule${pascalCase(file.replace(".ts", ""))}`;
@@ -1873,19 +1872,19 @@ class QueueStack {
1873
1872
  },
1874
1873
  {
1875
1874
  name: "JOB_BACKOFF_FACTOR",
1876
- value: jobModule.default?.backoffFactor
1875
+ value: module.default?.backoffFactor
1877
1876
  },
1878
1877
  {
1879
1878
  name: "JOB_RETRIES",
1880
- value: jobModule.default?.tries
1879
+ value: module.default?.tries
1881
1880
  },
1882
1881
  {
1883
1882
  name: "JOB_INITIAL_DELAY",
1884
- value: jobModule.default?.initialDelay
1883
+ value: module.default?.initialDelay
1885
1884
  },
1886
1885
  {
1887
1886
  name: "JOB_JITTER",
1888
- value: jobModule.default?.jitter
1887
+ value: module.default?.jitter
1889
1888
  }
1890
1889
  ]
1891
1890
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/cloud",
3
3
  "type": "module",
4
- "version": "0.58.58",
4
+ "version": "0.58.59",
5
5
  "description": "The Stacks cloud/serverless integration & implementation.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -55,19 +55,19 @@
55
55
  "prepublishOnly": "bun run build"
56
56
  },
57
57
  "peerDependencies": {
58
- "@aws-sdk/client-bedrock": "^3.509.0",
59
- "@aws-sdk/client-cloudformation": "^3.509.0",
60
- "@aws-sdk/client-cloudfront": "^3.509.0",
61
- "@aws-sdk/client-cloudwatch-logs": "^3.509.0",
62
- "@aws-sdk/client-ec2": "^3.509.0",
63
- "@aws-sdk/client-efs": "^3.509.0",
64
- "@aws-sdk/client-iam": "^3.509.0",
65
- "@aws-sdk/client-lambda": "^3.509.0",
66
- "@aws-sdk/client-route-53-domains": "^3.509.0",
67
- "@aws-sdk/client-s3": "^3.509.0",
68
- "@aws-sdk/client-ses": "^3.509.0",
69
- "@aws-sdk/client-sesv2": "^3.509.0",
70
- "@aws-sdk/client-ssm": "^3.509.0",
58
+ "@aws-sdk/client-bedrock": "^3.511.0",
59
+ "@aws-sdk/client-cloudformation": "^3.511.0",
60
+ "@aws-sdk/client-cloudfront": "^3.511.0",
61
+ "@aws-sdk/client-cloudwatch-logs": "^3.511.0",
62
+ "@aws-sdk/client-ec2": "^3.511.0",
63
+ "@aws-sdk/client-efs": "^3.511.0",
64
+ "@aws-sdk/client-iam": "^3.511.0",
65
+ "@aws-sdk/client-lambda": "^3.511.0",
66
+ "@aws-sdk/client-route-53-domains": "^3.511.0",
67
+ "@aws-sdk/client-s3": "^3.511.0",
68
+ "@aws-sdk/client-ses": "^3.511.0",
69
+ "@aws-sdk/client-sesv2": "^3.511.0",
70
+ "@aws-sdk/client-ssm": "^3.511.0",
71
71
  "@stacksjs/config": "workspace:*",
72
72
  "@stacksjs/env": "workspace:*",
73
73
  "@stacksjs/logging": "workspace:*",
@@ -79,20 +79,20 @@
79
79
  "@stacksjs/validation": "workspace:*"
80
80
  },
81
81
  "dependencies": {
82
- "@aws-sdk/client-bedrock": "^3.509.0",
83
- "@aws-sdk/client-cloudformation": "^3.509.0",
84
- "@aws-sdk/client-cloudfront": "^3.509.0",
85
- "@aws-sdk/client-cloudwatch-logs": "^3.509.0",
86
- "@aws-sdk/client-dynamodb": "3.509.0",
87
- "@aws-sdk/client-ec2": "^3.509.0",
88
- "@aws-sdk/client-efs": "^3.509.0",
89
- "@aws-sdk/client-iam": "^3.509.0",
90
- "@aws-sdk/client-lambda": "^3.509.0",
91
- "@aws-sdk/client-route-53-domains": "^3.509.0",
92
- "@aws-sdk/client-s3": "^3.509.0",
93
- "@aws-sdk/client-ses": "^3.509.0",
94
- "@aws-sdk/client-sesv2": "^3.509.0",
95
- "@aws-sdk/client-ssm": "^3.509.0",
82
+ "@aws-sdk/client-bedrock": "^3.511.0",
83
+ "@aws-sdk/client-cloudformation": "^3.511.0",
84
+ "@aws-sdk/client-cloudfront": "^3.511.0",
85
+ "@aws-sdk/client-cloudwatch-logs": "^3.511.0",
86
+ "@aws-sdk/client-dynamodb": "3.511.0",
87
+ "@aws-sdk/client-ec2": "^3.511.0",
88
+ "@aws-sdk/client-efs": "^3.511.0",
89
+ "@aws-sdk/client-iam": "^3.511.0",
90
+ "@aws-sdk/client-lambda": "^3.511.0",
91
+ "@aws-sdk/client-route-53-domains": "^3.511.0",
92
+ "@aws-sdk/client-s3": "^3.511.0",
93
+ "@aws-sdk/client-ses": "^3.511.0",
94
+ "@aws-sdk/client-sesv2": "^3.511.0",
95
+ "@aws-sdk/client-ssm": "^3.511.0",
96
96
  "@stacksjs/config": "workspace:*",
97
97
  "@stacksjs/dns": "workspace:*",
98
98
  "@stacksjs/env": "workspace:*",
@@ -102,18 +102,18 @@
102
102
  "@stacksjs/storage": "workspace:*",
103
103
  "@stacksjs/utils": "workspace:*",
104
104
  "@stacksjs/validation": "workspace:*",
105
- "aws-cdk": "^2.126.0",
106
- "aws-cdk-lib": "^2.126.0",
105
+ "aws-cdk": "^2.127.0",
106
+ "aws-cdk-lib": "^2.127.0",
107
107
  "aws4fetch": "^1.0.17",
108
108
  "constructs": "^10.3.0"
109
109
  },
110
110
  "devDependencies": {
111
- "@oclif/plugin-plugins": "^4.2.1",
111
+ "@oclif/plugin-plugins": "^4.2.2",
112
112
  "@stacksjs/cli": "workspace:*",
113
113
  "@stacksjs/development": "workspace:*",
114
114
  "@stacksjs/env": "workspace:*",
115
115
  "jszip": "^3.10.1",
116
- "oclif": "^4.4.7",
116
+ "oclif": "^4.4.10",
117
117
  "source-map-support": "^0.5.21"
118
118
  }
119
119
  }
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "aws-sdk-layer",
3
- "version": "0.58.57",
3
+ "version": "0.58.58",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aws-sdk-layer",
9
- "version": "0.58.57",
9
+ "version": "0.58.58",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "aws-sdk": "^2.1553.0"
12
+ "aws-sdk": "^2.1555.0"
13
13
  }
14
14
  },
15
15
  "node_modules/available-typed-arrays": {
@@ -24,9 +24,9 @@
24
24
  }
25
25
  },
26
26
  "node_modules/aws-sdk": {
27
- "version": "2.1553.0",
28
- "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1553.0.tgz",
29
- "integrity": "sha512-CfZaw8dR9e642aBOeFhkFL7KoQApeLR15uH2IQqfL/12snWYayAAesYh0tEaU+XbhrH0CUsf2Zro5IraEXEZMg==",
27
+ "version": "2.1555.0",
28
+ "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1555.0.tgz",
29
+ "integrity": "sha512-hjYs1MQkJxdHnoZm8hypqGy4PQKWVUs19McdXRXWNXr97V0il4xcUpIfvjHQ9x9EjP0p/jyIx9/BtyrR68jnUQ==",
30
30
  "dependencies": {
31
31
  "buffer": "4.9.2",
32
32
  "events": "1.1.1",