sentry-wizard
sentry-wizard copied to clipboard
feat(cloudflare): Enable update of the wrangler file
(closes #1148)
This PR will update the wrangler config automagically. The wrangler config can exist in .toml, .json and .jsonc (source) that is why I added ~smol-toml (BSD-3) and~ jsonc-parser (MIT).
These are the new steps:
- Wrangler config does not exist: We create a minimal jsonc config with the minimum required keys (also jsonc is recommended for new projects)
- On top we instruct that the
nameand themainline has to be changed
- On top we instruct that the
- Wrangler config does exist in either format: It adds Sentry specifics
- For .toml we add a copy paste snippet
For now we add:
nodejs_alsinstead ofnodejs_compatto keep the bundle size smaller, and it is not yet requiredcompatibility_dateto the date of creation (suggested by the Cloudflare docs)- And our required
version_metadata
Drawbacks
~Toml parsers are not quite popular and are not really feature complete, that is why toml files would loose all comments, once we update them (another option would be to not support .toml at all and give only a hint)~ (the toml parser has been removed)