You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All that is necessary to start using the tool is a component name `name`, which corresponds to a pascal-cased string that will serve as the component name, and a relative `--path`/`-p` that contains a `_Template` directory.
15
+
All that is necessary to start using the tool is a component name `name`, which corresponds to a pascal-cased string that will serve as the component name, and a relative `--path`/`-p` that contains a `_Template` directory (or other directory as specified by the `-t`/`--templateDir` option).
While it is possible to run this script directly, it is recommended that you add scripts to your `package.json` file in order to make using this tool easier and faster. The app structure isn't likely to change in any given project often, so this will help in making the usage more consistent.
28
28
29
-
The scripts `name` arg can be passed through to the script when running it through `npm`, therefore all that is recommended is to set up a script corresponding to each path that contains a `_Template` directory.
29
+
The scripts `name` arg can be passed through to the script when running it through `npm`, therefore all that is recommended is to set up a script corresponding to each path that contains a `_Template` directory (or other directory as specified by the `-t`/`--templateDir` option).
30
30
31
31
**Setting up scripts is simple ― consider an application with the following structure:**
32
32
@@ -55,6 +55,8 @@ The scripts `name` arg can be passed through to the script when running it throu
55
55
56
56
> **Note:** If your templates live outside of the directory you want them to be created in, use the `-o` or `--outputPath` option to set the output path.
57
57
58
+
> **Note:** If you want the template directory to have a different name than `_Template` for stylistic or conflict reasons, use the `-t`/`--templateDir` option.
59
+
58
60
### 3. Run the scripts
59
61
60
62
Given the scripts created in step #2 above, run them as follows ― being sure to provide a component name after the script name. These commands will clone the `_Template` directory in each of the corresponding project directories and will perform replacements both on the file names themselves as well as on the text content within the files.
@@ -82,7 +84,9 @@ The following table documents which text nodes will be operated on when the `_Te
82
84
|`_version`| The root package's version |`1.0.0`| ✔️ | ❌ |
83
85
|`_date`| The date as `m/d/yyyy`|`3/23/2022`| ✔️ | ❌ |
84
86
85
-
> **Note:** Version 2.0.0 will provide an API for adding custom replacements to the script.
87
+
> **Note:** The `_Template` and `_template` replacements are not affected by the `-t`/`--templateDir` option.
88
+
89
+
> **Coming soon:** Version 2.0.0 will provide an API for adding custom replacements to the script.
0 commit comments