-
Notifications
You must be signed in to change notification settings - Fork 748
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
chore(wrangler): update unenv dependency version #7541
Conversation
🦋 Changeset detectedLatest commit: 7913462 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/12367522688/npm-package-wrangler-7541 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7541/npm-package-wrangler-7541 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-wrangler-7541 dev path/to/script.js Additional artifacts:wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-workers-bindings-extension-7541 -O ./cloudflare-workers-bindings-extension.0.0.0-v859e5119b.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v859e5119b.vsix npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-create-cloudflare-7541 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-kv-asset-handler-7541 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-miniflare-7541 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-pages-shared-7541 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-vitest-pool-workers-7541 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-workers-editor-shared-7541 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-workers-shared-7541 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12367522688/npm-package-cloudflare-workflows-shared-7541 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
@@ -10090,7 +10090,7 @@ export default{ | |||
} | |||
`); | |||
expect(fs.readFileSync("dist/index.js", { encoding: "utf-8" })).toContain( | |||
`import path from "path";` | |||
`import path from "node:path";` |
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.
This change is required because unenv module resolution will always append the node:
prefix
@@ -10069,7 +10069,7 @@ export default{ | |||
fs.writeFileSync( | |||
"index.js", | |||
` | |||
import path from 'path'; | |||
import path from 'node:path'; |
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.
This change is not required - the output is the same with or without the prefix.
Added only for consistency with l10093 below
packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts
Show resolved
Hide resolved
// Convert `require()` calls for NPM packages to a virtual ES Module that can be imported avoiding the require calls. | ||
// Note: Does not apply to Node.js packages that are handled in `handleRequireCallsToNodeJSBuiltins` | ||
if ( | ||
args.kind === "require-call" && | ||
(unresolvedAlias.startsWith("unenv/runtime/npm/") || | ||
unresolvedAlias.startsWith("unenv/runtime/mock/")) | ||
(unresolved.startsWith("unenv/runtime/npm/") || |
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 recommend using resolveAlias
from pathe/utils
(pathe is safe against windows paths when comparing and also handles multiple recursive aliases a => b => c)
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.
Not sure to understand how it would help here?
"unenv/runtime/npm/"
comes from the preset alias.
🎉 |
Update unenv to the latest release.
unenv now resolves aliases to absolute path so the plugin does not it to do it any more.
/cc @petebacondarwin @pi0
This is part 1 of 2 in a stack made with GitButler: