Skip to content

Commit c4d734c

Browse files
committed
chore: wip
1 parent d4c203f commit c4d734c

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

app/Models/User.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
autoIncrement: true, // defaults to true
1010

1111
traits: {
12-
authenticatable: true, // defaults to false
12+
useAuth: true, // defaults to false
1313
useTimestamps: true, // defaults to true
1414
useSeeder: { // defaults to a count of 10
1515
count: 10,

storage/framework/core/cli/src/exec.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ export async function exec(command: string | string[], options?: CliOptions): Pr
4343
detached: options?.background || false,
4444
cwd: options?.cwd || import.meta.dir,
4545
// env: { ...e, ...options?.env },
46-
onExit(_subprocess, exitCode, _signalCode, _error) {
47-
if (exitCode && exitCode !== ExitCode.Success)
48-
process.exit(exitCode)
46+
onExit(subprocess, exitCode, signalCode, error) {
47+
exitHandler('spawn', subprocess, exitCode, signalCode, error)
4948
},
5049
})
5150

@@ -103,12 +102,26 @@ export async function execSync(command: string | string[], options?: CliOptions)
103102
stderr: options?.stderr ?? 'inherit',
104103
cwd: options?.cwd ?? import.meta.dir,
105104
// env: { ...Bun.env, ...options?.env },
106-
onExit(_subprocess, exitCode, _signalCode, _error) {
107-
// console.log('onExit', { subprocess, exitCode, signalCode, error })
108-
if (exitCode !== ExitCode.Success && exitCode)
109-
process.exit(exitCode)
105+
onExit(subprocess, exitCode, signalCode, error) {
106+
exitHandler('spawnSync', subprocess, exitCode, signalCode, error)
110107
},
111108
})
112109

113110
return proc.stdout.toString()
114111
}
112+
113+
// @ts-expect-error - missing types is okay here but can be improved later on
114+
function exitHandler(type: 'spawn' | 'spawnSync', subprocess, exitCode, signalCode, error) {
115+
log.debug(`exitHandler: ${type}`)
116+
log.debug('subprocess', subprocess)
117+
log.debug('exitCode', exitCode)
118+
log.debug('signalCode', signalCode)
119+
120+
if (error) {
121+
log.error(error)
122+
process.exit(ExitCode.FatalError)
123+
}
124+
125+
if (exitCode !== ExitCode.Success && exitCode)
126+
process.exit(exitCode)
127+
}

storage/framework/core/error-handling/build.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ await Bun.build({
99
external: [
1010
'@stacksjs/cli',
1111
'@stacksjs/path',
12-
'@stacksjs/storage',
1312
],
1413

1514
plugins: [

storage/framework/core/error-handling/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,11 @@
4949
"peerDependencies": {
5050
"@stacksjs/cli": "workspace:*",
5151
"@stacksjs/path": "workspace:*",
52-
"@stacksjs/storage": "workspace:*",
5352
"@stacksjs/types": "workspace:*"
5453
},
5554
"dependencies": {
5655
"@stacksjs/cli": "workspace:*",
5756
"@stacksjs/path": "workspace:*",
58-
"@stacksjs/storage": "workspace:*",
5957
"@stacksjs/types": "workspace:*",
6058
"neverthrow": "^6.1.0"
6159
},

storage/framework/core/error-handling/src/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dirname, logsPath } from '@stacksjs/path'
2-
import { fs } from '@stacksjs/storage'
2+
import fs from 'fs-extra'
33

44
interface ErrorOptions {
55
silent?: boolean

storage/framework/docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'vitepress'
2-
import { alias } from '@stacksjs/alias'
32
import { path as p } from '@stacksjs/path'
43
import { pwaDocs as pwa } from '@stacksjs/docs'
54
import { server } from '@stacksjs/server'
65
import { transformerTwoslash } from 'vitepress-plugin-twoslash'
6+
import { alias } from '@stacksjs/alias'
77
import { withPwa } from '@vite-pwa/vitepress'
88
import userConfig from '../../../../config/docs'
99
import { analyticsHead, faviconHead } from './head'

0 commit comments

Comments
 (0)