pingy-cli icon indicating copy to clipboard operation
pingy-cli copied to clipboard

[pingy-scaffold.json] explicit vs implicit files

Open afknapping opened this issue 7 years ago • 5 comments

so i have to write sth like this for every file:

{
    "input": "components/_component-list.pug",
    "output": "components/_component-list.pug"
}

there are two things with this:

  • if output is omitted, you could assume input = output. there might be cases where output is different, but in general i would always recommend to keep them the same anyways (simpler = easier to understand behaviour)
  • now that i forgot to add a file to that json for the first time, i thought: "why do i have to add those in the first place? why would i add files to the scaffold that i would not want in my project?" there might be special cases that need that too, but a blacklist seems less work and less config i need to think about...

afknapping avatar Nov 24 '17 14:11 afknapping

Thanks for the feedback, this is great stuff.

  1. Yes, that will come soon. You will be able to just use an array of strings if the input and output are the same and there is no vars. I.e.. ["components/_component-list.pug", …]. 👍
  2. For the moment I'm going to keep it as a whitelist. It's not super obvious now but I think it will be the simpler solution when I add dynamic scaffolding. Dynamic scaffolding will be awesome. 😉

davej avatar Nov 24 '17 15:11 davej

dynamic scaffolding

i guess that has something to do with the vars... but otherwise i am not sure what that could mean...

afknapping avatar Nov 24 '17 15:11 afknapping

ah – i guess that is about the full pingy client. you don't want one repo per scaffold, but configure the scaffolds from one pool of files...

i'm just wondering why not have both? :)

afknapping avatar Nov 24 '17 15:11 afknapping

No it's for Pingy CLI too. But yeah your basically correct about a pool of files. Take the Bootstrap scaffold for instance, there are lots of slightly different starter templates.

I'll leave you in suspense as to how dynamic scaffolding will actually work but it will be completely different to how other tools (Yeoman etc..) do it. 😁

i'm just wondering why not have both? :)

That's a possibility. I'll review it again when dynamic scaffolding is released.

davej avatar Nov 24 '17 15:11 davej

i get it – bootstrap is good example 👍👍

That's a possibility. I'll review it again when dynamic scaffolding is released.

cool – i fell over that multiple times when updating my scaffold in the past hours :)

afknapping avatar Nov 24 '17 16:11 afknapping