CLI that generates files from markdown documents
npm i @atomico/scaffold
Add script to package.json
{
"scripts": {
"create-component": "scaff template/component-jsx src"
}
}
scaff template/component-jsx src
The files are created according to the markdown file associated with the CLI, all the code blocks that declare the path will be created only if the document does not exist, example:
---
{
data: { name: "Upper Cod" },
questions: [{ type: "text", name: "name", message: "Component name?" }],
}
---
## bla bla..
```js tests/build/<<name|kebabCase>>.js
const data = {"<<name|kebabCase>>":10};
const <<name|camelCase>> = 10;
const <<name|pascalCase>> = 10;
```
Bla bla..
```css tests/build/<<name|kebabCase>>.css
:host {
display: block;
}
```
The CLI uses Prompts for the use of questions