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

🚀 Feature Request: Support argument for wrangler to run in different working directory #7993

Open
pi0 opened this issue Jan 31, 2025 · 0 comments · May be fixed by #7994
Open

🚀 Feature Request: Support argument for wrangler to run in different working directory #7993

pi0 opened this issue Jan 31, 2025 · 0 comments · May be fixed by #7994
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Contributor

pi0 commented Jan 31, 2025

Describe the solution

With the introduction of the generated wrangler config (#7442), some commands like wrangler pages dev|deploy require to be running in the correct working directory to be working as intended and reading generated wrangler config (or user config).

A global option like -C, --cwd in wrangler CLI can guarantee we can reliably run all commands in the project working directory without depending on the package manager monorepo features (which is not always possible).


Context: Nitro (and Nuxt) generates command hints after building for cloudflare pages. These commands are meant to be directly running in the user CLI and relative to where the build was issued for example:

$ <pm> nitro build path/to/project
✔ You can preview this build using npx wrangler pages dev path/to/project                              
✔ You can deploy this build using npx wrangler pages deploy path/to/project

Working on nitrojs/nitro#2949, noticed the above hint is not reliable because it won't use any of the wrangler configs from path/to/project

It is possible to manually point to the config path with -c, --config for modules in the example above but for pages, the only way is to somehow change CWD we need to show something like cd path/to/project && npx wrangler pages dev.

Quickly discussed with @petebacondarwin if we could make it a better DX from Wrangler CLI itself.

@pi0 pi0 added the enhancement New feature or request label Jan 31, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 31, 2025
@pi0 pi0 linked a pull request Jan 31, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Untriaged
Development

Successfully merging a pull request may close this issue.

1 participant