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

refactor(unenv-preset): sync directory structure with unenv #7915

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jan 27, 2025

Sync the directory structure with unjs/unenv#392


edit Jan 28:

This PR is expected to fail until [email protected] is released (or whatever rc changes the unenv file structure, see unjs/unenv#392)

It can be test locally in the unenv-preset folder via:

pnpm link /path/to/[email protected]
pnpm test:ci

/cc @pi0 @petebacondarwin

Todo:

  • update unenv version (for now file:...) when it is released
  • fix the build

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: already tested
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: no user facing change

@vicb vicb requested review from a team as code owners January 27, 2025 10:24
@vicb vicb marked this pull request as draft January 27, 2025 10:25
Copy link

changeset-bot bot commented Jan 27, 2025

⚠️ No Changeset found

Latest commit: cb92141

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

"unbuild": "^3.2.0",
"undici": "catalog:default",
"unenv": "file:/Users/vberchet/code/work/unenv",
Copy link
Contributor

Choose a reason for hiding this comment

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

Really not sure about effect of this on resolution but it won't be same as normal installations in node_modules.

We should adopt it with next rc (or nightly if you have it still working here)

Copy link
Contributor Author

@vicb vicb Jan 27, 2025

Choose a reason for hiding this comment

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

Yep, that was just pushing the changes that I have for (p)review.
This PR is in draft mode, I should have been more clear in the description.

@anonrig
Copy link
Member

anonrig commented Jan 27, 2025

@vicb Can you rebase?

@vicb
Copy link
Contributor Author

vicb commented Jan 27, 2025

@vicb Can you rebase?

I will, probably tomorrow. For now this is only a preview syncing with the next version of unenv

edit Jan 28: rebased and tested locally using pnpm link - added details in the description

@vicb vicb force-pushed the uennv-rc branch 2 times, most recently from 631bbf7 to ce8b989 Compare January 29, 2025 08:02
@vicb
Copy link
Contributor Author

vicb commented Jan 29, 2025

Drop timers + rebased

Comment on lines -1689 to -1718
unenv:
specifier: 2.0.0-rc.1
version: 2.0.0-rc.1
Copy link
Contributor

Choose a reason for hiding this comment

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

What's happening here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pnpm link to test the dev version as the new structure has not been released to npm.
Will need to be updated after the release and then remove draft from the PR

Copy link
Contributor

github-actions bot commented Feb 10, 2025

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/13301360645/npm-package-wrangler-7915

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-wrangler-7915 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-workers-bindings-extension-7915 -O ./cloudflare-workers-bindings-extension.0.0.0-vf735271e1.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vf735271e1.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-create-cloudflare-7915 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-kv-asset-handler-7915

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-miniflare-7915

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-pages-shared-7915

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-unenv-preset-7915

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-vite-plugin-7915

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-vitest-pool-workers-7915

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-workers-editor-shared-7915

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-workers-shared-7915

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13301360645/npm-package-cloudflare-workflows-shared-7915

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


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250204.0
workerd 1.20250204.0 1.20250204.0
workerd --version 1.20250204.0 2025-02-04

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

@vicb
Copy link
Contributor Author

vicb commented Feb 10, 2025

@petebacondarwin I have started to sync with unenv - there are still a few changes to sync. I also have 2 PRs on unenv that are pendings.

This PR also needs to be tested with a version of wrangler actually using the preset - currently wrangler (then also pnpm -F @cloudflare/unenv-preset test:ci) is using unjs/unenv.

I hope to be done with that later today so that we can release @cloudflare/unenv-preset@2 this week. This would be a prerequisite before switching wrangler back to the preset.

@vicb vicb force-pushed the uennv-rc branch 7 times, most recently from 778b8e4 to fe14753 Compare February 13, 2025 16:12
@vicb
Copy link
Contributor Author

vicb commented Feb 13, 2025

@petebacondarwin we need to fix performance (see #8111, it was broken before but with the changes to unenv we have to fix this now and it's a good time anyway) but the rest should be ~ready.

The PR should be ready by tomorrow but feel free to take a look before.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Untriaged
Development

Successfully merging this pull request may close these issues.

4 participants