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: withwrangler init, test for existence of package.json/ tsconfig.json / .git in the right locations #924

Merged
merged 1 commit into from
May 8, 2022

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented May 8, 2022

When running wrangler.init, we look for the existence of package.json, / tsconfig.json / .git when deciding whether we should create them ourselves or not. Because name can be a relative path, we had a bug where we don't starting look from the right directory. We also had a bug where we weren't even testing for the existence of the .git directory correctly. This patch fixes that initial starting location, tests for .git as a directory, and correctly decides when to create those files.

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2022

🦋 Changeset detected

Latest commit: 29eeea1

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

github-actions bot commented May 8, 2022

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/2289801239/npm-package-wrangler-924

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

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

Or you can use npx with this latest build directly:

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

…nfig.json` / `.git` in the right locations

When running `wrangler.init`, we look for the existence of `package.json`, / `tsconfig.json` / `.git` when deciding whether we should create them ourselves or not. Because `name` can be a relative path, we had a bug where we don't starting look from the right directory. We also had a bug where we weren't even testing for the existence of the `.git` directory correctly. This patch fixes that initial starting location, tests for `.git` as a directory, and correctly decides when to create those files.
@threepointone
Copy link
Contributor Author

merging to fix the build/release

@threepointone threepointone merged commit 3bdba63 into main May 8, 2022
@threepointone threepointone deleted the fix-init-package-tsconfig branch May 8, 2022 13:50
@github-actions github-actions bot mentioned this pull request May 8, 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.

1 participant