@mudah-cli/config 0.1.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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Dotted-key configuration repository.
3
+ *
4
+ * Values are stored in a nested plain object; keys use dot notation
5
+ * (`app.name`). `merge` follows standard merge semantics: existing values win over
6
+ * the merged-in defaults.
7
+ */
8
+ export declare class ConfigRepository {
9
+ private root;
10
+ /** Set a value at a dotted key, creating intermediate objects as needed. */
11
+ set(key: string, value: unknown): this;
12
+ /** Read a value at a dotted key, or `defaultValue` when missing. */
13
+ get<T = unknown>(key: string, defaultValue?: T): T;
14
+ /** Whether a dotted key holds a value. */
15
+ has(key: string): boolean;
16
+ /** Remove a dotted key. Returns whether anything was removed. */
17
+ delete(key: string): boolean;
18
+ /** The entire configuration tree (live reference, use with care). */
19
+ all(): Record<string, unknown>;
20
+ /**
21
+ * Merge defaults under an existing config group. Values already present
22
+ * win; missing keys are filled in.
23
+ */
24
+ merge(key: string, defaults: Record<string, unknown>): this;
25
+ /** Replace the entire configuration tree. */
26
+ clear(): this;
27
+ }
@@ -0,0 +1,48 @@
1
+ import { assignPath, deepMerge, hasPath, isPlainObject, readPath, removePath } from './paths.js';
2
+ /**
3
+ * Dotted-key configuration repository.
4
+ *
5
+ * Values are stored in a nested plain object; keys use dot notation
6
+ * (`app.name`). `merge` follows standard merge semantics: existing values win over
7
+ * the merged-in defaults.
8
+ */
9
+ export class ConfigRepository {
10
+ root = {};
11
+ /** Set a value at a dotted key, creating intermediate objects as needed. */
12
+ set(key, value) {
13
+ assignPath(this.root, key, value);
14
+ return this;
15
+ }
16
+ /** Read a value at a dotted key, or `defaultValue` when missing. */
17
+ get(key, defaultValue) {
18
+ return readPath(this.root, key, defaultValue);
19
+ }
20
+ /** Whether a dotted key holds a value. */
21
+ has(key) {
22
+ return hasPath(this.root, key);
23
+ }
24
+ /** Remove a dotted key. Returns whether anything was removed. */
25
+ delete(key) {
26
+ return removePath(this.root, key);
27
+ }
28
+ /** The entire configuration tree (live reference, use with care). */
29
+ all() {
30
+ return this.root;
31
+ }
32
+ /**
33
+ * Merge defaults under an existing config group. Values already present
34
+ * win; missing keys are filled in.
35
+ */
36
+ merge(key, defaults) {
37
+ const existing = this.get(key, undefined);
38
+ const base = isPlainObject(existing) ? existing : {};
39
+ this.set(key, deepMerge(base, defaults));
40
+ return this;
41
+ }
42
+ /** Replace the entire configuration tree. */
43
+ clear() {
44
+ this.root = {};
45
+ return this;
46
+ }
47
+ }
48
+ //# sourceMappingURL=config-repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-repository.js","sourceRoot":"","sources":["../src/config-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEjG;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IACnB,IAAI,GAA4B,EAAE,CAAC;IAE3C,4EAA4E;IAC5E,GAAG,CAAC,GAAW,EAAE,KAAc;QAC7B,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oEAAoE;IACpE,GAAG,CAAc,GAAW,EAAE,YAAgB;QAC5C,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,CAAM,CAAC;IACrD,CAAC;IAED,0CAA0C;IAC1C,GAAG,CAAC,GAAW;QACb,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,iEAAiE;IACjE,MAAM,CAAC,GAAW;QAChB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,qEAAqE;IACrE,GAAG;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAW,EAAE,QAAiC;QAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAsC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC/E,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6CAA6C;IAC7C,KAAK;QACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Define a typed configuration file. Identity at runtime — the value exists
3
+ * for type inference, giving apps full completion on `config.get('app.x')`
4
+ * when the config file is typed.
5
+ *
6
+ * ```ts
7
+ * // config/app.ts
8
+ * export default defineConfig({
9
+ * name: 'my-cli',
10
+ * env: env('APP_ENV', 'production'),
11
+ * });
12
+ * ```
13
+ */
14
+ export declare function defineConfig<T extends Record<string, unknown>>(config: T): T;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Define a typed configuration file. Identity at runtime — the value exists
3
+ * for type inference, giving apps full completion on `config.get('app.x')`
4
+ * when the config file is typed.
5
+ *
6
+ * ```ts
7
+ * // config/app.ts
8
+ * export default defineConfig({
9
+ * name: 'my-cli',
10
+ * env: env('APP_ENV', 'production'),
11
+ * });
12
+ * ```
13
+ */
14
+ export function defineConfig(config) {
15
+ return config;
16
+ }
17
+ //# sourceMappingURL=define-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-config.js","sourceRoot":"","sources":["../src/define-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAoC,MAAS;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/env.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Load a `.env` file into `process.env` using the native
3
+ * `process.loadEnvFile`. Returns false when the file does not exist, so
4
+ * scaffolds work before a `.env` is created.
5
+ */
6
+ export declare function loadEnvFile(path?: string): boolean;
7
+ /**
8
+ * Read a typed environment variable. Strings are parsed to booleans
9
+ * (`true`/`false`), null, numbers, and JSON objects/arrays when they look
10
+ * like them; everything else passes through as a string.
11
+ */
12
+ export declare function env<T = string>(key: string, defaultValue?: T): T | undefined;
package/dist/env.js ADDED
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Load a `.env` file into `process.env` using the native
3
+ * `process.loadEnvFile`. Returns false when the file does not exist, so
4
+ * scaffolds work before a `.env` is created.
5
+ */
6
+ export function loadEnvFile(path = '.env') {
7
+ try {
8
+ process.loadEnvFile(path);
9
+ return true;
10
+ }
11
+ catch {
12
+ return false;
13
+ }
14
+ }
15
+ /**
16
+ * Read a typed environment variable. Strings are parsed to booleans
17
+ * (`true`/`false`), null, numbers, and JSON objects/arrays when they look
18
+ * like them; everything else passes through as a string.
19
+ */
20
+ export function env(key, defaultValue) {
21
+ const raw = process.env[key];
22
+ if (raw === undefined)
23
+ return defaultValue;
24
+ return parseValue(raw);
25
+ }
26
+ function parseValue(raw) {
27
+ const lowered = raw.toLowerCase();
28
+ if (lowered === 'true')
29
+ return true;
30
+ if (lowered === 'false')
31
+ return false;
32
+ if (lowered === 'null' || lowered === 'none')
33
+ return null;
34
+ if (/^-?\d+(\.\d+)?$/.test(raw))
35
+ return Number(raw);
36
+ if (raw.startsWith('{') || raw.startsWith('[')) {
37
+ try {
38
+ return JSON.parse(raw);
39
+ }
40
+ catch {
41
+ return raw;
42
+ }
43
+ }
44
+ return raw;
45
+ }
46
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAI,GAAG,MAAM;IACvC,IAAI,CAAC;QACH,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAa,GAAW,EAAE,YAAgB;IAC3D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,YAAY,CAAC;IAC3C,OAAO,UAAU,CAAI,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,UAAU,CAAI,GAAW;IAChC,MAAM,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAClC,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,IAAS,CAAC;IACzC,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,KAAU,CAAC;IAC3C,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,IAAS,CAAC;IAC/D,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC,GAAG,CAAM,CAAC;IACzD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAM,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,GAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ConfigRepository } from './config-repository.js';
2
+ export { defineConfig } from './define-config.js';
3
+ export { env, loadEnvFile } from './env.js';
4
+ export { loadConfigFiles, type LoadConfigOptions } from './load-config-files.js';
5
+ export { deepMerge, isPlainObject } from './paths.js';
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { ConfigRepository } from './config-repository.js';
2
+ export { defineConfig } from './define-config.js';
3
+ export { env, loadEnvFile } from './env.js';
4
+ export { loadConfigFiles } from './load-config-files.js';
5
+ export { deepMerge, isPlainObject } from './paths.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,eAAe,EAA0B,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface LoadConfigOptions {
2
+ /** Directory to load from (relative to `basePath` or absolute). Default `config`. */
3
+ dir?: string;
4
+ }
5
+ /**
6
+ * Load every `config/*.ts|js` file (sorted for determinism) and return a map
7
+ * of `{ file-stem: default-export }`. A missing directory yields `{}`.
8
+ *
9
+ * Works on both Node (native TypeScript) and Bun.
10
+ */
11
+ export declare function loadConfigFiles(basePath: string, options?: LoadConfigOptions): Promise<Record<string, unknown>>;
@@ -0,0 +1,41 @@
1
+ import { readdir } from 'node:fs/promises';
2
+ import { isAbsolute, join } from 'node:path';
3
+ import { pathToFileURL } from 'node:url';
4
+ /**
5
+ * Load every `config/*.ts|js` file (sorted for determinism) and return a map
6
+ * of `{ file-stem: default-export }`. A missing directory yields `{}`.
7
+ *
8
+ * Works on both Node (native TypeScript) and Bun.
9
+ */
10
+ export async function loadConfigFiles(basePath, options = {}) {
11
+ const dir = options.dir ?? 'config';
12
+ const absolute = isAbsolute(dir) ? dir : join(basePath, dir);
13
+ let entries;
14
+ try {
15
+ entries = await readdir(absolute, { withFileTypes: true });
16
+ }
17
+ catch {
18
+ return {};
19
+ }
20
+ const files = entries
21
+ .filter((entry) => entry.isFile() && /\.(ts|mts|js|mjs)$/.test(entry.name))
22
+ .map((entry) => entry.name)
23
+ .sort();
24
+ const result = {};
25
+ for (const file of files) {
26
+ const name = file.replace(/\.(ts|mts|js|mjs)$/, '');
27
+ try {
28
+ const mod = await import(pathToFileURL(join(absolute, file)).href);
29
+ const value = mod.default ?? mod;
30
+ if (value && typeof value === 'object') {
31
+ result[name] = value;
32
+ }
33
+ }
34
+ catch (error) {
35
+ const message = error instanceof Error ? error.message : String(error);
36
+ console.error(`[config] Failed to load ${file}: ${message}`);
37
+ }
38
+ }
39
+ return result;
40
+ }
41
+ //# sourceMappingURL=load-config-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-config-files.js","sourceRoot":"","sources":["../src/load-config-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOzC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAgB,EAChB,OAAO,GAAsB,EAAE;IAE/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC;IACpC,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAE7D,IAAI,OAAyB,CAAC;IAC9B,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,OAAO;SAClB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC1E,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;SAC1B,IAAI,EAAE,CAAC;IAEV,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACnE,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC;YACjC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACvC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;YACvB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
2
+ export declare function readPath(root: Record<string, unknown>, key: string, defaultValue?: unknown): unknown;
3
+ export declare function hasPath(root: Record<string, unknown>, key: string): boolean;
4
+ export declare function assignPath(root: Record<string, unknown>, key: string, value: unknown): void;
5
+ export declare function removePath(root: Record<string, unknown>, key: string): boolean;
6
+ /**
7
+ * Deep-merge where `target` wins: values already present in the target are
8
+ * kept, missing keys are filled in from `source` (mergeConfig semantics).
9
+ */
10
+ export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Record<string, unknown>): T;
package/dist/paths.js ADDED
@@ -0,0 +1,74 @@
1
+ export function isPlainObject(value) {
2
+ if (typeof value !== 'object' || value === null)
3
+ return false;
4
+ const proto = Object.getPrototypeOf(value);
5
+ return proto === Object.prototype || proto === null;
6
+ }
7
+ function segments(key) {
8
+ return key.split('.');
9
+ }
10
+ export function readPath(root, key, defaultValue) {
11
+ let current = root;
12
+ for (const segment of segments(key)) {
13
+ if (!isPlainObject(current))
14
+ return defaultValue;
15
+ current = current[segment];
16
+ }
17
+ return current === undefined ? defaultValue : current;
18
+ }
19
+ export function hasPath(root, key) {
20
+ let current = root;
21
+ const parts = segments(key);
22
+ for (const segment of parts) {
23
+ if (!isPlainObject(current) || !(segment in current))
24
+ return false;
25
+ current = current[segment];
26
+ }
27
+ return true;
28
+ }
29
+ export function assignPath(root, key, value) {
30
+ const parts = segments(key);
31
+ let current = root;
32
+ for (const segment of parts.slice(0, -1)) {
33
+ const next = current[segment];
34
+ if (!isPlainObject(next)) {
35
+ current[segment] = {};
36
+ }
37
+ current = current[segment];
38
+ }
39
+ const last = parts[parts.length - 1];
40
+ current[last] = value;
41
+ }
42
+ export function removePath(root, key) {
43
+ const parts = segments(key);
44
+ let current = root;
45
+ for (const segment of parts.slice(0, -1)) {
46
+ const next = current[segment];
47
+ if (!isPlainObject(next))
48
+ return false;
49
+ current = next;
50
+ }
51
+ const last = parts[parts.length - 1];
52
+ if (!(last in current))
53
+ return false;
54
+ delete current[last];
55
+ return true;
56
+ }
57
+ /**
58
+ * Deep-merge where `target` wins: values already present in the target are
59
+ * kept, missing keys are filled in from `source` (mergeConfig semantics).
60
+ */
61
+ export function deepMerge(target, source) {
62
+ const result = { ...target };
63
+ for (const [key, value] of Object.entries(source)) {
64
+ const existing = result[key];
65
+ if (isPlainObject(existing) && isPlainObject(value)) {
66
+ result[key] = deepMerge(existing, value);
67
+ }
68
+ else if (existing === undefined) {
69
+ result[key] = value;
70
+ }
71
+ }
72
+ return result;
73
+ }
74
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"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"}
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@mudah-cli/config",
3
+ "version": "0.1.0",
4
+ "description": "Typed configuration repository, .env loading, and dotted-key access.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=26"
9
+ },
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "sideEffects": false,
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }