Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
chore: wip

chore: wip

chore: wip
  • Loading branch information
chrisbbreuer committed Feb 7, 2024
1 parent 4c8e929 commit 916e3b1
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 22 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ jobs:
- name: Install dependencies
run: bun install

- name: Set Application Key
run: bun buddy key:generate

- name: Typecheck
run: bun buddy test:types

Expand Down Expand Up @@ -111,9 +108,6 @@ jobs:
- name: Install Dependencies
run: bun install

- name: Set Application Key
run: bun buddy key:generate

- name: Test Suite
run: bun --bun run test

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ jobs:
- name: Install Dependencies
run: bun install

- name: Set Application Key
run: bun buddy key:generate

- name: Prepublish # these packages are required for the "Publish framework" step
run: bunx pnpm --filter='./storage/framework' build

Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion storage/framework/core/env/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Infer, VineBoolean, VineEnum, VineNumber, VineString } from '@stacksjs/validation'
import { validator } from '@stacksjs/validation'
import env from '../../../../../config/env'
import env from 'config/env'
import type { EnvKey } from '../../../env'

// import type { Validate } from '@stacksjs/validation'
Expand Down
2 changes: 2 additions & 0 deletions storage/framework/server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
bootstrap
*bun-build
app
routes
config
env.ts
20 changes: 14 additions & 6 deletions storage/framework/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ RUN cd /temp/prod && bun install
# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
COPY --from=install /temp/dev/node_modules ./node_modules
COPY ./app ./app
COPY ./config ./config
COPY ./routes ./routes
COPY ./index.ts ./index.ts
COPY ./package.json ./package.json
COPY ./tsconfig.json ./tsconfig.json

# [optional] tests & build
# ENV NODE_ENV=production
Expand All @@ -35,10 +40,13 @@ COPY . .

# copy production dependencies and source code into final image
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/index.ts .
COPY --from=prerelease /usr/src/app/package.json .
COPY --from=prerelease /usr/src/app/routes .
COPY --from=install /temp/prod/node_modules ./node_modules
COPY --from=prerelease /usr/src/app/index.ts ./index.ts
COPY --from=prerelease /usr/src/app/tsconfig.json ./tsconfig.json
COPY --from=prerelease /usr/src/app/package.json ./package.json
COPY --from=prerelease /usr/src/app/routes ./routes
COPY --from=prerelease /usr/src/app/config ./config
COPY --from=prerelease /usr/src/app/app ./app

# run the app
USER bun
Expand Down
18 changes: 16 additions & 2 deletions storage/framework/server/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@ else {
log.info('Using default server configuration')
}

await runCommand(`cp -r ../../../config ./config`, {
await runCommand(`rm -rf ${frameworkPath('server/config')}/*`, {
cwd: frameworkPath('server'),
})
await runCommand(`cp -r ../../../routes ./routes`, {
await runCommand(`cp -r ${projectPath('config')} ${frameworkPath('server/config')}`, {
cwd: frameworkPath('server'),
})

await runCommand(`rm -rf ${frameworkPath('server/routes')}/*`, {
cwd: frameworkPath('server'),
})
await runCommand(`cp -r ${projectPath('routes')} ${frameworkPath('server/routes')}`, {
cwd: frameworkPath('server'),
})

await runCommand(`rm -rf ${frameworkPath('server/app')}/*`, {
cwd: frameworkPath('server'),
})
await runCommand(`cp -r ${projectPath('app')} ${frameworkPath('server/app')}`, {
cwd: frameworkPath('server'),
})

Expand Down
4 changes: 3 additions & 1 deletion storage/framework/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ if (process.env.QUEUE_WORKER) {
if (!process.env.JOB)
throw new Error('Missing JOB environment variable')

const jobModule = await import(p.jobsPath('DummyJob'))
const jobModule = await import('./app/Jobs/DummyJob.ts')
// eslint-disable-next-line no-console
console.log('Running job', process.env.JOB)
await jobModule.default.handle()
process.exit(0)
}
Expand Down
6 changes: 3 additions & 3 deletions storage/framework/server/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "stacks-cloud",
"type": "module",
"version": "0.58.28",
"version": "0.58.55",
"scripts": {
"build": "bun build.ts"
},
"dependencies": {
"@stacksjs/path": "^0.58.54",
"@stacksjs/router": "^0.58.54",
"@stacksjs/queue": "^0.58.55",
"@stacksjs/router": "^0.58.55",
"aws4fetch": "^1.0.17"
}
}
50 changes: 50 additions & 0 deletions storage/framework/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"compilerOptions": {
"incremental": true,
"target": "esnext",
"jsx": "preserve",
"lib": [
"esnext"
],
"moduleDetection": "force",
"baseUrl": ".",
"module": "esnext",
"moduleResolution": "bundler",
"paths": {
"@stacksjs/*": ["../core/*/src"],
"stacks/*": ["../core/*/src"],
"buddy": ["../core/buddy/src/index.ts"],
"buddy/*": ["../core/buddy/src/*"],
"config/*": ["./config/*"],
"../../../env": ["./env.ts"]
},
"resolveJsonModule": true,
"types": [
"vite/client",
// "vue/ref-macros",
"vite-plugin-pages/client",
"vite-plugin-pwa/client",
"vite-plugin-vue-layouts/client",
"@intlify/unplugin-vue-i18n/messages"
],
"allowImportingTsExtensions": true,
"allowJs": true,
"strict": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./dist/types",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"skipLibCheck": true
},
"include": [
"./*.ts",
"./*.d.ts"
]
}

0 comments on commit 916e3b1

Please sign in to comment.