BETA version disclaimer: This package is still very volatile, use with caution.
Gives ability to copy a file structure into a certain path renaming the file paths and the files' content.
Can be used with React to provide component
and container
blueprints, in which case creating a new component is done with a single command instead of manually creating and filling all the files. This has the added benefit of providing teams the ability to offer and enforce common patterns for developers.
yarn add -D create-from-blueprint
npm i --save-dev create-from-blueprint
{
"createFromBlueprint": {
"component": "blueprints/component/",
"container": "blueprints/container/"
}
}
key
Type of the blueprint (component
, container
)
value
A path pointing to an existing folder (blueprints/component/
, ...)
create-from-blueprint <destination>
2.1. You'll be asked to choose a type
from a list1
2.2. And input a name
Instances of type
, beginning with a lowercase or uppercase letter, will be replaced with name
In file paths
: Every instance of{% type %}
will be replaced withname
for the files within the folder the blueprint config targetsIn file contents
: Every instance oftype
will be replaced withname
1 The list consists of keys
from the config field
Commander --help
output
$ create-from-blueprint --help
Usage: create-from-blueprint [options] <destination>
Options:
-n, --name <name> The name of the created component
-t, --type <type> The name of the component type defined in the config
-h, --help output usage information
When type
or name
is missing, both will be asked for with inquirer
. You can input everything in one go as well by providing both (type
, name
) of the options.
create-from-blueprint -t component -n InvoiceItem components
Django's startapp
which automatically generates a base for a new application.
This project is licensed under the MIT License - see the license file for details
- Single file blueprint support