@rotorsoft/act-tck 1.39.2 → 1.40.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 +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/stability-tck.d.ts +11 -6
- package/dist/@types/stability-tck.d.ts.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @property name - Display name for the snapshot suite (e.g., the package
|
|
5
5
|
* name). Used as the `describe` block label so failing snapshots are
|
|
6
6
|
* attributable at a glance.
|
|
7
|
-
* @property entryPoints - Map of subpath → entry
|
|
7
|
+
* @property entryPoints - Map of subpath → entry file, either source
|
|
8
|
+
* (`.ts`) or a published declaration (`.d.ts`). The TCK
|
|
8
9
|
* reads each entry, follows its relative re-exports recursively, and
|
|
9
10
|
* snapshots the resulting surface text. Empty-string subpaths label
|
|
10
11
|
* the root entry; everything else is rendered with its key (e.g.
|
|
@@ -15,8 +16,8 @@ export type StabilityTckOptions = {
|
|
|
15
16
|
readonly entryPoints: Readonly<Record<string, string>>;
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
|
-
* Snapshot-based public-API stability check. Walks each entry
|
|
19
|
-
*
|
|
19
|
+
* Snapshot-based public-API stability check. Walks each entry file plus
|
|
20
|
+
* everything it re-exports through relative imports, and
|
|
20
21
|
* compares the concatenated text against a committed Vitest snapshot.
|
|
21
22
|
*
|
|
22
23
|
* Catches accidental rename / removal / signature drift on the public
|
|
@@ -24,9 +25,13 @@ export type StabilityTckOptions = {
|
|
|
24
25
|
* shows up as a snapshot diff in the PR; reviewers either accept the
|
|
25
26
|
* change (update the snapshot deliberately) or push back.
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* Point it at the built declarations (`.d.ts`) to record the surface
|
|
29
|
+
* alone: a change to implementation then leaves the snapshot alone, and
|
|
30
|
+
* doc comments still show. That needs a build first. Point it at source
|
|
31
|
+
* (`.ts`) to skip the build, at the cost of a snapshot that also moves
|
|
32
|
+
* with every implementation change. It follows `from "./relative.js"`
|
|
33
|
+
* re-exports transitively, to `.d.ts` from a declaration and to `.ts`
|
|
34
|
+
* from source; non-relative paths (other packages, `node:`)
|
|
30
35
|
* stop the walk — drift in another package's surface is that package's
|
|
31
36
|
* stability TCK to catch.
|
|
32
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stability-tck.d.ts","sourceRoot":"","sources":["../../src/stability-tck.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"stability-tck.d.ts","sourceRoot":"","sources":["../../src/stability-tck.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAUlE"}
|
package/dist/index.cjs
CHANGED
|
@@ -418,8 +418,9 @@ async function load_surface(entry2) {
|
|
|
418
418
|
const content = await import_node_fs.promises.readFile(abs, "utf8");
|
|
419
419
|
visited.set(abs, content);
|
|
420
420
|
const re_export = /^\s*export\b[^"';]*\bfrom\s+["'](\.[^"']+)["']/gm;
|
|
421
|
+
const ext = abs.endsWith(".d.ts") ? ".d.ts" : ".ts";
|
|
421
422
|
for (const m of content.matchAll(re_export)) {
|
|
422
|
-
const rel = m[1].replace(/\.js$/,
|
|
423
|
+
const rel = m[1].replace(/\.js$/, ext);
|
|
423
424
|
const target = import_node_path.default.resolve(import_node_path.default.dirname(abs), rel);
|
|
424
425
|
await walk(target);
|
|
425
426
|
}
|