2.0.1 • Published 3 years ago
scaffi v2.0.1
Scaffi
The only scaffolding tool you will ever need!
Requirements:
- bash version 5+
How to install:
npm i -g scaffiHow to use:
- Create your custom template like this one: https://github.com/wolfiesites/scaffi-example-template
- Store it either locally or in repo
- use the command below to download template and search replace placeholders:
scaffi --placeholder="value of the placeholder" --placetwo="second value" --template="/path/to/repo"Example:
scaffi --directory="my awesome dir" --dirtwo="my amazing dir two" --filename="Scaffi is the best" --name="custom variable" -t="https://github.com/wolfiesites/scaffi-example-template"For further explanation use:
scaffi --helpAttention:
Package is new please consider making copy of your template before using template
IMPORTANT: IT WORKS ON UNIX BASED (MAC / LINUX) SYSTEMS WITH BASH INSTALLED IF YOU'RE on WINDOWS, Please consider using WSL
How it works:
- Scaffi takes placeholders from template:
- #{{name}}
- #{{nameKC}}
- #{{nameSC}}
- #{{nameCC}}
- #{{namePC}}
- #{{nameSPACE}}
- #{{yourimaginaryplaceholder}}
- #{{yourimaginaryplaceholderKC}}
- #{{yourimaginaryplaceholderSC}}
- #{{yourimaginaryplaceholderCC}}
- #{{yourimaginaryplaceholderPC}}
- #{{yourimaginaryplaceholderSPACE}}
- defined values for those placholders in flags: --name="awesome scaffi" --yourimaginaryplaceholder="imgainary is good"
- takes and converts it to all the cases:
| suffix | explanation | replacement |
|---|---|---|
| KC | KEBAB CASE | awesome-scaffi |
| SC | SNAKE CASE | awesome_scaffi |
| CC | CAMEL CASE | awesomeScaffi |
| PC | PASCAL CASE | AwesomeScaffi |
| SPACE | NORMAL STRING WITH SPACES | awesome scaffi |
- placeholders can be used as:
- directory
- filename
- variables in files
Future features:
- conditional placeholders with block of code
- interactive mode
- feed placeholders with config file.json
- getting private repos with token auth
Smart Usecases:
Please consider using .bashrc / .bashprofile to bend it to your will:
in ~/.basrhrc add:
newblock() {
scaffi --same-value="$*" -t="/your/amazing/template"
}* --same-value="" replaces all the placeholders with samevalue and use a command in terminal:
newblock my amazing new blockyour imagination is a key!