@fern-api/fern-api-dev 3.60.2-1-g4e59243ad4c → 3.61.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/cli.cjs +48 -6
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1654813,6 +1654813,20 @@ async function replaceReferencedMarkdown({
|
|
|
1654813
1654813
|
return { markdown: newMarkdown, referencedFiles: Array.from(collectedFiles.values()) };
|
|
1654814
1654814
|
}
|
|
1654815
1654815
|
|
|
1654816
|
+
// ../docs-markdown-utils/lib/transformAtPrefixImports.js
|
|
1654817
|
+
function transformAtPrefixImports({ markdown, absolutePathToFernFolder, absolutePathToMarkdownFile }) {
|
|
1654818
|
+
const importRegex = /(import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"])@\/([^'"]+)(['"])/g;
|
|
1654819
|
+
const mdxDir = dirname4(absolutePathToMarkdownFile);
|
|
1654820
|
+
return markdown.replace(importRegex, (match3, prefix2, importPath, suffix) => {
|
|
1654821
|
+
const absoluteImportPath = AbsoluteFilePath2.of(`${absolutePathToFernFolder}/${importPath}`);
|
|
1654822
|
+
let relativePath = relative3(mdxDir, absoluteImportPath);
|
|
1654823
|
+
if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
|
|
1654824
|
+
relativePath = RelativeFilePath2.of(`./${relativePath}`);
|
|
1654825
|
+
}
|
|
1654826
|
+
return `${prefix2}${relativePath}${suffix}`;
|
|
1654827
|
+
});
|
|
1654828
|
+
}
|
|
1654829
|
+
|
|
1654816
1654830
|
// ../docs-resolver/lib/DocsDefinitionResolver.js
|
|
1654817
1654831
|
init_js();
|
|
1654818
1654832
|
init_lib6();
|
|
@@ -1659166,12 +1659180,17 @@ var DocsDefinitionResolver = class {
|
|
|
1659166
1659180
|
this.referencedMarkdownFiles.push(refFile);
|
|
1659167
1659181
|
}
|
|
1659168
1659182
|
}
|
|
1659169
|
-
const
|
|
1659183
|
+
const codeReplacedMarkdown = await replaceReferencedCode({
|
|
1659170
1659184
|
markdown: result.markdown,
|
|
1659171
1659185
|
absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath,
|
|
1659172
1659186
|
absolutePathToMarkdownFile: this.resolveFilepath(relativePath),
|
|
1659173
1659187
|
context: this.taskContext
|
|
1659174
1659188
|
});
|
|
1659189
|
+
const newMarkdown = transformAtPrefixImports({
|
|
1659190
|
+
markdown: codeReplacedMarkdown,
|
|
1659191
|
+
absolutePathToFernFolder: this.docsWorkspace.absoluteFilePath,
|
|
1659192
|
+
absolutePathToMarkdownFile: this.resolveFilepath(relativePath)
|
|
1659193
|
+
});
|
|
1659175
1659194
|
this.parsedDocsConfig.pages[RelativeFilePath2.of(relativePath)] = newMarkdown;
|
|
1659176
1659195
|
}
|
|
1659177
1659196
|
const refTime = performance.now() - refStart;
|
|
@@ -1678894,7 +1678913,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1678894
1678913
|
properties: {
|
|
1678895
1678914
|
...event,
|
|
1678896
1678915
|
...event.properties,
|
|
1678897
|
-
version: "3.
|
|
1678916
|
+
version: "3.61.0",
|
|
1678898
1678917
|
usingAccessToken: true
|
|
1678899
1678918
|
}
|
|
1678900
1678919
|
});
|
|
@@ -1678944,7 +1678963,7 @@ var UserPosthogManager = class {
|
|
|
1678944
1678963
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1678945
1678964
|
event: "CLI",
|
|
1678946
1678965
|
properties: {
|
|
1678947
|
-
version: "3.
|
|
1678966
|
+
version: "3.61.0",
|
|
1678948
1678967
|
...event,
|
|
1678949
1678968
|
...event.properties,
|
|
1678950
1678969
|
usingAccessToken: false,
|
|
@@ -1710866,7 +1710885,7 @@ var CliContext = class {
|
|
|
1710866
1710885
|
if (false) {
|
|
1710867
1710886
|
this.logger.error("CLI_VERSION is not defined");
|
|
1710868
1710887
|
}
|
|
1710869
|
-
return "3.
|
|
1710888
|
+
return "3.61.0";
|
|
1710870
1710889
|
}
|
|
1710871
1710890
|
getCliName() {
|
|
1710872
1710891
|
if (false) {
|
|
@@ -1713980,7 +1713999,7 @@ var import_path56 = __toESM(require("path"), 1);
|
|
|
1713980
1713999
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
1713981
1714000
|
var LOGS_FOLDER_NAME = "logs";
|
|
1713982
1714001
|
function getCliSource() {
|
|
1713983
|
-
const version7 = "3.
|
|
1714002
|
+
const version7 = "3.61.0";
|
|
1713984
1714003
|
return `cli@${version7}`;
|
|
1713985
1714004
|
}
|
|
1713986
1714005
|
var DebugLogger = class {
|
|
@@ -1715625,6 +1715644,24 @@ async function replaceReferencedMarkdown2({
|
|
|
1715625
1715644
|
return { markdown: newMarkdown, referencedFiles: Array.from(collectedFiles.values()) };
|
|
1715626
1715645
|
}
|
|
1715627
1715646
|
|
|
1715647
|
+
// ../docs-markdown-utils/src/transformAtPrefixImports.ts
|
|
1715648
|
+
function transformAtPrefixImports2({
|
|
1715649
|
+
markdown,
|
|
1715650
|
+
absolutePathToFernFolder,
|
|
1715651
|
+
absolutePathToMarkdownFile
|
|
1715652
|
+
}) {
|
|
1715653
|
+
const importRegex = /(import\s+(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"])@\/([^'"]+)(['"])/g;
|
|
1715654
|
+
const mdxDir = dirname4(absolutePathToMarkdownFile);
|
|
1715655
|
+
return markdown.replace(importRegex, (match3, prefix2, importPath, suffix) => {
|
|
1715656
|
+
const absoluteImportPath = AbsoluteFilePath2.of(`${absolutePathToFernFolder}/${importPath}`);
|
|
1715657
|
+
let relativePath = relative3(mdxDir, absoluteImportPath);
|
|
1715658
|
+
if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
|
|
1715659
|
+
relativePath = RelativeFilePath2.of(`./${relativePath}`);
|
|
1715660
|
+
}
|
|
1715661
|
+
return `${prefix2}${relativePath}${suffix}`;
|
|
1715662
|
+
});
|
|
1715663
|
+
}
|
|
1715664
|
+
|
|
1715628
1715665
|
// ../docs-preview/lib/previewDocs.js
|
|
1715629
1715666
|
var frontmatterPositionCache = /* @__PURE__ */ new Map();
|
|
1715630
1715667
|
var frontmatterSidebarTitleCache = /* @__PURE__ */ new Map();
|
|
@@ -1715726,12 +1715763,17 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
|
|
|
1715726
1715763
|
absolutePathToMarkdownFile: absoluteFilePath,
|
|
1715727
1715764
|
context: context2
|
|
1715728
1715765
|
});
|
|
1715729
|
-
const
|
|
1715766
|
+
const markdownReplacedCode = await replaceReferencedCode2({
|
|
1715730
1715767
|
markdown: markdownReplacedMd,
|
|
1715731
1715768
|
absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
|
|
1715732
1715769
|
absolutePathToMarkdownFile: absoluteFilePath,
|
|
1715733
1715770
|
context: context2
|
|
1715734
1715771
|
});
|
|
1715772
|
+
const markdownReplacedMdAndCode = transformAtPrefixImports2({
|
|
1715773
|
+
markdown: markdownReplacedCode,
|
|
1715774
|
+
absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
|
|
1715775
|
+
absolutePathToMarkdownFile: absoluteFilePath
|
|
1715776
|
+
});
|
|
1715735
1715777
|
const { markdown: markdownWithAbsPaths, filepaths } = parseImagePaths2(markdownReplacedMdAndCode, {
|
|
1715736
1715778
|
absolutePathToFernFolder: docsWorkspace.absoluteFilePath,
|
|
1715737
1715779
|
absolutePathToMarkdownFile: absoluteFilePath
|
package/package.json
CHANGED