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

Add deprecation warning when trying to run commands without explicit entrypoint #401

Closed
Electroid opened this issue Feb 6, 2022 · 4 comments · Fixed by #427 or #407
Closed

Add deprecation warning when trying to run commands without explicit entrypoint #401

Electroid opened this issue Feb 6, 2022 · 4 comments · Fixed by #427 or #407
Assignees
Labels
polish Small improvements to the experience

Comments

@Electroid
Copy link
Contributor

In wrangler1, you could run wrangler dev, wrangler publish, etc. without explicitly specifying the entrypoint in the command. Many users will attempt to run these old commands and get confused why they now see the help page. Instead, there should be a deprecation warning that tells them what to do.

@Electroid Electroid added the polish Small improvements to the experience label Feb 6, 2022
@threepointone
Copy link
Contributor

Agreed, we should have explicit errors for when people do common mistakes instead of the generic yargs "expect x arguments, got y" message.

@Electroid Electroid added this to the 2.0 milestone Feb 7, 2022
@petebacondarwin
Copy link
Contributor

petebacondarwin commented Feb 9, 2022

One can still run wrangler publish with no entry-point in W2, as long as you have defined an entry-point via build.uploads.main. Here is the current output in this case:

> npx wrangler publish
Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler publish path/to/script`) or the `build.upload.main` config field.

I don't think we need anything else here, right?

@petebacondarwin
Copy link
Contributor

For wrangler dev I think we should also support the build.upload.main field exactly the same as wrangler publish. I will put together a PR to do that, which will also move the bundling into a helper that both commands use.

@Electroid
Copy link
Contributor Author

For wrangler dev I think we should also support the build.upload.main field exactly the same as wrangler publish. I will put together a PR to do that, which will also move the bundling into a helper that both commands use.

If we support something for publish, it should work for dev too. Similar to #396

petebacondarwin added a commit that referenced this issue Feb 10, 2022
…ands

This changes moves the code that does the esbuild bundling into a shared file
and updates the `publish` and `dev` to use it, rather than duplicating the
behaviour.

See #396
Resolves #401
petebacondarwin added a commit that referenced this issue Feb 11, 2022
…ands

This changes moves the code that does the esbuild bundling into a shared file
and updates the `publish` and `dev` to use it, rather than duplicating the
behaviour.

See #396
Resolves #401
petebacondarwin added a commit that referenced this issue Feb 11, 2022
…ands

This changes moves the code that does the esbuild bundling into a shared file
and updates the `publish` and `dev` to use it, rather than duplicating the
behaviour.

See #396
Resolves #401
petebacondarwin added a commit that referenced this issue Feb 12, 2022
…ands

This changes moves the code that does the esbuild bundling into a shared file
and updates the `publish` and `dev` to use it, rather than duplicating the
behaviour.

See #396
Resolves #401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Small improvements to the experience
Projects
Archived in project
3 participants