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

feat: added support for external templates #69

Closed
wants to merge 1 commit into from

Conversation

MathurAditya724
Copy link
Contributor

Closed #62

  • removed the statement that checks if the template is one of the pre-defined ones.
  • Taking the provided template repo and passing it in giget
  • Added a warning banner when using an external template
  • minor change - added node: in front of fs and path

I am not parsing the provided template URL because

  • We will lose the giget feature of downloading templates using json and tarball urls.
  • I'm not sure about this, but they also have an internal registry that devs might want to use.

Let me know if you don't want these, I can create the logic for parsing the URLs.

@ryuapp can you take a look at the warning message

@ryuapp
Copy link
Contributor

ryuapp commented Aug 25, 2024

It's slow timing to have those warning messages while downloading, so a warning message should be shown before the download. Also, I don't really know how to run it, so could you please tell me how to run it?

I have one more question. As I commented there(#62 (comment)), I'm a little negative about this feature. Is it necessary to create an external template with create-hono without recommending with other ways? I would like to know why this feature is good for users.

@MathurAditya724
Copy link
Contributor Author

Commands for building and running the script -

  1. Build the script - pnpm run build
  2. Run the script - node ./bin

As for why this feature might be useful for the community -

  1. create-hono has built-in hooks which is useful, especially for Cloudflare-related templates, it just reduces the number of steps to start using the template.
  2. The community has already built and is building templates, which can greatly benefit from this.
  3. And, we are still giving first-class support to the official templates, as to download them they can either choose from the menu or pass the name instead of a URL.

IMHO, if some dev does find a malicious repo, they can still put themselves at risk just by following the README.md of that repo.

@yusukebe
Copy link
Member

  1. create-hono has built-in hooks which is useful, especially for Cloudflare-related templates, it just reduces the number of steps to start using the template.

Regarding this, the create-cloudflare command already supports external templates. So you can use it.

npm create cloudflare my-project -- --template [email protected]:user/repo

@MathurAditya724
Copy link
Contributor Author

Regarding this, the create-cloudflare command already supports external templates. So you can use it.

npm create cloudflare my-project -- --template [email protected]:user/repo

That's why I am asking: Why are we also not doing this?

I believe adding this feature will significantly increase the circulation of examples within the community, encouraging more people to start using the Hono Examples and other third-party ones. This will make it much easier for users to get started.

@yusukebe
Copy link
Member

yusukebe commented Sep 1, 2024

I'm not excited about this feature.

That's why I am asking: Why are we also not doing this?

This is because the function is out of the scope of create-hono. I also thought about the same function supporting external projects ago, but I never did that. Because it might have maintenance costs and something like security risks. We have degit or giget. And if you want to modify wrangler.toml when creating a new project, you can use create-cloudflare.

@MathurAditya724
Copy link
Contributor Author

Thanks for the clarity on this. I understand the concerns regarding scope and maintenance. I'll go ahead and close this PR.

@yusukebe
Copy link
Member

yusukebe commented Sep 1, 2024

@MathurAditya724

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: support for external templates
3 participants