Skip to content

Commit 82a8af4

Browse files
committed
chore: wip
1 parent b147610 commit 82a8af4

File tree

9 files changed

+27
-28
lines changed

9 files changed

+27
-28
lines changed

storage/framework/core/actions/src/generate/env-files.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { path as p } from '@stacksjs/path'
22
import { storage } from '@stacksjs/storage'
33
import { env as e, enums } from '@stacksjs/env'
44
import { logger } from '@stacksjs/logging'
5-
import { envKeys } from '../../../env'
5+
import { envKeys } from '../../../../env'
66

77
logger.log('Generating type env files...')
88

@@ -68,9 +68,9 @@ declare module 'bun' {
6868

6969
await storage.writeFile(p.frameworkPath('types/env.d.ts'), envTypes)
7070

71-
logger.log(' - ./storage/framework/core/env.ts')
71+
logger.log(' - ./storage/framework/env.ts')
7272

73-
// generate ./storage/framework/core/env.ts file based on Bun.env
73+
// generate ./storage/framework/env.ts file based on Bun.env
7474
const env = `
7575
// This file is auto-generated by Stacks. Do not edit this file manually.
7676
// If you want to change the environment variables, please edit the .env file.
@@ -84,6 +84,6 @@ export const envKeys = [
8484
export type EnvKey = typeof envKeys[number]
8585
`
8686

87-
await storage.writeFile(p.projectStoragePath('framework/core/env.ts'), env)
87+
await storage.writeFile(p.frameworkPath('env.ts'), env)
8888

89-
logger.log(' - ./storage/framework/core/env.d.ts')
89+
logger.log(' - ./storage/framework/env.d.ts')

storage/framework/core/cloud/src/cloud/cdn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { hasFiles } from '@stacksjs/storage'
77
import { path as p } from '@stacksjs/path'
88
import { env } from '@stacksjs/env'
99
import type { NestedCloudProps } from '../types'
10-
import type { EnvKey } from '../../../env'
10+
import type { EnvKey } from '../../../../env'
1111

1212
export interface CdnStackProps extends NestedCloudProps {
1313
certificate: acm.Certificate

storage/framework/core/cloud/src/cloud/compute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Construct } from 'constructs'
55
import { path as p } from '@stacksjs/path'
66
import { env } from '@stacksjs/env'
77
import type { NestedCloudProps } from '../types'
8-
import type { EnvKey } from '../../../env'
8+
import type { EnvKey } from '../../../../env'
99

1010
export interface ComputeStackProps extends NestedCloudProps {
1111
vpc: ec2.Vpc

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import p from 'node:process'
22
import fs from 'fs-extra'
33
import { projectPath } from '@stacksjs/path'
44
import { ValidationBoolean, ValidationEnum, ValidationNumber } from '@stacksjs/validation'
5-
import type { EnvKey } from '../../env'
5+
import type { EnvKey } from '../../../env'
66
import type { Env } from './types'
77

8-
// interface EnumObject {
9-
// [key: string]: string[]
10-
// }
11-
12-
// export const enums: EnumObject = {
13-
// APP_ENV: ['local', 'dev', 'development', 'staging', 'prod', 'production'],
14-
// DB_CONNECTION: ['mysql', 'sqlite', 'postgres', 'planetscale'],
15-
// MAIL_MAILER: ['smtp', 'mailgun', 'ses', 'postmark', 'sendmail', 'log'],
16-
// SEARCH_ENGINE_DRIVER: ['meilisearch', 'algolia', 'typesense'],
17-
// FRONTEND_APP_ENV: ['development', 'staging', 'production'],
18-
// }
8+
interface EnumObject {
9+
[key: string]: string[]
10+
}
11+
12+
export const enums: EnumObject = {
13+
APP_ENV: ['local', 'dev', 'development', 'staging', 'prod', 'production'],
14+
DB_CONNECTION: ['mysql', 'sqlite', 'postgres', 'planetscale'],
15+
MAIL_MAILER: ['smtp', 'mailgun', 'ses', 'postmark', 'sendmail', 'log'],
16+
SEARCH_ENGINE_DRIVER: ['meilisearch', 'algolia', 'typesense'],
17+
FRONTEND_APP_ENV: ['development', 'staging', 'production'],
18+
}
1919

2020
const handler = {
2121
get: (target: Env, key: EnvKey) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Infer, VineBoolean, VineEnum, VineNumber, VineString } from '@stacksjs/validation'
22
import { validator } from '@stacksjs/validation'
33
import env from '../../../../../config/env'
4-
import type { EnvKey } from '../../env'
4+
import type { EnvKey } from '../../../env'
55

66
// import type { Validate } from '@stacksjs/validation'
77

storage/framework/core/env.ts renamed to storage/framework/env.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
12
// This file is auto-generated by Stacks. Do not edit this file manually.
23
// If you want to change the environment variables, please edit the .env file.
34
//
45
// For more information, please visit: https://stacksjs.org/docs
56

6-
export const env = {}
7-
87
export const envKeys = [
98
'APP_NAME',
109
'APP_ENV',
@@ -38,7 +37,7 @@ export const envKeys = [
3837
'MEILISEARCH_HOST',
3938
'MEILISEARCH_KEY',
4039
'FRONTEND_APP_ENV',
41-
'FRONTEND_APP_URL',
40+
'FRONTEND_APP_URL'
4241
] as const
4342

4443
export type EnvKey = typeof envKeys[number]

storage/framework/ide/vscode/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"cossssmin.posthtml",
5252
"mattpocock.ts-error-translator",
5353
"amazonwebservices.aws-toolkit-vscode",
54-
"rangav.vscode-thunder-client",
5554
"antfu.goto-alias",
5655
"mikestead.dotenv",
5756
"pflannery.vscode-versionlens",

storage/framework/types/auto-imports.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ declare global {
288288
const enums: typeof import('../core/index')['enums']
289289
const enumsPath: typeof import('../core/path/src/index')['enumsPath']
290290
const env: typeof import('../core/env/src/index')['env']
291-
const envKeys: typeof import('../core/env')['envKeys']
291+
const envKeys: typeof import('../env')['envKeys']
292292
const envSchema: typeof import('../core/env/src/types')['envSchema']
293293
const equal: typeof import('../core/utils/src/currency')['equal']
294294
const err: typeof import('../core/error-handling/src/index')['err']
@@ -1211,7 +1211,7 @@ declare module 'vue' {
12111211
readonly enums: UnwrapRef<typeof import('../core/index')['enums']>
12121212
readonly enumsPath: UnwrapRef<typeof import('../core/path/src/index')['enumsPath']>
12131213
readonly env: UnwrapRef<typeof import('../core/env/src/index')['env']>
1214-
readonly envKeys: UnwrapRef<typeof import('../core/env')['envKeys']>
1214+
readonly envKeys: UnwrapRef<typeof import('../env')['envKeys']>
12151215
readonly envSchema: UnwrapRef<typeof import('../core/env/src/types')['envSchema']>
12161216
readonly equal: UnwrapRef<typeof import('../core/utils/src/currency')['equal']>
12171217
readonly err: UnwrapRef<typeof import('../core/error-handling/src/index')['err']>
@@ -2113,7 +2113,7 @@ declare module '@vue/runtime-core' {
21132113
readonly enums: UnwrapRef<typeof import('../core/index')['enums']>
21142114
readonly enumsPath: UnwrapRef<typeof import('../core/path/src/index')['enumsPath']>
21152115
readonly env: UnwrapRef<typeof import('../core/env/src/index')['env']>
2116-
readonly envKeys: UnwrapRef<typeof import('../core/env')['envKeys']>
2116+
readonly envKeys: UnwrapRef<typeof import('../env')['envKeys']>
21172117
readonly envSchema: UnwrapRef<typeof import('../core/env/src/types')['envSchema']>
21182118
readonly equal: UnwrapRef<typeof import('../core/utils/src/currency')['equal']>
21192119
readonly err: UnwrapRef<typeof import('../core/error-handling/src/index')['err']>

storage/framework/types/env.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
// This file is auto-generated by Stacks. Do not edit this file manually.
23
// If you want to change the environment variables, please edit the .env file.
34
//
@@ -6,7 +7,7 @@
67
declare module 'bun' {
78
namespace env {
89
const APP_NAME: string
9-
const APP_ENV: 'development' | 'staging' | 'production'
10+
const APP_ENV: 'local' | 'dev' | 'development' | 'staging' | 'prod' | 'production'
1011
const APP_KEY: string
1112
const APP_PORT: number
1213
const APP_MAINTENANCE: boolean

0 commit comments

Comments
 (0)