-
-
Notifications
You must be signed in to change notification settings - Fork 662
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
[create-hono] Make the app name change based on a project name #1563
Comments
Hi, @yusukebe eg. wrangler.toml in "cloudflare-workers" template |
As for the directory name, like this video Unspecified -> asking (default is How about this? 2023-10-12.23.08.16.mov |
Hi @sor4chi, Super cool! I love it. |
Ideally, yes. But actually, we don't do that. As you mentioned, the Alternatively, we could make the Anyway, I think we should make it flexible. |
Okay. In my plan, Create a I would like to set What do you think? |
Using "magic strings" like I think we can make a "hook". The hook will be fired after type Hook = (args: { projectName: string; templateName: string; directoryPath: string }) => void
const cloudflareWorkersHook:Hook = (arg) => {
if (arg.templateName !== 'cloudflare-workers') return
const wranglerTomlPath = getWranglerTomlPath(arg.directoryPath)
rewriteNameInWranglerToml(wranglerTomlPath, arg.projectName)
} |
And one more thing we need to consider is testing. There are no tests in the project currently, but we need them. |
Or like the following: type Hook = (args: { projectName: string; directoryPath: string }) => void;
const rewriteWranglerHook: Hook = () => {}
addHook('cloudflare-worker', rewriteWranglerHook) |
wow, nice idea! I will get on with it for now! |
This can be closed! Thanks @sor4chi ! |
What is the feature you are proposing?
Currently, the application name of a project created by
create-hono
is fixed asmy-app
. This is bad for DX as we can only use a fixed name. Therefore, we need to modifycreate-hono
so that the application name is based on the directory name.The text was updated successfully, but these errors were encountered: