@fern-api/fern-api-dev 3.50.2 → 3.51.0-1-g79714d0ea3a
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/cli.cjs +224 -176
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1430941,7 +1430941,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1430941
1430941
|
properties: {
|
|
1430942
1430942
|
...event,
|
|
1430943
1430943
|
...event.properties,
|
|
1430944
|
-
version: "3.
|
|
1430944
|
+
version: "3.51.0-1-g79714d0ea3a",
|
|
1430945
1430945
|
usingAccessToken: true
|
|
1430946
1430946
|
}
|
|
1430947
1430947
|
});
|
|
@@ -1431040,7 +1431040,7 @@ var UserPosthogManager = class {
|
|
|
1431040
1431040
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1431041
1431041
|
event: "CLI",
|
|
1431042
1431042
|
properties: {
|
|
1431043
|
-
version: "3.
|
|
1431043
|
+
version: "3.51.0-1-g79714d0ea3a",
|
|
1431044
1431044
|
...event,
|
|
1431045
1431045
|
...event.properties,
|
|
1431046
1431046
|
usingAccessToken: false,
|
|
@@ -1510475,7 +1510475,7 @@ var CliContext = class {
|
|
|
1510475
1510475
|
if (false) {
|
|
1510476
1510476
|
this.logger.error("CLI_VERSION is not defined");
|
|
1510477
1510477
|
}
|
|
1510478
|
-
return "3.
|
|
1510478
|
+
return "3.51.0-1-g79714d0ea3a";
|
|
1510479
1510479
|
}
|
|
1510480
1510480
|
getCliName() {
|
|
1510481
1510481
|
if (false) {
|
|
@@ -1534814,6 +1534814,113 @@ function getFernPaginationExtension(document4, operation) {
|
|
|
1534814
1534814
|
return convertPaginationExtension(pagination);
|
|
1534815
1534815
|
}
|
|
1534816
1534816
|
|
|
1534817
|
+
// ../api-importers/openapi/openapi-ir-parser/lib/openapi/v3/converters/endpoint/getApplicationJsonSchema.js
|
|
1534818
|
+
function getTextEventStreamObject(media2, context2) {
|
|
1534819
|
+
for (const contentType of Object.keys(media2)) {
|
|
1534820
|
+
if (contentType.includes("text/event-stream")) {
|
|
1534821
|
+
const mediaObject = media2[contentType];
|
|
1534822
|
+
if (mediaObject == null) {
|
|
1534823
|
+
continue;
|
|
1534824
|
+
}
|
|
1534825
|
+
const mediaObjectWithItemSchema = mediaObject;
|
|
1534826
|
+
const schema2 = mediaObject.schema ?? mediaObjectWithItemSchema.itemSchema;
|
|
1534827
|
+
return {
|
|
1534828
|
+
contentType,
|
|
1534829
|
+
schema: schema2 ?? {},
|
|
1534830
|
+
examples: getExamples2(mediaObject, context2)
|
|
1534831
|
+
};
|
|
1534832
|
+
}
|
|
1534833
|
+
}
|
|
1534834
|
+
return void 0;
|
|
1534835
|
+
}
|
|
1534836
|
+
function hasTextEventStreamWithItemSchema(media2) {
|
|
1534837
|
+
for (const contentType of Object.keys(media2)) {
|
|
1534838
|
+
if (contentType.includes("text/event-stream")) {
|
|
1534839
|
+
const mediaObject = media2[contentType];
|
|
1534840
|
+
if (mediaObject == null) {
|
|
1534841
|
+
continue;
|
|
1534842
|
+
}
|
|
1534843
|
+
const mediaObjectWithItemSchema = mediaObject;
|
|
1534844
|
+
if (mediaObjectWithItemSchema.itemSchema != null) {
|
|
1534845
|
+
return true;
|
|
1534846
|
+
}
|
|
1534847
|
+
}
|
|
1534848
|
+
}
|
|
1534849
|
+
return false;
|
|
1534850
|
+
}
|
|
1534851
|
+
function isApplicationJsonMediaType(mediaType) {
|
|
1534852
|
+
return mediaType.includes("json") || mediaType === "*/*";
|
|
1534853
|
+
}
|
|
1534854
|
+
function findApplicationJsonRequest({ content: content5, context: context2 }) {
|
|
1534855
|
+
for (const [mediaType, mediaTypeObject] of Object.entries(content5)) {
|
|
1534856
|
+
const result = getApplicationJsonSchemaMediaObject({
|
|
1534857
|
+
mediaType,
|
|
1534858
|
+
mediaTypeObject,
|
|
1534859
|
+
context: context2
|
|
1534860
|
+
});
|
|
1534861
|
+
if (result != null) {
|
|
1534862
|
+
return [mediaType, mediaTypeObject];
|
|
1534863
|
+
}
|
|
1534864
|
+
}
|
|
1534865
|
+
return void 0;
|
|
1534866
|
+
}
|
|
1534867
|
+
function getApplicationJsonSchemaMediaObject({ mediaType, mediaTypeObject, context: context2 }) {
|
|
1534868
|
+
if (!isApplicationJsonMediaType(mediaType)) {
|
|
1534869
|
+
return void 0;
|
|
1534870
|
+
}
|
|
1534871
|
+
const schema2 = mediaTypeObject.schema;
|
|
1534872
|
+
return {
|
|
1534873
|
+
contentType: !mediaType.includes("*") ? mediaType : void 0,
|
|
1534874
|
+
schema: schema2 ?? {},
|
|
1534875
|
+
examples: getExamples2(mediaTypeObject, context2)
|
|
1534876
|
+
};
|
|
1534877
|
+
}
|
|
1534878
|
+
function getApplicationJsonSchemaMediaObjectFromContent({ content: content5, context: context2 }) {
|
|
1534879
|
+
const request6 = findApplicationJsonRequest({ content: content5, context: context2 });
|
|
1534880
|
+
if (!request6) {
|
|
1534881
|
+
return void 0;
|
|
1534882
|
+
}
|
|
1534883
|
+
const [mediaType, mediaTypeObject] = request6;
|
|
1534884
|
+
return getApplicationJsonSchemaMediaObject({ mediaType, mediaTypeObject, context: context2 });
|
|
1534885
|
+
}
|
|
1534886
|
+
function getSchemaMediaObject(media2, context2) {
|
|
1534887
|
+
for (const contentType of Object.keys(media2)) {
|
|
1534888
|
+
const mediaObject = media2[contentType];
|
|
1534889
|
+
if (mediaObject == null) {
|
|
1534890
|
+
continue;
|
|
1534891
|
+
}
|
|
1534892
|
+
const schema2 = mediaObject.schema;
|
|
1534893
|
+
return {
|
|
1534894
|
+
schema: schema2 ?? {},
|
|
1534895
|
+
examples: getExamples2(mediaObject, context2)
|
|
1534896
|
+
};
|
|
1534897
|
+
}
|
|
1534898
|
+
return void 0;
|
|
1534899
|
+
}
|
|
1534900
|
+
function getExamples2(mediaObject, context2) {
|
|
1534901
|
+
const fullExamples = [];
|
|
1534902
|
+
if (mediaObject.example != null) {
|
|
1534903
|
+
fullExamples.push({ name: void 0, value: mediaObject.example, description: void 0 });
|
|
1534904
|
+
}
|
|
1534905
|
+
const examples = getExtension(mediaObject, OpenAPIExtension.EXAMPLES);
|
|
1534906
|
+
if (examples != null && Object.keys(examples).length > 0) {
|
|
1534907
|
+
fullExamples.push(...Object.entries(examples).map(([name3, value]) => {
|
|
1534908
|
+
return { name: value.summary ?? name3, value: value.value, description: value.description };
|
|
1534909
|
+
}));
|
|
1534910
|
+
}
|
|
1534911
|
+
if (mediaObject.examples != null && Object.keys(mediaObject.examples).length > 0) {
|
|
1534912
|
+
fullExamples.push(...Object.entries(mediaObject.examples).map(([name3, example]) => {
|
|
1534913
|
+
const resolvedExample = isReferenceObject(example) ? context2.resolveExampleReference(example) : example;
|
|
1534914
|
+
return {
|
|
1534915
|
+
name: resolvedExample.summary ?? name3,
|
|
1534916
|
+
value: resolvedExample.value,
|
|
1534917
|
+
description: resolvedExample.description
|
|
1534918
|
+
};
|
|
1534919
|
+
}));
|
|
1534920
|
+
}
|
|
1534921
|
+
return fullExamples;
|
|
1534922
|
+
}
|
|
1534923
|
+
|
|
1534817
1534924
|
// ../api-importers/openapi/openapi-ir-parser/lib/schema/utils/getReferenceOccurrences.js
|
|
1534818
1534925
|
function getReferenceOccurrences(document4) {
|
|
1534819
1534926
|
const contentConflictsRemovedDocument = removeApplicationJsonAndMultipartConflictsFromDocument(document4);
|
|
@@ -1535538,97 +1535645,6 @@ function getExplodeForPathParameter(parameter) {
|
|
|
1535538
1535645
|
return explode === false ? void 0 : explode;
|
|
1535539
1535646
|
}
|
|
1535540
1535647
|
|
|
1535541
|
-
// ../api-importers/openapi/openapi-ir-parser/lib/openapi/v3/converters/endpoint/getApplicationJsonSchema.js
|
|
1535542
|
-
function getTextEventStreamObject(media2, context2) {
|
|
1535543
|
-
for (const contentType of Object.keys(media2)) {
|
|
1535544
|
-
if (contentType.includes("text/event-stream")) {
|
|
1535545
|
-
const mediaObject = media2[contentType];
|
|
1535546
|
-
if (mediaObject == null) {
|
|
1535547
|
-
continue;
|
|
1535548
|
-
}
|
|
1535549
|
-
const schema2 = mediaObject.schema;
|
|
1535550
|
-
return {
|
|
1535551
|
-
contentType,
|
|
1535552
|
-
schema: schema2 ?? {},
|
|
1535553
|
-
examples: getExamples2(mediaObject, context2)
|
|
1535554
|
-
};
|
|
1535555
|
-
}
|
|
1535556
|
-
}
|
|
1535557
|
-
return void 0;
|
|
1535558
|
-
}
|
|
1535559
|
-
function isApplicationJsonMediaType(mediaType) {
|
|
1535560
|
-
return mediaType.includes("json") || mediaType === "*/*";
|
|
1535561
|
-
}
|
|
1535562
|
-
function findApplicationJsonRequest({ content: content5, context: context2 }) {
|
|
1535563
|
-
for (const [mediaType, mediaTypeObject] of Object.entries(content5)) {
|
|
1535564
|
-
const result = getApplicationJsonSchemaMediaObject({
|
|
1535565
|
-
mediaType,
|
|
1535566
|
-
mediaTypeObject,
|
|
1535567
|
-
context: context2
|
|
1535568
|
-
});
|
|
1535569
|
-
if (result != null) {
|
|
1535570
|
-
return [mediaType, mediaTypeObject];
|
|
1535571
|
-
}
|
|
1535572
|
-
}
|
|
1535573
|
-
return void 0;
|
|
1535574
|
-
}
|
|
1535575
|
-
function getApplicationJsonSchemaMediaObject({ mediaType, mediaTypeObject, context: context2 }) {
|
|
1535576
|
-
if (!isApplicationJsonMediaType(mediaType)) {
|
|
1535577
|
-
return void 0;
|
|
1535578
|
-
}
|
|
1535579
|
-
const schema2 = mediaTypeObject.schema;
|
|
1535580
|
-
return {
|
|
1535581
|
-
contentType: !mediaType.includes("*") ? mediaType : void 0,
|
|
1535582
|
-
schema: schema2 ?? {},
|
|
1535583
|
-
examples: getExamples2(mediaTypeObject, context2)
|
|
1535584
|
-
};
|
|
1535585
|
-
}
|
|
1535586
|
-
function getApplicationJsonSchemaMediaObjectFromContent({ content: content5, context: context2 }) {
|
|
1535587
|
-
const request6 = findApplicationJsonRequest({ content: content5, context: context2 });
|
|
1535588
|
-
if (!request6) {
|
|
1535589
|
-
return void 0;
|
|
1535590
|
-
}
|
|
1535591
|
-
const [mediaType, mediaTypeObject] = request6;
|
|
1535592
|
-
return getApplicationJsonSchemaMediaObject({ mediaType, mediaTypeObject, context: context2 });
|
|
1535593
|
-
}
|
|
1535594
|
-
function getSchemaMediaObject(media2, context2) {
|
|
1535595
|
-
for (const contentType of Object.keys(media2)) {
|
|
1535596
|
-
const mediaObject = media2[contentType];
|
|
1535597
|
-
if (mediaObject == null) {
|
|
1535598
|
-
continue;
|
|
1535599
|
-
}
|
|
1535600
|
-
const schema2 = mediaObject.schema;
|
|
1535601
|
-
return {
|
|
1535602
|
-
schema: schema2 ?? {},
|
|
1535603
|
-
examples: getExamples2(mediaObject, context2)
|
|
1535604
|
-
};
|
|
1535605
|
-
}
|
|
1535606
|
-
return void 0;
|
|
1535607
|
-
}
|
|
1535608
|
-
function getExamples2(mediaObject, context2) {
|
|
1535609
|
-
const fullExamples = [];
|
|
1535610
|
-
if (mediaObject.example != null) {
|
|
1535611
|
-
fullExamples.push({ name: void 0, value: mediaObject.example, description: void 0 });
|
|
1535612
|
-
}
|
|
1535613
|
-
const examples = getExtension(mediaObject, OpenAPIExtension.EXAMPLES);
|
|
1535614
|
-
if (examples != null && Object.keys(examples).length > 0) {
|
|
1535615
|
-
fullExamples.push(...Object.entries(examples).map(([name3, value]) => {
|
|
1535616
|
-
return { name: value.summary ?? name3, value: value.value, description: value.description };
|
|
1535617
|
-
}));
|
|
1535618
|
-
}
|
|
1535619
|
-
if (mediaObject.examples != null && Object.keys(mediaObject.examples).length > 0) {
|
|
1535620
|
-
fullExamples.push(...Object.entries(mediaObject.examples).map(([name3, example]) => {
|
|
1535621
|
-
const resolvedExample = isReferenceObject(example) ? context2.resolveExampleReference(example) : example;
|
|
1535622
|
-
return {
|
|
1535623
|
-
name: resolvedExample.summary ?? name3,
|
|
1535624
|
-
value: resolvedExample.value,
|
|
1535625
|
-
description: resolvedExample.description
|
|
1535626
|
-
};
|
|
1535627
|
-
}));
|
|
1535628
|
-
}
|
|
1535629
|
-
return fullExamples;
|
|
1535630
|
-
}
|
|
1535631
|
-
|
|
1535632
1535648
|
// ../api-importers/openapi/openapi-ir-parser/lib/openapi/v3/converters/endpoint/convertRequest.js
|
|
1535633
1535649
|
function findApplicationUrlFormEncodedRequest({ content: content5, context: context2 }) {
|
|
1535634
1535650
|
for (const [mediaType, mediaTypeObject] of Object.entries(content5)) {
|
|
@@ -1536901,7 +1536917,13 @@ function convertOperation({ context: context2, pathItemContext, operation, conve
|
|
|
1536901
1536917
|
});
|
|
1536902
1536918
|
return { type: "webhook", value: webhooks2 };
|
|
1536903
1536919
|
}
|
|
1536904
|
-
|
|
1536920
|
+
let streamingExtension = getFernStreamingExtension(operation);
|
|
1536921
|
+
if (streamingExtension == null) {
|
|
1536922
|
+
const hasItemSchemaStreaming = checkOperationForItemSchemaStreaming({ operation, context: context2 });
|
|
1536923
|
+
if (hasItemSchemaStreaming) {
|
|
1536924
|
+
streamingExtension = { type: "stream", format: "sse" };
|
|
1536925
|
+
}
|
|
1536926
|
+
}
|
|
1536905
1536927
|
if (streamingExtension != null) {
|
|
1536906
1536928
|
const streamingOperation = convertStreamingOperation({
|
|
1536907
1536929
|
context: context2,
|
|
@@ -1536971,6 +1536993,21 @@ function getBaseBreadcrumbs({ sdkMethodName, operation, httpMethod, path: path76
|
|
|
1536971
1536993
|
}
|
|
1536972
1536994
|
return baseBreadcrumbs;
|
|
1536973
1536995
|
}
|
|
1536996
|
+
function checkOperationForItemSchemaStreaming({ operation, context: context2 }) {
|
|
1536997
|
+
if (operation.responses == null) {
|
|
1536998
|
+
return false;
|
|
1536999
|
+
}
|
|
1537000
|
+
for (const response of Object.values(operation.responses)) {
|
|
1537001
|
+
const resolvedResponse = isReferenceObject(response) ? context2.resolveResponseReference(response) : response;
|
|
1537002
|
+
if (resolvedResponse.content == null) {
|
|
1537003
|
+
continue;
|
|
1537004
|
+
}
|
|
1537005
|
+
if (hasTextEventStreamWithItemSchema(resolvedResponse.content)) {
|
|
1537006
|
+
return true;
|
|
1537007
|
+
}
|
|
1537008
|
+
}
|
|
1537009
|
+
return false;
|
|
1537010
|
+
}
|
|
1536974
1537011
|
|
|
1536975
1537012
|
// ../api-importers/openapi/openapi-ir-parser/lib/openapi/v3/converters/convertPathItem.js
|
|
1536976
1537013
|
function convertPathItem(path76, pathItemObject, document4, context2) {
|
|
@@ -1601813,7 +1601850,8 @@ var DocsDefinitionResolver = class {
|
|
|
1601813
1601850
|
uploadFiles;
|
|
1601814
1601851
|
registerApi;
|
|
1601815
1601852
|
targetAudiences;
|
|
1601816
|
-
|
|
1601853
|
+
pythonDocsSectionHandler;
|
|
1601854
|
+
constructor({ domain: domain3, docsWorkspace, ossWorkspaces, apiWorkspaces, taskContext, editThisPage, uploadFiles: uploadFiles2 = defaultUploadFiles, registerApi: registerApi2 = defaultRegisterApi, targetAudiences, pythonDocsSectionHandler }) {
|
|
1601817
1601855
|
this.domain = domain3;
|
|
1601818
1601856
|
this.docsWorkspace = docsWorkspace;
|
|
1601819
1601857
|
this.ossWorkspaces = ossWorkspaces;
|
|
@@ -1601823,6 +1601861,7 @@ var DocsDefinitionResolver = class {
|
|
|
1601823
1601861
|
this.uploadFiles = uploadFiles2;
|
|
1601824
1601862
|
this.registerApi = registerApi2;
|
|
1601825
1601863
|
this.targetAudiences = targetAudiences;
|
|
1601864
|
+
this.pythonDocsSectionHandler = pythonDocsSectionHandler;
|
|
1601826
1601865
|
}
|
|
1601827
1601866
|
#idgen = NodeIdGenerator2.init();
|
|
1601828
1601867
|
/**
|
|
@@ -1602512,7 +1602551,8 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
1602512
1602551
|
}
|
|
1602513
1602552
|
async toSidebarRootNode(prefix2, items, parentSlug) {
|
|
1602514
1602553
|
const id2 = this.#idgen.get(`${prefix2}/root`);
|
|
1602515
|
-
const
|
|
1602554
|
+
const childrenWithNulls = await Promise.all(items.map((item) => this.toNavigationChild({ prefix: id2, item, parentSlug })));
|
|
1602555
|
+
const children2 = childrenWithNulls.filter((child) => child != null);
|
|
1602516
1602556
|
const grouped = [];
|
|
1602517
1602557
|
children2.forEach((child) => {
|
|
1602518
1602558
|
if (child.type === "apiReference") {
|
|
@@ -1602563,7 +1602603,8 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
1602563
1602603
|
urlSlug: item.slug ?? kebabCase_default(item.title),
|
|
1602564
1602604
|
skipUrlSlug: item.skipUrlSlug
|
|
1602565
1602605
|
});
|
|
1602566
|
-
const
|
|
1602606
|
+
const childrenWithNulls = await Promise.all(item.layout.map((item2) => this.toVariantChild(item2, id2, variantSlug)));
|
|
1602607
|
+
const children2 = childrenWithNulls.filter((child) => child != null);
|
|
1602567
1602608
|
return {
|
|
1602568
1602609
|
type: "variant",
|
|
1602569
1602610
|
id: id2,
|
|
@@ -1602590,8 +1602631,9 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
1602590
1602631
|
section: async (value) => this.toSectionNode({ prefix: prefix2, item: value, parentSlug }),
|
|
1602591
1602632
|
link: async (value) => this.toLinkNode(value),
|
|
1602592
1602633
|
changelog: async (value) => this.toChangelogNode(value, parentSlug),
|
|
1602593
|
-
// Library sections are handled by FDR during registration
|
|
1602594
|
-
|
|
1602634
|
+
// Library sections are handled by FDR during registration
|
|
1602635
|
+
// If handler provided (dev mode), create placeholder; otherwise skip (FDR adds generated docs)
|
|
1602636
|
+
pythonDocsSection: async (value) => this.handlePythonDocsSection(value, parentSlug)
|
|
1602595
1602637
|
});
|
|
1602596
1602638
|
}
|
|
1602597
1602639
|
async toNavigationChild({ prefix: prefix2, item, parentSlug, hideChildren, parentAvailability }) {
|
|
@@ -1602601,8 +1602643,9 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
1602601
1602643
|
section: async (value) => this.toSectionNode({ prefix: prefix2, item: value, parentSlug, hideChildren, parentAvailability }),
|
|
1602602
1602644
|
link: async (value) => this.toLinkNode(value),
|
|
1602603
1602645
|
changelog: async (value) => this.toChangelogNode(value, parentSlug, hideChildren),
|
|
1602604
|
-
// Library sections are handled by FDR during registration
|
|
1602605
|
-
|
|
1602646
|
+
// Library sections are handled by FDR during registration
|
|
1602647
|
+
// If handler provided (dev mode), create placeholder; otherwise skip (FDR adds generated docs)
|
|
1602648
|
+
pythonDocsSection: async (value) => this.handlePythonDocsSection(value, parentSlug)
|
|
1602606
1602649
|
});
|
|
1602607
1602650
|
}
|
|
1602608
1602651
|
async toApiSectionNode({ item, parentSlug, hideChildren, parentAvailability }) {
|
|
@@ -1602723,77 +1602766,19 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
1602723
1602766
|
};
|
|
1602724
1602767
|
}
|
|
1602725
1602768
|
/**
|
|
1602726
|
-
*
|
|
1602727
|
-
*
|
|
1602728
|
-
* FDR then merges the generated Python docs into the navigation.
|
|
1602729
|
-
*
|
|
1602730
|
-
* In dev mode (fern docs dev), this placeholder returns a visible page with helpful content
|
|
1602731
|
-
* explaining that Python library docs are only generated during `fern generate --docs`.
|
|
1602732
|
-
*
|
|
1602733
|
-
* In production mode, FDR replaces/augments this with the actual generated documentation.
|
|
1602769
|
+
* Handles pythonDocsSection navigation items by delegating to the handler if provided.
|
|
1602770
|
+
* If no handler is provided, returns null (skips the section - FDR adds generated docs during publish).
|
|
1602734
1602771
|
*/
|
|
1602735
|
-
|
|
1602736
|
-
|
|
1602737
|
-
|
|
1602738
|
-
|
|
1602739
|
-
|
|
1602740
|
-
|
|
1602741
|
-
|
|
1602742
|
-
|
|
1602743
|
-
|
|
1602744
|
-
|
|
1602745
|
-
<Warning>
|
|
1602746
|
-
Python library documentation is not yet supported with \`fern docs dev\`. This feature will be added in a future release. To view the generated documentation, run \`fern generate --docs --preview\`.
|
|
1602747
|
-
</Warning>
|
|
1602748
|
-
|
|
1602749
|
-
## About Python Library Docs
|
|
1602750
|
-
|
|
1602751
|
-
When you publish your documentation using \`fern generate --docs\`, Fern will:
|
|
1602752
|
-
|
|
1602753
|
-
1. Clone and analyze your Python repository from: \`${item.githubUrl}\`
|
|
1602754
|
-
2. Parse the Python source code to extract docstrings and type information
|
|
1602755
|
-
3. Generate comprehensive API reference documentation
|
|
1602756
|
-
4. Integrate the generated docs into your documentation site
|
|
1602757
|
-
|
|
1602758
|
-
## How to Generate
|
|
1602759
|
-
|
|
1602760
|
-
To generate the full Python library documentation, run:
|
|
1602761
|
-
|
|
1602762
|
-
\`\`\`bash
|
|
1602763
|
-
fern generate --docs
|
|
1602764
|
-
\`\`\`
|
|
1602765
|
-
|
|
1602766
|
-
Or to preview without publishing:
|
|
1602767
|
-
|
|
1602768
|
-
\`\`\`bash
|
|
1602769
|
-
fern generate --docs --preview
|
|
1602770
|
-
\`\`\`
|
|
1602771
|
-
|
|
1602772
|
-
The generated documentation will replace this placeholder page with complete API reference content including:
|
|
1602773
|
-
|
|
1602774
|
-
- Module and package documentation
|
|
1602775
|
-
- Class and function references
|
|
1602776
|
-
- Type annotations and signatures
|
|
1602777
|
-
- Docstring content
|
|
1602778
|
-
`;
|
|
1602779
|
-
this.parsedDocsConfig.pages[RelativeFilePath2.of(syntheticPageId)] = placeholderMarkdown;
|
|
1602780
|
-
const id2 = this.#idgen.get(pageId);
|
|
1602781
|
-
return {
|
|
1602782
|
-
id: id2,
|
|
1602783
|
-
type: "page",
|
|
1602784
|
-
slug: slug.get(),
|
|
1602785
|
-
title: title5,
|
|
1602786
|
-
icon: void 0,
|
|
1602787
|
-
hidden: false,
|
|
1602788
|
-
viewers: void 0,
|
|
1602789
|
-
orphaned: void 0,
|
|
1602790
|
-
pageId,
|
|
1602791
|
-
authed: void 0,
|
|
1602792
|
-
noindex: true,
|
|
1602793
|
-
// Don't index placeholder pages
|
|
1602794
|
-
featureFlags: void 0,
|
|
1602795
|
-
availability: void 0
|
|
1602796
|
-
};
|
|
1602772
|
+
handlePythonDocsSection(item, parentSlug) {
|
|
1602773
|
+
if (this.pythonDocsSectionHandler == null) {
|
|
1602774
|
+
return null;
|
|
1602775
|
+
}
|
|
1602776
|
+
return this.pythonDocsSectionHandler(item, parentSlug, {
|
|
1602777
|
+
addPage: (pageId, markdown) => {
|
|
1602778
|
+
this.parsedDocsConfig.pages[RelativeFilePath2.of(pageId)] = markdown;
|
|
1602779
|
+
},
|
|
1602780
|
+
generateId: (key) => this.#idgen.get(key)
|
|
1602781
|
+
});
|
|
1602797
1602782
|
}
|
|
1602798
1602783
|
async toPageNode({ item, parentSlug, hideChildren, parentAvailability }) {
|
|
1602799
1602784
|
const pageId = navigation_exports2.PageId(this.toRelativeFilepath(item.absolutePath));
|
|
@@ -1602836,8 +1602821,9 @@ The generated documentation will replace this placeholder page with complete API
|
|
|
1602836
1602821
|
hideChildren: hiddenSection,
|
|
1602837
1602822
|
parentAvailability: item.availability ?? parentAvailability
|
|
1602838
1602823
|
})));
|
|
1602824
|
+
const filteredChildren = children2.filter((child) => child != null);
|
|
1602839
1602825
|
if (pageId == null) {
|
|
1602840
|
-
const flattenedApiRef =
|
|
1602826
|
+
const flattenedApiRef = filteredChildren.find((child) => child.type === "apiReference" && child.hideTitle === true && child.overviewPageId != null);
|
|
1602841
1602827
|
if (flattenedApiRef != null) {
|
|
1602842
1602828
|
pageId = flattenedApiRef.overviewPageId;
|
|
1602843
1602829
|
}
|
|
@@ -1602853,7 +1602839,7 @@ The generated documentation will replace this placeholder page with complete API
|
|
|
1602853
1602839
|
hidden: hiddenSection,
|
|
1602854
1602840
|
viewers: item.viewers,
|
|
1602855
1602841
|
orphaned: item.orphaned,
|
|
1602856
|
-
children:
|
|
1602842
|
+
children: filteredChildren,
|
|
1602857
1602843
|
authed: void 0,
|
|
1602858
1602844
|
pointsTo: void 0,
|
|
1602859
1602845
|
noindex,
|
|
@@ -1603129,6 +1603115,67 @@ function convertAvailability5(availability) {
|
|
|
1603129
1603115
|
assertNever(availability);
|
|
1603130
1603116
|
}
|
|
1603131
1603117
|
}
|
|
1603118
|
+
function createPythonDocsSectionPlaceholder(item, parentSlug, context2) {
|
|
1603119
|
+
const title5 = item.title ?? "Python Reference";
|
|
1603120
|
+
const urlSlug = item.slug ?? "python-docs";
|
|
1603121
|
+
const slug = parentSlug.apply({ urlSlug });
|
|
1603122
|
+
const syntheticPageId = `__python-docs-placeholder-${urlSlug}__.mdx`;
|
|
1603123
|
+
const pageId = navigation_exports2.PageId(syntheticPageId);
|
|
1603124
|
+
const placeholderMarkdown = `---
|
|
1603125
|
+
title: ${title5}
|
|
1603126
|
+
---
|
|
1603127
|
+
|
|
1603128
|
+
<Warning>
|
|
1603129
|
+
Python library documentation is not yet supported with \`fern docs dev\`. This feature will be added in a future release. To view the generated documentation, run \`fern generate --docs --preview\`.
|
|
1603130
|
+
</Warning>
|
|
1603131
|
+
|
|
1603132
|
+
## About Python Library Docs
|
|
1603133
|
+
|
|
1603134
|
+
When you publish your documentation using \`fern generate --docs\`, Fern will:
|
|
1603135
|
+
|
|
1603136
|
+
1. Clone and analyze your Python repository from: \`${item.githubUrl}\`
|
|
1603137
|
+
2. Parse the Python source code to extract docstrings and type information
|
|
1603138
|
+
3. Generate comprehensive API reference documentation
|
|
1603139
|
+
4. Integrate the generated docs into your documentation site
|
|
1603140
|
+
|
|
1603141
|
+
## How to Generate
|
|
1603142
|
+
|
|
1603143
|
+
To generate the full Python library documentation, run:
|
|
1603144
|
+
|
|
1603145
|
+
\`\`\`bash
|
|
1603146
|
+
fern generate --docs
|
|
1603147
|
+
\`\`\`
|
|
1603148
|
+
|
|
1603149
|
+
Or to preview without publishing:
|
|
1603150
|
+
|
|
1603151
|
+
\`\`\`bash
|
|
1603152
|
+
fern generate --docs --preview
|
|
1603153
|
+
\`\`\`
|
|
1603154
|
+
|
|
1603155
|
+
The generated documentation will replace this placeholder page with complete API reference content including:
|
|
1603156
|
+
|
|
1603157
|
+
- Module and package documentation
|
|
1603158
|
+
- Class and function references
|
|
1603159
|
+
- Type annotations and signatures
|
|
1603160
|
+
- Docstring content
|
|
1603161
|
+
`;
|
|
1603162
|
+
context2.addPage(syntheticPageId, placeholderMarkdown);
|
|
1603163
|
+
return {
|
|
1603164
|
+
id: context2.generateId(pageId),
|
|
1603165
|
+
type: "page",
|
|
1603166
|
+
slug: slug.get(),
|
|
1603167
|
+
title: title5,
|
|
1603168
|
+
icon: void 0,
|
|
1603169
|
+
hidden: false,
|
|
1603170
|
+
viewers: void 0,
|
|
1603171
|
+
orphaned: void 0,
|
|
1603172
|
+
pageId,
|
|
1603173
|
+
authed: void 0,
|
|
1603174
|
+
noindex: true,
|
|
1603175
|
+
featureFlags: void 0,
|
|
1603176
|
+
availability: void 0
|
|
1603177
|
+
};
|
|
1603178
|
+
}
|
|
1603132
1603179
|
|
|
1603133
1603180
|
// ../docs-resolver/lib/utils/filterOssWorkspaces.js
|
|
1603134
1603181
|
async function filterOssWorkspaces(project) {
|
|
@@ -1611573,7 +1611620,7 @@ var import_path40 = __toESM(require("path"), 1);
|
|
|
1611573
1611620
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
1611574
1611621
|
var LOGS_FOLDER_NAME = "logs";
|
|
1611575
1611622
|
function getCliSource() {
|
|
1611576
|
-
const version7 = "3.
|
|
1611623
|
+
const version7 = "3.51.0-1-g79714d0ea3a";
|
|
1611577
1611624
|
return `cli@${version7}`;
|
|
1611578
1611625
|
}
|
|
1611579
1611626
|
var DebugLogger = class {
|
|
@@ -1613390,7 +1613437,8 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
|
|
|
1613390
1613437
|
};
|
|
1613391
1613438
|
}),
|
|
1613392
1613439
|
registerApi: async (opts) => apiCollector.addReferencedAPI(opts),
|
|
1613393
|
-
targetAudiences: void 0
|
|
1613440
|
+
targetAudiences: void 0,
|
|
1613441
|
+
pythonDocsSectionHandler: createPythonDocsSectionPlaceholder
|
|
1613394
1613442
|
});
|
|
1613395
1613443
|
const writeDocsDefinition = await resolver2.resolve();
|
|
1613396
1613444
|
const dbDocsDefinition = convertDocsDefinitionToDb({
|
package/package.json
CHANGED