Patch Changes
-
#293
71b0fab
Thanks @petebacondarwin! - fix: warn if thesite.entry-point
configuration is found during publishingAlso updates the message and adds a test for the error when there is no entry-point specified.
Fixes #282
-
#304
7477b52
Thanks @threepointone! - feat: enhancewrangler init
This PR adds some enhancements/fixes to the
wrangler init
command.- doesn't overwrite
wrangler.toml
if it already exists - installs
wrangler
when creatingpackage.json
- offers to install
wrangler
intopackage.json
even ifpackage.json
already exists - offers to install
@cloudflare/workers-types
even iftsconfig.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 out tests 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 a bug 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. - doesn't overwrite
-
#294
7746fba
Thanks @threepointone! - feature: add more types that get logged viaconsole
methodsThis PR adds more special logic for some data types that get logged via
console
methods. Types likePromise
,Date
,WeakMaps
, and some more, now get logged correctly (or at least, better than they used to).This PR also fixes a sinister bug - the
type
of theConsoleAPICalled
events don't match 1:1 with actual console methods (eg:console.warn
message type iswarning
). This PR adds a mapping between those types and method names. Some methods don't seem to have a message type, I'm not sure why, but we'll get to them later. -
#310
52c99ee
Thanks @threepointone! - feat: error if a site definition doesn't have abucket
fieldThis adds an assertion error for making sure a
[site]
definition always has abucket
field.As a cleanup, I made some small fixes to theConfig
type definition, and modified the tests inpublish.test.ts
to use the config format when creating awrangler.toml
file.