Skip to content

Commit 56c1e17

Browse files
committed
Fix benign circularity, add CI check
1 parent aed8474 commit 56c1e17

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

.github/workflows/ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ jobs:
3131
- name: Circular dependency check
3232
uses: gerrit0/circular-dependency-check@v2.0.2
3333
with:
34-
entry: dist/index.js
34+
entry: >
35+
dist/index.js
36+
dist/lib/models/index.js
37+
dist/browser-utils.js
3538
build-release:
3639
runs-on: ubuntu-latest
3740
name: Node 22 Release

src/lib/models/ProjectReflection.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ import type { TypeParameterReflection } from "./TypeParameterReflection.js";
99
import { ReflectionKind } from "./kind.js";
1010
import { Comment, type CommentDisplayPart } from "./Comment.js";
1111
import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
12-
import { type Deserializer, JSONOutput, type Serializer } from "#serialization";
12+
import type { Deserializer, JSONOutput, Serializer } from "#serialization";
1313
import { assertNever, DefaultMap, i18n, type NormalizedPath, removeIfPresent, StableKeyMap } from "#utils";
1414
import type { DocumentReflection } from "./DocumentReflection.js";
1515
import type { FileRegistry } from "./FileRegistry.js";
1616

17+
// Keep this in sync with JSONOutput.SCHEMA_VERSION
18+
export const JSON_SCHEMA_VERSION = "2.0";
19+
1720
/**
1821
* A reflection that represents the root of the project.
1922
*
@@ -391,7 +394,7 @@ export class ProjectReflection extends ContainerReflection {
391394
});
392395

393396
return {
394-
schemaVersion: JSONOutput.SCHEMA_VERSION,
397+
schemaVersion: JSON_SCHEMA_VERSION,
395398
...super.toObject(serializer),
396399
variant: this.variant,
397400
packageName: this.packageName,

src/lib/models/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export * from "./DocumentReflection.js";
55
export * from "./FileRegistry.js";
66
export * from "./kind.js";
77
export * from "./ParameterReflection.js";
8-
export * from "./ProjectReflection.js";
8+
export { ProjectReflection } from "./ProjectReflection.js";
99
export * from "./ReferenceReflection.js";
1010
export * from "./Reflection.js";
1111
export * from "./ReflectionCategory.js";

src/lib/serialization/schema.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import type * as M from "#models";
3333
import type { IfInternal, NormalizedPath } from "#utils";
3434

35+
// Keep this in sync with JSON_SCHEMA_VERSION in ProjectReflection.ts
3536
export const SCHEMA_VERSION = "2.0";
3637

3738
/**

src/lib/utils-common/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export * from "./events.js";
88
export * from "./general.js";
99
export * from "./hooks.js";
1010
export * from "./i18n.js";
11-
export * from "./index.js";
1211
export * as JSX from "./jsx.js";
1312
export * from "./logger.js";
1413
export * from "./map.js";

src/test/project.test.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { splitUnquotedString } from "../index.js";
1+
import { JSONOutput, splitUnquotedString } from "../index.js";
22
import Assert from "assert";
3+
import { JSON_SCHEMA_VERSION } from "../lib/models/ProjectReflection.js";
34

45
describe("Project", function () {
56
describe("splitUnquotedString", () => {
@@ -32,4 +33,8 @@ describe("Project", function () {
3233
Assert.strictEqual(result[1], "d", "Wrong split");
3334
});
3435
});
36+
37+
describe("JSON schema version", () => {
38+
Assert.strictEqual(JSON_SCHEMA_VERSION, JSONOutput.SCHEMA_VERSION);
39+
});
3540
});

0 commit comments

Comments
 (0)