From ee9f84a64c423248d539fe1010f362e16c47d9cd Mon Sep 17 00:00:00 2001 From: xion Date: Fri, 6 Jun 2025 19:24:02 +0800 Subject: [PATCH] update env --- package.json | 10 +++++----- src/env.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 8667ad5..e92750d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/use-config", - "version": "1.0.17", + "version": "1.0.18", "types": "dist/config.d.ts", "scripts": { "build": "npm run clean && tsup", @@ -20,18 +20,18 @@ "license": "UNLICENSED", "type": "module", "devDependencies": { - "@types/node": "^22.14.1", + "@types/node": "^22.15.30", "dotenv": "^16.5.0", "fast-glob": "^3.3.3", "json-schema-to-ts": "^3.1.1", "json5": "^2.2.3", - "tsup": "^8.4.0", + "tsup": "^8.5.0", "typescript": "^5.8.3" }, "exports": { ".": { - "import": "./dist/config.mjs", - "types": "./dist/config.d.ts" + "import": "./dist/env.mjs", + "types": "./dist/env.d.ts" }, "./env": { "import": "./dist/env.mjs", diff --git a/src/env.ts b/src/env.ts index af0c352..4e46449 100644 --- a/src/env.ts +++ b/src/env.ts @@ -5,17 +5,17 @@ import { fileURLToPath } from 'url'; // 配置类型 export type Config = { - PORT: number; + PORT: string; // redis REDIS_HOST?: string; - REDIS_PORT?: number; + REDIS_PORT?: string; REDIS_PASSWORD?: string; REDIS_VERSION?: string; - REDIS_DB?: number; + REDIS_DB?: string; REDIS_USER?: string; // postgres POSTGRES_HOST?: string; - POSTGRES_PORT?: number; + POSTGRES_PORT?: string; POSTGRES_PASSWORD?: string; POSTGRES_USER?: string; POSTGRES_DB?: string; @@ -24,14 +24,14 @@ export type Config = { MINIO_BUCKET_NAME?: string; MINIO_ACCESS_KEY?: string; MINIO_SECRET_KEY?: string; - MINIO_USE_SSL?: boolean; + MINIO_USE_SSL?: string; // mongo MONGO_URI?: string; // [key: string]: any; }; export const initConfig: Config = { - PORT: 3000, + PORT: '3000', }; export const fileIsExist = (path: string) => { try {