stacks 0.52.0 → 0.52.1

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 (171) 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/clean.ts +2 -3
  25. package/core/buddy/src/commands/dev.ts +2 -1
  26. package/core/buddy/src/commands/fresh.ts +2 -2
  27. package/core/buddy/src/commands/release.ts +4 -12
  28. package/core/buddy/src/commands/seed.ts +14 -14
  29. package/core/buddy/src/commands/test.ts +25 -25
  30. package/core/buddy/src/commands/upgrade.ts +5 -5
  31. package/core/buddy/src/commands/version.ts +25 -16
  32. package/core/build/build.config.ts +2 -0
  33. package/core/build/node_modules/.bin/vite +4 -4
  34. package/core/build/node_modules/.bin/vite-ssg +4 -4
  35. package/core/build/node_modules/.bin/vue-docgen-web-types +4 -4
  36. package/core/build/package.json +5 -5
  37. package/core/build/src/stacks.ts +8 -14
  38. package/core/build/src/vue-components.ts +6 -4
  39. package/core/cache/build.config.ts +2 -0
  40. package/core/cache/package.json +2 -2
  41. package/core/chat/build.config.ts +2 -0
  42. package/core/chat/package.json +6 -6
  43. package/core/cli/package.json +1 -1
  44. package/core/cli/src/actions/install.ts +20 -2
  45. package/core/cli/src/helpers.ts +6 -1
  46. package/core/cli/src/run.ts +5 -8
  47. package/core/cloud/build.config.ts +2 -0
  48. package/core/cloud/package.json +1 -1
  49. package/core/collections/build.config.ts +2 -0
  50. package/core/collections/package.json +1 -1
  51. package/core/config/package.json +1 -1
  52. package/core/config/src/defaults.ts +0 -2
  53. package/core/config/src/stacks.ts +9 -2
  54. package/core/database/package.json +1 -1
  55. package/core/database/src/migrations/index.ts +2 -1
  56. package/core/datetime/package.json +1 -1
  57. package/core/desktop/build.config.ts +2 -0
  58. package/core/desktop/package.json +2 -2
  59. package/core/development/build.config.ts +2 -0
  60. package/core/development/package.json +6 -6
  61. package/core/docs/build.config.ts +1 -0
  62. package/core/docs/node_modules/.bin/vitepress +4 -4
  63. package/core/docs/package.json +2 -2
  64. package/core/domains/build.config.ts +2 -0
  65. package/core/domains/package.json +1 -1
  66. package/core/email/package.json +12 -12
  67. package/core/email/src/drivers/mailjet.ts +1 -0
  68. package/core/email/src/tailwind.config.ts +1 -1
  69. package/core/error-handling/package.json +2 -2
  70. package/core/events/package.json +1 -1
  71. package/core/faker/build.config.ts +2 -0
  72. package/core/faker/package.json +1 -1
  73. package/core/git/build.config.ts +2 -0
  74. package/core/git/package.json +1 -1
  75. package/core/health/build.config.ts +2 -0
  76. package/core/health/package.json +1 -1
  77. package/core/lint/build.config.ts +2 -0
  78. package/core/lint/node_modules/.bin/eslint +4 -4
  79. package/core/lint/package.json +3 -3
  80. package/core/lint/src/index.ts +1 -1
  81. package/core/logging/package.json +5 -5
  82. package/core/modules/build.config.ts +2 -0
  83. package/core/modules/package.json +1 -1
  84. package/core/notifications/package.json +22 -22
  85. package/core/notifications/src/index.ts +5 -8
  86. package/core/objects/build.config.ts +2 -0
  87. package/core/objects/package.json +1 -1
  88. package/core/orm/package.json +1 -1
  89. package/core/pages/build.config.ts +2 -0
  90. package/core/pages/package.json +1 -1
  91. package/core/path/build.config.ts +1 -0
  92. package/core/path/package.json +1 -1
  93. package/core/payments/build.config.ts +2 -0
  94. package/core/payments/package.json +2 -2
  95. package/core/push/build.config.ts +2 -0
  96. package/core/push/package.json +3 -3
  97. package/core/query-builder/build.config.ts +2 -0
  98. package/core/query-builder/package.json +1 -1
  99. package/core/queue/build.config.ts +2 -0
  100. package/core/queue/package.json +1 -1
  101. package/core/realtime/build.config.ts +2 -0
  102. package/core/realtime/package.json +1 -1
  103. package/core/router/build.config.ts +2 -0
  104. package/core/router/package.json +2 -2
  105. package/core/router/src/index.ts +114 -11
  106. package/core/scheduler/build.config.ts +2 -0
  107. package/core/scheduler/package.json +1 -1
  108. package/core/search-engine/build.config.ts +1 -0
  109. package/core/search-engine/package.json +1 -1
  110. package/core/search-engine/src/index.ts +1 -22
  111. package/core/security/build.config.ts +2 -0
  112. package/core/security/package.json +1 -1
  113. package/core/server/build.config.ts +2 -0
  114. package/core/server/node_modules/.bin/nitro +4 -4
  115. package/core/server/node_modules/.bin/nitropack +4 -4
  116. package/core/server/node_modules/.bin/vite +4 -4
  117. package/core/server/package.json +3 -3
  118. package/core/signals/build.config.ts +2 -0
  119. package/core/signals/package.json +1 -1
  120. package/core/slug/build.config.ts +2 -0
  121. package/core/slug/package.json +1 -1
  122. package/core/sms/build.config.ts +2 -0
  123. package/core/sms/package.json +11 -11
  124. package/core/storage/build.config.ts +2 -0
  125. package/core/storage/package.json +1 -1
  126. package/core/storage/src/index.ts +11 -1
  127. package/core/strings/package.json +1 -1
  128. package/core/strings/src/index.ts +0 -1
  129. package/core/testing/build.config.ts +2 -0
  130. package/core/testing/node_modules/.bin/vitest +4 -4
  131. package/core/testing/package.json +4 -4
  132. package/core/testing/src/index.ts +1 -0
  133. package/core/tinker/package.json +1 -1
  134. package/core/types/build.config.ts +2 -0
  135. package/core/types/node_modules/.bin/vite +4 -4
  136. package/core/types/node_modules/.bin/vite-ssg +4 -4
  137. package/core/types/node_modules/.bin/vitepress +4 -4
  138. package/core/types/package.json +7 -7
  139. package/core/types/src/cli.ts +10 -9
  140. package/core/types/src/fs.ts +8 -0
  141. package/core/types/src/router.ts +22 -0
  142. package/core/types/src/stacks.ts +3 -3
  143. package/core/ui/build.config.ts +2 -0
  144. package/core/ui/package.json +3 -3
  145. package/core/ui/src/index.ts +1 -1
  146. package/core/utils/build.config.ts +2 -0
  147. package/core/utils/node_modules/.bin/rimraf +4 -4
  148. package/core/utils/package.json +3 -3
  149. package/core/utils/src/base.ts +6 -5
  150. package/core/utils/src/config.ts +2 -3
  151. package/core/utils/src/currency.ts +26 -0
  152. package/core/utils/src/delete.ts +3 -0
  153. package/core/utils/src/helpers.ts +2 -2
  154. package/core/utils/src/index.ts +7 -9
  155. package/core/utils/src/math.ts +30 -0
  156. package/core/utils/src/throttle.ts +3 -6
  157. package/core/utils/src/vendors.ts +221 -0
  158. package/core/utils/src/versions.ts +1 -0
  159. package/core/validation/build.config.ts +2 -0
  160. package/core/validation/package.json +1 -1
  161. package/core/validation/src/index.ts +2 -29
  162. package/core/{strings/src/validation.ts → validation/src/is.ts} +83 -8
  163. package/core/validation/src/validate.ts +29 -0
  164. package/docs/node_modules/.bin/rimraf +4 -4
  165. package/docs/node_modules/.bin/vitepress +4 -4
  166. package/docs/package.json +2 -2
  167. package/package.json +93 -46
  168. package/vitest.config.ts +25 -17
  169. package/core/utils/src/is.ts +0 -83
  170. package/tests/feature/example.spec.ts +0 -20
  171. 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.1",
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.1",
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.1",
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.1",
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.1",
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.1",
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.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
@@ -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
  }
@@ -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
 
@@ -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
 
@@ -41,10 +41,10 @@ async function test(buddy: CLI) {
41
41
  const result = await runAction(Action.TestUnit, { ...options, verbose: true, cwd: projectPath() })
42
42
  console.log('result', result)
43
43
 
44
- // if (result.isErr()) {
45
- // outro('While running `buddy test:unit`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
46
- // process.exit()
47
- // }
44
+ if (result.isErr()) {
45
+ outro('While running `buddy test:unit`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
46
+ process.exit()
47
+ }
48
48
 
49
49
  outro('Finished running unit tests', { startTime: perf, useSeconds: true })
50
50
  })
@@ -55,17 +55,17 @@ async function test(buddy: CLI) {
55
55
  .option('--verbose', descriptions.verbose, { default: false })
56
56
  .action(async (options: TestOptions) => {
57
57
  const perf = await intro('buddy test:feature')
58
- // let result
58
+ let result
59
59
 
60
- // if (options.showReport)
61
- // result = await runAction(Action.ShowFeatureTestReport, { ...options, verbose: true, cwd: projectPath() })
62
- // else
63
- // result = await runAction(Action.TestFeature, { ...options, verbose: true, cwd: projectPath() })
60
+ if (options.showReport)
61
+ result = await runAction(Action.ShowFeatureTestReport, { ...options, verbose: true, cwd: projectPath() })
62
+ else
63
+ result = await runAction(Action.TestFeature, { ...options, verbose: true, cwd: projectPath() })
64
64
 
65
- // if (result.isErr()) {
66
- // outro('While running `buddy test:feature`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
67
- // process.exit()
68
- // }
65
+ if (result.isErr()) {
66
+ outro('While running `buddy test:feature`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
67
+ process.exit()
68
+ }
69
69
 
70
70
  outro('Finished running feature tests', { startTime: perf, useSeconds: true })
71
71
  })
@@ -78,10 +78,10 @@ async function test(buddy: CLI) {
78
78
  const result = await runAction(Action.TestUi, { ...options, verbose: true, cwd: projectPath() })
79
79
  console.log('result', result)
80
80
 
81
- // if (result.isErr()) {
82
- // outro('While running `buddy test:ui`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
83
- // process.exit()
84
- // }
81
+ if (result.isErr()) {
82
+ outro('While running `buddy test:ui`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
83
+ process.exit()
84
+ }
85
85
 
86
86
  outro('Finished running tests in the browser', { startTime: perf, useSeconds: true })
87
87
  })
@@ -95,10 +95,10 @@ async function test(buddy: CLI) {
95
95
  const result = await runAction(Action.Typecheck, { ...options, verbose: true, cwd: projectPath() })
96
96
  console.log('result', result)
97
97
 
98
- // if (result.isErr()) {
99
- // outro('While running `buddy test:types`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
100
- // process.exit()
101
- // }
98
+ if (result.isErr()) {
99
+ outro('While running `buddy test:types`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
100
+ process.exit()
101
+ }
102
102
 
103
103
  outro('Finished running typecheck', { startTime: perf, useSeconds: true })
104
104
  })
@@ -110,10 +110,10 @@ async function test(buddy: CLI) {
110
110
  const result = await runAction(Action.TestCoverage, { ...options, cwd: projectPath(), verbose: true })
111
111
  console.log('result', result)
112
112
 
113
- // if (result.isErr()) {
114
- // outro('While running `buddy test:coverage`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error)
115
- // process.exit()
116
- // }
113
+ if (result.isErr()) {
114
+ outro('While running `buddy test:coverage`, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error)
115
+ process.exit()
116
+ }
117
117
 
118
118
  outro('Generated the test coverage report', { startTime: perf, useSeconds: true })
119
119
  process.exit()
@@ -118,10 +118,10 @@ async function upgrade(buddy: CLI) {
118
118
  const result = await runAction(Action.UpgradeNode, options)
119
119
  console.log('result', result, perf)
120
120
 
121
- // if (response.isErr()) {
122
- // outro('While running the buddy upgrade:node command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, response.error)
123
- // process.exit()
124
- // }
121
+ if (result.isErr()) {
122
+ outro('While running the buddy upgrade:node command, there was an issue', { startTime: perf, useSeconds: true, isError: true }, result.error as Error) // FIXME: should not have to cast
123
+ process.exit()
124
+ }
125
125
 
126
126
  process.exit(ExitCode.Success)
127
127
  })
@@ -130,7 +130,7 @@ async function upgrade(buddy: CLI) {
130
130
  .command('upgrade:all', descriptions.all)
131
131
  .option('--verbose', descriptions.verbose, { default: false })
132
132
  .action(async (options: UpgradeOptions) => {
133
- // await runAction(Action.Upgrade, { ...options, all: true })
133
+ await runAction(Action.Upgrade, options)
134
134
  })
135
135
  }
136
136
 
@@ -1,12 +1,20 @@
1
- import type { CLI, FreshOptions } from '@stacksjs/types'
2
-
3
- // import { bold, dim, green, intro } from '@stacksjs/cli'
4
- // import { filesystem } from '@stacksjs/storage'
5
- // import { log } from '@stacksjs/logging'
6
- // import { frameworkPath } from '@stacksjs/path'
1
+ import type { CLI } from '@stacksjs/types'
2
+ import { bold, dim, green, intro } from '@stacksjs/cli'
3
+ import { filesystem } from '@stacksjs/storage'
4
+ import { log } from '@stacksjs/logging'
5
+ import { frameworkPath } from '@stacksjs/path'
7
6
 
8
7
  async function version(buddy: CLI) {
9
- // const { fs } = filesystem
8
+ // maybe use type-fest?
9
+ interface PackageJson {
10
+ engines: {
11
+ node: string
12
+ pnpm: string
13
+ }
14
+ version: string
15
+ }
16
+
17
+ const { fs } = filesystem
10
18
 
11
19
  const descriptions = {
12
20
  version: 'Retrieving Stacks build version',
@@ -14,17 +22,18 @@ async function version(buddy: CLI) {
14
22
 
15
23
  buddy
16
24
  .command('version', descriptions.version)
17
- .action(async (options: FreshOptions) => {
18
- // const perf = await intro('buddy version')
25
+ .action(async () => {
26
+ await intro('buddy version')
19
27
 
20
- // const depVersions = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
21
- // const nodeVersion = depVersions.engines.node.replace('>=v', '')
22
- // const pnpmVersion = depVersions.engines.pnpm.replace('>=', '')
23
- // const stacksVersion = JSON.parse(fs.readFileSync(frameworkPath('/package.json'), 'utf8'))
28
+ const depVersions = JSON.parse(fs.readFileSync('./package.json', 'utf8')) as PackageJson
29
+ const nodeVersion = depVersions.engines.node.replace('>=v', '')
30
+ const pnpmVersion = depVersions.engines.pnpm.replace('>=', '')
31
+ const stacksVersion = JSON.parse(fs.readFileSync(frameworkPath('/package.json'), 'utf8')) as PackageJson
24
32
 
25
- // log.info(green(bold('Stacks: ')) + dim(` ${stacksVersion.version}`))
26
- // log.info(green(bold('node: ')) + dim(` ${nodeVersion}`))
27
- // log.info(green(bold('pnpm: ')) + dim(` ${pnpmVersion}`))
33
+ log.info(green(bold('Stacks: ')) + dim(` ${stacksVersion.version}`))
34
+ log.info(green(bold('node: ')) + dim(` ${nodeVersion}`))
35
+ log.info(green(bold('pnpm: ')) + dim(` ${pnpmVersion}`))
36
+ // redis (or other cache/s), mysql (or other database/s),
28
37
  })
29
38
  }
30
39
 
@@ -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
  })
@@ -6,12 +6,12 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules/vite/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules/vite/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules/vite/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules/vite/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules/vite/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules/vite/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules/vite/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules/vite/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules/vite/bin/vite.js" "$@"
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules/vite/bin/vite.js" "$@"
15
15
  else
16
- exec node "$basedir/../../../../../node_modules/.pnpm/vite@4.3.7_@types+node@18.16.10/node_modules/vite/bin/vite.js" "$@"
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/vite@4.3.8_@types+node@18.16.13/node_modules/vite/bin/vite.js" "$@"
17
17
  fi
@@ -6,12 +6,12 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules/vite-ssg/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules/vite-ssg/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules/vite-ssg/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules/vite-ssg/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules/vite-ssg/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules/vite-ssg/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules/vite-ssg/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules/vite-ssg/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules/vite-ssg/bin/vite-ssg.js" "$@"
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules/vite-ssg/bin/vite-ssg.js" "$@"
15
15
  else
16
- exec node "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.7_vue-router@4.2.0_vue@3.3.2/node_modules/vite-ssg/bin/vite-ssg.js" "$@"
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/vite-ssg@0.22.2_@vueuse+head@1.1.26_vite@4.3.8_vue-router@4.2.1_vue@3.3.4/node_modules/vite-ssg/bin/vite-ssg.js" "$@"
17
17
  fi