Skip to content

Commit 637866d

Browse files
committed
chore: wip
1 parent fdbd51e commit 637866d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+133
-325
lines changed

.stacks/config/README.md

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

.stacks/config/package.json

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

.stacks/config/src/index.ts

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

.stacks/config/tests/example.test.ts

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

.stacks/core/actions/src/fresh.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ import { frameworkPath } from '@stacksjs/path'
44
await runCommands([
55
'pnpm buddy clean',
66
'pnpm install',
7-
'npx prisma generate --schema=./database/schema.prisma',
87
], { cwd: frameworkPath(), verbose: true })

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { GeneratorOptions } from '@stacksjs/types'
55
import { runNpmScript } from '@stacksjs/utils'
66
import { runCommand } from '@stacksjs/cli'
77
import { frameworkPath } from '@stacksjs/path'
8-
import { database } from '../../../../config/src'
8+
import { database } from '@stacksjs/config'
99
import { runAction } from '../helpers'
1010

1111
export async function invoke(options?: GeneratorOptions) {

.stacks/core/cli/src/console.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Prompts from 'prompts'
2-
import { log } from '../../logging/src'
2+
import { log } from '@stacksjs/logging'
33

44
const { prompts } = Prompts
55

.stacks/core/cli/src/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { execSync as childExec } from 'node:child_process'
22
import type { Err } from '@stacksjs/error-handling'
33
import type { CliOptions, CommandResult, Result, SpinnerOptions as Spinner } from '@stacksjs/types'
44
import { projectPath } from '@stacksjs/path'
5-
import { ResultAsync, err } from '../../error-handling/src'
6-
import { determineDebugMode } from '../../utils/src'
5+
import { ResultAsync, err } from '@stacksjs/error-handling'
6+
import { determineDebugMode } from '@stacksjs/utils'
77
import { spawn } from './command'
88
import { startSpinner } from './helpers'
99
import { italic } from '.'

.stacks/core/config/src/index.ts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,61 @@
11
import type { AppOptions, CacheOptions, CliOptions, CronJobOptions, DatabaseOptions, DebugOptions, DeployOptions, DnsOptions, EmailOptions, Events, GitOptions, HashingOptions, LibraryOptions, Model, NotificationOptions, PagesOption, PaymentOptions, SearchEngineOptions, ServicesOptions, StorageOptions, UiOptions } from '@stacksjs/types'
2+
import app from '../../../../config/app'
3+
import cache from '../../../../config/cache'
4+
import database from '../../../../config/database'
5+
import debug from '../../../../config/debug'
6+
import deploy from '../../../../config/deploy'
7+
import dns from '../../../../config/dns'
8+
import events from '../../../../config/events'
9+
import git from '../../../../config/git'
10+
import hashing from '../../../../config/hashing'
11+
import library from '../../../../config/library'
12+
import page from '../../../../config/page'
13+
import payments from '../../../../config/payment'
14+
import notification from '../../../../config/notification'
15+
import searchEngine from '../../../../config/search-engine'
16+
import services from '../../../../config/services'
17+
import storage from '../../../../config/storage'
18+
import ui from '../../../../config/ui'
19+
20+
// TODO: Vitepress requires this to be a named export
21+
import * as docs from '../../../../config/docs'
22+
23+
type Config = 'app' | 'cache' | 'database' | 'debug' | 'deploy' | 'docs' | 'git' | 'hashing' | 'library' | 'notification' | 'searchEngine' | 'services' | 'storage' | 'ui'
24+
25+
const conf = {
26+
app,
27+
cache,
28+
database,
29+
debug,
30+
deploy,
31+
dns,
32+
docs,
33+
events,
34+
git,
35+
hashing,
36+
library,
37+
page,
38+
payments,
39+
notification,
40+
searchEngine,
41+
services,
42+
storage,
43+
ui,
44+
}
45+
46+
export { app, cache, database, debug, deploy, dns, docs, events, git, hashing, library, page, payments, notification, searchEngine, services, storage, ui }
47+
48+
export function config(key?: Config, fallback?: any) {
49+
return key ? conf[key] : fallback
50+
}
51+
52+
export function env(key: string, fallback: any) {
53+
// console.log('isClient', isClient)
54+
// if (key && import.meta?.env)
55+
// return import.meta.env[key]
56+
57+
return fallback
58+
}
259

360
export { defineBuildConfig } from 'unbuild'
461

@@ -10,7 +67,7 @@ export function defineCacheConfig(options: CacheOptions) {
1067
return options
1168
}
1269

13-
export function defineCLIConfig(options: CliOptions) {
70+
export function defineCliConfig(options: CliOptions) {
1471
return options
1572
}
1673

.stacks/core/database/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"planetScale",
2525
"supabase",
2626
"singleStore",
27-
"prisma",
2827
"stacks"
2928
],
3029
"module": "dist/index.mjs",
@@ -43,7 +42,6 @@
4342
"typecheck": "tsc --noEmit"
4443
},
4544
"peerDependencies": {
46-
"@prisma/client": "^4.12.0",
4745
"@stacksjs/faker": "workspace:*",
4846
"@stacksjs/path": "workspace:*",
4947
"@stacksjs/strings": "workspace:*",

0 commit comments

Comments
 (0)