Skip to content

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Dec 20, 2024

No description provided.

vicb and others added 30 commits December 20, 2024 15:16
Update examples/middleware/package.json

Co-authored-by: James Anderson <[email protected]>
Update the lock file
Format the files
- Rely on OpenNext to copy the static assets
- Remove useless code in the worker - assets are served when path matches
Co-authored-by: Pete Bacon Darwin <[email protected]>
This is required to apply string replacement patches.
Fixes #143
wrangler 3.93.0 has an updated unenv using the native workerd stream implementation.
It fixes an issue with server actions.

Ref:
- #147
- unjs/unenv#363
…(experimental branch) (#166)

* feat: rename the binary from "cloudflare" to "opennextjs-cloudflare"

**BREAKING CHANGE**:
After this change the old way of running the tool (e.g. `pnpm cloudflare`) no longer works.
Going forward use the new binary name (e.g. `pnpm opennextjs-cloudflare`).

See [#161](#161)

* update experimental branch with binary name change
run workflow checks on experimental branch prs
Use ReadableStream.from instead of Readable.toWeb
The latter triggers a "This ReadableStream is disturbed" error
See cloudflare/workerd#3245
There is a "[unenv] fs.readdirSync is not implemented yet!" error to investigate
Also add patching validation check
make sure all code patch steps are validated and improve the code patching validation by removing the validation for each single patch function and introducing a new `patchCodeWithValidations` that applies all the patches
with validations all in a single place
* extract env vars from file system

* combine variables from a global with the request-scoped env

* inline build-time env vars in the worker script

* for some reason the tests failed in the pipeline but not locally

* switch between modes at runtime and apply on process.env

* add test for referencing variables

* use a .env.mjs file for the vars

* Update packages/cloudflare/src/cli/build/patches/investigated/copy-package-cli-files.ts

* move the merging to extractProjectEnvVars

* rename secrets to nextEnvVars

* add missing mode when retrieving value

* add link to nextjs var load order

* rename to compile

* change function to read a single file

* move the readEnvFile call inside the flatMap

* remove process.env.node_env usage

* add e2e test for env vars

* move locations
Co-authored-by: conico974 <[email protected]>
Copy link

changeset-bot bot commented Dec 20, 2024

🦋 Changeset detected

Latest commit: 2c0e57a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Minor

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

Copy link

pkg-pr-new bot commented Dec 20, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@196

commit: 2c0e57a

vicb added 2 commits December 20, 2024 15:26
The edge runtime is not supported yet
Co-authored-by: Pete Bacon Darwin <[email protected]>
@vicb vicb merged commit 7651d80 into main Dec 20, 2024
7 checks passed
@vicb vicb deleted the merge-exp branch December 20, 2024 15:11
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.

4 participants