Initial commit
This commit is contained in:
10
packages/env/lib/config.ts
vendored
Normal file
10
packages/env/lib/config.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { config } from '@dotenvx/dotenvx';
|
||||
|
||||
export const baseEnv =
|
||||
config({
|
||||
path: `${import.meta.dirname}/../../../../.env`,
|
||||
}).parsed ?? {};
|
||||
|
||||
export const dynamicEnvValues = {
|
||||
CEB_NODE_ENV: baseEnv.CEB_DEV === 'true' ? 'development' : 'production',
|
||||
} as const;
|
||||
4
packages/env/lib/const.ts
vendored
Normal file
4
packages/env/lib/const.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export const IS_DEV = process.env['CLI_CEB_DEV'] === 'true';
|
||||
export const IS_PROD = !IS_DEV;
|
||||
export const IS_FIREFOX = process.env['CLI_CEB_FIREFOX'] === 'true';
|
||||
export const IS_CI = process.env['CEB_CI'] === 'true';
|
||||
2
packages/env/lib/index.ts
vendored
Normal file
2
packages/env/lib/index.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './config.js';
|
||||
export * from './const.js';
|
||||
13
packages/env/lib/types.ts
vendored
Normal file
13
packages/env/lib/types.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { dynamicEnvValues } from './index.js';
|
||||
|
||||
interface ICebEnv {
|
||||
readonly CEB_EXAMPLE: string;
|
||||
readonly CEB_DEV_LOCALE: string;
|
||||
}
|
||||
|
||||
interface ICebCliEnv {
|
||||
readonly CLI_CEB_DEV: string;
|
||||
readonly CLI_CEB_FIREFOX: string;
|
||||
}
|
||||
|
||||
export type EnvType = ICebEnv & ICebCliEnv & typeof dynamicEnvValues;
|
||||
Reference in New Issue
Block a user