pi-supernova 0.0.11 → 0.0.15
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/CHANGELOG.md +56 -3
- package/README.md +33 -13
- package/bottleneck.js +1 -1
- package/catalog.js +8 -7
- package/check.js +166 -0
- package/config.default.json +1 -0
- package/config.js +1 -1
- package/decode.js +0 -10
- package/evidence.js +13 -30
- package/fuzzy.js +182 -0
- package/guest-worker.js +10 -8
- package/host-bridge.js +152 -103
- package/index.js +31 -40
- package/ledger.js +178 -0
- package/omp-frame.js +7 -22
- package/outline.js +80 -0
- package/package.json +6 -1
- package/render-measure.js +2 -30
- package/render.js +32 -146
- package/repo-index.js +105 -11
- package/runtime.js +3 -20
- package/search.js +141 -0
- package/snap.js +1 -6
- package/surface.js +22 -13
- package/vfs.js +0 -5
- package/workspace.js +14 -0
package/vfs.js
CHANGED
package/workspace.js
CHANGED
|
@@ -41,6 +41,20 @@ async function realpathNearest(target) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/** Workspace-relative path with "/" separators, the form every model-facing surface uses. */
|
|
45
|
+
export function relativeSlash(root, absolute) {
|
|
46
|
+
return (path.relative(root, absolute) || absolute).split(path.sep).join("/");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const TEST_SEGMENTS = new Set(["test", "tests", "__tests__", "spec"]);
|
|
50
|
+
|
|
51
|
+
/** One rule for "is this a test file" across snap, evidence, and outlines. */
|
|
52
|
+
export function isTestPath(filePath) {
|
|
53
|
+
const segments = filePath.split(/[\\/]/);
|
|
54
|
+
const base = segments[segments.length - 1];
|
|
55
|
+
return segments.some((s) => TEST_SEGMENTS.has(s)) || /\.(test|spec)\./.test(base);
|
|
56
|
+
}
|
|
57
|
+
|
|
44
58
|
export async function resolveWorkspacePath(cwd, inputPath, opName, allowRoot = false) {
|
|
45
59
|
if (inputPath == null || !isString(inputPath) || !inputPath.trim()) {
|
|
46
60
|
throw new Error(`${opName} requires path`);
|