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
* - Moved templates into mustache
- Generation logic now resides in the templates
- Added flag 'namedexports' to remove default exports
* - Updated templates
* - Added template reading mechanism to add to the promise chain
- Templates refactored as pure handlebars files
- Stories and Tests added to templates
* - Added template publishing
- Split application into two sub commands with the default set to create for backward compatibility.
- Added argument to logComponentTree to allow control over appending the component name to the folderPath
* - Updated readme with extra detail on usage for templates and namedexports
* - Added error handling for directory reading in the publish scripts.
* Fixed bug in classComponents template for proptypes
* Fixed functional template proptypes
* Added capability to change output by config
* Added a few comments
* Delete .crcfrc
Removed .crcfrc - Mistakenly added
* Refactored config
* Added freeze to config api
* Updated gitignore to remove intelij config
* Bump js-yaml from 3.12.0 to 3.13.1
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](nodeca/js-yaml@3.12.0...3.13.1)
Signed-off-by: dependabot[bot] <[email protected]>
* Bump eslint-utils from 1.3.1 to 1.4.3
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](mysticatea/eslint-utils@v1.3.1...v1.4.3)
Signed-off-by: dependabot[bot] <[email protected]>
* Prettier now used by default
* Bump lodash.merge from 4.6.1 to 4.6.2
Bumps [lodash.merge](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)
Signed-off-by: dependabot[bot] <[email protected]>
* Bump lodash from 4.17.11 to 4.17.15
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.11...4.17.15)
Signed-off-by: dependabot[bot] <[email protected]>
* - Updated CRCF runtime error catching
- Fixed proptype errors in templates
* Updated lock file after merge with upstream
* Bumped version to 0.3.0
* Fixed bugs introduced during merge
* - Fixed bug with undefined showing at start
- Added more information to the readme
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
There is support for setting default config options, so you only have to set you desired config once. This makes creating your components even easier. All you have to do is follow one of these three options.
84
84
@@ -133,7 +133,11 @@ So now all you have to do is type **npx crcf componentName** and you will get al
If the project you are working on always needs components structured differently, we've got you covered.
159
+
160
+
Publishing the templates allows you to have finer control over the generated components and content. Published templates use <handlebars>[https://handlebarsjs.com/] to generate the different components.
161
+
162
+
```sh
163
+
$ npx crcf publish-templates
164
+
```
165
+
166
+
The templates will be copied to a directory `.crcf/templates` relative to the directory you ran the script from.
167
+
168
+
### Modifying templates
169
+
170
+
Templates are always passed a number of variables to help you generate templates when certain flags / config options have been enabled.
171
+
172
+
| Variable | Type | Description |
173
+
|----------|------|-------------|
174
+
| name | string | The generated name of the component |
175
+
| typescript | boolean |`true` when `typescript` is enabled |
176
+
| native | boolean |`true` when building react native components |
177
+
| proptypes | boolean |`true` when `proptypes` is enabled |
178
+
| export | boolean |`true` when `namedexports` is enabled |
179
+
180
+
**Tests and stories** have extra variables (**NOT** available in functional or class component templates)
181
+
182
+
| Variable | Type | Description |
183
+
|----------|------|-------------|
184
+
| nameLowercase | string | The generated name of the component in lowercase so it can be interpolated in sentences. |
185
+
| uppercase | boolean | `true` when `uppercase` is enabled
186
+
152
187
## Options
153
188
154
189
```sh
@@ -158,22 +193,23 @@ $ npx crcf --help
158
193
159
194
Options:
160
195
161
-
-V, --version output the version number
162
-
--typescript Creates Typescript component and files
163
-
--nocss No css file
164
-
--notest No test file
165
-
--cssmodules Creates css/less/scss file with .module extensions. Example
166
-
--reactnative Creates React Native components
167
-
--createindex Creates index.js file for multple component imports
0 commit comments