Skip to content

Commit e605540

Browse files
committed
chore: wip
1 parent ad750b6 commit e605540

File tree

3 files changed

+32
-18
lines changed

3 files changed

+32
-18
lines changed

storage/framework/core/actions/src/orm/generate-model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ await initiateModelGeneration()
2323
await setKyselyTypes()
2424

2525
async function generateApiRoutes(modelFiles: string[]) {
26-
const file = Bun.file(path.frameworkPath(`orm/routes`))
26+
const file = Bun.file(path.frameworkPath(`orm/routes.ts`))
2727
const writer = file.writer()
2828
let routeString = `import { route } from '@stacksjs/router'\n\n\n`
2929

@@ -489,7 +489,7 @@ async function deleteExistingModels(modelStringFile?: string) {
489489
}
490490

491491
async function deleteExistingOrmActions(modelStringFile?: string) {
492-
const routes = path.frameworkPath(`orm/routes`)
492+
const routes = path.frameworkPath(`orm/routes.ts`)
493493
if (fs.existsSync(routes)) await Bun.$`rm ${routes}`
494494

495495
if (modelStringFile) {

storage/framework/orm/routes

Lines changed: 0 additions & 11 deletions
This file was deleted.

storage/framework/server/src/utils.ts

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import process from 'node:process'
22
import { log, runCommand } from '@stacksjs/cli'
33
import { app } from '@stacksjs/config'
4-
import { frameworkCloudPath, frameworkPath, projectPath } from '@stacksjs/path'
5-
import { hasFiles } from '@stacksjs/storage'
4+
import { path, frameworkCloudPath, frameworkPath, projectPath } from '@stacksjs/path'
5+
import { fs, hasFiles } from '@stacksjs/storage'
66
import { slug } from '@stacksjs/strings'
77
import { $ } from 'bun'
88

@@ -36,12 +36,15 @@ export async function buildDockerImage() {
3636

3737
// delete old CDK relating files, to always build fresh
3838
log.info('Deleting old CDK files...')
39-
log.debug('Deleting old cdk.out ...')
39+
log.info('Deleting old cdk.out ...')
4040
await runCommand(`rm -rf ${frameworkCloudPath('cdk.out/')}`)
41-
log.debug('Deleting old CDK context file...')
41+
log.success('Deleted old cdk.out')
42+
log.info('Deleting old CDK context file...')
4243
await runCommand(`rm -rf ${frameworkCloudPath('cdk.context.json')}`)
43-
log.debug('Deleting old dist.zip file...')
44+
log.success('Deleted old cdk.context.json')
45+
log.info('Deleting old dist.zip file...')
4446
await runCommand(`rm -rf ${frameworkCloudPath('dist.zip')}`)
47+
log.success('Deleted old dist.zip')
4548

4649
log.info('Copying project files...')
4750
log.info('Copying config files...')
@@ -53,6 +56,28 @@ export async function buildDockerImage() {
5356
log.info('Copying storage files...')
5457
await cleanCopy(projectPath('storage'), frameworkPath('server/storage'))
5558
log.success('Copied storage files')
59+
60+
// move files out of the frameworkPath('server/storage/dist') folder to the frameworkPath('server/storage') folder
61+
if (fs.existsSync(frameworkPath('server/storage/dist'))) {
62+
log.info('Moving files...')
63+
const sourceDir = frameworkPath('server/storage/dist')
64+
const targetDir = frameworkPath('server/storage')
65+
66+
// Read all items in the source directory
67+
const items = await fs.readdir(sourceDir)
68+
69+
// Move each item to the target directory
70+
for (const item of items) {
71+
const srcPath = path.join(sourceDir, item)
72+
const destPath = path.join(targetDir, item)
73+
await fs.move(srcPath, destPath, { overwrite: true })
74+
}
75+
76+
// Remove the now-empty dist folder
77+
await fs.remove(sourceDir)
78+
log.success('Moved files')
79+
}
80+
5681
log.info('Copying .env file...')
5782
await cleanCopy(projectPath('.env'), frameworkPath('server/.env'))
5883
log.success('Copied .env file')

0 commit comments

Comments
 (0)