-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pages] Update pages functions build
to include config
#5353
Conversation
🦋 Changeset detectedLatest commit: a2541ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-wrangler-5353 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5353/npm-package-wrangler-5353 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-wrangler-5353 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-create-cloudflare-5353 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-cloudflare-kv-asset-handler-5353 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-miniflare-5353 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-cloudflare-pages-shared-5353 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8421253010/npm-package-cloudflare-vitest-pool-workers-5353 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
3af8b05
to
b5deb07
Compare
6cdeaef
to
4ac26c3
Compare
4ac26c3
to
bfefb7f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5353 +/- ##
==========================================
+ Coverage 72.29% 72.45% +0.16%
==========================================
Files 318 318
Lines 16458 16505 +47
Branches 4201 4230 +29
==========================================
+ Hits 11898 11959 +61
+ Misses 4560 4546 -14
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! ✅ Some very minor comments. 👍
packages/wrangler/src/api/pages/create-worker-bundle-contents.ts
Outdated
Show resolved
Hide resolved
const metadata = JSON.parse(workerBundleFormData.get("metadata") as string); | ||
|
||
/** | ||
* Pages doesn't need the metadata bindings returned by | ||
* `createWorkerBundleFormData`. Let's strip them out and return only | ||
* the contents we need | ||
*/ | ||
workerBundleFormData.set( | ||
"metadata", | ||
JSON.stringify({ main_module: metadata.main_module }) | ||
); | ||
workerBundleFormData.set("metadata", JSON.stringify(metadata)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these lines are no longer needed. They were only here because we were trying to strip out the bindings from the metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact perhaps this whole function is redundant now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modified this function to strip out the empty bindings key from the metadata if no config has been found
According to the JIRA ticket we also need to support a |
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
I've updated the JIRA ticket—for consistency with |
What this PR solves / how to test
Updates
wrangler pages functions build
to support including values fromwrangler.toml
in the Functions upload. Additionally, support two properties that will be set in CI—--build-metadata-path
and--project-directory
.Fixes DEVX-1177 & DEVX-1175
Author has addressed the following