Skip to content

Commit d330e44

Browse files
committed
chore: wip
1 parent 7ab4aec commit d330e44

File tree

7 files changed

+196
-6
lines changed

7 files changed

+196
-6
lines changed

.env.ts

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
import type { EnvConfig } from '@stacksjs/env'
2+
import { schema } from '@stacksjs/validation'
3+
4+
/**
5+
* **Env Configuration & Validations**
6+
*
7+
* This configuration defines all of your Env validations. Because Stacks is fully-typed, you
8+
* may hover any of the options below and the definitions will be provided. In case you
9+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
10+
*/
11+
export default {
12+
APP_NAME: {
13+
validation: schema.string(),
14+
default: 'Stacks',
15+
},
16+
17+
APP_ENV: {
18+
validation: schema.enum(['local', 'dev', 'stage', 'prod']),
19+
default: 'local',
20+
},
21+
22+
APP_KEY: {
23+
validation: schema.string(),
24+
default: 'base64:1234567890',
25+
},
26+
27+
PORT: {
28+
validation: schema.number(),
29+
default: 3000,
30+
},
31+
32+
PORT_BACKEND: {
33+
validation: schema.number(),
34+
default: 3000,
35+
},
36+
37+
PORT_ADMIN: {
38+
validation: schema.number(),
39+
default: 3000,
40+
},
41+
42+
PORT_LIBRARY: {
43+
validation: schema.number(),
44+
default: 3000,
45+
},
46+
47+
PORT_DESKTOP: {
48+
validation: schema.number(),
49+
default: 3000,
50+
},
51+
52+
PORT_EMAIL: {
53+
validation: schema.number(),
54+
default: 3000,
55+
},
56+
PORT_DOCS: {
57+
validation: schema.number(),
58+
default: 3000,
59+
},
60+
61+
PORT_INSPECT: {
62+
validation: schema.number(),
63+
default: 3000,
64+
},
65+
66+
PORT_API: {
67+
validation: schema.number(),
68+
default: 3000,
69+
},
70+
71+
PORT_SYSTEM_TRAY: {
72+
validation: schema.number(),
73+
default: 3000,
74+
},
75+
76+
APP_MAINTENANCE: {
77+
validation: schema.boolean(),
78+
default: false,
79+
},
80+
81+
DEBUG: {
82+
validation: schema.boolean(),
83+
default: false,
84+
},
85+
86+
API_PREFIX: {
87+
validation: schema.string(),
88+
default: '/api',
89+
},
90+
91+
DOCS_PREFIX: {
92+
validation: schema.string(),
93+
default: '/docs',
94+
},
95+
96+
DB_CONNECTION: {
97+
validation: schema.enum(['mysql', 'sqlite', 'postgres']),
98+
default: 'mysql',
99+
},
100+
101+
DB_HOST: {
102+
validation: schema.string(),
103+
default: 'localhost',
104+
},
105+
106+
DB_PORT: {
107+
validation: schema.number(),
108+
default: 3306,
109+
},
110+
111+
AWS_ACCOUNT_ID: {
112+
validation: schema.string(),
113+
default: '',
114+
},
115+
116+
AWS_ACCESS_KEY_ID: {
117+
validation: schema.string(),
118+
default: '',
119+
},
120+
121+
AWS_SECRET_ACCESS_KEY: {
122+
validation: schema.string(),
123+
default: '',
124+
},
125+
126+
AWS_DEFAULT_REGION: {
127+
validation: schema.string(),
128+
default: '',
129+
},
130+
131+
AWS_DEFAULT_PASSWORD: {
132+
validation: schema.string(),
133+
default: '',
134+
},
135+
136+
MAIL_MAILER: {
137+
validation: schema.enum(['ses', 'sendmail', 'log', 'smtp']),
138+
default: 'ses',
139+
},
140+
141+
MAIL_HOST: {
142+
validation: schema.string(),
143+
default: '',
144+
},
145+
146+
MAIL_PORT: {
147+
validation: schema.number(),
148+
default: 465,
149+
},
150+
151+
MAIL_USERNAME: {
152+
validation: schema.string(),
153+
default: '',
154+
},
155+
156+
MAIL_PASSWORD: {
157+
validation: schema.string(),
158+
default: '',
159+
},
160+
161+
MAIL_FROM_ADDRESS: {
162+
validation: schema.string(),
163+
default: '',
164+
},
165+
166+
SEARCH_ENGINE_DRIVER: {
167+
validation: schema.enum(['meilisearch', 'algolia', 'typesense']),
168+
default: 'meilisearch',
169+
},
170+
171+
MEILISEARCH_HOST: {
172+
validation: schema.string(),
173+
default: '',
174+
},
175+
176+
MEILISEARCH_KEY: {
177+
validation: schema.string(),
178+
default: '',
179+
},
180+
181+
FRONTEND_APP_ENV: {
182+
validation: schema.enum(['development', 'staging', 'production']),
183+
default: 'development',
184+
},
185+
186+
FRONTEND_APP_URL: {
187+
validation: schema.string(),
188+
default: '',
189+
},
190+
} satisfies EnvConfig

storage/framework/core/alias/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export const alias: Record<string, string> = {
235235
'~/config/dns': p.projectConfigPath('dns.ts'),
236236
'~/config/docs': p.docsPath('config.ts'),
237237
'~/config/errors': p.projectConfigPath('errors.ts'),
238-
'~/config/env': p.projectConfigPath('env.ts'),
238+
'~/.env': p.projectConfigPath('env.ts'),
239239
'~/config/email': p.projectConfigPath('email.ts'),
240240
'~/config/git': p.projectConfigPath('git.ts'),
241241
'~/config/hashing': p.projectConfigPath('hashing.ts'),

storage/framework/core/components/command-palette/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default defineConfig(({ mode }) => {
107107

108108
return {
109109
resolve: {
110-
'~/config/env': p.projectConfigPath('env.ts'),
110+
'~/.env': p.projectConfigPath('env.ts'),
111111
'~/config/errors': p.projectConfigPath('errors.ts'),
112112

113113
...alias,

storage/framework/core/components/navigator/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default defineConfig(({ mode }) => {
108108

109109
return {
110110
resolve: {
111-
'~/config/env': p.projectConfigPath('env.ts'),
111+
'~/.env': p.projectConfigPath('env.ts'),
112112
'~/config/errors': p.projectConfigPath('errors.ts'),
113113

114114
...alias,

storage/framework/core/components/notification/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default defineConfig(({ mode }) => {
108108

109109
return {
110110
resolve: {
111-
'~/config/env': p.projectConfigPath('env.ts'),
111+
'~/.env': p.projectConfigPath('env.ts'),
112112
'~/config/errors': p.projectConfigPath('errors.ts'),
113113

114114
...alias,

storage/framework/core/components/payment/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default defineConfig(({ mode }) => {
108108

109109
return {
110110
resolve: {
111-
'~/config/env': p.projectConfigPath('env.ts'),
111+
'~/.env': p.projectConfigPath('env.ts'),
112112
'~/config/errors': p.projectConfigPath('errors.ts'),
113113

114114
...alias,

storage/framework/core/env/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Infer, VineBoolean, VineEnum, VineNumber, VineString } from '@stac
22
import type { SchemaTypes } from '@vinejs/vine/types'
33
import type { EnvKey } from '../../../env'
44
import { schema } from '@stacksjs/validation'
5-
import env from '~/config/env'
5+
import env from '~/.env'
66

77
interface EnumObject {
88
[key: string]: string[]

0 commit comments

Comments
 (0)