Skip to content

Commit 255f06d

Browse files
committed
chore: wip
1 parent e336df7 commit 255f06d

File tree

8 files changed

+824
-1703
lines changed

8 files changed

+824
-1703
lines changed

.stacks/buddy/src/commands/generate.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { CLI, GeneratorOptions } from '@stacksjs/types'
2+
import { log } from '@stacksjs/logging'
23
import { ExitCode } from '@stacksjs/types'
34
import { prompts } from '@stacksjs/cli'
4-
import { componentMeta, ideHelpers, libEntries, invoke as startGenerationProcess, types, vsCodeCustomData, vueCompat, webTypes } from '@stacksjs/actions/generate'
5+
import { componentMeta, ideHelpers, libEntries, invoke as startGenerationProcess, types, vsCodeCustomData, vueCompat, webTypes, models } from '@stacksjs/actions/generate'
56

67
async function generate(buddy: CLI) {
78
const descriptions = {
@@ -110,6 +111,23 @@ async function generate(buddy: CLI) {
110111
.action(async (options: GeneratorOptions) => {
111112
await componentMeta(options)
112113
})
114+
115+
buddy
116+
.command('generate:model', 'Generate Model')
117+
.option('-n, --name', 'Model Name')
118+
.action(async (options: any) => {
119+
const name = buddy.args[0] || options.name
120+
121+
options.name = name
122+
123+
if (!name) {
124+
log.error('You need to specify the Model Name.')
125+
126+
process.exit()
127+
}
128+
129+
await models(options)
130+
})
113131
}
114132

115133
function hasNoOptions(options: GeneratorOptions) {

.stacks/core/actions/src/generate.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,7 @@ export async function types(options?: GeneratorOptions) {
117117

118118
log.success('Types were generated successfully')
119119
}
120+
121+
export async function models(options?: any) {
122+
log.success('Model was generated successfully')
123+
}

.stacks/core/database/src/factory/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { filesystem } from '@stacksjs/storage'
22

3-
const fs = filesystem.fs
3+
const { fs } = filesystem
44

55
function generateFactoryFile(modelName: string, fileName: string, path: string): void {
66
const generateMethodName = 'generate'

.stacks/core/database/src/migrations/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { filesystem } from '@stacksjs/storage'
22

3-
const fs = filesystem.fs
3+
const { fs } = filesystem
44

55
interface Column {
66
name: string

.stacks/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,5 @@
126126
"../**/dist/**",
127127
"../**/node_modules/**"
128128
],
129-
"extends": "./api/.nitro/types/tsconfig.json"
129+
// "extends": "./api/.nitro/types/tsconfig.json"
130130
}

config/database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { env } from '@stacksjs/utils'
12
/**
23
* **Database Options**
34
*

config/payment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { env } from '@stacksjs/utils'
12
import { type PaymentOptions } from '@stacksjs/types'
23

34
export default <PaymentOptions> {

0 commit comments

Comments
 (0)