@@ -77,20 +77,20 @@ module.exports = (config) => {
7777## Using a config file
7878
7979Once your config is created, you can use it by providing the file name to the ` --config ` (or ` -c `
80- for brevity), optionally followed by a colon, then your scaffold config name.
80+ for brevity), optionally alongside ` --key ` or ` -k ` , denoting the key to use as the config object, as
81+ you define in your config:
8182
8283``` shell
83- simple-scaffold -c < file> [: < template_key> ]
84+ simple-scaffold -c < file> -k < template_key>
8485```
8586
8687For example:
8788
8889``` shell
89- simple-scaffold -c scaffold.json: component MyComponentName
90+ simple-scaffold -c scaffold.json -k component MyComponentName
9091```
9192
92- If you don't want to supply a template/config name (e.g. ` component ` ), you can omit the colon and
93- the name, and it will use the configuration named ` default ` :
93+ If you don't want to supply a template/config name (e.g. ` component ` ), ` default ` will be used:
9494
9595``` js
9696/** @type {import('simple-scaffold').ScaffoldConfigFile} */
@@ -108,6 +108,19 @@ And then:
108108simple-scaffold -c scaffold.json MyComponentName
109109```
110110
111+ Any importable file is supported, depending on your build process.
112+
113+ Common files include:
114+
115+ - ` *.json `
116+ - ` *.js `
117+ - ` *.mjs `
118+ - ` *.cjs `
119+
120+ Note that you might need to find the correct extension of ` .js ` , ` .cjs ` or ` .mjs ` depending on your
121+ build process and your package type (for example, packages with ` "type": "module" ` in their
122+ ` package.json ` might be required to use ` .mjs ` .
123+
111124## Remote Templates
112125
113126You can load template groups remotely, similar to how you would pass a config normally.
@@ -120,13 +133,13 @@ When passing a git URL to `--config`, you will clone that repo and use the files
120133The syntax is as follows:
121134
122135``` shell
123- simple-scaffold -c < git_url> [# <git_file>][: <template_key>]
136+ simple-scaffold -c < git_url> [# <git_file>] [-k <template_key>]
124137` ` `
125138
126139For example, to use this repository' s example as base:
127140
128141```shell
129- simple-scaffold -c https://github.com/chenasraf/simple-scaffold.git#scaffold.config.js: component
142+ simple-scaffold -c https://github.com/chenasraf/simple-scaffold.git#scaffold.config.js -k component
130143```
131144
132145When the `filename` is omitted, `/scaffold.config.js` will be used as default.
@@ -141,13 +154,13 @@ URL without specifying the whole path.
141154The syntax is as follows:
142155
143156```shell
144- simple-scaffold -gh <username>/<project_name>[#<git_file>][: <template_key>]
157+ simple-scaffold -gh <username>/<project_name>[#<git_file>] [-k <template_key>]
145158```
146159
147160This example is equivalent to the above, just shorter to write:
148161
149162```shell
150- simple-scaffold -c chenasraf/simple-scaffold#scaffold.config.js: component
163+ simple-scaffold -c chenasraf/simple-scaffold#scaffold.config.js -k component
151164```
152165
153166## Use In Node.js
0 commit comments