Skip to content

Commit 1926982

Browse files
committed
chore: wip
1 parent 2eb8728 commit 1926982

File tree

9 files changed

+18
-10
lines changed

9 files changed

+18
-10
lines changed

bun.lockb

24 Bytes
Binary file not shown.

storage/framework/core/cloud/src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export async function getJumpBoxInstanceId(name?: string) {
160160
],
161161
})
162162

163-
if (data.Reservations?.[0].Instances?.[0]) return data.Reservations[0].Instances[0].InstanceId
163+
if (data.Reservations?.[0]?.Instances?.[0]) return data.Reservations[0].Instances[0].InstanceId
164164

165165
return undefined
166166
}
@@ -537,7 +537,7 @@ export async function getJumpBoxSecurityGroupName() {
537537
const ec2 = new EC2({ region: 'us-east-1' })
538538
const data = await ec2.describeInstances({ InstanceIds: [jumpBoxId] })
539539

540-
if (data.Reservations?.[0].Instances?.[0]) {
540+
if (data.Reservations?.[0]?.Instances?.[0]) {
541541
const instance = data.Reservations[0].Instances[0]
542542
const securityGroups = instance.SecurityGroups
543543

@@ -551,7 +551,7 @@ export async function getSecurityGroupFromInstanceId(instanceId: string) {
551551
const ec2 = new EC2({ region: 'us-east-1' })
552552
const data = await ec2.describeInstances({ InstanceIds: [instanceId] })
553553

554-
if (data.Reservations?.[0].Instances?.[0]) {
554+
if (data.Reservations?.[0]?.Instances?.[0]) {
555555
const instance = data.Reservations[0].Instances[0]
556556
const securityGroups = instance.SecurityGroups
557557

storage/framework/core/env/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const envStructure = Object.entries(env).reduce((acc, [key, value]) => {
4444
if (typeof value === 'object') {
4545
const schemaNameSymbol = Symbol.for('schema_name')
4646
const schemaName = value[schemaNameSymbol]
47-
log.debug('value', value)
48-
log.debug('schemaName', schemaName)
47+
// log.debug('value', value)
48+
// log.debug('schemaName', schemaName)
4949

5050
if (schemaName === 'vine.string') {
5151
validatorType = schema.string()

storage/framework/core/logging/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const result = await Bun.build({
1010
format: 'esm',
1111
target: 'bun',
1212

13-
external: ['@stacksjs/cli', '@stacksjs/config', '@stacksjs/error-handling', '@stacksjs/path', '@stacksjs/types'],
13+
external: ['@stacksjs/cli', '@stacksjs/config', '@stacksjs/error-handling', '@stacksjs/path', '@stacksjs/types', '@stacksjs/validation'],
1414
})
1515

1616
await outro({

storage/framework/core/logging/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@stacksjs/cli": "workspace:*",
4444
"@stacksjs/config": "workspace:*",
4545
"@stacksjs/error-handling": "workspace:*",
46+
"@stacksjs/validation": "workspace:*",
4647
"consola": "^3.2.3"
4748
},
4849
"devDependencies": {

storage/framework/core/logging/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { buddyOptions, prompt as getPrompt } from '@stacksjs/cli'
66
import { handleError } from '@stacksjs/error-handling'
77
import { logsPath } from '@stacksjs/path'
88
import { ExitCode } from '@stacksjs/types'
9+
import { isString } from '@stacksjs/validation'
910
import { consola, createConsola } from 'consola'
1011

1112
export async function logLevel() {
@@ -105,7 +106,9 @@ export const log: Log = {
105106
return await writeToLogFile(`DEBUG: ${arg}`)
106107

107108
logger.debug(arg)
108-
await writeToLogFile(`DEBUG: ${arg}`)
109+
110+
if (isString(arg)) await writeToLogFile(`DEBUG: ${arg}`)
111+
else await writeToLogFile(`DEBUG: ${JSON.stringify(arg)}`)
109112
},
110113

111114
async start(...arg: any) {

storage/framework/server/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ COPY --from=prerelease /usr/src/app/index.ts ./index.ts
5151
COPY --from=prerelease /usr/src/app/tsconfig.json ./tsconfig.json
5252
COPY --from=prerelease /usr/src/app/package.json ./package.json
5353

54+
# Add volume for logs
55+
VOLUME ["/mnt/efs"]
56+
5457
# run the app
5558
USER bun
5659
EXPOSE 3000/tcp

storage/framework/server/dev

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ DOCS_DIR="$PROJECT_ROOT/docs"
1313
ROUTES_DIR="$PROJECT_ROOT/routes"
1414

1515
if [ "$1" = "local" ]; then
16-
APP_ENV="local"
16+
ENV="local"
1717
else
18-
APP_ENV="remote" # Default to remote because we are using EFS
18+
ENV="remote" # Default to remote because we are using EFS
1919
fi
2020

21-
if [ "$APP_ENV" != "local" ]; then
21+
if [ "$ENV" != "local" ]; then
2222
STORAGE_DIR="/mnt/efs" # Use EFS mount for non-local environments
2323
else # Local environment
2424
STORAGE_DIR="$PROJECT_ROOT/storage"

storage/framework/server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"version": "0.58.56",
55
"scripts": {
66
"dev": "./dev local",
7+
"dev:container": "docker run -d -p 3000:3000 stacks",
78
"build": "bun build.ts"
89
},
910
"dependencies": {

0 commit comments

Comments
 (0)