Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

ref(create): switch default file format to JSON #536

Merged
merged 1 commit into from
Nov 28, 2018
Merged

ref(create): switch default file format to JSON #536

merged 1 commit into from
Nov 28, 2018

Conversation

bacongobbler
Copy link
Contributor

Signed-off-by: Matthew Fisher [email protected]

Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny docs niggle


For example, 'duffle create foo' will create a directory structure that looks like this:

foo/
|
|- duffle.yaml # Contains metadata for bundle
|- duffle.json # Contains metadata for bundle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you describe this as 'metadata'? I think I see where you're coming from, but it feels like more the bundle definition or bundle build source or something like that to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. What do you think about "The bundle build definition file"? Still seems kinda vague... Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine I think. I don't think it's too vague and we don't have space to go into more detail.

@@ -47,12 +46,12 @@ func Scaffold(path string) error {
},
}

d, err := yaml.Marshal(m)
d, err := json.Marshal(m)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue here is that the entire JSON file is written on a single line:

$ bat duffle.json 
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: duffle.json
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ {"Name":"json-test","Version":"0.1.0","Description":"A short description of your bundle","Keywords":null,"Maintainers":null,"Components":{"cnab":{"Name":"cnab","Builder":"docker","Configura
       │ tion":{"registry":"microsoft"}}},"Parameters":null,"Credentials":null}
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

With a bit of formatting, this would look great.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh... Good catch. json.MarshalIndent to the rescue!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That, and I was looking for a reason to have a comment where I'd use bat and see how it looks in markdown.

Next is exa.

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- with a comment on formatting, that I think should be addressed before merging.

@bacongobbler
Copy link
Contributor Author

both comments addressed. Thanks guys!

@bacongobbler bacongobbler merged commit f7a9178 into cnabio:master Nov 28, 2018
@bacongobbler bacongobbler deleted the make-it-blue branch November 28, 2018 22:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants