@fern-api/fern-api-dev 4.103.1-4-g44dd803daf9 → 4.103.1-8-g1b02c3d2d8c

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.
Files changed (2) hide show
  1. package/cli.cjs +47 -18
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -510181,6 +510181,7 @@ __export(DocsYmlSchemas_exports, {
510181
510181
  ThemeConfig: () => ThemeConfig,
510182
510182
  TitleSource: () => TitleSource,
510183
510183
  TranslationConfig: () => TranslationConfig,
510184
+ TranslationConfigObject: () => TranslationConfigObject,
510184
510185
  TwitterCardSetting: () => TwitterCardSetting,
510185
510186
  UntabbedNavigationConfig: () => UntabbedNavigationConfig,
510186
510187
  VersionAvailability: () => VersionAvailability,
@@ -510189,7 +510190,8 @@ __export(DocsYmlSchemas_exports, {
510189
510190
  VersionedSnippetLanguageConfiguration: () => VersionedSnippetLanguageConfiguration,
510190
510191
  WithFeatureFlags: () => WithFeatureFlags,
510191
510192
  WithPermissions: () => WithPermissions,
510192
- WithViewers: () => WithViewers
510193
+ WithViewers: () => WithViewers,
510194
+ normalizeTranslationConfig: () => normalizeTranslationConfig
510193
510195
  });
510194
510196
  var TabId = external_exports.string();
510195
510197
  var ChangelogFolderRelativePath = external_exports.string();
@@ -510853,10 +510855,17 @@ var ProductFileConfig = external_exports.object({
510853
510855
  "landing-page": PageConfiguration.optional(),
510854
510856
  navigation: NavigationConfig
510855
510857
  });
510856
- var TranslationConfig = external_exports.object({
510858
+ var TranslationConfigObject = external_exports.object({
510857
510859
  lang: Language,
510858
510860
  default: external_exports.boolean().optional()
510859
510861
  });
510862
+ var TranslationConfig = external_exports.union([Language, TranslationConfigObject]);
510863
+ function normalizeTranslationConfig(config5) {
510864
+ if (typeof config5 === "string") {
510865
+ return { lang: config5 };
510866
+ }
510867
+ return config5;
510868
+ }
510860
510869
  var DocsConfiguration = external_exports.object({
510861
510870
  instances: external_exports.array(DocsInstance),
510862
510871
  title: external_exports.string().optional(),
@@ -510879,7 +510888,8 @@ var DocsConfiguration = external_exports.object({
510879
510888
  if (translations == null) {
510880
510889
  return;
510881
510890
  }
510882
- const defaultCount = translations.filter((t3) => t3.default === true).length;
510891
+ const normalizedTranslations = translations.map(normalizeTranslationConfig);
510892
+ const defaultCount = normalizedTranslations.filter((t3) => t3.default === true).length;
510883
510893
  if (defaultCount > 1) {
510884
510894
  ctx.addIssue({
510885
510895
  code: external_exports.ZodIssueCode.custom,
@@ -511627,6 +511637,7 @@ __export(serialization_exports3, {
511627
511637
  ThemeConfig: () => ThemeConfig2,
511628
511638
  TitleSource: () => TitleSource3,
511629
511639
  TranslationConfig: () => TranslationConfig2,
511640
+ TranslationConfigObject: () => TranslationConfigObject2,
511630
511641
  TwitterCardSetting: () => TwitterCardSetting3,
511631
511642
  UntabbedNavigationConfig: () => UntabbedNavigationConfig2,
511632
511643
  VersionAvailability: () => VersionAvailability3,
@@ -511780,6 +511791,7 @@ __export(docs_exports2, {
511780
511791
  ThemeConfig: () => ThemeConfig2,
511781
511792
  TitleSource: () => TitleSource3,
511782
511793
  TranslationConfig: () => TranslationConfig2,
511794
+ TranslationConfigObject: () => TranslationConfigObject2,
511783
511795
  TwitterCardSetting: () => TwitterCardSetting3,
511784
511796
  UntabbedNavigationConfig: () => UntabbedNavigationConfig2,
511785
511797
  VersionAvailability: () => VersionAvailability3,
@@ -514171,12 +514183,15 @@ var ThemeConfig2 = schemas_exports6.object({
514171
514183
  productSwitcher: schemas_exports6.property("product-switcher", ProductSwitcherThemeConfig3.optional())
514172
514184
  });
514173
514185
 
514174
- // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TranslationConfig.js
514175
- var TranslationConfig2 = schemas_exports6.object({
514186
+ // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TranslationConfigObject.js
514187
+ var TranslationConfigObject2 = schemas_exports6.object({
514176
514188
  lang: Language3,
514177
514189
  default: schemas_exports6.boolean().optional()
514178
514190
  });
514179
514191
 
514192
+ // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TranslationConfig.js
514193
+ var TranslationConfig2 = schemas_exports6.undiscriminatedUnion([Language3, TranslationConfigObject2]);
514194
+
514180
514195
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/DocsConfiguration.js
514181
514196
  var DocsConfiguration2 = schemas_exports6.object({
514182
514197
  instances: schemas_exports6.list(DocsInstance2),
@@ -541974,7 +541989,7 @@ async function parseDocsConfiguration({ rawDocsConfiguration, absolutePathToFern
541974
541989
  rawPath: agents?.llmsFullTxt,
541975
541990
  absoluteFilepathToDocsConfig
541976
541991
  });
541977
- const defaultLocale = rawDocsConfiguration.translations?.find((t3) => t3.default === true)?.lang ?? rawDocsConfiguration.translations?.[0]?.lang;
541992
+ const defaultLocale = rawDocsConfiguration.translations?.map((t3) => docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(t3)).find((t3) => t3.default === true)?.lang ?? (rawDocsConfiguration.translations?.[0] != null ? docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(rawDocsConfiguration.translations[0]).lang : void 0);
541978
541993
  const translationPagesPromise = pagesPromise.then((resolvedPages) => loadTranslationPages({
541979
541994
  translations: rawDocsConfiguration.translations,
541980
541995
  defaultLocale,
@@ -543242,7 +543257,8 @@ async function loadTranslationPages({ translations, defaultLocale, pages, absolu
543242
543257
  }
543243
543258
  const translationsRootDir = import_path22.default.join(absolutePathToFernFolder, "translations");
543244
543259
  const result = {};
543245
- await Promise.all(translations.map(async ({ lang }) => {
543260
+ const normalizedTranslations = translations.map((t3) => docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(t3));
543261
+ await Promise.all(normalizedTranslations.map(async ({ lang }) => {
543246
543262
  if (lang === defaultLocale) {
543247
543263
  return;
543248
543264
  }
@@ -620962,7 +620978,7 @@ var AccessTokenPosthogManager = class {
620962
620978
  properties: {
620963
620979
  ...event,
620964
620980
  ...event.properties,
620965
- version: "4.103.1-4-g44dd803daf9",
620981
+ version: "4.103.1-8-g1b02c3d2d8c",
620966
620982
  usingAccessToken: true
620967
620983
  }
620968
620984
  });
@@ -621016,7 +621032,7 @@ var UserPosthogManager = class {
621016
621032
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
621017
621033
  event: "CLI",
621018
621034
  properties: {
621019
- version: "4.103.1-4-g44dd803daf9",
621035
+ version: "4.103.1-8-g1b02c3d2d8c",
621020
621036
  ...event,
621021
621037
  ...event.properties,
621022
621038
  usingAccessToken: false,
@@ -798536,13 +798552,14 @@ var DocsDefinitionResolver = class {
798536
798552
  if (translations == null || translations.length === 0) {
798537
798553
  return void 0;
798538
798554
  }
798539
- const defaultTranslation = translations.find((translation) => translation.default === true) ?? translations[0];
798555
+ const normalizedTranslations = translations.map((t3) => docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(t3));
798556
+ const defaultTranslation = normalizedTranslations.find((translation) => translation.default === true) ?? normalizedTranslations[0];
798540
798557
  if (defaultTranslation == null) {
798541
798558
  return void 0;
798542
798559
  }
798543
798560
  return {
798544
798561
  defaultLocale: defaultTranslation.lang,
798545
- translations: translations.map((translation) => translation.lang)
798562
+ translations: normalizedTranslations.map((translation) => translation.lang)
798546
798563
  };
798547
798564
  }
798548
798565
  collectedFileIds = /* @__PURE__ */ new Map();
@@ -806130,11 +806147,12 @@ var TranslationDirectoriesExistRule = {
806130
806147
  if (translations == null || translations.length === 0) {
806131
806148
  return violations;
806132
806149
  }
806133
- const defaultLocale = (translations.find((t3) => t3.default === true) ?? translations[0])?.lang;
806150
+ const normalizedTranslations = translations.map((t3) => docs_yml_exports.DocsYmlSchemas.normalizeTranslationConfig(t3));
806151
+ const defaultLocale = (normalizedTranslations.find((t3) => t3.default === true) ?? normalizedTranslations[0])?.lang;
806134
806152
  const translationsDir = join8(workspace.absoluteFilePath, RelativeFilePath2.of("translations"));
806135
806153
  const translationsDirExists = await doesPathExist(translationsDir);
806136
806154
  const missingDirs = [];
806137
- for (const translation of translations) {
806155
+ for (const translation of normalizedTranslations) {
806138
806156
  if (translation.lang === defaultLocale) {
806139
806157
  continue;
806140
806158
  }
@@ -832310,7 +832328,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
832310
832328
  var LOGS_FOLDER_NAME = "logs";
832311
832329
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
832312
832330
  function getCliSource() {
832313
- const version7 = "4.103.1-4-g44dd803daf9";
832331
+ const version7 = "4.103.1-8-g1b02c3d2d8c";
832314
832332
  return `cli@${version7}`;
832315
832333
  }
832316
832334
  var DebugLogger = class {
@@ -840315,7 +840333,7 @@ var definitions6 = {
840315
840333
  "tr"
840316
840334
  ]
840317
840335
  },
840318
- "docs.TranslationConfig": {
840336
+ "docs.TranslationConfigObject": {
840319
840337
  type: "object",
840320
840338
  properties: {
840321
840339
  lang: {
@@ -840337,6 +840355,16 @@ var definitions6 = {
840337
840355
  ],
840338
840356
  additionalProperties: false
840339
840357
  },
840358
+ "docs.TranslationConfig": {
840359
+ anyOf: [
840360
+ {
840361
+ $ref: "#/definitions/docs.Language"
840362
+ },
840363
+ {
840364
+ $ref: "#/definitions/docs.TranslationConfigObject"
840365
+ }
840366
+ ]
840367
+ },
840340
840368
  "docs.AIChatModel": {
840341
840369
  type: "string",
840342
840370
  enum: [
@@ -843958,7 +843986,8 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
843958
843986
  root: updatedRoot
843959
843987
  }
843960
843988
  };
843961
- context3.logger.info(`Sending translation for locale "${locale}": pages=${JSON.stringify(Object.keys(localePages))}`);
843989
+ const pageCount2 = Object.keys(localePages).length;
843990
+ context3.logger.debug(`Sending translation for locale "${locale}" (${pageCount2} page${pageCount2 === 1 ? "" : "s"})`);
843962
843991
  const translationResponse = await fetch(`${fdrOrigin}/v2/registry/docs/translations/register`, {
843963
843992
  method: "POST",
843964
843993
  headers: {
@@ -844666,7 +844695,7 @@ var LegacyDocsPublisher = class {
844666
844695
  previewId,
844667
844696
  disableTemplates: void 0,
844668
844697
  skipUpload,
844669
- cliVersion: "4.103.1-4-g44dd803daf9",
844698
+ cliVersion: "4.103.1-8-g1b02c3d2d8c",
844670
844699
  loginCommand: "fern auth login"
844671
844700
  });
844672
844701
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -918757,7 +918786,7 @@ var CliContext = class _CliContext {
918757
918786
  if (false) {
918758
918787
  this.logger.error("CLI_VERSION is not defined");
918759
918788
  }
918760
- return "4.103.1-4-g44dd803daf9";
918789
+ return "4.103.1-8-g1b02c3d2d8c";
918761
918790
  }
918762
918791
  getCliName() {
918763
918792
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.103.1-4-g44dd803daf9",
2
+ "version": "4.103.1-8-g1b02c3d2d8c",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",