Skip to content

[Chore] Bump node and remove node-fetch#15

Merged
wessels2 merged 28 commits intomasterfrom
chore/bump-node-remove-node-fetch
Jul 9, 2025
Merged

[Chore] Bump node and remove node-fetch#15
wessels2 merged 28 commits intomasterfrom
chore/bump-node-remove-node-fetch

Conversation

@wessels2
Copy link
Contributor

@wessels2 wessels2 commented Jul 7, 2025

Description

CloudCode 1.15 has been bumped to use node 22.15 and node-fetch is no longer being used as the global fetch implementation in favor of the native fetch now included with the newer node version.

We're updating this package to match the node version and also removing the node-fetch dependency.

QA

  • Tested pdf-reports 1.0.0 on CC 1.12 and got no errors
  • Tested pdf-reports 1.0.0 on CC 1.15 and got the same missing package error as the customer
  • Tested pdf-reports 1.1.0-dev.1 on CC 1.15 and got no errors
  • Tested pdf-reports 1.1.0-dev.1 on CC 1.12 and got no errors (Although fetch didn't get used, so might still be incompatible)
image

Reason for major version bump to 2.0.0

Native fetch has been introduced in node 18 as experimental and in node 21 as stable. Since the dependency is added on templates and such with the semver caret (e.g. "@journeyapps/pdf-reports": "^1.0.0") users run the risk of using the new pdf-reports version on an older CC task which could cause issues.

Checklist

@wessels2 wessels2 marked this pull request as ready for review July 8, 2025 11:51
@wessels2 wessels2 requested a review from Manrich121 July 8, 2025 11:52
*.tsbuildinfo

.idea
.env No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a .env.template with the empty keys and JOURNEY_PDF_KEY for local dev

src/docraptor.ts Outdated
}

return new PdfResult(await response.buffer());
return new PdfResult(Buffer.from(await response.arrayBuffer()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a helper function that will do this Buffer.from(...) under the hood. It can be imported as fetch and the response be used like in the past await response.buffer()

yarn.lock Outdated
@@ -2,17 +2,30 @@
# yarn lockfile v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade this repo to use PNPM instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled in: #16

@wessels2 wessels2 requested a review from Manrich121 July 9, 2025 12:35
@wessels2 wessels2 merged commit 4e52c06 into master Jul 9, 2025
2 of 3 checks passed
@wessels2 wessels2 deleted the chore/bump-node-remove-node-fetch branch July 9, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants