Skip to content

Commit 35a726a

Browse files
committed
chore: wip
1 parent d6d3cb0 commit 35a726a

File tree

9 files changed

+120
-81
lines changed

9 files changed

+120
-81
lines changed

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,34 @@ import type { StacksOptions } from '@stacksjs/types'
44
export const stacksConfigDefaults: StacksOptions = {
55
app: {
66
name: 'Stacks',
7-
description: 'Stacks Application',
8-
}
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: {}
932
}
1033

11-
export async function loadStacksConfig(overrides?: Partial<StacksOptions>,
12-
cwd = process.cwd()) {
34+
export async function loadStacksConfig(overrides?: Partial<StacksOptions>, cwd = process.cwd()) {
1335
const { config } = await loadConfig<StacksOptions>({
1436
name: 'bump',
1537
defaults: stacksConfigDefaults,

.stacks/core/types/src/app.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,6 @@ export interface AppOptions {
106106
*/
107107
fallbackLocale: 'en'
108108

109-
/**
110-
* **Integrated Development Environment**
111-
*
112-
* Currently, only VS Code is fully supported. While you may use Stacks with
113-
* any editor, some of its tooling is VS Code specific. Hence, for the
114-
* best experience, VS Code is currently the recommended editor.
115-
*
116-
* @default string "vscode"
117-
*/
118-
editor: string
119-
120109
/**
121110
* **Cipher**
122111
*

.stacks/core/types/src/cache.ts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,35 @@ export interface CacheOptions {
4444
*/
4545
ttl: number
4646

47-
redis: {
48-
connection: string
47+
drivers: {
48+
redis?: {
49+
connection: string
4950

50-
/**
51-
* **Redis Host**
52-
*
53-
* This value determines the host that will be used to connect to the Redis server.
54-
*
55-
* @default string "localhost"
56-
* @example "localhost"
57-
*/
58-
host: string
51+
/**
52+
* **Redis Host**
53+
*
54+
* This value determines the host that will be used to connect to the Redis server.
55+
*
56+
* @default string "localhost"
57+
* @example "localhost"
58+
*/
59+
host: string
5960

60-
/**
61-
* **Redis Port**
62-
*
63-
* This value determines the port that will be used to connect to the Redis server.
64-
*
65-
* @default number 6379
66-
* @example 6379
67-
*/
68-
port: number
69-
}
61+
/**
62+
* **Redis Port**
63+
*
64+
* This value determines the port that will be used to connect to the Redis server.
65+
*
66+
* @default number 6379
67+
* @example 6379
68+
*/
69+
port: number
70+
}
7071

71-
memcached: {
72-
}
72+
memcached?: {
73+
}
7374

74-
dynamodb: {
75+
dynamodb?: {
76+
}
7577
}
7678
}

.stacks/core/types/src/database.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ export type DatabaseClient = any
44

55
export interface DatabaseOptions {
66
driver: string
7-
url?: string
8-
host?: string
9-
port?: number
10-
client?: DatabaseClient
11-
database: string
12-
username?: string
13-
password?: string
7+
8+
drivers: {
9+
mysql: {
10+
url?: string
11+
host?: string
12+
port?: number
13+
client?: DatabaseClient
14+
name: string
15+
username?: string
16+
password?: string
17+
}
18+
19+
planetscale: {}
20+
postgres: {}
21+
}
1422
}
1523

1624
export interface FactoryOptions {

config/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ export default defineApp({
1919
locale: 'en',
2020
fallbackLocale: 'en',
2121
cipher: 'aes-256-cbc',
22-
editor: 'vscode',
2322
})

config/cache.ts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,35 @@ export default defineCache({
1212
prefix: env('CACHE_PREFIX', 'stacks'),
1313
ttl: env('CACHE_TTL', 3600),
1414

15-
redis: {
16-
connection: 'cache',
17-
host: env('REDIS_HOST', '127.0.0.1'),
18-
port: env('REDIS_PORT', '6379'),
19-
},
15+
drivers: {
16+
dynamodb: {
17+
key: env('AWS_ACCESS_KEY_ID', ''),
18+
secret: env('AWS_SECRET_ACCESS_KEY', ''),
19+
region: env('AWS_DEFAULT_REGION', 'us-east-1'),
20+
table: env('DYNAMODB_CACHE_TABLE', 'cache'),
21+
endpoint: env('DYNAMODB_ENDPOINT', ''),
22+
},
2023

21-
memcached: {
22-
persistent_id: env('MEMCACHED_PERSISTENT_ID', ''),
23-
sasl: [
24-
env('MEMCACHED_USERNAME', ''),
25-
env('MEMCACHED_PASSWORD', ''),
26-
],
27-
options: {
28-
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
24+
memcached: {
25+
persistent_id: env('MEMCACHED_PERSISTENT_ID', ''),
26+
sasl: [
27+
env('MEMCACHED_USERNAME', ''),
28+
env('MEMCACHED_PASSWORD', ''),
29+
],
30+
options: {
31+
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
32+
},
33+
servers: [{
34+
host: env('MEMCACHED_HOST', '127.0.0.1'),
35+
port: env('MEMCACHED_PORT', 11211),
36+
weight: 100,
37+
}],
2938
},
30-
servers: [{
31-
host: env('MEMCACHED_HOST', '127.0.0.1'),
32-
port: env('MEMCACHED_PORT', 11211),
33-
weight: 100,
34-
}],
35-
},
3639

37-
dynamodb: {
38-
key: env('AWS_ACCESS_KEY_ID', ''),
39-
secret: env('AWS_SECRET_ACCESS_KEY', ''),
40-
region: env('AWS_DEFAULT_REGION', 'us-east-1'),
41-
table: env('DYNAMODB_CACHE_TABLE', 'cache'),
42-
endpoint: env('DYNAMODB_ENDPOINT', ''),
43-
},
40+
redis: {
41+
connection: 'cache',
42+
host: env('REDIS_HOST', '127.0.0.1'),
43+
port: env('REDIS_PORT', '6379'),
44+
},
45+
}
4446
})

config/cdn.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ import { defineCdn } from '@stacksjs/utils'
99
*/
1010
export default defineCdn({
1111
driver: 'cloudfront',
12+
13+
// drivers: {
14+
// cloudfront: {}
15+
// }
1216
})

config/database.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,19 @@ import { defineDatabase, env } from '@stacksjs/utils'
99
*/
1010
export default defineDatabase({
1111
driver: 'mysql',
12-
url: env('DATABASE_URL', ''),
13-
host: 'localhost',
14-
port: 3306,
15-
database: env('DATABASE_NAME', ''),
16-
username: env('DATABASE_USERNAME', ''),
17-
password: env('DATABASE_PASSWORD', ''),
12+
13+
drivers: {
14+
mysql: {
15+
name: env('DATABASE_NAME', ''),
16+
host: env('DATABASE_HOST', ''),
17+
url: env('DATABASE_URL', 'localhost'),
18+
port: env('DATABASE_PORT', 3306),
19+
username: env('DATABASE_USERNAME', ''),
20+
password: env('DATABASE_PASSWORD', ''),
21+
},
22+
23+
planetscale: {},
24+
25+
postgres: {},
26+
}
1827
})

pnpm-lock.yaml

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)