@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.
- package/dist/add.js +3 -0
- package/dist/add.js.map +10 -0
- package/dist/build/component-libs.js +3 -0
- package/dist/build/component-libs.js.map +10 -0
- package/dist/build/core.js +3 -0
- package/dist/build/core.js.map +10 -0
- package/dist/build/stacks.js +3 -0
- package/dist/build/stacks.js.map +10 -0
- package/dist/build.js +6 -4
- package/dist/build.js.map +14 -0
- package/dist/bump.js +7 -4
- package/dist/bump.js.map +10 -0
- package/dist/changelog.js +3 -0
- package/dist/changelog.js.map +10 -0
- package/dist/clean.js +3 -0
- package/dist/clean.js.map +10 -0
- package/dist/commit.js +3 -0
- package/dist/commit.js.map +10 -0
- package/dist/copy-types.js +3 -0
- package/dist/copy-types.js.map +10 -0
- package/dist/database/seed.js +3 -0
- package/dist/database/seed.js.map +10 -0
- package/dist/deploy/index.js +14 -5
- package/dist/deploy/index.js.map +10 -0
- package/dist/dev/components.js +3 -0
- package/dist/dev/components.js.map +10 -0
- package/dist/dev/docs.js +3 -0
- package/dist/dev/docs.js.map +10 -0
- package/dist/dev/index.js +4 -2
- package/dist/dev/index.js.map +11 -0
- package/dist/examples.js +3 -0
- package/dist/examples.js.map +10 -0
- package/dist/fresh.js +3 -0
- package/dist/fresh.js.map +10 -0
- package/dist/generate/component-meta.js +3 -0
- package/dist/generate/component-meta.js.map +11 -0
- package/dist/generate/ide-helpers.js +5 -2
- package/dist/generate/ide-helpers.js.map +12 -0
- package/dist/generate/index.js +6 -4
- package/dist/generate/index.js.map +13 -0
- package/dist/generate/lib-entries.js +3 -0
- package/dist/generate/lib-entries.js.map +12 -0
- package/dist/generate/vscode-custom-data.js +5 -2
- package/dist/generate/vscode-custom-data.js.map +12 -0
- package/dist/helpers/component-meta.js +3 -0
- package/dist/helpers/component-meta.js.map +10 -0
- package/dist/helpers/lib-entries.js +3 -0
- package/dist/helpers/lib-entries.js.map +11 -0
- package/dist/helpers/package-json.js +3 -0
- package/dist/helpers/package-json.js.map +11 -0
- package/dist/helpers/utils.js +4 -2
- package/dist/helpers/utils.js.map +10 -0
- package/dist/helpers/vscode-custom-data.js +5 -2
- package/dist/helpers/vscode-custom-data.js.map +11 -0
- package/dist/index.js +21 -5
- package/dist/index.js.map +18 -0
- package/dist/key-generate.js +3 -0
- package/dist/key-generate.js.map +10 -0
- package/dist/lint/fix.js +3 -0
- package/dist/lint/fix.js.map +10 -0
- package/dist/lint/index.js +3 -0
- package/dist/lint/index.js.map +10 -0
- package/dist/make.js +3 -0
- package/dist/make.js.map +10 -0
- package/dist/prepublish.js +3 -0
- package/dist/prepublish.js.map +10 -0
- package/dist/release.js +21 -5
- package/dist/release.js.map +19 -0
- package/dist/test/coverage.js +3 -0
- package/dist/test/coverage.js.map +10 -0
- package/dist/test/feature.js +3 -0
- package/dist/test/feature.js.map +10 -0
- package/dist/test/ui.js +3 -0
- package/dist/test/ui.js.map +10 -0
- package/dist/test/unit.js +3 -0
- package/dist/test/unit.js.map +10 -0
- package/dist/test.js +3 -0
- package/dist/test.js.map +10 -0
- package/dist/typecheck.js +3 -0
- package/dist/typecheck.js.map +10 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +10 -0
- package/dist/upgrade/dependencies.js +3 -0
- package/dist/upgrade/dependencies.js.map +9 -0
- package/dist/upgrade/framework.js +3 -0
- package/dist/upgrade/framework.js.map +9 -0
- package/dist/upgrade/index.js +4 -2
- package/dist/upgrade/index.js.map +11 -0
- package/dist/upgrade.js +4 -1
- package/dist/upgrade.js.map +10 -0
- package/package.json +3 -3
- package/src/action.ts +18 -9
- package/src/build/server.ts +1 -1
- package/src/bump.ts +5 -5
- package/src/cdn/invalidate-cache.ts +1 -1
- package/src/deploy/index.ts +14 -6
- package/src/files/watch.ts +8 -0
- package/src/helpers/utils.ts +4 -5
- package/src/orm/generate-model.ts +814 -467
package/src/deploy/index.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
|
39
|
+
const profile = process.env.AWS_PROFILE ?? 'stacks'
|
|
39
40
|
|
|
40
|
-
|
|
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
|
package/src/helpers/utils.ts
CHANGED
|
@@ -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
|
|
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
|
|