cloudflare / template-registry

A simple API via a Worker that serves all the template content
https://developers.cloudflare.com/workers/templates
Apache License 2.0
62 stars 37 forks source link

wrangler generate modifies formatting of wrangler.toml #41

Open jroyal opened 4 years ago

jroyal commented 4 years ago

🐛 Bug Report

Environment

Steps to reproduce

Run wrangler generate my-crl-worker https://github.com/cloudflare/access-crl-worker-template

This project has an empty wrangler.toml file that looks like this.

name = "access-crl-worker"
type = "webpack"

workers_dev = false
route = ""
account_id = ""
zone_id = ""
kv-namespaces = [{ binding = "CRL_NAMESPACE", id = "" }]
vars = { CRL_URL = "" }

What did you expect to see?

I expected to see what was in the wrangler.toml file in the template repo.

What did you see instead?

I got a slightly different version of the wrangler.toml file

name = "access-crl-worker-test"
type = "webpack"
account_id = ""
workers_dev = true
route = ""
zone_id = ""

[[kv-namespaces]]
id = ""
binding = "CRL_NAMESPACE"

[vars]
CRL_URL = ""

In my opinion, the new version is better. It was just unexpected.

EverlastingBugstopper commented 4 years ago

This has to do with the way that the toml-rs crate works - it doesn't guarantee anything other than that it outputs valid toml, preserving the structure is not something it advertises.

Should probably document this in the template registry contributing guide

EverlastingBugstopper commented 4 years ago

hey @victoriabernard92 can you move this issue to https://github.com/cloudflare/template-registry? i dont seem to have permissions to do so

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ashleymichal commented 4 years ago

hey @victoriabernard92 can you move this issue to https://github.com/cloudflare/template-registry? i dont seem to have permissions to do so

@ispivey