fern-api 0.26.9-rc0 → 0.26.9-rc1

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/bundle.cjs +30 -39
  2. package/package.json +1 -1
package/bundle.cjs CHANGED
@@ -977842,7 +977842,7 @@ var AccessTokenPosthogManager = class {
977842
977842
  properties: {
977843
977843
  ...event,
977844
977844
  ...event.properties,
977845
- version: "0.26.9-rc0",
977845
+ version: "0.26.9-rc1",
977846
977846
  usingAccessToken: true
977847
977847
  }
977848
977848
  });
@@ -977904,7 +977904,7 @@ var UserPosthogManager = class {
977904
977904
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
977905
977905
  event: "CLI",
977906
977906
  properties: {
977907
- version: "0.26.9-rc0",
977907
+ version: "0.26.9-rc1",
977908
977908
  ...event,
977909
977909
  ...event.properties
977910
977910
  }
@@ -1002759,10 +1002759,10 @@ var CliContext = class {
1002759
1002759
  return "fern-api";
1002760
1002760
  }
1002761
1002761
  getPackageVersion() {
1002762
- if ("0.26.9-rc0" == null) {
1002762
+ if ("0.26.9-rc1" == null) {
1002763
1002763
  this.logger.error("CLI_VERSION is not defined");
1002764
1002764
  }
1002765
- return "0.26.9-rc0";
1002765
+ return "0.26.9-rc1";
1002766
1002766
  }
1002767
1002767
  getCliName() {
1002768
1002768
  if ("fern" == null) {
@@ -1053346,8 +1053346,13 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
1053346
1053346
  }
1053347
1053347
  const { docsRegistrationId, uploadUrls } = startDocsRegisterResponse.body;
1053348
1053348
  const collectedFileIds = /* @__PURE__ */ new Map();
1053349
- await Promise.all([
1053350
- ...filepathsToUpload.map(async (filepathToUpload) => {
1053349
+ const allFilepathsToUpload = [
1053350
+ ...filepathsToUpload,
1053351
+ ...imageFilepathsWithSizesToUpload.map((image2) => image2.filePath)
1053352
+ ];
1053353
+ const chunkedFilepathsToUpload = chunk_default(allFilepathsToUpload, 50);
1053354
+ for (const chunkedFilepaths of chunkedFilepathsToUpload) {
1053355
+ await Promise.all(chunkedFilepaths.map(async (filepathToUpload) => {
1053351
1053356
  const relativePath = convertAbsoluteFilepathToFdrFilepath(filepathToUpload, parsedDocsConfig);
1053352
1053357
  const uploadUrl = uploadUrls[relativePath];
1053353
1053358
  if (uploadUrl == null) {
@@ -1053365,27 +1053370,8 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
1053365
1053370
  context.failAndThrow(`Failed to upload ${filepathToUpload}`, e);
1053366
1053371
  }
1053367
1053372
  }
1053368
- }),
1053369
- ...imageFilepathsWithSizesToUpload.map(async ({ filePath: imageFilepathToUpload }) => {
1053370
- const relativePath = convertAbsoluteFilepathToFdrFilepath(imageFilepathToUpload, parsedDocsConfig);
1053371
- const uploadUrl = uploadUrls[relativePath];
1053372
- if (uploadUrl == null) {
1053373
- context.failAndThrow(`Failed to upload ${imageFilepathToUpload}`, "Upload URL is missing");
1053374
- } else {
1053375
- try {
1053376
- const mimeType = mime.lookup(imageFilepathToUpload);
1053377
- await import_axios8.default.put(uploadUrl.uploadUrl, await (0, import_promises43.readFile)(imageFilepathToUpload), {
1053378
- headers: {
1053379
- "Content-Type": mimeType === false ? "application/octet-stream" : mimeType
1053380
- }
1053381
- });
1053382
- collectedFileIds.set(relativePath, uploadUrl.fileId);
1053383
- } catch (e) {
1053384
- context.failAndThrow(`Failed to upload ${imageFilepathToUpload}`, e);
1053385
- }
1053386
- }
1053387
- })
1053388
- ]);
1053373
+ }));
1053374
+ }
1053389
1053375
  for (const [relativePath, markdown] of Object.entries(parsedDocsConfig.pages)) {
1053390
1053376
  parsedDocsConfig.pages[RelativeFilePath.of(relativePath)] = replaceImagePaths(markdown, collectedFileIds);
1053391
1053377
  }
@@ -1054006,20 +1053992,25 @@ async function getImageFilepathsToUpload(parsedDocsConfig, parsedImagePaths) {
1054006
1053992
  for (const parsedImagePath of parsedImagePaths) {
1054007
1053993
  filepaths.add(parsedImagePath.filepath);
1054008
1053994
  }
1054009
- const imageFilepathsAndSizesToUpload = await Promise.all([...filepaths].map(async (filePath) => {
1054010
- try {
1054011
- const size2 = await sizeOf(filePath);
1054012
- if (size2 == null || size2.height == null || size2.width == null) {
1053995
+ const filepathChunks = chunk_default([...filepaths], 10);
1053996
+ const imageFilepathsAndSizesToUpload = [];
1053997
+ for (const filepaths2 of filepathChunks) {
1053998
+ const chunk2 = await Promise.all(filepaths2.map(async (filePath) => {
1053999
+ try {
1054000
+ const size2 = await sizeOf(filePath);
1054001
+ if (size2 == null || size2.height == null || size2.width == null) {
1054002
+ return { type: "filepath", value: filePath };
1054003
+ }
1054004
+ return {
1054005
+ type: "image",
1054006
+ value: { filePath, width: size2.width, height: size2.height, blurDataUrl: void 0 }
1054007
+ };
1054008
+ } catch (e) {
1054013
1054009
  return { type: "filepath", value: filePath };
1054014
1054010
  }
1054015
- return {
1054016
- type: "image",
1054017
- value: { filePath, width: size2.width, height: size2.height, blurDataUrl: void 0 }
1054018
- };
1054019
- } catch (e) {
1054020
- return { type: "filepath", value: filePath };
1054021
- }
1054022
- }));
1054011
+ }));
1054012
+ imageFilepathsAndSizesToUpload.push(...chunk2);
1054013
+ }
1054023
1054014
  const imagesWithSize = imageFilepathsAndSizesToUpload.filter(isImage).map((image2) => image2.value);
1054024
1054015
  const imagesWithoutSize = imageFilepathsAndSizesToUpload.filter(isFilePath).map((image2) => image2.value);
1054025
1054016
  return [imagesWithSize, imagesWithoutSize];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fern-api",
3
- "version": "0.26.9-rc0",
3
+ "version": "0.26.9-rc1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/fern-api/fern.git",