@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.
@@ -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]="e3097683-993f-599d-92ef-d1e724637586")}catch(e){}}();
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 join3, relative, resolve as resolve2 } from "path";
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 as join2 } from "path";
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 ?? join3(options.specRoot, "conformance", "fixtures");
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(join3(tmpdir(), `sm-conformance-${safeId}-`));
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(join3(scope, entry), { recursive: true, force: true });
192
+ rmSync(join2(scope, entry), { recursive: true, force: true });
205
193
  }
206
- const src = join3(fixturesRoot, fixture);
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 = resolve2(root, rel);
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 = resolve2(ctx.scope, a.path);
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 = join3(ctx.fixturesRoot, a.fixture);
257
- const targetPath = resolve2(ctx.scope, a.path);
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 = join3(specRoot, "index.json");
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=e3097683-993f-599d-92ef-d1e724637586
416
+ //# debugId=cc85d6cc-8968-5fbd-b7b7-eab3d298263d