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

🐛 BUG: remove init from list of commands when running npx wrangler #5701

Closed
rita3ko opened this issue Apr 24, 2024 · 2 comments · Fixed by #7097
Closed

🐛 BUG: remove init from list of commands when running npx wrangler #5701

rita3ko opened this issue Apr 24, 2024 · 2 comments · Fixed by #7097
Labels
bug Something that isn't working documentation Improvements or additions to documentation internal Requires support from the Cloudflare Platform wrangler Relating to the Wrangler CLI tool

Comments

@rita3ko
Copy link

rita3ko commented Apr 24, 2024

Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

⛅️ wrangler 3.51.2

What version of Node are you using?

No response

What operating system and version are you using?

mac

Describe the Bug

Observed behavior

running npx wrangler lists wrangler init command, which then tells you it's deprecated

Expected behavior

not list it

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@rita3ko rita3ko added the bug Something that isn't working label Apr 24, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Apr 24, 2024
@kornelski
Copy link

npx wrangler generate displays the same message.

However, I without this message I would not have known that npm create cloudflare exists, and I would be lost not knowing how to start using Wrangler.

@penalosa penalosa moved this from Untriaged to Backlog in workers-sdk Jun 17, 2024
@irvinebroque
Copy link
Contributor

Came here with same problem, but different suggestion on how we solve it.

When I run npx wrangler@latest init from a directory without a wrangler.toml file — npm create cloudflare runs — this is what should happen!

brendan@N64W27QG5Q test % npx wrangler@latest init

 ⛅️ wrangler 3.61.0
-------------------

Using npm as package manager.
▲ [WARNING] The `init` command is no longer supported. Please use `npm create cloudflare\@2.5.0` instead.

  The `init` command will be removed in a future version.


Running `npm create cloudflare\@2.5.0`...

...but when I run this from a directory that has a wrangler.toml already, the old wrangler init runs:

brendan@N64W27QG5Q remix-d1 % npx wrangler init
 ⛅️ wrangler 3.57.1 (update available 3.61.0)
-------------------------------------------------------
Using npm as package manager, as there is already a package-lock.json file.
▲ [WARNING] wrangler.toml already exists!


✔ Do you want to continue initializing this project? … yes
? Would you like to create a Worker at src/index.ts? › - Use arrow-keys. Return to submit.
    None
❯   Fetch handler
    Scheduled handler

...and if I run wrangler generate, in either scenario, ye ole wrangler init command runs:

brendan@N64W27QG5Q test % npx wrangler@latest generate

 ⛅️ wrangler 3.61.0
-------------------

Using npm as package manager.
▲ [WARNING] The `init` command is no longer supported. Please use `npm create cloudflare\@2.5.0` instead.

  The `init` command will be removed in a future version.


✨ Created wrangler.toml
✖ Would you like to use git to manage this Worker? … yes

What should we do about it?

  1. In all cases, we should run npm create cloudflare@latest. There should never be a case where we run the old init command runs, regardless of where you run it from.
  2. We should remove the deprecation message about wrangler init and wrangler generate. It's just noise. There are tons of projects floating out there that reference the command directly. We should make things clear and easy and simple for people coming from these paths. We already hide init and generate from Wrangler's list of commands, and in the docs.

@petebacondarwin petebacondarwin added documentation Improvements or additions to documentation wrangler Relating to the Wrangler CLI tool labels Aug 5, 2024
@RamIdeas RamIdeas moved this from Backlog to Other in workers-sdk Sep 2, 2024
@RamIdeas RamIdeas added the internal Requires support from the Cloudflare Platform label Sep 2, 2024
@RamIdeas RamIdeas removed this from workers-sdk Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working documentation Improvements or additions to documentation internal Requires support from the Cloudflare Platform wrangler Relating to the Wrangler CLI tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants