Skip to content

Commit

Permalink
chore(cli): add more logging statements for preview bundle (#4993)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Oct 24, 2024
1 parent 234dae7 commit 9efa2ee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions fern/pages/changelogs/cli/2024-10-24.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 0.45.0-rc18
**`(fix):`** - Add additional debug logging to the CLI when downloading docs preview bundle


7 changes: 7 additions & 0 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- changelogEntry:
- summary: |
- Add additional debug logging to the CLI when downloading docs preview bundle
type: fix
irVersion: 53
version: 0.45.0-rc18

- changelogEntry:
- summary: |
- Improved union example generation by increasing depth for better handling of recursive structures.
Expand Down
10 changes: 9 additions & 1 deletion packages/cli/docs-preview/src/downloadLocalDocsBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,21 @@ export async function downloadBundle({
}
}

logger.debug("Creating tmp directory to download docs preview bundle");
// create tmp directory
const dir = await tmp.dir({ prefix: "fern" });
const absoluteDirectoryToTmpDir = AbsoluteFilePath.of(dir.path);
logger.debug(`Created tmp directory ${absoluteDirectoryToTmpDir}`);

logger.debug(`Downloading docs preview bundle from ${path.join(bucketUrl, key)}`);
// download docs bundle
const docsBundleZipResponse = await fetch(`${path.join(bucketUrl, key)}`);

if (!docsBundleZipResponse.ok) {
logger.error(`Failed to download docs preview bundle. ${docsBundleZipResponse.statusText}`);
return {
type: "failure"
};
}
const outputZipPath = join(absoluteDirectoryToTmpDir, RelativeFilePath.of("output.zip"));

const contents = docsBundleZipResponse.body;
Expand Down

0 comments on commit 9efa2ee

Please sign in to comment.