Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module readmes to json output #2500

Merged
merged 2 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/lib/models/reflections/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export class DeclarationReflection extends ContainerReflection {
this.implementedTypes,
),
implementedBy: serializer.toObjectsOptional(this.implementedBy),
readme: Comment.serializeDisplayParts(serializer, this.readme),
Gerrit0 marked this conversation as resolved.
Show resolved Hide resolved
};
}

Expand All @@ -320,14 +321,15 @@ export class DeclarationReflection extends ContainerReflection {
): void {
super.fromObject(de, obj);

if (obj.readme) {
this.readme = Comment.deserializeDisplayParts(de, obj.readme);
}

// This happens when merging multiple projects together.
// If updating this, also check ProjectReflection.fromObject.
if (obj.variant === "project") {
this.kind = ReflectionKind.Module;
this.packageVersion = obj.packageVersion;
if (obj.readme) {
this.readme = Comment.deserializeDisplayParts(de, obj.readme);
}

de.defer(() => {
for (const [id, sid] of Object.entries(obj.symbolIdMap || {})) {
Expand Down
1 change: 1 addition & 0 deletions src/lib/serialization/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export interface DeclarationReflection
| "getSignature"
| "setSignature"
| "typeParameters"
| "readme"
> {}

/** @category Reflections */
Expand Down
Loading