@fern-api/generator-cli 0.0.11-9ad75c8f6 → 0.0.12-7cbcf4cc7
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.cjs +7 -7
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -13317,7 +13317,7 @@ var ReferenceGenerator = class {
|
|
|
13317
13317
|
async generate({ output }) {
|
|
13318
13318
|
const writer = new StreamWriter(output);
|
|
13319
13319
|
writer.writeLine("# Reference");
|
|
13320
|
-
if (this.referenceConfig.rootSection
|
|
13320
|
+
if (this.referenceConfig.rootSection != null) {
|
|
13321
13321
|
this.writeRootSection({ section: this.referenceConfig.rootSection, writer });
|
|
13322
13322
|
}
|
|
13323
13323
|
for (const section of this.referenceConfig.sections) {
|
|
@@ -13326,7 +13326,7 @@ var ReferenceGenerator = class {
|
|
|
13326
13326
|
writer.end();
|
|
13327
13327
|
}
|
|
13328
13328
|
writeRootSection({ section, writer }) {
|
|
13329
|
-
if (section.description
|
|
13329
|
+
if (section.description != null) {
|
|
13330
13330
|
writer.writeLine(`${section.description}`);
|
|
13331
13331
|
}
|
|
13332
13332
|
for (const endpoint of section.endpoints) {
|
|
@@ -13335,7 +13335,7 @@ var ReferenceGenerator = class {
|
|
|
13335
13335
|
}
|
|
13336
13336
|
writeSection({ section, writer }) {
|
|
13337
13337
|
writer.writeLine(`## ${section.title}`);
|
|
13338
|
-
if (section.description
|
|
13338
|
+
if (section.description != null) {
|
|
13339
13339
|
writer.writeLine(`${section.description}`);
|
|
13340
13340
|
}
|
|
13341
13341
|
for (const endpoint of section.endpoints) {
|
|
@@ -13344,7 +13344,7 @@ var ReferenceGenerator = class {
|
|
|
13344
13344
|
}
|
|
13345
13345
|
writeEndpoint({ endpoint, writer }) {
|
|
13346
13346
|
const stringWriter = new StringWriter();
|
|
13347
|
-
if (endpoint.description
|
|
13347
|
+
if (endpoint.description != null) {
|
|
13348
13348
|
stringWriter.writeLine(
|
|
13349
13349
|
`#### \u{1F4DD} Description
|
|
13350
13350
|
|
|
@@ -13382,8 +13382,8 @@ ${this.writeIndentedBlock(
|
|
|
13382
13382
|
}
|
|
13383
13383
|
writeParameter(parameter) {
|
|
13384
13384
|
const desc = parameter.description?.match(/[^\r\n]+/g)?.length;
|
|
13385
|
-
const containsLineBreak = desc
|
|
13386
|
-
return `**${parameter.name}:** \`${this.wrapInLink(parameter.type, parameter.location)}\` ${parameter.description
|
|
13385
|
+
const containsLineBreak = desc != null && desc > 1;
|
|
13386
|
+
return `**${parameter.name}:** \`${this.wrapInLink(parameter.type, parameter.location)}\` ${parameter.description != null ? (containsLineBreak ? "\n\n" : "\u2014 ") + parameter.description : ""}
|
|
13387
13387
|
`;
|
|
13388
13388
|
}
|
|
13389
13389
|
writeIndentedBlock(content) {
|
|
@@ -13398,7 +13398,7 @@ ${content}
|
|
|
13398
13398
|
return content.map(({ text, location }) => this.wrapInLink(text, location)).join("");
|
|
13399
13399
|
}
|
|
13400
13400
|
wrapInLink(content, link) {
|
|
13401
|
-
return link
|
|
13401
|
+
return link != null ? `<a href="${link.path}">${content}</a>` : content;
|
|
13402
13402
|
}
|
|
13403
13403
|
};
|
|
13404
13404
|
|