@kb-labs/core-sys 1.2.0 → 1.4.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 +3 -1
- package/dist/index.cjs +86 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +191 -5
- package/dist/index.js +431 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/fs/__tests__/fs.spec.d.ts +0 -2
- package/dist/fs/__tests__/fs.spec.d.ts.map +0 -1
- package/dist/fs/__tests__/fs.spec.js +0 -22
- package/dist/fs/__tests__/fs.spec.js.map +0 -1
- package/dist/fs/fs.d.ts +0 -6
- package/dist/fs/fs.d.ts.map +0 -1
- package/dist/fs/fs.js +0 -12
- package/dist/fs/fs.js.map +0 -1
- package/dist/fs/index.d.ts +0 -2
- package/dist/fs/index.d.ts.map +0 -1
- package/dist/fs/index.js +0 -2
- package/dist/fs/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/output/factory.d.ts +0 -20
- package/dist/output/factory.d.ts.map +0 -1
- package/dist/output/factory.js +0 -101
- package/dist/output/factory.js.map +0 -1
- package/dist/output/index.d.ts +0 -8
- package/dist/output/index.d.ts.map +0 -1
- package/dist/output/index.js +0 -7
- package/dist/output/index.js.map +0 -1
- package/dist/output/output-impl.d.ts +0 -40
- package/dist/output/output-impl.d.ts.map +0 -1
- package/dist/output/output-impl.js +0 -241
- package/dist/output/output-impl.js.map +0 -1
- package/dist/output/types.d.ts +0 -122
- package/dist/output/types.d.ts.map +0 -1
- package/dist/output/types.js +0 -6
- package/dist/output/types.js.map +0 -1
- package/dist/repo/__tests__/repo.spec.d.ts +0 -2
- package/dist/repo/__tests__/repo.spec.d.ts.map +0 -1
- package/dist/repo/__tests__/repo.spec.js +0 -25
- package/dist/repo/__tests__/repo.spec.js.map +0 -1
- package/dist/repo/index.d.ts +0 -2
- package/dist/repo/index.d.ts.map +0 -1
- package/dist/repo/index.js +0 -2
- package/dist/repo/index.js.map +0 -1
- package/dist/repo/repo.d.ts +0 -11
- package/dist/repo/repo.d.ts.map +0 -1
- package/dist/repo/repo.js +0 -36
- package/dist/repo/repo.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/types.d.ts +0 -6
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js +0 -2
- package/dist/types/types.js.map +0 -1
package/dist/repo/repo.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/core/sys/repo
|
|
3
|
-
* Repository root discovery. Pure infrastructure, no domain keys.
|
|
4
|
-
*/
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { promises as fsp } from "node:fs";
|
|
7
|
-
/**
|
|
8
|
-
* Find repository root by searching for markers in priority order.
|
|
9
|
-
* First searches entire tree for pnpm-workspace.yaml (monorepo root),
|
|
10
|
-
* then .git, then package.json as fallback.
|
|
11
|
-
*/
|
|
12
|
-
export async function findRepoRoot(startDir = process.cwd()) {
|
|
13
|
-
const markersPriority = ["pnpm-workspace.yaml", ".git", "package.json"];
|
|
14
|
-
// Try each marker in priority order, searching entire tree each time
|
|
15
|
-
for (const marker of markersPriority) {
|
|
16
|
-
let dir = path.resolve(startDir);
|
|
17
|
-
while (true) {
|
|
18
|
-
try {
|
|
19
|
-
await fsp.access(path.join(dir, marker));
|
|
20
|
-
return dir; // Found it!
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
// Continue searching upward
|
|
24
|
-
}
|
|
25
|
-
const parent = path.dirname(dir);
|
|
26
|
-
if (parent === dir) {
|
|
27
|
-
// Reached filesystem root without finding this marker
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
dir = parent;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// Fallback: return current directory if nothing found
|
|
34
|
-
return path.resolve(startDir);
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=repo.js.map
|
package/dist/repo/repo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../src/repo/repo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;IACvD,MAAM,eAAe,GAAG,CAAC,qBAAqB,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IAExE,qEAAqE;IACrE,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACnC,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,IAAI,EAAE,CAAC;YACV,IAAI,CAAC;gBACD,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;gBACzC,OAAO,GAAG,CAAC,CAAC,YAAY;YAC5B,CAAC;YAAC,MAAM,CAAC;gBACL,4BAA4B;YAChC,CAAC;YAED,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;gBACjB,sDAAsD;gBACtD,MAAM;YACV,CAAC;YACD,GAAG,GAAG,MAAM,CAAC;QACjB,CAAC;IACL,CAAC;IAED,sDAAsD;IACtD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
package/dist/types/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
package/dist/types/types.js
DELETED
package/dist/types/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":""}
|