@stacksjs/actions 0.61.24 → 0.63.0

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 (99) hide show
  1. package/dist/add.js +3 -0
  2. package/dist/add.js.map +10 -0
  3. package/dist/build/component-libs.js +3 -0
  4. package/dist/build/component-libs.js.map +10 -0
  5. package/dist/build/core.js +3 -0
  6. package/dist/build/core.js.map +10 -0
  7. package/dist/build/stacks.js +3 -0
  8. package/dist/build/stacks.js.map +10 -0
  9. package/dist/build.js +6 -4
  10. package/dist/build.js.map +14 -0
  11. package/dist/bump.js +7 -4
  12. package/dist/bump.js.map +10 -0
  13. package/dist/changelog.js +3 -0
  14. package/dist/changelog.js.map +10 -0
  15. package/dist/clean.js +3 -0
  16. package/dist/clean.js.map +10 -0
  17. package/dist/commit.js +3 -0
  18. package/dist/commit.js.map +10 -0
  19. package/dist/copy-types.js +3 -0
  20. package/dist/copy-types.js.map +10 -0
  21. package/dist/database/seed.js +3 -0
  22. package/dist/database/seed.js.map +10 -0
  23. package/dist/deploy/index.js +14 -5
  24. package/dist/deploy/index.js.map +10 -0
  25. package/dist/dev/components.js +3 -0
  26. package/dist/dev/components.js.map +10 -0
  27. package/dist/dev/docs.js +3 -0
  28. package/dist/dev/docs.js.map +10 -0
  29. package/dist/dev/index.js +4 -2
  30. package/dist/dev/index.js.map +11 -0
  31. package/dist/examples.js +3 -0
  32. package/dist/examples.js.map +10 -0
  33. package/dist/fresh.js +3 -0
  34. package/dist/fresh.js.map +10 -0
  35. package/dist/generate/component-meta.js +3 -0
  36. package/dist/generate/component-meta.js.map +11 -0
  37. package/dist/generate/ide-helpers.js +5 -2
  38. package/dist/generate/ide-helpers.js.map +12 -0
  39. package/dist/generate/index.js +6 -4
  40. package/dist/generate/index.js.map +13 -0
  41. package/dist/generate/lib-entries.js +3 -0
  42. package/dist/generate/lib-entries.js.map +12 -0
  43. package/dist/generate/vscode-custom-data.js +5 -2
  44. package/dist/generate/vscode-custom-data.js.map +12 -0
  45. package/dist/helpers/component-meta.js +3 -0
  46. package/dist/helpers/component-meta.js.map +10 -0
  47. package/dist/helpers/lib-entries.js +3 -0
  48. package/dist/helpers/lib-entries.js.map +11 -0
  49. package/dist/helpers/package-json.js +3 -0
  50. package/dist/helpers/package-json.js.map +11 -0
  51. package/dist/helpers/utils.js +4 -2
  52. package/dist/helpers/utils.js.map +10 -0
  53. package/dist/helpers/vscode-custom-data.js +5 -2
  54. package/dist/helpers/vscode-custom-data.js.map +11 -0
  55. package/dist/index.js +21 -5
  56. package/dist/index.js.map +18 -0
  57. package/dist/key-generate.js +3 -0
  58. package/dist/key-generate.js.map +10 -0
  59. package/dist/lint/fix.js +3 -0
  60. package/dist/lint/fix.js.map +10 -0
  61. package/dist/lint/index.js +3 -0
  62. package/dist/lint/index.js.map +10 -0
  63. package/dist/make.js +3 -0
  64. package/dist/make.js.map +10 -0
  65. package/dist/prepublish.js +3 -0
  66. package/dist/prepublish.js.map +10 -0
  67. package/dist/release.js +21 -5
  68. package/dist/release.js.map +19 -0
  69. package/dist/test/coverage.js +3 -0
  70. package/dist/test/coverage.js.map +10 -0
  71. package/dist/test/feature.js +3 -0
  72. package/dist/test/feature.js.map +10 -0
  73. package/dist/test/ui.js +3 -0
  74. package/dist/test/ui.js.map +10 -0
  75. package/dist/test/unit.js +3 -0
  76. package/dist/test/unit.js.map +10 -0
  77. package/dist/test.js +3 -0
  78. package/dist/test.js.map +10 -0
  79. package/dist/typecheck.js +3 -0
  80. package/dist/typecheck.js.map +10 -0
  81. package/dist/types.js +3 -0
  82. package/dist/types.js.map +10 -0
  83. package/dist/upgrade/dependencies.js +3 -0
  84. package/dist/upgrade/dependencies.js.map +9 -0
  85. package/dist/upgrade/framework.js +3 -0
  86. package/dist/upgrade/framework.js.map +9 -0
  87. package/dist/upgrade/index.js +4 -2
  88. package/dist/upgrade/index.js.map +11 -0
  89. package/dist/upgrade.js +4 -1
  90. package/dist/upgrade.js.map +10 -0
  91. package/package.json +3 -3
  92. package/src/action.ts +18 -9
  93. package/src/build/server.ts +1 -1
  94. package/src/bump.ts +5 -5
  95. package/src/cdn/invalidate-cache.ts +1 -1
  96. package/src/deploy/index.ts +14 -6
  97. package/src/files/watch.ts +8 -0
  98. package/src/helpers/utils.ts +4 -5
  99. package/src/orm/generate-model.ts +814 -467
@@ -3,9 +3,10 @@ import { log, runCommand } from '@stacksjs/cli'
3
3
  import { config } from '@stacksjs/config'
4
4
  import { path as p } from '@stacksjs/path'
5
5
  import { storage } from '@stacksjs/storage'
6
+ import type { Subprocess } from '@stacksjs/types'
6
7
 
7
8
  await runCommand('bun run build', {
8
- cwd: p.corePath(),
9
+ cwd: p.frameworkPath(),
9
10
  })
10
11
 
11
12
  if (storage.hasFiles(p.projectPath('docs'))) {
@@ -17,7 +18,7 @@ if (storage.hasFiles(p.projectPath('docs'))) {
17
18
  if (config.app.docMode !== true) {
18
19
  // when in docMode, we can disregard building views
19
20
  await runCommand('bun run build', {
20
- cwd: p.frameworkPath('views'),
21
+ cwd: p.frameworkPath('views/web'),
21
22
  })
22
23
  }
23
24
 
@@ -26,7 +27,7 @@ if (config.app.docMode !== true) {
26
27
  // })
27
28
 
28
29
  await runCommand('bun build.ts', {
29
- cwd: p.frameworkPath('server'),
30
+ cwd: p.frameworkCloudPath(),
30
31
  })
31
32
 
32
33
  await runCommand('bun zip.ts', {
@@ -35,9 +36,16 @@ await runCommand('bun zip.ts', {
35
36
 
36
37
  log.info('Preparing Deployment...')
37
38
 
38
- const profile = process.env.AWS_PROFILE || 'stacks'
39
+ const profile = process.env.AWS_PROFILE ?? 'stacks'
39
40
 
40
- // TODO: ensure we check whether cdk bootstrap needs to be run
41
- await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
41
+ const result = await runCommand(`npx cdk deploy --require-approval never --profile="${profile}"`, {
42
42
  cwd: p.frameworkCloudPath(),
43
43
  })
44
+
45
+ if (result.isErr()) {
46
+ log.error(result.error)
47
+ process.exit(ExitCode.FatalError)
48
+ }
49
+
50
+ const t = result.value as Subprocess
51
+ const x = await t.exited
@@ -0,0 +1,8 @@
1
+ import { path } from '@stacksjs/path'
2
+ import { fsWatch as watch } from '@stacksjs/storage'
3
+
4
+ watch(path.userModelsPath(), async (event, filename) => {
5
+ await Bun.$`bun ../orm/generate-model.ts`
6
+
7
+ console.log('generated orm models')
8
+ })
@@ -3,9 +3,8 @@ import { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'
3
3
  import { err } from '@stacksjs/error-handling'
4
4
  import { log } from '@stacksjs/logging'
5
5
  import * as p from '@stacksjs/path'
6
- import { glob, storage } from '@stacksjs/storage'
6
+ import { glob } from '@stacksjs/storage'
7
7
  import type { ActionOptions } from '@stacksjs/types'
8
- import { Glob } from 'bun'
9
8
 
10
9
  type ActionPath = string // TODO: narrow this by automating its generation
11
10
  type ActionName = string // TODO: narrow this by automating its generation
@@ -21,16 +20,16 @@ type Action = ActionPath | ActionName | string
21
20
  export async function runAction(action: Action, options?: ActionOptions) {
22
21
  // check if action is a file anywhere in ./app/Actions/**/*.ts
23
22
  // if it is, return and await the action
24
- const glob = new Glob('**/*.ts')
23
+ const glob = new Bun.Glob('**/*.ts')
25
24
  const scanOptions = { cwd: p.userActionsPath(), onlyFiles: true }
26
25
 
27
26
  for await (const file of glob.scan(scanOptions)) {
28
27
  log.debug('file', file)
29
28
  if (file === `${action}.ts` || file.endsWith(`${action}.ts`))
30
- return ((await import(p.userActionsPath(file))).default as ActionType).handle()
29
+ return ((await import(/* @vite-ignore */ p.userActionsPath(file))).default as ActionType).handle()
31
30
 
32
31
  // if a custom model name is used, we need to check for it
33
- const a = await import(p.userActionsPath(file))
32
+ const a = await import(/* @vite-ignore */ p.userActionsPath(file))
34
33
  if (a.name === action) return await a.handle()
35
34
  }
36
35