-
Notifications
You must be signed in to change notification settings - Fork 735
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: wrangler init foo
should stop looking for tsconfig.json and package.json at ./foo
#859
Comments
Yeah I can agree with this. Especially because:
Both scenarios require a new tsconfig file. And it's easier to delete/modify a generated tsconfig than it is to create one. |
I think this might be two issues:
I would argue (at least for my own uses, maybe I'm the edge case?) in both cases, we should completely ignore what's in the current directory or higher up in a parent directory - if I run |
I agree that if you specify a path in the If you do not specify a path then Wrangler defaults to initialising the current directory. In this case then I think we should be willing to look up the directory-tree for package.json and tsconfig.json. |
…a specified name When initializing a new project (via `wrangler init`) we attempt to reuse files in the current directory, or in an ancestor directory. In particular we look up the directory tree for package.json and tsconfig.json and use those instead of creating new ones. Now we only do this if you do not specify a name for the new Worker. If you do specify a name, we now only consider files in the directory where the Worker will be initialized. Fixes cloudflare#859
…a specified name (#1269) * test: add checks for unused mock dialogs in tests * test: refactor init tests to use file-system helpers * fix: do not consider ancestor files when initializing a project with a specified name When initializing a new project (via `wrangler init`) we attempt to reuse files in the current directory, or in an ancestor directory. In particular we look up the directory tree for package.json and tsconfig.json and use those instead of creating new ones. Now we only do this if you do not specify a name for the new Worker. If you do specify a name, we now only consider files in the directory where the Worker will be initialized. Fixes #859
What version of
Wrangler
are you using?0.027
What operating system are you using?
Mac
Describe the Bug
If you run
wrangler init foo
inside a directory that contains a tsconfig.json, then Wrangler automatically assumes you are in a TypeScript project. I would argue that if you have specified a new directory (e.g.foo
) for this Worker, then we should not treat it as part of a wider project.The text was updated successfully, but these errors were encountered: