@skill-map/cli 0.50.1 → 0.52.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/dist/cli.js +197 -95
- package/dist/conformance/index.js +13 -25
- package/dist/index.js +92 -409
- package/dist/kernel/index.js +92 -409
- package/dist/ui/{chunk-4N5LGWJ4.js → chunk-5MCXQKRN.js} +14 -14
- package/dist/ui/{chunk-DOWLJNMD.js → chunk-6B5EAHIM.js} +13 -13
- package/dist/ui/chunk-AQN27TN2.js +123 -0
- package/dist/ui/chunk-CAJ7ZI44.js +1 -0
- package/dist/ui/chunk-E2XO4JVD.js +1 -0
- package/dist/ui/chunk-WHZVGOS3.js +5 -0
- package/dist/ui/chunk-ZNDMBION.js +2206 -0
- package/dist/ui/index.html +8 -2
- package/dist/ui/main-2DWVSRRX.js +4 -0
- package/dist/ui/{styles-O3EXBCXH.css → styles-QBTVKEVX.css} +1 -1
- package/package.json +2 -2
- package/dist/ui/chunk-76APRPAZ.js +0 -123
- package/dist/ui/chunk-DQEAPUE5.js +0 -2349
- package/dist/ui/chunk-FQQYWQV6.js +0 -1
- package/dist/ui/chunk-OYCCFH2S.js +0 -1
- package/dist/ui/main-I3HSF6GU.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// conformance/index.ts
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cc85d6cc-8968-5fbd-b7b7-eab3d298263d")}catch(e){}}();
|
|
4
4
|
import { spawnSync } from "child_process";
|
|
5
5
|
import { cpSync, existsSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync } from "fs";
|
|
6
6
|
import { tmpdir } from "os";
|
|
7
|
-
import { isAbsolute, join as
|
|
7
|
+
import { isAbsolute, join as join2, relative, resolve } from "path";
|
|
8
8
|
|
|
9
9
|
// kernel/util/format-error.ts
|
|
10
10
|
function formatErrorMessage(err) {
|
|
@@ -12,20 +12,8 @@ function formatErrorMessage(err) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// kernel/util/skill-map-paths.ts
|
|
15
|
-
import { join
|
|
16
|
-
|
|
17
|
-
// core/paths/db-path.ts
|
|
18
|
-
import { join, resolve } from "path";
|
|
15
|
+
import { join } from "path";
|
|
19
16
|
var SKILL_MAP_DIR = ".skill-map";
|
|
20
|
-
var DB_FILENAME = "skill-map.db";
|
|
21
|
-
var LOCAL_SETTINGS_FILENAME = "settings.local.json";
|
|
22
|
-
var DEFAULT_DB_REL = `${SKILL_MAP_DIR}/${DB_FILENAME}`;
|
|
23
|
-
var GITIGNORE_ENTRIES = [
|
|
24
|
-
`${SKILL_MAP_DIR}/${LOCAL_SETTINGS_FILENAME}`,
|
|
25
|
-
`${SKILL_MAP_DIR}/${DB_FILENAME}`
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
// kernel/util/skill-map-paths.ts
|
|
29
17
|
var KERNEL_SKILL_MAP_DIR = SKILL_MAP_DIR;
|
|
30
18
|
|
|
31
19
|
// kernel/util/tx.ts
|
|
@@ -127,9 +115,9 @@ function pickSafeEnv(source) {
|
|
|
127
115
|
function runConformanceCase(options) {
|
|
128
116
|
const raw = readFileSync(options.casePath, "utf8");
|
|
129
117
|
const c = JSON.parse(raw);
|
|
130
|
-
const fixturesRoot = options.fixturesRoot ??
|
|
118
|
+
const fixturesRoot = options.fixturesRoot ?? join2(options.specRoot, "conformance", "fixtures");
|
|
131
119
|
const safeId = c.id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 32);
|
|
132
|
-
const scope = mkdtempSync(
|
|
120
|
+
const scope = mkdtempSync(join2(tmpdir(), `sm-conformance-${safeId}-`));
|
|
133
121
|
const setupEnv = disableEnv(c.setup);
|
|
134
122
|
try {
|
|
135
123
|
const priorFailure = runPriorScansSetup(c, options, scope, fixturesRoot, setupEnv);
|
|
@@ -201,9 +189,9 @@ function replaceFixture(scope, fixturesRoot, fixture) {
|
|
|
201
189
|
assertContained(fixturesRoot, fixture, "fixture");
|
|
202
190
|
for (const entry of readdirSync(scope)) {
|
|
203
191
|
if (entry === KERNEL_SKILL_MAP_DIR) continue;
|
|
204
|
-
rmSync(
|
|
192
|
+
rmSync(join2(scope, entry), { recursive: true, force: true });
|
|
205
193
|
}
|
|
206
|
-
const src =
|
|
194
|
+
const src = join2(fixturesRoot, fixture);
|
|
207
195
|
cpSync(src, scope, { recursive: true });
|
|
208
196
|
}
|
|
209
197
|
function assertContained(root, rel, label) {
|
|
@@ -212,7 +200,7 @@ function assertContained(root, rel, label) {
|
|
|
212
200
|
tx(CONFORMANCE_RUNNER_TEXTS.pathMustBeRelative, { label, path: rel, anchor: root })
|
|
213
201
|
);
|
|
214
202
|
}
|
|
215
|
-
const abs =
|
|
203
|
+
const abs = resolve(root, rel);
|
|
216
204
|
const r = relative(root, abs);
|
|
217
205
|
if (r.startsWith("..") || isAbsolute(r)) {
|
|
218
206
|
throw new Error(
|
|
@@ -239,7 +227,7 @@ function evaluateAssertion(a, ctx) {
|
|
|
239
227
|
} catch (err) {
|
|
240
228
|
return { ok: false, type: a.type, reason: formatErrorMessage(err) };
|
|
241
229
|
}
|
|
242
|
-
const abs =
|
|
230
|
+
const abs = resolve(ctx.scope, a.path);
|
|
243
231
|
return existsSync(abs) ? { ok: true, type: a.type } : {
|
|
244
232
|
ok: false,
|
|
245
233
|
type: a.type,
|
|
@@ -253,8 +241,8 @@ function evaluateAssertion(a, ctx) {
|
|
|
253
241
|
} catch (err) {
|
|
254
242
|
return { ok: false, type: a.type, reason: formatErrorMessage(err) };
|
|
255
243
|
}
|
|
256
|
-
const fixturePath =
|
|
257
|
-
const targetPath =
|
|
244
|
+
const fixturePath = join2(ctx.fixturesRoot, a.fixture);
|
|
245
|
+
const targetPath = resolve(ctx.scope, a.path);
|
|
258
246
|
if (!existsSync(targetPath)) {
|
|
259
247
|
return {
|
|
260
248
|
ok: false,
|
|
@@ -415,7 +403,7 @@ function deepEqual(a, b) {
|
|
|
415
403
|
return false;
|
|
416
404
|
}
|
|
417
405
|
function assertSpecRoot(specRoot) {
|
|
418
|
-
const indexPath =
|
|
406
|
+
const indexPath = join2(specRoot, "index.json");
|
|
419
407
|
if (!existsSync(indexPath) || !statSync(indexPath).isFile()) {
|
|
420
408
|
throw new Error(tx(CONFORMANCE_RUNNER_TEXTS.specRootMissingIndex, { specRoot }));
|
|
421
409
|
}
|
|
@@ -425,4 +413,4 @@ export {
|
|
|
425
413
|
runConformanceCase
|
|
426
414
|
};
|
|
427
415
|
//# sourceMappingURL=index.js.map
|
|
428
|
-
//# debugId=
|
|
416
|
+
//# debugId=cc85d6cc-8968-5fbd-b7b7-eab3d298263d
|