-
Notifications
You must be signed in to change notification settings - Fork 734
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: enhance wrangler init
#304
Conversation
🦋 Changeset detectedLatest commit: 43ebbec The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
fa750f9
to
88395bb
Compare
Not bad, it didn't get that much slower. |
88395bb
to
0792eea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @threepointone! I love the new test helper.
If you can resolve all my questions then I will happily mark this as approved.
0792eea
to
0707b7e
Compare
Answered, modified, parried. Looks good? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. LGTM with potential for follow ups later.
a5afdae
to
d8fc913
Compare
This PR adds some enhancements/fixes to the `wrangler init` command. - doesn't overwrite `wrangler.toml` if it already exists - installs `wrangler` when creating `package.json` - offers to install `wrangler` into `package.json` even if `package.json` already exists - offers to install `@cloudflare/workers-types` even if `tsconfig.json` already exists - pipes stdio back to the terminal so there's feedback when it's installing npm packages This does have the side effect of making our tests a _little_ slower. I added `--prefer-offline` to the `npm install` calls to make this a shade quicker, but I can't figure out a good way of mocking these. I'll think about it some more later. We should work on making the installs themselves quicker (re: #66) This PR also fixes an issue with our tests: `runWrangler()` would catch thrown errors, and if we didn't manually verify the error, tests would pass. Instead, it now throws correctly, and I modified all the tests to assert on thrown errors. It seems like a lot, but it was just mechanical rewriting.
d8fc913
to
43ebbec
Compare
This PR adds some enhancements/fixes to the
wrangler init
command.wrangler.toml
if it already existswrangler
when creatingpackage.json
wrangler
intopackage.json
even ifpackage.json
already exists@cloudflare/workers-types
even iftsconfig.json
already existsThis does have the side effect of making our tests a little slower. I added
--prefer-offline
to thenpm install
calls to make this a shade quicker, but I can't figure out a good way of mocking these. I'll think about it some more later. We should work on making the installs themselves quicker (re: #66)This PR also fixes an issue with our tests:
runWrangler()
would catch thrown errors, and if we didn't manually verify the error, tests would pass. Instead, it now throws correctly, and I modified all the tests to assert on thrown errors. It seems like a lot, but it was just mechanical rewriting.