stacks 0.52.0 → 0.52.2

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 (181) hide show
  1. package/auto-imports.d.ts +1595 -651
  2. package/components.d.ts +4 -2
  3. package/core/actions/build.config.ts +2 -0
  4. package/core/actions/package.json +14 -2
  5. package/core/actions/src/clean.ts +9 -12
  6. package/core/actions/src/deploy/domains.ts +1 -1
  7. package/core/actions/src/helpers/package-json.ts +1 -2
  8. package/core/actions/src/helpers/utils.ts +1 -2
  9. package/core/actions/src/release.ts +1 -1
  10. package/core/actions/src/tinker.ts +1 -0
  11. package/core/ai/build.config.ts +2 -0
  12. package/core/ai/package.json +1 -1
  13. package/core/alias/build.config.ts +2 -0
  14. package/core/alias/package.json +1 -2
  15. package/core/analytics/build.config.ts +2 -0
  16. package/core/analytics/package.json +1 -1
  17. package/core/arrays/build.config.ts +2 -0
  18. package/core/arrays/package.json +1 -1
  19. package/core/auth/build.config.ts +2 -0
  20. package/core/auth/package.json +1 -1
  21. package/core/auth/src/index.ts +1 -3
  22. package/core/buddy/README.md +1 -1
  23. package/core/buddy/package.json +1 -1
  24. package/core/buddy/src/commands/build.ts +8 -11
  25. package/core/buddy/src/commands/changelog.ts +4 -5
  26. package/core/buddy/src/commands/clean.ts +2 -3
  27. package/core/buddy/src/commands/deploy.ts +4 -5
  28. package/core/buddy/src/commands/dev.ts +2 -1
  29. package/core/buddy/src/commands/fresh.ts +2 -2
  30. package/core/buddy/src/commands/inspire.ts +4 -5
  31. package/core/buddy/src/commands/key.ts +4 -5
  32. package/core/buddy/src/commands/lint.ts +8 -10
  33. package/core/buddy/src/commands/make.ts +4 -5
  34. package/core/buddy/src/commands/migrate.ts +4 -5
  35. package/core/buddy/src/commands/onboarding.ts +4 -5
  36. package/core/buddy/src/commands/release.ts +4 -12
  37. package/core/buddy/src/commands/seed.ts +14 -14
  38. package/core/buddy/src/commands/setting.ts +4 -5
  39. package/core/buddy/src/commands/test.ts +29 -34
  40. package/core/buddy/src/commands/upgrade.ts +13 -16
  41. package/core/buddy/src/commands/version.ts +25 -16
  42. package/core/build/build.config.ts +2 -0
  43. package/core/build/node_modules/.bin/vite +4 -4
  44. package/core/build/node_modules/.bin/vite-ssg +4 -4
  45. package/core/build/node_modules/.bin/vue-docgen-web-types +4 -4
  46. package/core/build/package.json +5 -5
  47. package/core/build/src/stacks.ts +8 -14
  48. package/core/build/src/vue-components.ts +6 -4
  49. package/core/cache/build.config.ts +2 -0
  50. package/core/cache/package.json +2 -2
  51. package/core/chat/build.config.ts +2 -0
  52. package/core/chat/package.json +6 -6
  53. package/core/cli/package.json +1 -1
  54. package/core/cli/src/actions/install.ts +20 -2
  55. package/core/cli/src/helpers.ts +6 -1
  56. package/core/cli/src/run.ts +5 -8
  57. package/core/cloud/build.config.ts +2 -0
  58. package/core/cloud/package.json +1 -1
  59. package/core/collections/build.config.ts +2 -0
  60. package/core/collections/package.json +1 -1
  61. package/core/config/package.json +1 -1
  62. package/core/config/src/defaults.ts +0 -2
  63. package/core/config/src/stacks.ts +9 -2
  64. package/core/database/package.json +1 -1
  65. package/core/database/src/migrations/index.ts +2 -1
  66. package/core/datetime/package.json +1 -1
  67. package/core/desktop/build.config.ts +2 -0
  68. package/core/desktop/package.json +2 -2
  69. package/core/development/build.config.ts +2 -0
  70. package/core/development/package.json +6 -6
  71. package/core/docs/build.config.ts +1 -0
  72. package/core/docs/node_modules/.bin/vitepress +4 -4
  73. package/core/docs/package.json +2 -2
  74. package/core/domains/build.config.ts +2 -0
  75. package/core/domains/package.json +1 -1
  76. package/core/email/package.json +12 -12
  77. package/core/email/src/drivers/mailjet.ts +1 -0
  78. package/core/email/src/tailwind.config.ts +1 -1
  79. package/core/error-handling/package.json +2 -2
  80. package/core/events/package.json +1 -1
  81. package/core/faker/build.config.ts +2 -0
  82. package/core/faker/package.json +1 -1
  83. package/core/git/build.config.ts +2 -0
  84. package/core/git/package.json +1 -1
  85. package/core/health/build.config.ts +2 -0
  86. package/core/health/package.json +1 -1
  87. package/core/lint/build.config.ts +2 -0
  88. package/core/lint/node_modules/.bin/eslint +4 -4
  89. package/core/lint/package.json +3 -3
  90. package/core/lint/src/index.ts +1 -1
  91. package/core/logging/package.json +5 -5
  92. package/core/modules/build.config.ts +2 -0
  93. package/core/modules/package.json +1 -1
  94. package/core/notifications/package.json +22 -22
  95. package/core/notifications/src/index.ts +5 -8
  96. package/core/objects/build.config.ts +2 -0
  97. package/core/objects/package.json +1 -1
  98. package/core/orm/package.json +1 -1
  99. package/core/pages/build.config.ts +2 -0
  100. package/core/pages/package.json +1 -1
  101. package/core/path/build.config.ts +1 -0
  102. package/core/path/package.json +1 -1
  103. package/core/payments/build.config.ts +2 -0
  104. package/core/payments/package.json +2 -2
  105. package/core/push/build.config.ts +2 -0
  106. package/core/push/package.json +3 -3
  107. package/core/query-builder/build.config.ts +2 -0
  108. package/core/query-builder/package.json +1 -1
  109. package/core/queue/build.config.ts +2 -0
  110. package/core/queue/package.json +1 -1
  111. package/core/realtime/build.config.ts +2 -0
  112. package/core/realtime/package.json +1 -1
  113. package/core/router/build.config.ts +2 -0
  114. package/core/router/package.json +2 -2
  115. package/core/router/src/index.ts +114 -11
  116. package/core/scheduler/build.config.ts +2 -0
  117. package/core/scheduler/package.json +1 -1
  118. package/core/search-engine/build.config.ts +1 -0
  119. package/core/search-engine/package.json +1 -1
  120. package/core/search-engine/src/index.ts +1 -22
  121. package/core/security/build.config.ts +2 -0
  122. package/core/security/package.json +1 -1
  123. package/core/server/build.config.ts +2 -0
  124. package/core/server/node_modules/.bin/nitro +4 -4
  125. package/core/server/node_modules/.bin/nitropack +4 -4
  126. package/core/server/node_modules/.bin/vite +4 -4
  127. package/core/server/package.json +3 -3
  128. package/core/signals/build.config.ts +2 -0
  129. package/core/signals/package.json +1 -1
  130. package/core/slug/build.config.ts +2 -0
  131. package/core/slug/package.json +1 -1
  132. package/core/sms/build.config.ts +2 -0
  133. package/core/sms/package.json +11 -11
  134. package/core/storage/build.config.ts +2 -0
  135. package/core/storage/package.json +1 -1
  136. package/core/storage/src/index.ts +11 -1
  137. package/core/strings/package.json +1 -1
  138. package/core/strings/src/index.ts +0 -1
  139. package/core/testing/build.config.ts +2 -0
  140. package/core/testing/node_modules/.bin/vitest +4 -4
  141. package/core/testing/package.json +4 -4
  142. package/core/testing/src/index.ts +1 -0
  143. package/core/tinker/package.json +1 -1
  144. package/core/types/build.config.ts +2 -0
  145. package/core/types/node_modules/.bin/vite +4 -4
  146. package/core/types/node_modules/.bin/vite-ssg +4 -4
  147. package/core/types/node_modules/.bin/vitepress +4 -4
  148. package/core/types/package.json +7 -7
  149. package/core/types/src/cli.ts +10 -9
  150. package/core/types/src/fs.ts +8 -0
  151. package/core/types/src/router.ts +22 -0
  152. package/core/types/src/stacks.ts +3 -3
  153. package/core/ui/build.config.ts +2 -0
  154. package/core/ui/package.json +3 -3
  155. package/core/ui/src/index.ts +1 -1
  156. package/core/utils/build.config.ts +2 -0
  157. package/core/utils/node_modules/.bin/rimraf +4 -4
  158. package/core/utils/package.json +3 -3
  159. package/core/utils/src/base.ts +6 -5
  160. package/core/utils/src/config.ts +2 -3
  161. package/core/utils/src/currency.ts +26 -0
  162. package/core/utils/src/delete.ts +3 -0
  163. package/core/utils/src/helpers.ts +2 -2
  164. package/core/utils/src/index.ts +7 -9
  165. package/core/utils/src/math.ts +30 -0
  166. package/core/utils/src/throttle.ts +3 -6
  167. package/core/utils/src/vendors.ts +221 -0
  168. package/core/utils/src/versions.ts +1 -0
  169. package/core/validation/build.config.ts +2 -0
  170. package/core/validation/package.json +1 -1
  171. package/core/validation/src/index.ts +2 -29
  172. package/core/{strings/src/validation.ts → validation/src/is.ts} +83 -8
  173. package/core/validation/src/validate.ts +29 -0
  174. package/docs/node_modules/.bin/rimraf +4 -4
  175. package/docs/node_modules/.bin/vitepress +4 -4
  176. package/docs/package.json +2 -2
  177. package/package.json +93 -46
  178. package/vitest.config.ts +25 -17
  179. package/core/utils/src/is.ts +0 -83
  180. package/tests/feature/example.spec.ts +0 -20
  181. package/tests/unit/example.test.ts +0 -7
package/components.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- // generated by unplugin-vue-components
2
- // We suggest you to commit this file into source control
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // Generated by unplugin-vue-components
3
5
  // Read more: https://github.com/vuejs/core/pull/3399
4
6
  import '@vue/runtime-core'
5
7
 
@@ -6,8 +6,10 @@ export default defineBuildConfig({
6
6
  builder: 'mkdist',
7
7
  input: './src/',
8
8
  outDir: './dist/',
9
+ format: 'esm',
9
10
  },
10
11
  ],
11
12
 
13
+ clean: true,
12
14
  declaration: true,
13
15
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
@@ -259,9 +259,21 @@
259
259
  "vue-component-meta": "^1.6.5"
260
260
  },
261
261
  "dependencies": {
262
+ "@stacksjs/cli": "workspace:*",
263
+ "@stacksjs/config": "workspace:*",
264
+ "@stacksjs/database": "workspace:*",
265
+ "@stacksjs/error-handling": "workspace:*",
266
+ "@stacksjs/logging": "workspace:*",
267
+ "@stacksjs/pages": "workspace:*",
268
+ "@stacksjs/path": "workspace:*",
269
+ "@stacksjs/security": "workspace:*",
270
+ "@stacksjs/storage": "workspace:*",
262
271
  "@stacksjs/strings": "workspace:*",
272
+ "@stacksjs/utils": "workspace:*",
263
273
  "fast-glob": "^3.2.12",
264
- "fs-extra": "^11.1.1"
274
+ "fs-extra": "^11.1.1",
275
+ "markdown-it": "^13.0.1",
276
+ "vue-component-meta": "^1.6.5"
265
277
  },
266
278
  "devDependencies": {
267
279
  "@stacksjs/development": "workspace:*",
@@ -1,15 +1,12 @@
1
- import { log, runCommand } from '@stacksjs/cli'
1
+ import { log } from '@stacksjs/cli'
2
2
  import { projectPath } from '@stacksjs/path'
3
- import { ExitCode, NpmScript } from '@stacksjs/types'
3
+ import { del } from '@stacksjs/utils'
4
4
 
5
- log.info('Running clean command...')
5
+ log.info('Running clean command...', projectPath())
6
6
 
7
- const result = await runCommand(NpmScript.Clean, { cwd: projectPath() })
8
-
9
- if (result.isOk()) {
10
- log.success('Cleaned up')
11
- process.exit(ExitCode.Success)
12
- }
13
-
14
- log.error(result.error)
15
- process.exit(ExitCode.FatalError)
7
+ await del([
8
+ projectPath('pnpm-lock.yaml'),
9
+ projectPath('node_modules/'),
10
+ projectPath('.stacks/**/dist'),
11
+ projectPath('.stacks/**/node_modules'),
12
+ ])
@@ -2,7 +2,7 @@ import { parseOptions } from '@stacksjs/cli'
2
2
 
3
3
  const options = parseOptions()
4
4
 
5
- // eslint-disable-next-line no-console')
5
+ // eslint-disable-next-line no-console
6
6
  console.log('options', options)
7
7
 
8
8
  // ...
@@ -1,8 +1,7 @@
1
1
  import { log } from '@stacksjs/logging'
2
2
  import { writeTextFile } from '@stacksjs/storage'
3
3
  import { packageJsonPath } from '@stacksjs/path'
4
- import { library } from '@stacksjs/config'
5
- import { packageManager } from '../../package.json' assert { type: 'json' }
4
+ import { library, packageManager } from '@stacksjs/config'
6
5
 
7
6
  export async function generatePackageJson(type: 'vue-components' | 'web-components' | 'functions') {
8
7
  let name, description, directory, keywords, config, prettyName
@@ -10,7 +10,7 @@ function parseOptions(options?: ActionOptions) {
10
10
 
11
11
  const parsedOptions = Object.entries(options).map(([key, value]) => {
12
12
  if (key.length === 1)
13
- return
13
+ return `-${key}=${value}`
14
14
  if (typeof value === 'boolean' && value) // if the value is a boolean and true, just return the key
15
15
  return `--${key}`
16
16
  else
@@ -37,7 +37,6 @@ export async function runAction(action: string, options?: ActionOptions): Promis
37
37
  // we need to parse options here because they need to bw passed to the action
38
38
  const opts = parseOptions(options)
39
39
  const cmd = `npx tsx ${actionsPath(`${action}.ts ${opts}`)}`
40
-
41
40
  // eslint-disable-next-line no-console
42
41
  console.log('cmd', cmd)
43
42
 
@@ -3,7 +3,7 @@ import { frameworkPath } from '@stacksjs/path'
3
3
  import { runActions } from '@stacksjs/actions'
4
4
  import { Action } from '@stacksjs/types'
5
5
 
6
- // import { log } from '@stacksjxs/cli'
6
+ // import { log } from '@stacksjs/cli'
7
7
 
8
8
  await runActions([
9
9
  // Action.GeneratePackageJsons, // generate the package.json's for each package
@@ -2,6 +2,7 @@ import { parseArgs } from '@stacksjs/cli'
2
2
 
3
3
  const options = parseArgs()
4
4
 
5
+ // eslint-disable-next-line no-console
5
6
  console.log('options are:', options)
6
7
 
7
8
  // await runCommands([
@@ -6,8 +6,10 @@ export default defineBuildConfig({
6
6
  builder: 'mkdist',
7
7
  input: './src/',
8
8
  outDir: './dist/',
9
+ format: 'esm',
9
10
  },
10
11
  ],
11
12
 
13
+ clean: true,
12
14
  declaration: true,
13
15
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ai",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Stacks Artificial Intelligence.",
7
7
  "author": "Chris Breuer",
@@ -6,8 +6,10 @@ export default defineBuildConfig({
6
6
  builder: 'mkdist',
7
7
  input: './src/',
8
8
  outDir: './dist/',
9
+ format: 'esm',
9
10
  },
10
11
  ],
11
12
 
13
+ clean: true,
12
14
  declaration: true,
13
15
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/alias",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks aliases.",
7
7
  "author": "Chris Breuer",
@@ -26,7 +26,6 @@
26
26
  "import": "./dist/index.mjs"
27
27
  }
28
28
  },
29
- "main": "dist/index.mjs",
30
29
  "module": "dist/index.mjs",
31
30
  "types": "dist/index.d.ts",
32
31
  "contributors": [
@@ -6,8 +6,10 @@ export default defineBuildConfig({
6
6
  builder: 'mkdist',
7
7
  input: './src/',
8
8
  outDir: './dist/',
9
+ format: 'esm',
9
10
  },
10
11
  ],
11
12
 
13
+ clean: true,
12
14
  declaration: true,
13
15
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/analytics",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Stacks Analytics. Privacy-friendly.",
7
7
  "author": "Chris Breuer",
@@ -6,8 +6,10 @@ export default defineBuildConfig({
6
6
  builder: 'mkdist',
7
7
  input: './src/',
8
8
  outDir: './dist/',
9
+ format: 'esm',
9
10
  },
10
11
  ],
11
12
 
13
+ clean: true,
12
14
  declaration: true,
13
15
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/arrays",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks array utilities.",
7
7
  "author": "Chris Breuer",
@@ -6,8 +6,10 @@ export default defineBuildConfig({
6
6
  builder: 'mkdist',
7
7
  input: './src/',
8
8
  outDir: './dist/',
9
+ format: 'esm',
9
10
  },
10
11
  ],
11
12
 
13
+ clean: true,
12
14
  declaration: true,
13
15
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/auth",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "A more simplistic way to authenticate.",
7
7
  "author": "Chris Breuer",
@@ -1,3 +1 @@
1
- export {
2
- // wip
3
- }
1
+ export const auth = 'wip'
@@ -72,7 +72,7 @@ _Create your personal or professional Vercel-like cloud, based on MIT-licensed O
72
72
  - ⛅️ **Serverless** _on-demand, auto-scaling, zero maintenance_
73
73
  - 🚏 **CDN** _zero-config low-latency CDN, including request life-cycle hooks & optimized request compressions (Brotli & gzip)_
74
74
  - 🔀 **Domain** _version-controlled & zero-config domain management (e.g. DNS)_
75
- - 📧 **Email** _secure & simplistic easy-peasy@custom-domains.com mail_
75
+ - 📧 **Email** _secure & simplistic <easy-peasy@custom-domains.com> mail_
76
76
  - 🔐 **Firewall** _native web application firewall support_
77
77
  - 🚜 **Maintenance** _handles your cloud infrastructure via the Stacks & Serverless framework_
78
78
  - 🤖 **Infrastructure as Code** _create & maintain your cloud infrastructure with ease_
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.52.0",
4
+ "version": "0.52.2",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
@@ -110,12 +110,10 @@ async function build(buddy: CLI) {
110
110
  const startTime = await intro('buddy build:core')
111
111
  const result = await runAction(Action.BuildCore, options)
112
112
 
113
- console.log('result', result)
114
-
115
- // if (result.isErr()) {
116
- // log.error('Failed to build the Stacks core.', result.error)
117
- // process.exit()
118
- // }
113
+ if (result.isErr()) {
114
+ log.error('Failed to build the Stacks core.', result.error as Error)
115
+ process.exit()
116
+ }
119
117
 
120
118
  outro('Stacks core built successfully', { startTime, useSeconds: true })
121
119
  })
@@ -127,12 +125,11 @@ async function build(buddy: CLI) {
127
125
  .action(async (options: BuildOptions) => {
128
126
  const startTime = await intro('buddy build:stacks')
129
127
  const result = await runAction(Action.BuildStacks, options)
130
- console.log('result', result)
131
128
 
132
- // if (result.isErr()) {
133
- // log.error('Failed to build Stacks.', result.error)
134
- // process.exit()
135
- // }
129
+ if (result.isErr()) {
130
+ log.error('Failed to build Stacks.', result.error as Error)
131
+ process.exit()
132
+ }
136
133
 
137
134
  outro('Stacks built successfully', { startTime, useSeconds: true })
138
135
  })
@@ -15,12 +15,11 @@ async function changelog(buddy: CLI) {
15
15
  .action(async (options: FreshOptions) => {
16
16
  const perf = await intro('buddy changelog')
17
17
  const result = await runAction(Action.Changelog, options)
18
- console.log('result', result)
19
18
 
20
- // if (result.isErr()) {
21
- // outro('While running the changelog command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
22
- // process.exit()
23
- // }
19
+ if (result.isErr()) {
20
+ outro('While running the changelog command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21
+ process.exit()
22
+ }
24
23
 
25
24
  outro('Generated the CHANGELOG.md file.', { startTime: perf, useSeconds: true })
26
25
  process.exit(ExitCode.Success)
@@ -13,16 +13,15 @@ async function clean(buddy: CLI) {
13
13
  .command('clean', descriptions.clean)
14
14
  .option('--verbose', descriptions.verbose, { default: false })
15
15
  .action(async (options: CleanOptions) => {
16
- // { shell: true, verbose: true }
17
16
  const perf = await intro('buddy clean')
18
- const result = await runAction(Action.Fresh, { verbose: true })
17
+ const result = await runAction(Action.Clean, { ...options, verbose: true })
19
18
 
20
19
  if (result.isErr()) {
21
20
  outro('While running the clean command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
22
21
  process.exit(ExitCode.FatalError)
23
22
  }
24
23
 
25
- outro('Cleaned project.', { startTime: perf, useSeconds: true })
24
+ outro('Cleaned up', { startTime: perf, useSeconds: true })
26
25
  process.exit(ExitCode.Success)
27
26
  })
28
27
  }
@@ -15,12 +15,11 @@ async function deploy(buddy: CLI) {
15
15
  .action(async (options: DeployOptions) => {
16
16
  const perf = await intro('buddy deploy')
17
17
  const result = await runAction(Action.Deploy, options)
18
- console.log('result', result)
19
18
 
20
- // if (result.isErr()) {
21
- // outro('While running the `buddy deploy`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
22
- // process.exit()
23
- // }
19
+ if (result.isErr()) {
20
+ outro('While running the `buddy deploy`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21
+ process.exit()
22
+ }
24
23
 
25
24
  outro('Deployment succeeded.', { startTime: perf, useSeconds: true })
26
25
  process.exit(ExitCode.Success)
@@ -81,7 +81,8 @@ async function dev(buddy: CLI) {
81
81
  process.exit()
82
82
  }
83
83
 
84
- outro('Finished running dev:components.', { startTime: perf, useSeconds: true })
84
+ console.log('')
85
+ outro('Exited', { startTime: perf, useSeconds: true })
85
86
  process.exit(ExitCode.Success)
86
87
  })
87
88
 
@@ -14,10 +14,10 @@ async function fresh(buddy: CLI) {
14
14
  .option('--verbose', descriptions.verbose, { default: false })
15
15
  .action(async (options: FreshOptions) => {
16
16
  const perf = await intro('buddy fresh')
17
- const result = await runAction(Action.Fresh, { verbose: true })
17
+ const result = await runAction(Action.Fresh, { ...options, verbose: true })
18
18
 
19
19
  if (result.isErr()) {
20
- outro('While running the fresh command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
20
+ outro('While running the `fresh` command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21
21
  process.exit(ExitCode.FatalError)
22
22
  }
23
23
 
@@ -10,12 +10,11 @@ async function inspire(buddy: CLI) {
10
10
  .action(async () => {
11
11
  const perf = await intro('buddy inspire')
12
12
  const result = await runAction(Action.Inspire)
13
- console.log('result', result)
14
13
 
15
- // if (result.isErr()) {
16
- // outro('While running the inspire command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
17
- // process.exit()
18
- // }
14
+ if (result.isErr()) {
15
+ outro('While running the inspire command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
16
+ process.exit()
17
+ }
19
18
 
20
19
  outro('Your quote is: ...', { startTime: perf, useSeconds: true })
21
20
  process.exit(ExitCode.Success)
@@ -15,12 +15,11 @@ async function key(buddy: CLI) {
15
15
  .action(async (options: KeyOptions) => {
16
16
  const startTime = await intro('buddy key:generate')
17
17
  const result = await runAction(Action.KeyGenerate, options)
18
- console.log('result', result)
19
18
 
20
- // if (result.isErr()) {
21
- // log.error('Failed to set random application key.', result.error)
22
- // process.exit()
23
- // }
19
+ if (result.isErr()) {
20
+ log.error('Failed to set random application key.', result.error as Error)
21
+ process.exit()
22
+ }
24
23
 
25
24
  outro('Set random application key.', { startTime })
26
25
  })
@@ -17,12 +17,11 @@ async function lint(buddy: CLI) {
17
17
  .action(async (options: LintOptions) => {
18
18
  const perf = await intro('buddy lint')
19
19
  const result = await runAction(Action.Lint, { ...options, showSpinner: true, spinnerText: 'Linting...' })
20
- console.log('result', result)
21
20
 
22
- // if (result.isErr()) {
23
- // outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
24
- // process.exit()
25
- // }
21
+ if (result.isErr()) {
22
+ outro('While running `buddy lint`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
23
+ process.exit()
24
+ }
26
25
 
27
26
  outro('Linted your project.', { startTime: perf, useSeconds: true })
28
27
  })
@@ -33,12 +32,11 @@ async function lint(buddy: CLI) {
33
32
  .action(async (options: LintOptions) => {
34
33
  log.info('Fixing lint errors...')
35
34
  const result = await runAction(Action.LintFix, { ...options, showSpinner: true, spinnerText: 'Linting...' })
36
- console.log('result', result)
37
35
 
38
- // if (result.isErr()) {
39
- // log.error('There was an error lint fixing your code.', result.error)
40
- // process.exit()
41
- // }
36
+ if (result.isErr()) {
37
+ log.error('There was an error lint fixing your code.', result.error as Error)
38
+ process.exit()
39
+ }
42
40
 
43
41
  log.success('Fixed lint errors.')
44
42
  })
@@ -185,12 +185,11 @@ async function make(buddy: CLI) {
185
185
  }
186
186
 
187
187
  const result = await createNotification(options)
188
- console.log('result', result)
189
188
 
190
- // if (!result) {
191
- // outro('While running the make:notification command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
192
- // process.exit()
193
- // }
189
+ if (!result) {
190
+ outro('While running the make:notification command, there was an issue', { startTime: perf, useSeconds: true, isError: true })
191
+ process.exit()
192
+ }
194
193
 
195
194
  outro(`Created your ${italic(name)} notification.`, { startTime: perf, useSeconds: true })
196
195
  process.exit(ExitCode.Success)
@@ -15,12 +15,11 @@ async function migrate(buddy: CLI) {
15
15
  .action(async (options: FreshOptions) => {
16
16
  const perf = await intro('buddy migrate')
17
17
  const result = await runAction(Action.Migrate, { ...options, showSpinner: true, spinnerText: 'Migrating...' })
18
- console.log('result', result)
19
18
 
20
- // if (result.isErr()) {
21
- // outro('While running the migrate command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
22
- // process.exit()
23
- // }
19
+ if (result.isErr()) {
20
+ outro('While running the migrate command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21
+ process.exit()
22
+ }
24
23
 
25
24
  const APP_ENV = process.env.APP_ENV || 'local'
26
25
 
@@ -15,12 +15,11 @@ async function onboarding(buddy: CLI) {
15
15
  .action(async () => {
16
16
  const startTime = await intro('buddy page:onboarding')
17
17
  const result = await runAction(Action.GenerateOnboarding)
18
- console.log('result', result)
19
18
 
20
- // if (result.isErr()) {
21
- // log.error('Something went wrong when generating', result.error)
22
- // process.exit()
23
- // }
19
+ if (result.isErr()) {
20
+ log.error('Something went wrong when generating', result.error as Error)
21
+ process.exit()
22
+ }
24
23
 
25
24
  outro('Pages generated successfully', { startTime })
26
25
  })
@@ -1,6 +1,6 @@
1
1
  import { Action } from '@stacksjs/types'
2
2
  import type { CLI, ReleaseOptions } from '@stacksjs/types'
3
- import { intro, outro } from '@stacksjs/cli'
3
+ import { intro, log, outro } from '@stacksjs/cli'
4
4
  import { runAction } from '@stacksjs/actions'
5
5
 
6
6
  const descriptions = {
@@ -14,22 +14,14 @@ async function release(buddy: CLI) {
14
14
  .option('--verbose', descriptions.verbose, { default: true }) // it's on by default because it requires manual input
15
15
  .action(async (options: ReleaseOptions) => {
16
16
  const startTime = await intro('buddy release')
17
- const result = await runAction(Action.Release, { shell: true })
18
-
19
- console.log('result', result)
20
-
21
- // check if any element of the array is an error
22
- if (Array.isArray(result) && result.some(r => r.isErr())) {
23
- log.error('Failed to trigger the CI/CD release workflow.', result)
24
- process.exit()
25
- }
17
+ const result = await runAction(Action.Release, { ...options, shell: true })
26
18
 
27
19
  if (result.isErr()) {
28
- log.error('Failed to trigger the CI/CD release workflow.', result.error)
20
+ log.error('Failed to release', result.error)
29
21
  process.exit()
30
22
  }
31
23
 
32
- outro('Triggered CI/CD release workflow', { startTime, useSeconds: true })
24
+ outro('Triggered your CI/CD release workflow', { startTime, useSeconds: true })
33
25
  })
34
26
  }
35
27
 
@@ -1,5 +1,7 @@
1
- import type { CLI, FreshOptions } from '@stacksjs/types'
2
- import { seeder } from '@stacksjs/actions/generate'
1
+ import type { CLI, SeedOptions } from '@stacksjs/types'
2
+ import { runAction } from '@stacksjs/actions'
3
+ import { intro, outro } from '@stacksjs/cli'
4
+ import { Action, ExitCode } from '@stacksjs/types'
3
5
 
4
6
  async function seed(buddy: CLI) {
5
7
  const descriptions = {
@@ -10,21 +12,19 @@ async function seed(buddy: CLI) {
10
12
  buddy
11
13
  .command('seed', descriptions.seed)
12
14
  .option('--verbose', descriptions.verbose, { default: false })
13
- .action(async (options: FreshOptions) => {
14
- // const perf = await intro('buddy seed')
15
- // const result = await runAction(Action.Seed, { ...options, showSpinner: true, spinnerText: 'Seeding...' })
15
+ .action(async (options: SeedOptions) => {
16
+ const perf = await intro('buddy seed')
17
+ const result = await runAction(Action.Seed, { ...options, showSpinner: true, spinnerText: 'Seeding...' })
16
18
 
17
- // if (result.isErr()) {
18
- // outro('While running the seed command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
19
- // process.exit()
20
- // }
19
+ if (result.isErr()) {
20
+ outro('While running the seed command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
21
+ process.exit(ExitCode.FatalError)
22
+ }
21
23
 
22
- // const APP_ENV = process.env.APP_ENV || 'local'
24
+ const APP_ENV = process.env.APP_ENV || 'local'
23
25
 
24
- // outro(`Seeded your ${APP_ENV} database.`, { startTime: perf, useSeconds: true })
25
- // process.exit(ExitCode.Success)
26
-
27
- await seeder()
26
+ outro(`Seeded your ${APP_ENV} database.`, { startTime: perf, useSeconds: true })
27
+ process.exit(ExitCode.Success)
28
28
  })
29
29
  }
30
30
 
@@ -15,12 +15,11 @@ async function setting(buddy: CLI) {
15
15
  .action(async () => {
16
16
  const startTime = await intro('buddy page:setting')
17
17
  const result = await runAction(Action.GenerateSettings)
18
- console.log('result', result)
19
18
 
20
- // if (result.isErr()) {
21
- // log.error('Something went wrong when generating', result.error)
22
- // process.exit()
23
- // }
19
+ if (result.isErr()) {
20
+ log.error('Something went wrong when generating', result.error as Error)
21
+ process.exit()
22
+ }
24
23
 
25
24
  outro('Pages generated successfully', { startTime })
26
25
  })