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

fix: do not consider ancestor files when initializing a project with a specified name #1269

Merged
merged 3 commits into from
Jun 17, 2022

Conversation

petebacondarwin
Copy link
Contributor

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

…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
@changeset-bot
Copy link

changeset-bot bot commented Jun 15, 2022

🦋 Changeset detected

Latest commit: 43ec49b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2502865565/npm-package-wrangler-1269

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1269/npm-package-wrangler-1269

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2502865565/npm-package-wrangler-1269 dev path/to/script.js

@petebacondarwin petebacondarwin merged commit fea87cf into cloudflare:main Jun 17, 2022
@petebacondarwin petebacondarwin deleted the init-scope branch June 17, 2022 11:21
@github-actions github-actions bot mentioned this pull request Jun 17, 2022
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.

🐛 BUG: wrangler init foo should stop looking for tsconfig.json and package.json at ./foo
3 participants