Skip to content

Commit 824cf50

Browse files
committed
chore: wip
1 parent 1bf22c3 commit 824cf50

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

storage/framework/core/buddy/src/commands/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export function generate(buddy: CLI) {
151151
try {
152152
await generateModelFiles()
153153

154-
outro('Generated model files', {
154+
outro('Generated Model files', {
155155
startTime: perf,
156156
useSeconds: true,
157157
})

storage/framework/core/orm/src/utils.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { generator, parser, traverse } from '@stacksjs/build'
2-
import { log } from '@stacksjs/logging'
2+
import { italic, log } from '@stacksjs/cli'
33
import { path } from '@stacksjs/path'
44
import { fs, glob } from '@stacksjs/storage'
5-
import { plural, singular, snakeCase } from '@stacksjs/strings'
5+
import { pascalCase, plural, singular, snakeCase } from '@stacksjs/strings'
66
import type { Attributes, FieldArrayElement, Model, ModelElement, RelationConfig } from '@stacksjs/types'
7+
import { isString } from '@stacksjs/validation'
78

89
type ModelPath = string
910

@@ -554,7 +555,7 @@ export async function generateApiRoutes(modelFiles: string[]) {
554555
let routeString = `import { route } from '@stacksjs/router'\n\n\n`
555556

556557
for (const modelFile of modelFiles) {
557-
log.info(`Processing model file: ${modelFile}`)
558+
log.info(`Generating API Routes for: ${italic(modelFile)}`)
558559
let middlewareString = ''
559560
const model = (await import(modelFile)).default as Model
560561
const modelName = getModelName(model, modelFile)
@@ -634,9 +635,9 @@ export async function deleteExistingModels(modelStringFile?: string) {
634635
await Promise.all(
635636
modelPaths.map(async (modelPath) => {
636637
if (fs.existsSync(modelPath)) {
637-
log.info(`Deleting Model: ${modelPath}`)
638+
log.info(`Deleting Model: ${italic(modelPath)}`)
638639
await fs.promises.unlink(modelPath)
639-
log.success(`Deleted Model: ${modelPath}`)
640+
log.success(`Deleted Model: ${italic(modelPath)}`)
640641
}
641642
}),
642643
)
@@ -729,7 +730,7 @@ export async function generateKyselyTypes() {
729730
for (const modelFile of modelFiles) {
730731
const model = (await import(modelFile)).default as Model
731732
const modelName = getModelName(model, modelFile)
732-
const tableName = await getTableName(model, modelFile)
733+
const tableName = getTableName(model, modelFile)
733734
const pivotTables = await getPivotTables(model, modelName)
734735

735736
for (const pivotTable of pivotTables) text += ` ${pivotTable.table}: ${pivotFormatted}\n`
@@ -1683,7 +1684,7 @@ export async function generateModelFiles(modelStringFile?: string): Promise<void
16831684

16841685
for (const modelFile of modelFiles) {
16851686
if (modelStringFile && modelStringFile !== modelFile) continue
1686-
log.info(`Processing Model: ${modelFile}`)
1687+
log.info(`Processing Model: ${italic(modelFile)}`)
16871688

16881689
const model = (await import(modelFile)).default as Model
16891690
const tableName = getTableName(model, modelFile)
@@ -1693,9 +1694,9 @@ export async function generateModelFiles(modelStringFile?: string): Promise<void
16931694
const classString = await generateModelString(tableName, modelName, model, fields)
16941695

16951696
const writer = file.writer()
1696-
log.info(`Writing API Endpoints for: ${modelName}`)
1697+
log.info(`Writing API Endpoints for: ${italic(modelName)}`)
16971698
writer.write(classString)
1698-
log.success(`Wrote API endpoints for: ${modelName}`)
1699+
log.success(`Wrote API endpoints for: ${italic(modelName)}`)
16991700
await writer.end()
17001701
}
17011702

storage/framework/core/strings/src/string.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export * from './case'
33
export * from './pluralize'
44
export * from './macro'
55
export * from './helpers'
6+
7+
export { isString } from '@stacksjs/validation'

0 commit comments

Comments
 (0)