Skip to content
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

import unenv-preset #7370

Merged
merged 3 commits into from
Dec 17, 2024
Merged

import unenv-preset #7370

merged 3 commits into from
Dec 17, 2024

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Nov 27, 2024

@pi0 @petebacondarwin This PR imports & sync the cloudflare preset.

#7366 lists (most of) the tasks that will need to be done.

--

Smoke tested with https://github.com/cloudflare/workers-sdk/tree/preset-test. In that branche, wrangler uses @cloudflare/unenv-preset and the hybrid test pass.

Next steps:

  • Add a way to test the dev version of the package (the plugin should resolve modules to the workspace version of the file)
  • Add tests
  • Setup the NPM release
  • ... see tracking issue

--

@pi0 I changed the license to MIT + Apache, is that ok with you?

@petebacondarwin do you think it would cause an issue to merge this before all of #7366 is done?

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: will be added in a follow up PR
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: newly created pkg not used yet
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: there is no user facing change

@vicb vicb requested a review from a team as a code owner November 27, 2024 15:31
Copy link

changeset-bot bot commented Nov 27, 2024

⚠️ No Changeset found

Latest commit: d2c606e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vicb vicb requested a review from petebacondarwin November 27, 2024 15:34
@vicb vicb added the e2e Run wrangler e2e tests on a PR label Nov 27, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

while personally recommand unbuild/mkdist, also a simple tsc would work if it is widely used in this repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have any other convention perhaps here?

Copy link
Contributor

github-actions bot commented Nov 27, 2024

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/12371005027/npm-package-wrangler-7370

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7370/npm-package-wrangler-7370

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-wrangler-7370 dev path/to/script.js
Additional artifacts:
wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-workers-bindings-extension-7370 -O ./cloudflare-workers-bindings-extension.0.0.0-v5995bd3c6.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v5995bd3c6.vsix
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-create-cloudflare-7370 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-kv-asset-handler-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-miniflare-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-pages-shared-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-unenv-preset-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-vitest-pool-workers-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-workers-editor-shared-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-workers-shared-7370
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12371005027/npm-package-cloudflare-workflows-shared-7370

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.96.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241205.0
workerd 1.20241205.0 1.20241205.0
workerd --version 1.20241205.0 2024-12-05

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@pi0
Copy link
Contributor

pi0 commented Nov 28, 2024

@vicb I think you need to update deps.ts to include this new package.

@vicb
Copy link
Contributor Author

vicb commented Nov 29, 2024

@vicb I think you need to update deps.ts to include this new package.

Good point, thanks @pi0. I'll add that to the tracking issue for when we switch wrangler to using this package.

@vicb vicb force-pushed the unenv branch 6 times, most recently from 08eea47 to 708af56 Compare December 11, 2024 09:39
@vicb vicb requested a review from pi0 December 11, 2024 13:58
@vicb vicb removed the e2e Run wrangler e2e tests on a PR label Dec 11, 2024
@vicb vicb force-pushed the unenv branch 2 times, most recently from 0195bfd to 81019e0 Compare December 11, 2024 14:11
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Will need to update findPackageNames() in validate-changesets.test.ts.

@petebacondarwin
Copy link
Contributor

Still need to fix this test:

Will need to update findPackageNames() in validate-changesets.test.ts.

@petebacondarwin
Copy link
Contributor

And appears to be a problem with the lockfile?

@petebacondarwin
Copy link
Contributor

I think to do the first deployment we need to mark it as public access:

npm publish --access public

@vicb vicb force-pushed the unenv branch 4 times, most recently from 57e875b to 813d437 Compare December 15, 2024 07:35
@vicb vicb added the e2e Run wrangler e2e tests on a PR label Dec 15, 2024
@vicb vicb force-pushed the unenv branch 5 times, most recently from d3bd9bf to 5f59687 Compare December 17, 2024 08:08
@vicb vicb requested a review from petebacondarwin December 17, 2024 09:44
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Just this one small nit.

vicb added 2 commits December 17, 2024 11:00
sync at unjs/unenv d9d4d03
https://github.com/pi0/unenv-preset-cloudflare

Co-authored-by: Pooya Parsa <pooya@pi0.io>
step
step
step
@vicb vicb merged commit 32e0616 into main Dec 17, 2024
31 checks passed
@vicb vicb deleted the unenv branch December 17, 2024 11:18
penalosa pushed a commit that referenced this pull request Jan 10, 2025
feat(unenv-preset): import the package

sync at unjs/unenv 7e05819
https://github.com/pi0/unenv-preset-cloudflare

Co-authored-by: Pooya Parsa <pooya@pi0.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run wrangler e2e tests on a PR no-changeset-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants