Improve CLI arguments for the wrangler deploy command by adding a new generic --path option and making the --script option explicit - #11371
Conversation
🦋 Changeset detectedLatest commit: 755914e The changes in this PR will be included in the next version bump. 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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
b1f7d70 to
e17c520
Compare
1820fbd to
0918042
Compare
…ew generic `--path` option and making the `--script` option explicit
0918042 to
755914e
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
I think we should validate that an explicit --script arg points to a file (and not a directory).
| // TODO: In the next Wrangler major change this logic to treat the path arg as an assets directory while | ||
| // using the script arg as the entrypoint path (e.g. just as `wrangler deploy --assets <ASSETS_PATH> --script <SCRIPT_PATH>`) |
There was a problem hiding this comment.
Would this really be a breaking change?
The use must have opted in to providing the --script arg, so they can expect different behaviour, no?
There was a problem hiding this comment.
Would this really be a breaking change? The use must have opted in to providing the
--scriptarg, so they can expect different behaviour, no?
mh.... sorry I am not sure I follow...
Let's say that the user has a CI job or script or anything that automatically runs wrangler deploy --script <PATH>, if we caused this to behave differently here, wouldn't that constitute as a breaking change?
Mh.... as I mentioned I think that |
Oh gosh! Can you actually do What if we make |
|
Then we would have |
Yeah, it's super weird behaviour from yargs |
Closing this PR since introducing a new Also the scope and risks involved would be significantly higher (I am not even completely sure if that'd be worth the effort?). I'll try to come back to this when I'll have some bandwidth. |
Fixes https://jira.cfdata.org/browse/DEVX-2333
Before:

After:

Describe your change...
wrangler deployhas been added as a new v4-only functionality (see #10016)