-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(wrangler): support --cwd cli argument
#8253
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
Conversation
🦋 Changeset detectedLatest commit: af6e4d0 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 |
9b5d685 to
e953a98
Compare
|
on a second thought...I don't think we can support this for Pages, because I think Pages assumed the process is always running at the root? I need to double check this... |
|
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/13521568897/npm-package-wrangler-8253You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8253/npm-package-wrangler-8253Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-wrangler-8253 dev path/to/script.jsAdditional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-workers-bindings-extension-8253 -O ./cloudflare-workers-bindings-extension.0.0.0-vff1fdaf5e.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-vff1fdaf5e.vsixcreate-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-create-cloudflare-8253 --no-auto-update@cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-kv-asset-handler-8253miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-miniflare-8253@cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-pages-shared-8253@cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-unenv-preset-8253@cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-vite-plugin-8253@cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-vitest-pool-workers-8253@cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-workers-editor-shared-8253@cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-workers-shared-8253@cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13521568897/npm-package-cloudflare-workflows-shared-8253Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
This commit adds the `--cwd` global argument to the `wrangler` CLI to allow changing the current working directory before running any command.
e953a98 to
af6e4d0
Compare
Why not support this for Pages? It is no different to cd-ing into that directory and running For example, in the workers-sdk root: works fine |
petebacondarwin
left a comment
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.
LGTM
Original PR is here #7994. This PR was created from a fork, but required a couple of adjustments.
I tried creating a PR with the required changes to the fork, but it didn't get reviewed. Opening a new PR instead so we can get this over the finish line
---- from original PR
This PR adds
-C, --cwdglobal argument to thewranglerCLI to allow changing the current working directory before running any command.This feature is used in most of CLI tools that depend on right working directory but different names. I have chosen
-C, --cwdfollowing with pnpm (-C) + yarn (--cwd), but open to ideas changing it to anything else.This allows better DX of using
wranglercommands from any working directory to another (where project is).--cmdcloudflare-docs#19665