@nexusts/config 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @nexusts/config
2
+
3
+ > **NexusTS** — Bun-native fullstack framework
4
+
5
+ ## Description
6
+
7
+ Zod-validated configuration with layered loading.
8
+
9
+ Layered config (env, .env, load()). Schema-validated with Zod. Read with `ConfigService.get('db.host')`.
10
+
11
+ ## Install
12
+
13
+ This module is part of the NexusTS monorepo. Each module is published as its own npm package under the `@nexusts/` scope.
14
+
15
+ Most apps start with just the core:
16
+
17
+ ```bash
18
+ bun add @nexusts/core reflect-metadata zod hono
19
+ ```
20
+
21
+ Then add this module only if you need it:
22
+
23
+ ```bash
24
+ bun add @nexusts/config
25
+ ```
26
+
27
+ ## Peer dependencies
28
+
29
+ None. This module is fully self-contained.
30
+
31
+ ## Usage
32
+
33
+ ```typescript
34
+ import { /* public API */ } from "@nexusts/config";
35
+ ```
36
+
37
+ See the [user guide](../../docs/user-guide/config.md) and the [example app](../../examples/) for a working demo.
38
+
39
+ ## License
40
+
41
+ MIT — see the root [LICENSE](../../LICENSE).
package/dist/index.js ADDED
@@ -0,0 +1,199 @@
1
+ // @bun
2
+ var __legacyDecorateClassTS = function(decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
5
+ r = Reflect.decorate(decorators, target, key, desc);
6
+ else
7
+ for (var i = decorators.length - 1;i >= 0; i--)
8
+ if (d = decorators[i])
9
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11
+ };
12
+ var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
13
+ var __legacyMetadataTS = (k, v) => {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
15
+ return Reflect.metadata(k, v);
16
+ };
17
+ var __require = import.meta.require;
18
+ // packages/config/src/config.service.ts
19
+ import { Inject, Injectable } from "@nexusts/core/decorators/index.js";
20
+ class ConfigService {
21
+ options;
22
+ static TOKEN = Symbol.for("nexus:ConfigService");
23
+ config;
24
+ #raw;
25
+ #cache = new Map;
26
+ #strict;
27
+ constructor(options = {}) {
28
+ this.options = options;
29
+ const loaded = loadConfig(options);
30
+ this.config = loaded.value;
31
+ this.#raw = loaded.raw;
32
+ this.#strict = options.strict ?? false;
33
+ if (loaded.errors.length > 0) {
34
+ const msg = `[nexus/config] Configuration validation failed:
35
+ ` + loaded.errors.map((e) => ` - ${e}`).join(`
36
+ `);
37
+ if (options.exitOnError) {
38
+ console.error(msg);
39
+ process.exit(1);
40
+ }
41
+ throw new Error(msg);
42
+ }
43
+ }
44
+ get(key, options) {
45
+ if (this.options.cache !== false && this.#cache.has(key)) {
46
+ return this.#cache.get(key);
47
+ }
48
+ const fromConfig = this.config[key];
49
+ if (fromConfig !== undefined) {
50
+ if (this.options.cache !== false)
51
+ this.#cache.set(key, fromConfig);
52
+ return fromConfig;
53
+ }
54
+ if (options && "default" in options) {
55
+ return options.default;
56
+ }
57
+ if (this.#strict) {
58
+ throw new Error(`[nexus/config] Unknown config key "${key}"`);
59
+ }
60
+ return;
61
+ }
62
+ require(key) {
63
+ const v = this.get(key);
64
+ if (v === undefined || v === null || v === "") {
65
+ throw new Error(`[nexus/config] Required config key "${String(key)}" is missing`);
66
+ }
67
+ return v;
68
+ }
69
+ env(key) {
70
+ return this.#raw[key];
71
+ }
72
+ reload() {
73
+ this.#cache.clear();
74
+ const loaded = loadConfig(this.options);
75
+ Object.assign(this.config, loaded.value);
76
+ this.#raw = loaded.raw;
77
+ }
78
+ }
79
+ ConfigService = __legacyDecorateClassTS([
80
+ Injectable(),
81
+ __legacyDecorateParamTS(0, Inject("CONFIG_OPTIONS")),
82
+ __legacyMetadataTS("design:paramtypes", [
83
+ typeof ConfigOptions === "undefined" ? Object : ConfigOptions
84
+ ])
85
+ ], ConfigService);
86
+ function loadConfig(options) {
87
+ const env = {};
88
+ for (const [k, v] of Object.entries(process.env)) {
89
+ env[k] = v;
90
+ }
91
+ const paths = options.envFilePaths ?? [];
92
+ const useEnvFile = options.envFile !== false;
93
+ if (useEnvFile) {
94
+ const nodeEnv = options.nodeEnv ?? process.env["NODE_ENV"] ?? "development";
95
+ if (!paths.includes(".env"))
96
+ paths.unshift(".env");
97
+ if (!paths.includes(".env.local"))
98
+ paths.push(".env.local");
99
+ const envSpecific = `.env.${nodeEnv}`;
100
+ if (!paths.includes(envSpecific))
101
+ paths.push(envSpecific);
102
+ }
103
+ for (const p of paths) {
104
+ const file = readDotEnv(p);
105
+ for (const [k, v] of Object.entries(file)) {
106
+ if (env[k] === undefined)
107
+ env[k] = v;
108
+ }
109
+ }
110
+ const merged = { ...env };
111
+ if (options.load) {
112
+ for (const layer of options.load) {
113
+ for (const [k, v] of Object.entries(layer)) {
114
+ if (!(k in env))
115
+ merged[k] = v;
116
+ }
117
+ }
118
+ }
119
+ const schema = options.schema;
120
+ if (!schema) {
121
+ return { value: merged, raw: env, errors: [] };
122
+ }
123
+ const result = schema.safeParse(merged);
124
+ if (result.success) {
125
+ return { value: result.data, raw: env, errors: [] };
126
+ }
127
+ const errors = result.error.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`);
128
+ return { value: merged, raw: env, errors };
129
+ }
130
+ function readDotEnv(path) {
131
+ try {
132
+ const fs = __require("fs");
133
+ if (!fs.existsSync(path))
134
+ return {};
135
+ const text = fs.readFileSync(path, "utf8");
136
+ const out = {};
137
+ for (const rawLine of text.split(/\r?\n/)) {
138
+ const line = rawLine.trim();
139
+ if (!line || line.startsWith("#"))
140
+ continue;
141
+ const eq = line.indexOf("=");
142
+ if (eq < 0)
143
+ continue;
144
+ const key = line.slice(0, eq).trim();
145
+ let value = line.slice(eq + 1).trim();
146
+ if (!value.startsWith('"') && !value.startsWith("'")) {
147
+ const hash = value.indexOf(" #");
148
+ if (hash >= 0)
149
+ value = value.slice(0, hash).trim();
150
+ }
151
+ if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
152
+ value = value.slice(1, -1);
153
+ }
154
+ out[key] = value;
155
+ }
156
+ return out;
157
+ } catch {
158
+ return {};
159
+ }
160
+ }
161
+ // packages/config/src/config.module.ts
162
+ import"reflect-metadata";
163
+ import { Module } from "@nexusts/core/decorators/module.js";
164
+ class ConfigModule {
165
+ static forRoot(options = {}) {
166
+ class ConfiguredConfigModule {
167
+ }
168
+ ConfiguredConfigModule = __legacyDecorateClassTS([
169
+ Module({
170
+ providers: [
171
+ ConfigService,
172
+ { provide: ConfigService.TOKEN, useExisting: ConfigService },
173
+ { provide: "CONFIG_OPTIONS", useValue: options }
174
+ ],
175
+ exports: [ConfigService, ConfigService.TOKEN]
176
+ })
177
+ ], ConfiguredConfigModule);
178
+ Object.defineProperty(ConfiguredConfigModule, "name", {
179
+ value: "ConfiguredConfigModule"
180
+ });
181
+ return ConfiguredConfigModule;
182
+ }
183
+ }
184
+ ConfigModule = __legacyDecorateClassTS([
185
+ Module({
186
+ providers: [
187
+ ConfigService,
188
+ { provide: ConfigService.TOKEN, useExisting: ConfigService }
189
+ ],
190
+ exports: [ConfigService, ConfigService.TOKEN]
191
+ })
192
+ ], ConfigModule);
193
+ export {
194
+ ConfigService,
195
+ ConfigModule
196
+ };
197
+
198
+ //# debugId=D09AA5FB2E6CC0DF64756E2164756E21
199
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/config.service.ts", "../src/config.module.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * `ConfigService` — type-safe access to validated environment\n * variables and configuration values.\n *\n * Usage:\n * constructor(@Inject(ConfigService.TOKEN) private config: ConfigService<typeof schema>) {}\n *\n * const dbUrl = this.config.get('DATABASE_URL'); // string\n * const port = this.config.get('PORT', { default: 3000 }); // number\n *\n * For full type inference, parameterize the class with your schema:\n * class MyService {\n * constructor(@Inject(ConfigService.TOKEN) private config: ConfigService<typeof schema>) {}\n * }\n */\n\nimport { Inject, Injectable } from \"@nexusts/core/decorators/index.js\";\nimport type {\n\tConfigSchema,\n\tInferConfig,\n\tConfigOptions,\n\tLoadedConfig,\n} from \"./types.js\";\n\n@Injectable()\nexport class ConfigService<S extends ConfigSchema = ConfigSchema> {\n\t/** DI token — use with `@Inject(ConfigService.TOKEN)`. */\n\tstatic readonly TOKEN = Symbol.for(\"nexus:ConfigService\");\n\n\t/** The validated, fully-typed config. */\n\treadonly config: InferConfig<S>;\n\n\t#raw: Record<string, string | undefined>;\n\t#cache = new Map<string, unknown>();\n\t#strict: boolean;\n\n\tconstructor(\n\t\t@Inject(\"CONFIG_OPTIONS\") private readonly options: ConfigOptions<S> = {},\n\t) {\n\t\tconst loaded = loadConfig(options);\n\t\tthis.config = loaded.value as InferConfig<S>;\n\t\tthis.#raw = loaded.raw;\n\t\tthis.#strict = options.strict ?? false;\n\n\t\tif (loaded.errors.length > 0) {\n\t\t\tconst msg =\n\t\t\t\t`[nexus/config] Configuration validation failed:\\n` +\n\t\t\t\tloaded.errors.map((e) => ` - ${e}`).join(\"\\n\");\n\t\t\tif (options.exitOnError) {\n\t\t\t\tconsole.error(msg);\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t\tthrow new Error(msg);\n\t\t}\n\t}\n\n\t/**\n\t * Look up a config value by key. Type-safe when the class is\n\t * parameterized with the schema (`ConfigService<typeof schema>`).\n\t */\n\tget<K extends keyof InferConfig<S>>(key: K): InferConfig<S>[K];\n\tget<K extends keyof InferConfig<S>>(\n\t\tkey: K,\n\t\toptions: { default: InferConfig<S>[K] },\n\t): InferConfig<S>[K];\n\tget(key: string): unknown;\n\tget(key: string, options?: { default?: unknown }): unknown {\n\t\tif (this.options.cache !== false && this.#cache.has(key)) {\n\t\t\treturn this.#cache.get(key);\n\t\t}\n\t\tconst fromConfig = (this.config as Record<string, unknown>)[key];\n\t\tif (fromConfig !== undefined) {\n\t\t\tif (this.options.cache !== false) this.#cache.set(key, fromConfig);\n\t\t\treturn fromConfig;\n\t\t}\n\t\tif (options && \"default\" in options) {\n\t\t\treturn options.default;\n\t\t}\n\t\tif (this.#strict) {\n\t\t\tthrow new Error(`[nexus/config] Unknown config key \"${key}\"`);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Look up a config value by key, throwing if it's missing.\n\t * Convenience for required values.\n\t */\n\trequire<K extends keyof InferConfig<S>>(key: K): InferConfig<S>[K] {\n\t\tconst v = this.get(key);\n\t\tif (v === undefined || v === null || v === \"\") {\n\t\t\tthrow new Error(`[nexus/config] Required config key \"${String(key)}\" is missing`);\n\t\t}\n\t\treturn v as InferConfig<S>[K];\n\t}\n\n\t/**\n\t * Read the raw env value (string), regardless of the schema.\n\t * Useful for debugging.\n\t */\n\tenv(key: string): string | undefined {\n\t\treturn this.#raw[key];\n\t}\n\n\t/** Reload from env. Drops the cache. */\n\treload(): void {\n\t\tthis.#cache.clear();\n\t\tconst loaded = loadConfig(this.options);\n\t\tObject.assign(this.config as object, loaded.value);\n\t\tthis.#raw = loaded.raw;\n\t}\n}\n\n/**\n * Internal: load + validate config.\n *\n * Order: static `load` overrides → `.env` files → `process.env`.\n * Env wins on conflict (most recent takes precedence).\n */\nfunction loadConfig<S extends ConfigSchema>(\n\toptions: ConfigOptions<S>,\n): LoadedConfig<S> {\n\t// 1) process.env as the base layer\n\tconst env: Record<string, string | undefined> = {};\n\tfor (const [k, v] of Object.entries(process.env)) {\n\t\tenv[k] = v;\n\t}\n\n\t// 2) .env files (overrides env defaults but env still wins)\n\tconst paths = options.envFilePaths ?? [];\n\n\t// When envFile is enabled (default), auto-load environment-specific files.\n\tconst useEnvFile = options.envFile !== false;\n\tif (useEnvFile) {\n\t\tconst nodeEnv = options.nodeEnv ?? process.env[\"NODE_ENV\"] ?? \"development\";\n\t\t// Base .env is always loaded first.\n\t\tif (!paths.includes(\".env\")) paths.unshift(\".env\");\n\t\t// .env.local — local overrides (should be .gitignored).\n\t\tif (!paths.includes(\".env.local\")) paths.push(\".env.local\");\n\t\t// .env.{NODE_ENV} — environment-specific (e.g. .env.production).\n\t\tconst envSpecific = `.env.${nodeEnv}`;\n\t\tif (!paths.includes(envSpecific)) paths.push(envSpecific);\n\t}\n\n\tfor (const p of paths) {\n\t\tconst file = readDotEnv(p);\n\t\tfor (const [k, v] of Object.entries(file)) {\n\t\t\tif (env[k] === undefined) env[k] = v;\n\t\t}\n\t}\n\n\t// 3) Static load() overrides\n\tconst merged: Record<string, unknown> = { ...env };\n\tif (options.load) {\n\t\tfor (const layer of options.load) {\n\t\t\tfor (const [k, v] of Object.entries(layer)) {\n\t\t\t\tif (!(k in env)) merged[k] = v;\n\t\t\t}\n\t\t}\n\t}\n\n\t// 4) Validate through Zod\n\tconst schema = options.schema;\n\tif (!schema) {\n\t\treturn { value: merged as InferConfig<S>, raw: env, errors: [] };\n\t}\n\tconst result = schema.safeParse(merged);\n\tif (result.success) {\n\t\treturn { value: result.data as InferConfig<S>, raw: env, errors: [] };\n\t}\n\tconst errors = result.error.issues.map(\n\t\t(i) => `${i.path.join(\".\") || \"(root)\"}: ${i.message}`,\n\t);\n\treturn { value: merged as InferConfig<S>, raw: env, errors };\n}\n\n/**\n * Minimal .env reader. Avoids a runtime dep on `dotenv`.\n * Supports `KEY=value` lines, comments, and quoted values.\n */\nfunction readDotEnv(path: string): Record<string, string> {\n\ttry {\n\t\t// Bun has Bun.file(); Node has node:fs. Use whichever is available.\n\t\t// eslint-disable-next-line @typescript-eslint/no-require-imports\n\t\tconst fs = require(\"node:fs\") as typeof import(\"node:fs\");\n\t\tif (!fs.existsSync(path)) return {};\n\t\tconst text = fs.readFileSync(path, \"utf8\");\n\t\tconst out: Record<string, string> = {};\n\t\tfor (const rawLine of text.split(/\\r?\\n/)) {\n\t\t\tconst line = rawLine.trim();\n\t\t\tif (!line || line.startsWith(\"#\")) continue;\n\t\t\tconst eq = line.indexOf(\"=\");\n\t\t\tif (eq < 0) continue;\n\t\t\tconst key = line.slice(0, eq).trim();\n\t\t\tlet value = line.slice(eq + 1).trim();\n\t\t\t// Strip inline comments after unquoted values.\n\t\t\tif (!value.startsWith('\"') && !value.startsWith(\"'\")) {\n\t\t\t\tconst hash = value.indexOf(\" #\");\n\t\t\t\tif (hash >= 0) value = value.slice(0, hash).trim();\n\t\t\t}\n\t\t\t// Strip surrounding quotes.\n\t\t\tif (\n\t\t\t\t(value.startsWith('\"') && value.endsWith('\"')) ||\n\t\t\t\t(value.startsWith(\"'\") && value.endsWith(\"'\"))\n\t\t\t) {\n\t\t\t\tvalue = value.slice(1, -1);\n\t\t\t}\n\t\t\tout[key] = value;\n\t\t}\n\t\treturn out;\n\t} catch {\n\t\treturn {};\n\t}\n}",
6
+ "/**\n * `ConfigModule` — drop-in module for typed, validated configuration.\n *\n * Usage:\n * // src/config/schema.ts\n * import { z } from 'zod';\n * export const configSchema = z.object({\n * DATABASE_URL: z.string().url(),\n * PORT: z.coerce.number().default(3000),\n * LOG_LEVEL: z.enum(['debug', 'info', 'warn', 'error']).default('info'),\n * });\n *\n * // src/app/app.module.ts\n * @Module({\n * imports: [\n * ConfigModule.forRoot({\n * schema: configSchema,\n * envFilePaths: ['.env.local', '.env'],\n * }),\n * ],\n * })\n * export class AppModule {}\n *\n * // any service\n * class MyService {\n * constructor(@Inject(ConfigService.TOKEN) private config: ConfigService<typeof configSchema>) {}\n * connect() {\n * return this.config.require('DATABASE_URL');\n * }\n * }\n */\n\nimport \"reflect-metadata\";\nimport { Module } from \"@nexusts/core/decorators/module.js\";\nimport { ConfigService } from \"./config.service.js\";\nimport type { ConfigOptions } from \"./types.js\";\n\n@Module({\n\tproviders: [\n\t\tConfigService,\n\t\t{ provide: ConfigService.TOKEN, useExisting: ConfigService },\n\t],\n\texports: [ConfigService, ConfigService.TOKEN],\n})\nexport class ConfigModule {\n\tstatic forRoot(options: ConfigOptions = {}) {\n\t\t@Module({\n\t\t\tproviders: [\n\t\t\t\tConfigService,\n\t\t\t\t{ provide: ConfigService.TOKEN, useExisting: ConfigService },\n\t\t\t\t{ provide: \"CONFIG_OPTIONS\", useValue: options },\n\t\t\t],\n\t\t\texports: [ConfigService, ConfigService.TOKEN],\n\t\t})\n\t\tclass ConfiguredConfigModule {}\n\n\t\tObject.defineProperty(ConfiguredConfigModule, \"name\", {\n\t\t\tvalue: \"ConfiguredConfigModule\",\n\t\t});\n\n\t\treturn ConfiguredConfigModule;\n\t}\n}\n"
7
+ ],
8
+ "mappings": ";;;;;;;;;;;;;;;;;;AAgBA;AASO,MAAM,cAAqD;AAAA,EAYrB;AAAA,SAV5B,QAAQ,OAAO,IAAI,qBAAqB;AAAA,EAG/C;AAAA,EAET;AAAA,EACA,SAAS,IAAI;AAAA,EACb;AAAA,EAEA,WAAW,CACiC,UAA4B,CAAC,GACvE;AAAA,IAD0C;AAAA,IAE3C,MAAM,SAAS,WAAW,OAAO;AAAA,IACjC,KAAK,SAAS,OAAO;AAAA,IACrB,KAAK,OAAO,OAAO;AAAA,IACnB,KAAK,UAAU,QAAQ,UAAU;AAAA,IAEjC,IAAI,OAAO,OAAO,SAAS,GAAG;AAAA,MAC7B,MAAM,MACL;AAAA,IACA,OAAO,OAAO,IAAI,CAAC,MAAM,OAAO,GAAG,EAAE,KAAK;AAAA,CAAI;AAAA,MAC/C,IAAI,QAAQ,aAAa;AAAA,QACxB,QAAQ,MAAM,GAAG;AAAA,QACjB,QAAQ,KAAK,CAAC;AAAA,MACf;AAAA,MACA,MAAM,IAAI,MAAM,GAAG;AAAA,IACpB;AAAA;AAAA,EAaD,GAAG,CAAC,KAAa,SAA0C;AAAA,IAC1D,IAAI,KAAK,QAAQ,UAAU,SAAS,KAAK,OAAO,IAAI,GAAG,GAAG;AAAA,MACzD,OAAO,KAAK,OAAO,IAAI,GAAG;AAAA,IAC3B;AAAA,IACA,MAAM,aAAc,KAAK,OAAmC;A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,UAC3D,EAAE,SAAS,kBAAkB,UAAU,QAAQ;AAAA,QAChD;AAAA,QACA,SAAS,CAAC,eAAe,cAAc,KAAK;AAAA,MAC7C,CAAC;AAAA,OACK;AAAA,IAEN,OAAO,eAAe,wBAAwB,QAAQ;AAAA,MACrD,OAAO;AAAA,IACR,CAAC;AAAA,IAED,OAAO;AAAA;AAET;AAlBa,eAAN;AAAA,EAPN,OAAO;AAAA,IACP,WAAW;AAAA,MACV;AAAA,MACA,EAAE,SAAS,cAAc,OAAO,aAAa,cAAc;AAAA,IAC5D;AAAA,IACA,SAAS,CAAC,eAAe,cAAc,KAAK;AAAA,EAC7C,CAAC;AAAA,GACY;",
9
+ "debugId": "D09AA5FB2E6CC0DF64756E2164756E21",
10
+ "names": []
11
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@nexusts/config",
3
+ "version": "0.7.0",
4
+ "description": "Zod-validated configuration with layered loading",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "bun run ../../build.ts"
21
+ },
22
+ "keywords": [
23
+ "nexusts",
24
+ "framework",
25
+ "bun"
26
+ ],
27
+ "license": "MIT",
28
+ "dependencies": {
29
+ "@nexusts/core": "^0.7.0"
30
+ }
31
+ }