@theholocron/datapad 5.0.0-alpha.450 → 5.0.0-alpha.451
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/dist/index.d.mts +29 -0
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@theholocron/datapad` — generic config-file loading for Holocron.
|
|
3
|
+
*
|
|
4
|
+
* A datapad reads and holds data; this reads and holds config files.
|
|
5
|
+
* Discover `<name>.config.{ts,js,mjs,cjs,json}`, load it (typed configs
|
|
6
|
+
* via `tsx`, no build step), layer a dedicated file over a key of a
|
|
7
|
+
* parent file, deep-merge, and hand back a plain object. No schema, no
|
|
8
|
+
* validation, no defaults — the consumer owns those. `readConfigSource` +
|
|
9
|
+
* `loadConfigFromContent` cover the same loading for content that didn't come
|
|
10
|
+
* from a file on disk (a network fetch, a git blob, …), and
|
|
11
|
+
* `withConfigSandbox` prepares the directory that needs. A config directory of area files (`.holocron/<area>.*`) is
|
|
12
|
+
* read with `loadConfigDir` from disk, or with `readConfigDirSource` / `writeConfigDir` from a remote source; the
|
|
13
|
+
* directory name and the area names are parameters.
|
|
14
|
+
*
|
|
15
|
+
* Probe order is **TS-first**: `.ts` → `.js` → `.mjs` → `.cjs` → `.json`
|
|
16
|
+
* (ADR-0010). `walkUp` adds the "nearest config" search (see
|
|
17
|
+
* `loadConfigFile`).
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { loadConfigFile, loadLayered, mergeConfig, createDefineConfig } from "@theholocron/datapad";
|
|
21
|
+
*
|
|
22
|
+
* const found = await loadConfigFile<HolocronConfig>({ cwd, name: "holocron" });
|
|
23
|
+
* const layered = await loadLayered<TasksConfig>({
|
|
24
|
+
* cwd,
|
|
25
|
+
* name: "astromech",
|
|
26
|
+
* fallback: { file: "holocron", key: "tasks" },
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
1
30
|
import { deepMerge as mergeConfig } from "@theholocron/object-utils";
|
|
2
31
|
/** Default extension probe order, highest priority first. */
|
|
3
32
|
export declare const DEFAULT_EXTENSIONS: readonly ["ts", "js", "mjs", "cjs", "json"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/datapad",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.451",
|
|
4
4
|
"description": "Generic config-file loading for Holocron — discover, load (JSON/JS/TS/ESM/CJS), and merge <name>.config.* files with a typed defineConfig.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"tsx": "4.23.15",
|
|
36
|
-
"@theholocron/fs-utils": "^1.17.0-alpha.4",
|
|
37
36
|
"@theholocron/misc-utils": "^1.17.0-alpha.4",
|
|
37
|
+
"@theholocron/fs-utils": "^1.17.0-alpha.4",
|
|
38
38
|
"@theholocron/object-utils": "^1.17.0-alpha.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"eslint": "^10.14.0",
|
|
45
45
|
"eslint-plugin-n": "^18.5.0",
|
|
46
46
|
"globals": "^17.14.0",
|
|
47
|
-
"tsdown": "^0.23.
|
|
47
|
+
"tsdown": "^0.23.7",
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vitest": "^5.1.0",
|
|
50
50
|
"@theholocron/eslint-config": "^8.9.0-alpha.17",
|