@fern-api/fern-api-dev 5.2.1-2-gbc8fbb865e6 → 5.2.1-5-geb7105beec4
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 +30 -13
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -544029,11 +544029,14 @@ async function loadTranslationNavigationOverlays({ translations, defaultLocale,
|
|
|
544029
544029
|
if (lang === defaultLocale) {
|
|
544030
544030
|
return;
|
|
544031
544031
|
}
|
|
544032
|
-
const
|
|
544033
|
-
|
|
544034
|
-
|
|
544032
|
+
const overlayLookup = await resolveTranslationOverlayDocsYml({
|
|
544033
|
+
translationsRootDir,
|
|
544034
|
+
lang
|
|
544035
|
+
});
|
|
544036
|
+
if (overlayLookup == null) {
|
|
544035
544037
|
return;
|
|
544036
544038
|
}
|
|
544039
|
+
const { overlayDocsYmlPath, overlayDir } = overlayLookup;
|
|
544037
544040
|
try {
|
|
544038
544041
|
const overlayContent = jsYaml.load(await (0, import_promises14.readFile)(overlayDocsYmlPath, "utf-8"));
|
|
544039
544042
|
if (!isPlainObject4(overlayContent)) {
|
|
@@ -544042,7 +544045,7 @@ async function loadTranslationNavigationOverlays({ translations, defaultLocale,
|
|
|
544042
544045
|
}
|
|
544043
544046
|
const overlay = await parseNavigationOverlayFromDocsYml({
|
|
544044
544047
|
docsYmlContent: overlayContent,
|
|
544045
|
-
langFernDir,
|
|
544048
|
+
langFernDir: overlayDir,
|
|
544046
544049
|
context: context3
|
|
544047
544050
|
});
|
|
544048
544051
|
result[lang] = overlay;
|
|
@@ -544055,6 +544058,19 @@ async function loadTranslationNavigationOverlays({ translations, defaultLocale,
|
|
|
544055
544058
|
}
|
|
544056
544059
|
return result;
|
|
544057
544060
|
}
|
|
544061
|
+
async function resolveTranslationOverlayDocsYml({ translationsRootDir, lang }) {
|
|
544062
|
+
const langDir = import_path22.default.join(translationsRootDir, lang);
|
|
544063
|
+
const directDocsYmlPath = import_path22.default.join(langDir, "docs.yml");
|
|
544064
|
+
if (await doesPathExist(directDocsYmlPath)) {
|
|
544065
|
+
return { overlayDocsYmlPath: directDocsYmlPath, overlayDir: langDir };
|
|
544066
|
+
}
|
|
544067
|
+
const legacyFernDir = import_path22.default.join(langDir, "fern");
|
|
544068
|
+
const legacyDocsYmlPath = import_path22.default.join(legacyFernDir, "docs.yml");
|
|
544069
|
+
if (await doesPathExist(legacyDocsYmlPath)) {
|
|
544070
|
+
return { overlayDocsYmlPath: legacyDocsYmlPath, overlayDir: legacyFernDir };
|
|
544071
|
+
}
|
|
544072
|
+
return void 0;
|
|
544073
|
+
}
|
|
544058
544074
|
function extractString(obj, key2) {
|
|
544059
544075
|
if (isPlainObject4(obj)) {
|
|
544060
544076
|
const value2 = obj[key2];
|
|
@@ -544064,7 +544080,7 @@ function extractString(obj, key2) {
|
|
|
544064
544080
|
}
|
|
544065
544081
|
return void 0;
|
|
544066
544082
|
}
|
|
544067
|
-
async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir, context: context3 }) {
|
|
544083
|
+
async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir: overlayDir, context: context3 }) {
|
|
544068
544084
|
const overlay = {
|
|
544069
544085
|
tabs: void 0,
|
|
544070
544086
|
products: void 0,
|
|
@@ -544103,8 +544119,8 @@ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir,
|
|
|
544103
544119
|
}
|
|
544104
544120
|
}
|
|
544105
544121
|
if (typeof productObj.path === "string") {
|
|
544106
|
-
const resolvedNavFilePath = import_path22.default.resolve(
|
|
544107
|
-
if (!resolvedNavFilePath.startsWith(
|
|
544122
|
+
const resolvedNavFilePath = import_path22.default.resolve(overlayDir, productObj.path);
|
|
544123
|
+
if (!resolvedNavFilePath.startsWith(overlayDir)) {
|
|
544108
544124
|
context3.logger.warn(`Invalid path in product overlay: "${productObj.path}" escapes the translations directory. Skipping.`);
|
|
544109
544125
|
overlay.products.push(productOverlay);
|
|
544110
544126
|
continue;
|
|
@@ -622001,7 +622017,7 @@ var AccessTokenPosthogManager = class {
|
|
|
622001
622017
|
properties: {
|
|
622002
622018
|
...event,
|
|
622003
622019
|
...event.properties,
|
|
622004
|
-
version: "5.2.1-
|
|
622020
|
+
version: "5.2.1-5-geb7105beec4",
|
|
622005
622021
|
usingAccessToken: true
|
|
622006
622022
|
}
|
|
622007
622023
|
});
|
|
@@ -622055,7 +622071,7 @@ var UserPosthogManager = class {
|
|
|
622055
622071
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
622056
622072
|
event: "CLI",
|
|
622057
622073
|
properties: {
|
|
622058
|
-
version: "5.2.1-
|
|
622074
|
+
version: "5.2.1-5-geb7105beec4",
|
|
622059
622075
|
...event,
|
|
622060
622076
|
...event.properties,
|
|
622061
622077
|
usingAccessToken: false,
|
|
@@ -800072,7 +800088,8 @@ var DocsDefinitionResolver = class {
|
|
|
800072
800088
|
}
|
|
800073
800089
|
/**
|
|
800074
800090
|
* Returns per-locale translated navigation overlays loaded from
|
|
800075
|
-
* `translations/<lang>/fern/docs.yml`
|
|
800091
|
+
* `translations/<lang>/docs.yml` (or `translations/<lang>/fern/docs.yml` for
|
|
800092
|
+
* backwards compatibility) and referenced nav YAML files.
|
|
800076
800093
|
* Must be called after `resolve()`.
|
|
800077
800094
|
*/
|
|
800078
800095
|
getTranslationNavigationOverlays() {
|
|
@@ -833930,7 +833947,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
833930
833947
|
var LOGS_FOLDER_NAME = "logs";
|
|
833931
833948
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
833932
833949
|
function getCliSource() {
|
|
833933
|
-
const version7 = "5.2.1-
|
|
833950
|
+
const version7 = "5.2.1-5-geb7105beec4";
|
|
833934
833951
|
return `cli@${version7}`;
|
|
833935
833952
|
}
|
|
833936
833953
|
var DebugLogger = class {
|
|
@@ -846382,7 +846399,7 @@ var LegacyDocsPublisher = class {
|
|
|
846382
846399
|
previewId,
|
|
846383
846400
|
disableTemplates: void 0,
|
|
846384
846401
|
skipUpload,
|
|
846385
|
-
cliVersion: "5.2.1-
|
|
846402
|
+
cliVersion: "5.2.1-5-geb7105beec4",
|
|
846386
846403
|
loginCommand: "fern auth login"
|
|
846387
846404
|
});
|
|
846388
846405
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -920711,7 +920728,7 @@ var CliContext = class _CliContext {
|
|
|
920711
920728
|
if (false) {
|
|
920712
920729
|
this.logger.error("CLI_VERSION is not defined");
|
|
920713
920730
|
}
|
|
920714
|
-
return "5.2.1-
|
|
920731
|
+
return "5.2.1-5-geb7105beec4";
|
|
920715
920732
|
}
|
|
920716
920733
|
getCliName() {
|
|
920717
920734
|
if (false) {
|
package/package.json
CHANGED