Skip to content

Commit a00e088

Browse files
committed
chore: wip
1 parent 7757543 commit a00e088

File tree

17 files changed

+586
-297
lines changed

17 files changed

+586
-297
lines changed

.stacks/core/alias/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ const alias: Record<string, string> = {
9999
'@stacksjs/x-ray/*': p.xRayPath('src/*'),
100100
'framework/*': p.frameworkPath('*'),
101101
'stacks': p.frameworkPath('src/index.ts'),
102+
'app/*': p.appPath('*'),
103+
'config/*': p.userConfigPath('*'),
102104
'components/*': p.componentsPath('*'),
103105
'functions/*': p.functionsPath('*'),
104106
'pages/*': p.pagesPath('*'),

.stacks/core/config/build.config.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import { defineBuildConfig } from 'unbuild'
22
import { alias } from '@stacksjs/alias'
33

4+
// eslint-disable-next-line no-console
5+
console.log('Building...')
6+
47
export default defineBuildConfig({
58
alias,
69
entries: [
10+
'src/user',
711
{
812
builder: 'mkdist',
9-
input: './src/user',
10-
outDir: './dist/user',
13+
input: './src',
14+
outDir: './dist',
1115
},
12-
'src/index',
1316
],
1417
declaration: true,
1518
clean: true,
@@ -43,6 +46,27 @@ export default defineBuildConfig({
4346
'vite-plugin-pwa',
4447
'@novu/stateless',
4548
'semver',
49+
'config/app',
50+
'config/cache',
51+
'config/cdn',
52+
'config/cli',
53+
'config/debug',
54+
'config/database',
55+
'config/dns',
56+
'config/docs',
57+
'config/git',
58+
'config/email',
59+
'config/events',
60+
'config/hashing',
61+
'config/library',
62+
'config/page',
63+
'config/payment',
64+
'config/notification',
65+
'config/search-engine',
66+
'config/storage',
67+
'config/services',
68+
'config/ui',
69+
'app/jobs',
4670
],
4771
rollup: {
4872
emitCJS: true,

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import { loadConfig } from 'c12'
22
import type { ResolvedStacksOptions, StacksOptions } from './types'
3-
import { app, cache, cdn, cli, cronJobs, database, debug, dns, docs, email, events, git, hashing, library, notification, pages, payment, searchEngine, services, storage, ui } from './user'
3+
import { app, cache, cdn, cli, cronJobs, database, debug, dns, docs, email, events, git, hashing, library, notification, payment, searchEngine, services, storage, ui } from './user'
44

5-
export const defaults: ResolvedStacksOptions = { app, cache, cdn, cli, cronJobs, database, debug, dns, docs, email, events, git, hashing, library, notification, pages, payment, searchEngine, services, storage, ui }
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 }
66

77
export async function resolveConfig(options: StacksOptions) {
88
// const { loadConfig } = await import('c12')
99
const config = await loadConfig<StacksOptions>({
1010
name: 'stacks',
11-
defaults: {
12-
13-
},
11+
defaults: {},
1412
overrides: options,
1513
}).then(r => r.config || defaults)
1614

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { loadConfig } from 'c12'
2+
import type { StacksOptions } from '@stacksjs/types'
3+
4+
export const stacksConfigDefaults: StacksOptions = {
5+
app: {
6+
name: 'Stacks',
7+
description: 'Stacks Application',
8+
}
9+
}
10+
11+
export async function loadStacksConfig(overrides?: Partial<StacksOptions>,
12+
cwd = process.cwd()) {
13+
const { config } = await loadConfig<StacksOptions>({
14+
name: 'bump',
15+
defaults: stacksConfigDefaults,
16+
overrides: {
17+
...(overrides as StacksOptions),
18+
},
19+
cwd,
20+
})
21+
22+
return config!
23+
}
24+
25+
export function defineConfig(config: Partial<StacksOptions>) {
26+
return config
27+
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ export interface StacksOptions {
7070
* The Pages config.
7171
*/
7272
pages?: Partial<PagesOption>
73-
/**
74-
* The Payment config.
75-
*/
76-
payment?: Partial<PaymentOptions>
7773
/**
7874
* The Search Engine config.
7975
*/

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

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
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 pages } from '../../../../../config/page'
16-
export { default as payment } from '../../../../../config/payment'
17-
export { default as notification } from '../../../../../config/notification'
18-
export { default as searchEngine } from '../../../../../config/search-engine'
19-
export { default as services } from '../../../../../config/services'
20-
export { default as storage } from '../../../../../config/storage'
21-
export { default as ui } from '../../../../../config/ui'
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'
2221

23-
// export { default as cloud } from '../../../../../config/cloud'
22+
// export { default as cloud } from 'config/cloud'

.stacks/core/logging/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
"vue-ray": "^1.17.3"
5656
},
5757
"devDependencies": {
58-
"@stacksjs/development": "workspace:*"
58+
"@stacksjs/testing": "workspace:*",
59+
"tsx": "^3.12.7",
60+
"typescript": "^5.0.4",
61+
"unbuild": "^1.2.1"
5962
}
6063
}

.stacks/core/path/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ export function configPath(path?: string) {
110110
return corePath(`config/${path || ''}`)
111111
}
112112

113+
export function userConfigPath(path?: string) {
114+
return projectPath(`config/${path || ''}`)
115+
}
116+
113117
export function corePath(path?: string) {
114118
return frameworkPath(`core/${path || ''}`)
115119
}
@@ -371,6 +375,7 @@ const path = {
371375
actionsPath,
372376
aliasPath,
373377
arraysPath,
378+
appPath,
374379
authPath,
375380
buildEnginePath,
376381
buildEntriesPath,
@@ -382,6 +387,7 @@ const path = {
382387
collectionsPath,
383388
componentsPath,
384389
configPath,
390+
userConfigPath,
385391
corePath,
386392
customElementsDataPath,
387393
databasePath,

.stacks/core/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export * from './reactivity'
3333
export * from './router'
3434
export * from './search-engine'
3535
export * from './ssg'
36+
export * from './stacks'
3637
export * from './tables'
3738
export * from './ui'
3839
export * from './utils'

0 commit comments

Comments
 (0)