News for hackers. Stuff that matters.
Re:Architect your project with Framed: effortless files and ... by dlisboa on Monday June 05, 2023 @07:02AM (#36194719)
Hey, congrats on shipping it. Let me run this by you:

I was just thinking of building a CLI tool that I can say “start me a X lang project”, with my preferred dir layout, files and default dependencies. Basically a “react-create-app” or “bundle init” for any language.

Is Framed a solution for that? From what I saw there’s no default file contents and ability to run commands?

Re:Architect your project with Framed: effortless files and ... by mactat on Monday June 05, 2023 @07:06AM (#36194737)
There is Framed import command, where you can import framed file from specific url/examples. Then if you would execute Framed create it will create dirs and file structure. In the future I would imagine that there will be more examples files in the repo so you would be able to do f.e framed import —examples react.
Re:Architect your project with Framed: effortless files and ... by thiagoeh on Monday June 05, 2023 @08:42AM (#36195408)
I believe that Cookie Cutter premise is exactly that https://www.cookiecutter.io/
Re:Architect your project with Framed: effortless files and ... by dlisboa on Monday June 05, 2023 @01:53PM (#36200177)
This seems to be precisely what I wanted, although a bit more features than I needed. Thanks!
Re:Architect your project with Framed: effortless files and ... by usrme on Monday June 05, 2023 @02:19PM (#36200639)
There's also Copier (https://copier.readthedocs.io/en/stable/comparisons/) that is worth a look at. I especially love the how you can bring a template up-to-date based on a new changes.
Re:Architect your project with Framed: effortless files and ... by linsomniac on Monday June 05, 2023 @10:20AM (#36196540)
CookieCutter is the typical solution for for this.

An alternative is "uPlaybook": https://github.com/linsomniac/uplaybook (disclaimer, I'm the author). It is a YAML-based simple scripting that is focused on simple CLI-based automation, in particular file templating and secrets decryption.

uPlaybook is a small Ansible+CookieCutter combination. In the uPlaybook you can do simple shell-like operations, create files based on jinja2 templates, decrypt secrets, and do some looping/conditionals.

You can define parameters that the user needs to supply (for your "react-create-app" that might be app name, features you might optionally want), which uPlaybook turns into CLI arguments, or it can prompt the user to fill them out.