Skip to content

Commit 0646ce0

Browse files
committed
chore: wip
1 parent 35a726a commit 0646ce0

File tree

7 files changed

+71
-221
lines changed

7 files changed

+71
-221
lines changed

.stacks/core/config/src/defaults.ts

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import type { StacksOptions } from './types'
2-
import { app, cache, cdn, database, debug, dns, email, events, git, hashing, library, notification, pages, payment, searchEngine, services, storage, ui } from './user'
1+
export { default as app } from '../../../../config/app'
2+
export { default as cache } from '../../../../config/cache'
3+
export { default as cdn } from '../../../../config/cdn'
4+
export { default as cronJobs } from '../../../../app/jobs'
5+
export { default as cli } from '../../../../config/cli'
6+
export { default as database } from '../../../../config/database'
7+
export { default as debug } from '../../../../config/debug'
8+
export { default as dns } from '../../../../config/dns'
9+
export { default as docs } from '../../../../config/docs'
10+
export { default as email } from '../../../../config/email'
11+
export { default as events } from '../../../../config/events'
12+
export { default as git } from '../../../../config/git'
13+
export { default as hashing } from '../../../../config/hashing'
14+
export { default as library } from '../../../../config/library'
15+
export { default as payment } from '../../../../config/payment'
16+
export { default as notification } from '../../../../config/notification'
17+
export { default as searchEngine } from '../../../../config/search-engine'
18+
export { default as services } from '../../../../config/services'
19+
export { default as storage } from '../../../../config/storage'
20+
export { default as ui } from '../../../../config/ui'
321

4-
export { // StacksOptions is an interface of all the ./config options
5-
app,
6-
cache,
7-
cdn,
8-
database,
9-
debug,
10-
dns,
11-
// docs,
12-
email,
13-
events,
14-
git,
15-
hashing,
16-
library,
17-
notification,
18-
pages,
19-
payment,
20-
searchEngine,
21-
services,
22-
storage,
23-
ui,
24-
}
22+
// export { default as cloud } from '../../../../config/cloud'

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

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
import { loadConfig } from 'c12'
2-
import type { ResolvedStacksOptions, StacksOptions } from './types'
3-
import { app, cache, cdn, cli, cronJobs, database, debug, dns, docs, email, events, git, hashing, library, notification, payment, searchEngine, services, storage, ui } from './user'
4-
5-
export const defaults: ResolvedStacksOptions = { app, cache, cdn, cli, cronJobs, database, debug, dns, docs, email, events, git, hashing, library, notification, payment, searchEngine, services, storage, ui }
6-
7-
export async function resolveConfig(options: StacksOptions) {
8-
// const { loadConfig } = await import('c12')
9-
const config = await loadConfig<StacksOptions>({
10-
name: 'stacks',
11-
defaults: {},
12-
overrides: options,
13-
}).then(r => r.config || defaults)
14-
15-
return config as ResolvedStacksOptions
16-
}
17-
18-
export * from './types'
19-
201
export { loadConfig, watchConfig } from 'c12'
2+
3+
// export * from './defaults'
4+
export * from './stacks'

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

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,32 @@
11
import { loadConfig } from 'c12'
2-
import type { StacksOptions } from '@stacksjs/types'
2+
import type { StacksOptions, ResolvedStacksOptions } from '@stacksjs/types'
3+
import { app, cache, cdn, cli, database, debug, dns, email, events, git, hashing, library, notification, payment, searchEngine, services, storage, ui } from './defaults'
34

4-
export const stacksConfigDefaults: StacksOptions = {
5-
app: {
6-
name: 'Stacks',
7-
env: 'local',
8-
key: '',
9-
debug: false,
10-
url: 'https://localhost',
11-
port: 3000,
12-
timezone: 'UTC',
13-
locale: 'en',
14-
fallbackLocale: 'en',
15-
cipher: 'aes-256-cbc',
16-
editor: 'vscode',
17-
},
18-
19-
cache: {},
20-
cli: {},
21-
database: {},
22-
debug: {},
23-
dns: {},
24-
hashing: {},
25-
library: {},
26-
notification: {},
27-
payment: {},
28-
searchEngine: {},
29-
services: {},
30-
storage: {},
31-
ui: {}
32-
}
5+
export const stacksConfigDefaults = {
6+
app,
7+
cache,
8+
cdn,
9+
cli,
10+
database,
11+
debug,
12+
dns,
13+
docs,
14+
email,
15+
event: events,
16+
git,
17+
hashing,
18+
library,
19+
notification,
20+
payment,
21+
searchEngine,
22+
services,
23+
storage,
24+
ui
25+
} satisfies ResolvedStacksOptions
3326

3427
export async function loadStacksConfig(overrides?: Partial<StacksOptions>, cwd = process.cwd()) {
3528
const { config } = await loadConfig<StacksOptions>({
36-
name: 'bump',
29+
name: 'stacks',
3730
defaults: stacksConfigDefaults,
3831
overrides: {
3932
...(overrides as StacksOptions),
@@ -44,6 +37,6 @@ export async function loadStacksConfig(overrides?: Partial<StacksOptions>, cwd =
4437
return config!
4538
}
4639

47-
export function defineConfig(config: Partial<StacksOptions>) {
40+
export function defineStacksConfig(config: Partial<StacksOptions>) {
4841
return config
4942
}

.stacks/core/config/src/types.ts

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

.stacks/core/config/src/user/README.md

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

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

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

0 commit comments

Comments
 (0)