@shrkcrft/config 0.1.0-alpha.7 → 0.1.0-alpha.9
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 +1 -1
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +11 -2
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
SharkCraft config loader: sharkcraft.config.ts discovery, defaults, zod-validated schema.
|
|
4
4
|
|
|
5
|
-
Part of [SharkCraft](https://github.com/
|
|
5
|
+
Part of [SharkCraft](https://github.com/sharkcraft/sharkcraft) — a deterministic, local-first toolkit that gives AI coding agents durable project context. See the main repo for documentation, examples, and the `shrk` CLI.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsC,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAKhE,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAID,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CA+DjG"}
|
package/dist/config-loader.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import { existsSync } from 'node:fs';
|
|
2
10
|
import * as nodePath from 'node:path';
|
|
3
|
-
import {
|
|
11
|
+
import { pathToFileURL } from 'node:url';
|
|
12
|
+
import { AppErrorImpl, ERROR_CODES, err, ok } from '@shrkcrft/core';
|
|
4
13
|
import { withDefaults } from "./default-config.js";
|
|
5
14
|
import { detectProjectRoot, findSharkcraftDir } from "./project-config-resolver.js";
|
|
6
15
|
import { SharkCraftConfigSchema } from "./config-schema.js";
|
|
@@ -17,7 +26,7 @@ export async function loadProjectConfig(startDir) {
|
|
|
17
26
|
if (!existsSync(fullPath))
|
|
18
27
|
continue;
|
|
19
28
|
try {
|
|
20
|
-
const mod = await
|
|
29
|
+
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(fullPath).href)));
|
|
21
30
|
const userConfig = (mod.default ?? mod) || {};
|
|
22
31
|
const parsed = SharkCraftConfigSchema.safeParse(userConfig);
|
|
23
32
|
if (!parsed.success) {
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shrkcrft/config",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "SharkCraft config loader: sharkcraft.config.ts discovery, defaults, zod-validated schema.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SharkCraft contributors",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"bun": "./src/index.ts",
|
|
14
13
|
"import": "./dist/index.js",
|
|
15
14
|
"default": "./dist/index.js"
|
|
16
15
|
}
|
|
@@ -22,12 +21,12 @@
|
|
|
22
21
|
],
|
|
23
22
|
"repository": {
|
|
24
23
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/sharkcraft/sharkcraft.git",
|
|
26
25
|
"directory": "packages/config"
|
|
27
26
|
},
|
|
28
|
-
"homepage": "https://github.com/
|
|
27
|
+
"homepage": "https://github.com/sharkcraft/sharkcraft",
|
|
29
28
|
"bugs": {
|
|
30
|
-
"url": "https://github.com/
|
|
29
|
+
"url": "https://github.com/sharkcraft/sharkcraft/issues"
|
|
31
30
|
},
|
|
32
31
|
"keywords": [
|
|
33
32
|
"sharkcraft",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
44
43
|
},
|
|
45
44
|
"dependencies": {
|
|
46
|
-
"@shrkcrft/core": "^0.1.0-alpha.
|
|
45
|
+
"@shrkcrft/core": "^0.1.0-alpha.9",
|
|
47
46
|
"zod": "^3.25.0 || ^4.0.0"
|
|
48
47
|
},
|
|
49
48
|
"publishConfig": {
|