stacks 0.52.9 → 0.53.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 (122) hide show
  1. package/api/nitro.config.ts +2 -2
  2. package/api/routes/index.ts +1 -1
  3. package/auto-imports.d.ts +6 -0
  4. package/core/actions/package.json +1 -5
  5. package/core/actions/src/clean.ts +1 -1
  6. package/core/actions/src/dev/index.ts +0 -9
  7. package/core/actions/src/generate/index.ts +3 -3
  8. package/core/actions/src/generate/settings.ts +3 -3
  9. package/core/actions/src/helpers/lib-entries.ts +11 -12
  10. package/core/actions/src/helpers/utils.ts +1 -1
  11. package/core/actions/src/make.ts +1 -1
  12. package/core/actions/src/release.ts +4 -2
  13. package/core/actions/src/upgrade/framework.ts +29 -29
  14. package/core/actions/src/upgrade/index.ts +13 -15
  15. package/core/actions/src/upgrade/node.ts +4 -4
  16. package/core/actions/src/upgrade/package-manager.ts +4 -4
  17. package/core/actions/src/upgrade.ts +1 -1
  18. package/core/ai/package.json +1 -1
  19. package/core/alias/package.json +1 -1
  20. package/core/analytics/package.json +1 -1
  21. package/core/arrays/package.json +1 -1
  22. package/core/auth/package.json +1 -1
  23. package/core/buddy/package.json +1 -1
  24. package/core/buddy/src/cli.ts +3 -26
  25. package/core/buddy/src/commands/fresh.ts +1 -1
  26. package/core/buddy/src/commands/lint.ts +2 -2
  27. package/core/buddy/src/commands/onboarding.ts +9 -15
  28. package/core/buddy/src/commands/setting.ts +10 -12
  29. package/core/buddy/src/commands/version.ts +7 -19
  30. package/core/buddy/src/index.ts +0 -21
  31. package/core/build/package.json +3 -3
  32. package/core/build/src/functions.ts +3 -3
  33. package/core/build/src/stacks.ts +3 -6
  34. package/core/build/src/web-components.ts +1 -1
  35. package/core/cache/package.json +2 -2
  36. package/core/cache/src/drivers/redis.ts +2 -2
  37. package/core/chat/package.json +1 -1
  38. package/core/cli/package.json +1 -1
  39. package/core/cli/src/run.ts +2 -2
  40. package/core/cloud/package.json +1 -1
  41. package/core/collections/package.json +1 -1
  42. package/core/config/package.json +1 -1
  43. package/core/database/package.json +1 -1
  44. package/core/database/src/factory/index.ts +2 -2
  45. package/core/database/src/migrations/index.ts +2 -2
  46. package/core/datetime/package.json +1 -1
  47. package/core/desktop/package.json +1 -1
  48. package/core/development/package.json +1 -1
  49. package/core/docs/node_modules/.bin/vitepress +4 -4
  50. package/core/docs/package.json +2 -2
  51. package/core/domains/package.json +1 -1
  52. package/core/email/package.json +1 -1
  53. package/core/email/src/actions/send.ts +2 -0
  54. package/core/email/src/tailwind.config.ts +3 -3
  55. package/core/error-handling/package.json +2 -2
  56. package/core/events/package.json +1 -1
  57. package/core/faker/package.json +1 -1
  58. package/core/git/package.json +1 -1
  59. package/core/health/package.json +1 -1
  60. package/core/lint/node_modules/.bin/publint +4 -4
  61. package/core/lint/package.json +4 -4
  62. package/core/logging/package.json +2 -2
  63. package/core/modules/package.json +1 -1
  64. package/core/notifications/package.json +1 -1
  65. package/core/notifications/tests/chat/Slack.test.ts +35 -35
  66. package/core/notifications/tests/email/Mailgun.test.ts +41 -41
  67. package/core/notifications/tests/email/Sendgrid.test.ts +41 -41
  68. package/core/notifications/tests/sms/Twilio.test.ts +38 -38
  69. package/core/objects/package.json +1 -1
  70. package/core/objects/src/index.ts +2 -1
  71. package/core/orm/package.json +1 -1
  72. package/core/pages/package.json +1 -1
  73. package/core/pages/src/index.ts +39 -39
  74. package/core/path/package.json +1 -1
  75. package/core/path/src/index.ts +14 -4
  76. package/core/payments/package.json +1 -1
  77. package/core/push/package.json +1 -1
  78. package/core/query-builder/package.json +2 -2
  79. package/core/queue/package.json +1 -1
  80. package/core/realtime/package.json +1 -1
  81. package/core/router/package.json +1 -1
  82. package/core/scheduler/package.json +1 -1
  83. package/core/search-engine/package.json +2 -2
  84. package/core/search-engine/src/helpers.ts +1 -1
  85. package/core/security/package.json +1 -1
  86. package/core/server/package.json +2 -1
  87. package/core/server/src/index.ts +2 -5
  88. package/core/server/src/nitro.config.ts +2 -2
  89. package/core/signals/package.json +1 -1
  90. package/core/slug/package.json +1 -1
  91. package/core/sms/package.json +1 -1
  92. package/core/sms/src/drivers/gupshup.ts +1 -1
  93. package/core/sms/src/drivers/nexmo.ts +3 -2
  94. package/core/sms/src/drivers/plivo.ts +3 -2
  95. package/core/sms/src/drivers/sms77.ts +3 -2
  96. package/core/sms/src/drivers/sns.ts +1 -1
  97. package/core/sms/src/drivers/telnyx.ts +3 -2
  98. package/core/sms/src/drivers/termii.ts +3 -2
  99. package/core/sms/src/drivers/twilio.ts +3 -2
  100. package/core/storage/package.json +1 -1
  101. package/core/storage/src/index.ts +3 -5
  102. package/core/strings/package.json +1 -1
  103. package/core/testing/node_modules/.bin/playwright +4 -4
  104. package/core/testing/package.json +2 -2
  105. package/core/tinker/package.json +1 -1
  106. package/core/types/node_modules/.bin/vite +4 -4
  107. package/core/types/node_modules/.bin/vitepress +4 -4
  108. package/core/types/package.json +8 -8
  109. package/core/types/src/cli.ts +9 -11
  110. package/core/types/src/fs.ts +5 -0
  111. package/core/types/src/model.ts +0 -1
  112. package/core/ui/package.json +3 -3
  113. package/core/utils/package.json +3 -3
  114. package/core/utils/src/guards.ts +3 -3
  115. package/core/utils/src/helpers.ts +26 -8
  116. package/core/utils/src/vendors.ts +1 -0
  117. package/core/validation/package.json +1 -1
  118. package/docs/node_modules/.bin/vitepress +4 -4
  119. package/docs/package.json +1 -1
  120. package/package.json +91 -91
  121. package/pages/web/main.ts +26 -26
  122. package/core/actions/src/generate/package-jsons.ts +0 -11
@@ -1,10 +1,10 @@
1
- import { defineNitroConfig } from 'nitropack'
1
+ import { defineServerConfig } from '@stacksjs/server'
2
2
 
3
3
  // import { alias } from '@stacksjs/alias'
4
4
  // import { resolve } from '@stacksjs/path'
5
5
  // import { deploy } from '@stacksjs/config'
6
6
 
7
- export default defineNitroConfig({
7
+ export default defineServerConfig({
8
8
  // alias,
9
9
  output: {
10
10
  dir: '.output',
@@ -1 +1 @@
1
- export default defineEventHandler(() => '.stacks is amazing!')
1
+ // export default defineEventHandler(() => 'stacks is amazing!')
package/auto-imports.d.ts CHANGED
@@ -393,6 +393,7 @@ declare module 'vue' {
393
393
  readonly normalizeScale: UnwrapRef<typeof import('./core/utils/src/currency')['normalizeScale']>
394
394
  readonly normalizeString: UnwrapRef<typeof import('./core/path/src/index')['normalizeString']>
395
395
  readonly not: UnwrapRef<typeof import('./core/utils/src/math')['not']>
396
+ readonly notNullish: UnwrapRef<typeof import('./core/utils/src/guards')['notNullish']>
396
397
  readonly notUndefined: UnwrapRef<typeof import('./core/utils/src/guards')['notUndefined']>
397
398
  readonly notification: UnwrapRef<typeof import('../config/notification')['default']>
398
399
  readonly notificationsPath: UnwrapRef<typeof import('./core/path/src/index')['notificationsPath']>
@@ -702,6 +703,7 @@ declare module 'vue' {
702
703
  readonly useTimeoutPoll: UnwrapRef<typeof import('./core/utils/src/vendors')['useTimeoutPoll']>
703
704
  readonly useTimestamp: UnwrapRef<typeof import('./core/utils/src/vendors')['useTimestamp']>
704
705
  readonly useTitle: UnwrapRef<typeof import('./core/utils/src/vendors')['useTitle']>
706
+ readonly useToggle: UnwrapRef<typeof import('./core/utils/src/vendors')['useToggle']>
705
707
  readonly useTransition: UnwrapRef<typeof import('./core/utils/src/vendors')['useTransition']>
706
708
  readonly useTrunc: UnwrapRef<typeof import('./core/utils/src/math')['useTrunc']>
707
709
  readonly useUrlSearchParams: UnwrapRef<typeof import('./core/utils/src/vendors')['useUrlSearchParams']>
@@ -1126,6 +1128,7 @@ declare module 'vue' {
1126
1128
  const normalizeScale: typeof import('./core/utils/src/currency')['normalizeScale']
1127
1129
  const normalizeString: typeof import('./core/path/src/index')['normalizeString']
1128
1130
  const not: typeof import('./core/utils/src/math')['not']
1131
+ const notNullish: typeof import('./core/utils/src/guards')['notNullish']
1129
1132
  const notUndefined: typeof import('./core/utils/src/guards')['notUndefined']
1130
1133
  const notification: typeof import('../config/notification')['default']
1131
1134
  const notificationsPath: typeof import('./core/path/src/index')['notificationsPath']
@@ -1435,6 +1438,7 @@ declare module 'vue' {
1435
1438
  const useTimeoutPoll: typeof import('./core/utils/src/vendors')['useTimeoutPoll']
1436
1439
  const useTimestamp: typeof import('./core/utils/src/vendors')['useTimestamp']
1437
1440
  const useTitle: typeof import('./core/utils/src/vendors')['useTitle']
1441
+ const useToggle: typeof import('./core/utils/src/vendors')['useToggle']
1438
1442
  const useTransition: typeof import('./core/utils/src/vendors')['useTransition']
1439
1443
  const useTrunc: typeof import('./core/utils/src/math')['useTrunc']
1440
1444
  const useUrlSearchParams: typeof import('./core/utils/src/vendors')['useUrlSearchParams']
@@ -1868,6 +1872,7 @@ declare module 'vue' {
1868
1872
  readonly normalizeScale: UnwrapRef<typeof import('./core/utils/src/currency')['normalizeScale']>
1869
1873
  readonly normalizeString: UnwrapRef<typeof import('./core/path/src/index')['normalizeString']>
1870
1874
  readonly not: UnwrapRef<typeof import('./core/utils/src/math')['not']>
1875
+ readonly notNullish: UnwrapRef<typeof import('./core/utils/src/guards')['notNullish']>
1871
1876
  readonly notUndefined: UnwrapRef<typeof import('./core/utils/src/guards')['notUndefined']>
1872
1877
  readonly notification: UnwrapRef<typeof import('../config/notification')['default']>
1873
1878
  readonly notificationsPath: UnwrapRef<typeof import('./core/path/src/index')['notificationsPath']>
@@ -2177,6 +2182,7 @@ declare module 'vue' {
2177
2182
  readonly useTimeoutPoll: UnwrapRef<typeof import('./core/utils/src/vendors')['useTimeoutPoll']>
2178
2183
  readonly useTimestamp: UnwrapRef<typeof import('./core/utils/src/vendors')['useTimestamp']>
2179
2184
  readonly useTitle: UnwrapRef<typeof import('./core/utils/src/vendors')['useTitle']>
2185
+ readonly useToggle: UnwrapRef<typeof import('./core/utils/src/vendors')['useToggle']>
2180
2186
  readonly useTransition: UnwrapRef<typeof import('./core/utils/src/vendors')['useTransition']>
2181
2187
  readonly useTrunc: UnwrapRef<typeof import('./core/utils/src/math')['useTrunc']>
2182
2188
  readonly useUrlSearchParams: UnwrapRef<typeof import('./core/utils/src/vendors')['useUrlSearchParams']>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
@@ -77,10 +77,6 @@
77
77
  "types": "./dist/generate/lib-entries.d.ts",
78
78
  "import": "./dist/generate/lib-entries.mjs"
79
79
  },
80
- "./generate/package-jsons": {
81
- "types": "./dist/generate/package-jsons.d.ts",
82
- "import": "./dist/generate/package-jsons.mjs"
83
- },
84
80
  "./generate/settings": {
85
81
  "types": "./dist/generate/settings.d.ts",
86
82
  "import": "./dist/generate/settings.mjs"
@@ -2,7 +2,7 @@ import { log } from '@stacksjs/cli'
2
2
  import { projectPath } from '@stacksjs/path'
3
3
  import { del } from '@stacksjs/utils'
4
4
 
5
- log.info('Running clean command...', projectPath())
5
+ log.info('Running clean command...')
6
6
 
7
7
  await del([
8
8
  projectPath('pnpm-lock.yaml'),
@@ -3,15 +3,6 @@ import { runNpmScript } from '@stacksjs/utils'
3
3
  import type { DevOptions } from '@stacksjs/types'
4
4
  import { NpmScript } from '@stacksjs/types'
5
5
 
6
- /**
7
- * An alias of the invoke method.
8
- * @param options
9
- * @returns
10
- */
11
- export async function dev(options: DevOptions) {
12
- return invoke(options)
13
- }
14
-
15
6
  export async function components(options: DevOptions) {
16
7
  log.info('Starting your components dev server...')
17
8
  await runNpmScript(NpmScript.DevComponents, options)
@@ -4,7 +4,7 @@ import { Action, NpmScript } from '@stacksjs/types'
4
4
  import type { GeneratorOptions } from '@stacksjs/types'
5
5
  import { runNpmScript } from '@stacksjs/utils'
6
6
  import { runCommand } from '@stacksjs/cli'
7
- import { frameworkPath } from '@stacksjs/path'
7
+ import { frameworkPath, projectPath } from '@stacksjs/path'
8
8
  import { runAction } from '../helpers'
9
9
 
10
10
  export async function invoke(options?: GeneratorOptions) {
@@ -40,14 +40,14 @@ export async function generate(options: GeneratorOptions) {
40
40
  }
41
41
 
42
42
  export async function libEntries(options: GeneratorOptions) {
43
- const result = await runCommand('tsx .stacks/core/actions/src/generate-package-json.ts', { ...options, verbose: true, cwd: projectPath() })
43
+ const result = await runAction(Action.GeneratePackageJsons, { ...options, verbose: true, cwd: projectPath() })
44
44
 
45
45
  if (result.isErr()) {
46
46
  log.error('There was an error generating your library entry points.', result.error)
47
47
  process.exit()
48
48
  }
49
49
 
50
- log.success('Library entry points were generated successfully')
50
+ log.success('Library entry points generated successfully')
51
51
  }
52
52
 
53
53
  export async function vueCompat(options?: GeneratorOptions) {
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { generateSettings } from '@stacksjs/pages'
3
-
4
- await generateSettings()
2
+ // import { generateSettings } from '@stacksjs/pages'
3
+ //
4
+ // await generateSettings()
@@ -1,6 +1,5 @@
1
1
  import { log } from '@stacksjs/logging'
2
-
3
- // import { kebabCase } from '@stacksjs/strings'
2
+ import { kebabCase } from '@stacksjs/strings'
4
3
  import { libraryEntryPath } from '@stacksjs/path'
5
4
  import { writeTextFile } from '@stacksjs/storage'
6
5
  import { determineResetPreset } from '@stacksjs/utils'
@@ -25,7 +24,7 @@ export async function generateLibEntry(type: LibEntryType) {
25
24
  await createFunctionLibraryEntryPoint()
26
25
  }
27
26
  catch (err) {
28
- log.error('There was an error generating the library entry point.', err)
27
+ log.error('There was an error generating the library entry point', err)
29
28
  process.exit()
30
29
  }
31
30
  }
@@ -38,7 +37,7 @@ export async function createVueLibraryEntryPoint() {
38
37
  data: generateEntryPointData('vue-components'),
39
38
  })
40
39
 
41
- log.success('Created the Vue component library entry point.')
40
+ log.success('Created the Vue component library entry point')
42
41
  }
43
42
 
44
43
  export async function createWebComponentLibraryEntryPoint() {
@@ -49,7 +48,7 @@ export async function createWebComponentLibraryEntryPoint() {
49
48
  data: generateEntryPointData('web-components'),
50
49
  })
51
50
 
52
- log.success('Created Web Component library entry point.')
51
+ log.success('Created Web Component library entry point')
53
52
  }
54
53
 
55
54
  export async function createFunctionLibraryEntryPoint() {
@@ -60,7 +59,7 @@ export async function createFunctionLibraryEntryPoint() {
60
59
  data: generateEntryPointData('functions'),
61
60
  })
62
61
 
63
- log.success('Created Functions library entry point.')
62
+ log.success('Created Functions library entry point')
64
63
  }
65
64
 
66
65
  export function generateEntryPointData(type: 'vue-components' | 'web-components' | 'functions'): string {
@@ -74,9 +73,9 @@ export function generateEntryPointData(type: 'vue-components' | 'web-components'
74
73
 
75
74
  for (const fx of library.functions?.functions) {
76
75
  if (Array.isArray(fx))
77
- arr.push(`export * as ${fx[1]} from '../../../functions/${fx[0]}'`)
76
+ arr.push(`export * as ${fx[1]} from '../../../resources/functions/${fx[0]}'`)
78
77
  else
79
- arr.push(`export * from '../../../functions/${fx}'`)
78
+ arr.push(`export * from '../../../resources/functions/${fx}'`)
80
79
  }
81
80
 
82
81
  // join the array into a string with each element being on a new line
@@ -93,9 +92,9 @@ export function generateEntryPointData(type: 'vue-components' | 'web-components'
93
92
 
94
93
  for (const component of library.vueComponents?.tags.map(tag => tag.name)) {
95
94
  if (Array.isArray(component))
96
- arr.push(`export { default as ${component[1]} } from '../../../components/${component[0]}.vue'`)
95
+ arr.push(`export { default as ${component[1]} } from '../../../resources/components/${component[0]}.vue'`)
97
96
  else
98
- arr.push(`export { default as ${component} } from '../../../components/${component}.vue'`)
97
+ arr.push(`export { default as ${component} } from '../../../resources/components/${component}.vue'`)
99
98
  }
100
99
 
101
100
  // join the array into a string with each element being on a new line
@@ -115,12 +114,12 @@ export function generateEntryPointData(type: 'vue-components' | 'web-components'
115
114
 
116
115
  for (const component of library.webComponents?.tags.map(tag => tag.name)) {
117
116
  if (Array.isArray(component)) {
118
- imports.push(`import ${component[1]} from '../../../components/${component[0]}.vue'`)
117
+ imports.push(`import ${component[1]} from '../../../resources/components/${component[0]}.vue'`)
119
118
  declarations.push(`const ${component[1]}CustomElement = defineCustomElement(${component[1]})`)
120
119
  definitions.push(`customElements.define('${kebabCase(component[1])}', ${component[1]}CustomElement)`)
121
120
  }
122
121
  else {
123
- imports.push(`import ${component} from '../../../components/${component}.vue'`)
122
+ imports.push(`import ${component} from '../../../resources/components/${component}.vue'`)
124
123
  declarations.push(`const ${component}CustomElement = defineCustomElement(${component})`)
125
124
  definitions.push(`customElements.define('${kebabCase(component)}', ${component}CustomElement)`)
126
125
  }
@@ -1,4 +1,4 @@
1
- import storage from '@stacksjs/storage'
1
+ import { storage } from '@stacksjs/storage'
2
2
  import { italic, log, runCommand, runCommands } from '@stacksjs/cli'
3
3
  import { actionsPath, functionsPath } from '@stacksjs/path'
4
4
  import type { ActionOptions, CommandResult } from '@stacksjs/types'
@@ -310,7 +310,7 @@ export default <Model> {
310
310
  name: {
311
311
  type: 'String',
312
312
  validation: validate.string().min(3).max(255),
313
- factory: () => faker.name,
313
+ factory: () => faker.person,
314
314
  },
315
315
  // more fields here
316
316
  },
@@ -2,12 +2,14 @@
2
2
  import { frameworkPath } from '@stacksjs/path'
3
3
  import { runActions } from '@stacksjs/actions'
4
4
  import { Action } from '@stacksjs/types'
5
+ import { log } from '@stacksjs/cli'
6
+ import { app } from '@stacksjs/config'
5
7
 
6
8
  await runActions([
7
- Action.GeneratePackageJsons, // generate the package.json's for each package
9
+ Action.GenerateLibraryEntries, // generates the package/library entry points
8
10
  Action.LintFix, // ensure there are no lint errors
9
11
  // Action.Test, // run the tests
10
12
  Action.Bump, // bump the versions, create the git tag, generate the changelog, commit & push the changes
11
13
  ], { verbose: true, cwd: frameworkPath(), shell: true }) // debug mode needs to be enabled to see the output due to the interactive prompts
12
14
 
13
- // log.success('Successfully released the Stacks framework')
15
+ log.success(`Successfully released ${app.name}`)
@@ -1,29 +1,29 @@
1
- import { log, outro } from '@stacksjs/cli'
2
- import storage from '@stacksjs/storage'
3
- import { determineDebugLevel, loop } from '@stacksjs/utils'
4
- import { frameworkPath, projectPath } from '@stacksjs/path'
5
-
6
- // await runCommand(NpmScript.UpgradeFramework, parseArgs())
7
-
8
- await checkForUncommittedChanges('./.stacks', options)
9
- await downloadFrameworkUpdate(options)
10
-
11
- log.info('Updating framework...')
12
-
13
- const exclude = ['functions/package.json', 'components/vue/package.json', 'components/web/package.json', 'auto-imports.d.ts', 'components.d.ts', 'dist']
14
- await storage.deleteFiles(frameworkPath(), exclude)
15
-
16
- // loop 5 times to make sure all "deep empty" folders are deleted
17
- loop(5, async () => {
18
- await storage.deleteEmptyFolders(frameworkPath())
19
- })
20
-
21
- await storage.copyFolder(frameworkPath(), projectPath('./updates/.stacks'), exclude)
22
-
23
- if (determineDebugLevel(options))
24
- log.info('Cleanup...')
25
-
26
- await storage.deleteFolder(projectPath('updates'))
27
-
28
- outro('Framework updated', { startTime: perf, useSeconds: true })
29
- process.exit()
1
+ // import { log, outro } from '@stacksjs/cli'
2
+ // import { storage } from '@stacksjs/storage'
3
+ // import { determineDebugLevel, loop } from '@stacksjs/utils'
4
+ // import { frameworkPath, projectPath } from '@stacksjs/path'
5
+ //
6
+ // // await runCommand(NpmScript.UpgradeFramework, parseArgs())
7
+ //
8
+ // await checkForUncommittedChanges('./.stacks', options)
9
+ // await downloadFrameworkUpdate(options)
10
+ //
11
+ // log.info('Updating framework...')
12
+ //
13
+ // const exclude = ['functions/package.json', 'components/vue/package.json', 'components/web/package.json', 'auto-imports.d.ts', 'components.d.ts', 'dist']
14
+ // await storage.deleteFiles(frameworkPath(), exclude)
15
+ //
16
+ // // loop 5 times to make sure all "deep empty" folders are deleted
17
+ // loop(5, async () => {
18
+ // await storage.deleteEmptyFolders(frameworkPath())
19
+ // })
20
+ //
21
+ // await storage.copyFolder(frameworkPath(), projectPath('./updates/.stacks'), exclude)
22
+ //
23
+ // if (determineDebugLevel(options))
24
+ // log.info('Cleanup...')
25
+ //
26
+ // await storage.deleteFolder(projectPath('updates'))
27
+ //
28
+ // outro('Framework updated', { startTime: perf, useSeconds: true })
29
+ // process.exit()
@@ -1,10 +1,8 @@
1
- import { ExitCode, parseArgs } from '@stacksjs/cli'
2
- import { Action } from '@stacksjs/types'
3
- import { runAction } from '../helpers'
4
-
5
- const options = parseArgs()
6
- // eslint-disable-next-line no-console
7
- console.log('here is opt', options)
1
+ // import { ExitCode, parseArgs } from '@stacksjs/cli'
2
+ // import { Action } from '@stacksjs/types'
3
+ // import { runAction } from '../helpers'
4
+ //
5
+ // const options = parseArgs()
8
6
 
9
7
  // run all the upgrade actions
10
8
  // if (options?.framework || options?.all)
@@ -13,14 +11,14 @@ console.log('here is opt', options)
13
11
  // if (options?.dependencies || options?.all)
14
12
  // await updateDependencies(options)
15
13
 
16
- if (options?.packageManager || options?.all)
17
- await runAction(Action.UpgradePackageManager, options)
18
-
19
- if (options?.node || options?.all)
20
- await runAction(Action.UpgradeNode, options)
21
-
22
- else
23
- process.exit(ExitCode.InvalidArgument)
14
+ // if (options?.packageManager || options?.all)
15
+ // await runAction(Action.UpgradePackageManager, options)
16
+ //
17
+ // if (options?.node || options?.all)
18
+ // await runAction(Action.UpgradeNode, options)
19
+ //
20
+ // else
21
+ // process.exit(ExitCode.InvalidArgument)
24
22
 
25
23
  // // TODO: also update CI files & configurations, and other files, possibly
26
24
  // // we want this to be smart enough to update only if files that have been updated
@@ -1,4 +1,4 @@
1
- import { parseArgs, runCommand } from '@stacksjs/cli'
2
- import { NpmScript } from '@stacksjs/types'
3
-
4
- await runCommand(NpmScript.UpgradeNode, parseArgs())
1
+ // import { parseArgs, runCommand } from '@stacksjs/cli'
2
+ // import { NpmScript } from '@stacksjs/types'
3
+ //
4
+ // await runCommand(NpmScript.UpgradeNode, parseArgs())
@@ -1,4 +1,4 @@
1
- import { parseArgs, runCommand } from '@stacksjs/cli'
2
- import { NpmScript } from '@stacksjs/types'
3
-
4
- await runCommand(NpmScript.UpgradePackageManager, parseArgs())
1
+ // import { parseArgs, runCommand } from '@stacksjs/cli'
2
+ // import { NpmScript } from '@stacksjs/types'
3
+ //
4
+ // await runCommand(NpmScript.UpgradePackageManager, parseArgs())
@@ -1,5 +1,5 @@
1
1
  import { intro, log, outro, prompt, runCommand, spawn } from '@stacksjs/cli'
2
- import storage from '@stacksjs/storage'
2
+ import { storage } from '@stacksjs/storage'
3
3
  import { determineDebugLevel } from '@stacksjs/utils'
4
4
  import { projectPath } from '@stacksjs/path'
5
5
  import type { UpgradeOptions } from '@stacksjs/types'
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ai",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Stacks Artificial Intelligence.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/alias",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks aliases.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/analytics",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Stacks Analytics. Privacy-friendly.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/arrays",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "The Stacks array utilities.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/auth",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "A more simplistic way to authenticate.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.52.9",
4
+ "version": "0.53.1",
5
5
  "packageManager": "pnpm@8.5.1",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
@@ -1,14 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { runAction } from '@stacksjs/actions'
3
- import { command, execSync, log, runCommand } from '@stacksjs/cli'
4
- import { env, frameworkVersion, isProjectCreated, parseYaml, semver } from '@stacksjs/utils'
3
+ import { command, log } from '@stacksjs/cli'
4
+ import { env, frameworkVersion, installIfVersionMismatch, isProjectCreated } from '@stacksjs/utils'
5
5
  import { projectPath } from '@stacksjs/path'
6
6
  import { Action } from '@stacksjs/types'
7
- import { filesystem } from '@stacksjs/storage'
8
7
  import { build, changelog, clean, commit, create, dev, example, fresh, generate, key, lint, make, migrate, preinstall, prepublish, release, seed, setup, test, upgrade, version } from './commands'
9
8
 
10
9
  const cli = command('buddy')
11
- const { fs } = filesystem
12
10
 
13
11
  // setup global error handlers
14
12
  process.on('uncaughtException', errorHandler)
@@ -16,7 +14,7 @@ process.on('unhandledRejection', errorHandler)
16
14
 
17
15
  async function main() {
18
16
  // the following commands are not dependent on the project being initialized
19
- installIfVersionMismatch()
17
+ await installIfVersionMismatch()
20
18
  await setup(cli)
21
19
  await key(cli)
22
20
 
@@ -69,27 +67,6 @@ async function main() {
69
67
 
70
68
  main()
71
69
 
72
- async function installIfVersionMismatch() {
73
- const dependenciesYaml = fs.readFileSync(projectPath('tea.yaml'), 'utf8')
74
- const dependencies = parseYaml(dependenciesYaml).dependencies
75
-
76
- const requiredNodeVersion = dependencies['nodejs.org']
77
- const requiredPnpmVersion = dependencies['pnpm.io']
78
-
79
- const installedNodeVersion = process.version
80
- const installedPnpmVersion = execSync('pnpm -v').trim()
81
-
82
- if (!semver.satisfies(installedNodeVersion, requiredNodeVersion)) {
83
- log.error(`Installed Node.js version (${installedNodeVersion}) does not satisfy required version (${requiredNodeVersion}). Installing...`)
84
- await runCommand(`tea +nodejs.org${requiredNodeVersion} >/dev/null 2>&1`)
85
- }
86
-
87
- if (!semver.satisfies(installedPnpmVersion, requiredPnpmVersion)) {
88
- log.error(`Installed pnpm version (${installedPnpmVersion}) does not satisfy required version (${requiredPnpmVersion}). Installing...`)
89
- await runCommand(`tea +pnpm.io${requiredPnpmVersion} >/dev/null 2>&1`)
90
- }
91
- }
92
-
93
70
  function errorHandler(error: Error): void {
94
71
  log.error(error)
95
72
  process.exit(1)
@@ -21,7 +21,7 @@ async function fresh(buddy: CLI) {
21
21
  process.exit(ExitCode.FatalError)
22
22
  }
23
23
 
24
- outro('Freshly reinstalled your dependencies.', { startTime: perf, useSeconds: true })
24
+ outro('Freshly reinstalled your dependencies', { startTime: perf, useSeconds: true })
25
25
  process.exit(ExitCode.Success)
26
26
  })
27
27
  }
@@ -23,7 +23,7 @@ async function lint(buddy: CLI) {
23
23
  process.exit()
24
24
  }
25
25
 
26
- outro('Linted your project.', { startTime: perf, useSeconds: true })
26
+ outro('Linted your project', { startTime: perf, useSeconds: true })
27
27
  })
28
28
 
29
29
  buddy
@@ -38,7 +38,7 @@ async function lint(buddy: CLI) {
38
38
  process.exit()
39
39
  }
40
40
 
41
- log.success('Fixed lint errors.')
41
+ log.success('Fixed lint errors')
42
42
  })
43
43
  }
44
44
 
@@ -1,9 +1,6 @@
1
1
  import type { CLI } from '@stacksjs/types'
2
- import { intro, outro } from '@stacksjs/cli'
3
- import { Action } from '@stacksjs/types'
4
- import { runAction } from '@stacksjs/actions'
5
2
 
6
- async function onboarding(buddy: CLI) {
3
+ export async function onboarding(buddy: CLI) {
7
4
  const descriptions = {
8
5
  command: 'Generate Onboarding Pages',
9
6
  verbose: 'Enable verbose output',
@@ -13,16 +10,13 @@ async function onboarding(buddy: CLI) {
13
10
  .command('page:onboarding', descriptions.command)
14
11
  .option('--verbose', descriptions.verbose, { default: false })
15
12
  .action(async () => {
16
- const startTime = await intro('buddy page:onboarding')
17
- const result = await runAction(Action.GenerateOnboarding)
18
-
19
- if (result.isErr()) {
20
- log.error('Something went wrong when generating', result.error as Error)
21
- process.exit()
22
- }
23
-
24
- outro('Pages generated successfully', { startTime })
13
+ console.log('onboarding')
14
+ // const startTime = await intro('buddy page:onboarding')
15
+ // const result = await runAction(Action.GenerateOnboarding)
16
+ //
17
+ // if (result.isErr())
18
+ // process.exit()
19
+ //
20
+ // outro('Pages generated successfully', { startTime })
25
21
  })
26
22
  }
27
-
28
- export { onboarding }
@@ -1,7 +1,4 @@
1
1
  import type { CLI } from '@stacksjs/types'
2
- import { intro, outro } from '@stacksjs/cli'
3
- import { Action } from '@stacksjs/types'
4
- import { runAction } from '@stacksjs/actions'
5
2
 
6
3
  async function setting(buddy: CLI) {
7
4
  const descriptions = {
@@ -13,15 +10,16 @@ async function setting(buddy: CLI) {
13
10
  .command('page:setting', descriptions.command)
14
11
  .option('--verbose', descriptions.verbose, { default: false })
15
12
  .action(async () => {
16
- const startTime = await intro('buddy page:setting')
17
- const result = await runAction(Action.GenerateSettings)
18
-
19
- if (result.isErr()) {
20
- log.error('Something went wrong when generating', result.error as Error)
21
- process.exit()
22
- }
23
-
24
- outro('Pages generated successfully', { startTime })
13
+ console.log('Generating setting pages...')
14
+ // const startTime = await intro('buddy page:setting')
15
+ // const result = await runAction(Action.GenerateSettings)
16
+ //
17
+ // if (result.isErr()) {
18
+ // log.error('Something went wrong when generating', result.error as Error)
19
+ // process.exit()
20
+ // }
21
+ //
22
+ // outro('Pages generated successfully', { startTime })
25
23
  })
26
24
  }
27
25