Show HN: Scaffolder, CLI tool to generate project structure, taken from YAML (github.com)
Scaffolder is a CLI tool written in Golang to instantly generate skeleton project structure with boilerplate code, that's taken from configurable YAML file, to quickly kick-start your project
I was tired of manually creating the project structure, with all those folder, files... So I decided to create a CLI tool that allows you to instantly generate skeleton projects, based on a reusable YAML file with boilerplate code if specified.
YAML is very easy for both humans and programs to work with and parse, hence why it's the most logical choice in context of Scaffolder.
Check out the GitHub page for detailed description and examples :)
28 comments
[ 3.9 ms ] story [ 68.7 ms ] threadI'd recommend adding at the very beginning of the README a short yaml sample. That's the first thing I wanted to look at, but I had to get some understanding and then I found the scaffolder-config repo.
Variables are an interesting idea. I will consider in that in the future.
If you added simple variable substitution to use in filenames and file contents that would kick it up quite a few notches. Especially if you could use the result of bash command instead of static text.
P.S. Judging by [0], it wants you to paste template code inside YAML files. If you just precreate an actual project folder on disk and use it as a template (with, say, regexps for fixups), it's going to be easier to work with, as I can edit the template files in the IDE of my choice. Our microservice template is relatively large and changes quite often, it would be a nightmare to edit it and debug it via YAML files.
https://github.com/cemister/scaffold-configs/blob/master/cpp...
You should consider adding: 1) configurability in terms of name ( a templating engine might help ) 2) generate functional build files
[0] https://github.com/copier-org/copier
At a glance what makes that painfully obvious is that scoffolder is one binary, while Yeoman is... Well, first it depends on node+npm, then `yo` seems depend on more than 1000 packages.
I don't think your opinion is "unpopular" but more making unfair assumptions about situations you imagine others to use it, while there is more situations a tool like this could be useful for.
Microsoft recognized this need by updating its .NET CLI to create projects based on project templates. I know for a fact that at least one FANG has a couple of internal tools to create projects and CICD infrastructure from scratch using project templates.
When I wrote my own framework, Nexus (for Nim), I wrote a CLI for this sort of thing. It uses variables in naming things, and is quite specialized. I don't think I could use a generic tool.
1. You have no clue about what "boilerplate" is required or why.
2. You know what's required but you need to generate the boilerplate often.
In the first case, just stop. Using a tool might give you some kind of result, but the quality of what you do is already subpar from the beginning. Learn your effing tools.
In the second case, stop, too. Work with a higher abstraction layer, instead.
> I know for a fact that at least one FANG has a couple of internal tools to create projects and CICD infrastructure from scratch using project templates.
Imagine what that means for the ICs in that FANG: They don't know why the boilerplate is what it is or what part they could or should replace with something more modern .
The number of times I had to think "That would not have happened with a JSON file." ... But I guess the debate is so well known on HN, that I don't need to go into it now.
JSON is not the the be-all and end-all of formats. All formats have their drawbacks, and there is not one format that is THE BEST for absolutely everything.
The author never claimed that YAML is simple, or whatever. But what I can see, is why'd they use YAML instead of JSON for this specific project.
The first thing that comes to mind is multiline strings, as files typically have multiple lines. How'd you do that with JSON? "fn main {\nprintln!(\"Hello\")\n}"? Looks super fun to edit.
I think you should read the OP again.