|
19 | 19 |
|
20 | 20 | <!-- START mdmod {use: 'toc'} -->
|
21 | 21 |
|
22 |
| -- [Quick Start](#quick-start) |
23 |
| - - [1. Bootstrap your project](#1-bootstrap-your-project) |
24 |
| - - [2. Add and edit template files](#2-add-and-edit-template-files) |
25 |
| - - [3. Build the app (TypeScript only)](#3-build-the-app-typescript-only) |
26 |
| - - [4. Publish package to npm](#4-publish-package-to-npm) |
27 |
| - - [5. PROFIT](#5-profit) |
28 |
| -- [Template](#template) |
29 |
| - - [Advanced: Multiple templates](#advanced-multiple-templates) |
30 |
| - - [Helper functions](#helper-functions) |
31 |
| - - [`upper`](#upper) |
32 |
| - - [`lower`](#lower) |
33 |
| - - [`capital`](#capital) |
34 |
| - - [`camel`](#camel) |
35 |
| - - [`snake`](#snake) |
36 |
| - - [`kebab`](#kebab) |
37 |
| - - [`space`](#space) |
38 |
| - - [`uuid`](#uuid) |
39 |
| -- [Config](#config) |
40 |
| - - [templateRoot (required)](#templateroot-required) |
41 |
| - - [modifyName (default: `undefined`)](#modifyname-default-undefined) |
42 |
| - - [extra (default: `undefined`)](#extra-default-undefined) |
43 |
| - - [defaultDescription (default: `description`)](#defaultdescription-default-description) |
44 |
| - - [defaultAuthor (default: `user.name` in `~/.gitconfig` otherwise `Your name`)](#defaultauthor-default-username-in-gitconfig-otherwise-your-name) |
45 |
| - - [defaultEmail (default: `user.email` in `~/.gitconfig` otherwise `Your email`)](#defaultemail-default-useremail-in-gitconfig-otherwise-your-email) |
46 |
| - - [defaultTemplate (default: `default`)](#defaulttemplate-default-default) |
47 |
| - - [defaultLicense (default: `MIT`)](#defaultlicense-default-mit) |
48 |
| - - [defaultPackageManager (default: `undefined`)](#defaultpackagemanager-default-undefined) |
49 |
| - - [promptForDescription (default: `true`)](#promptfordescription-default-true) |
50 |
| - - [promptForAuthor (default: `true`)](#promptforauthor-default-true) |
51 |
| - - [promptForEmail (default: `true`)](#promptforemail-default-true) |
52 |
| - - [promptForTemplate (default: `false`)](#promptfortemplate-default-false) |
53 |
| - - [promptForLicense (default: `true`)](#promptforlicense-default-true) |
54 |
| - - [promptForPackageManager (default: `false`)](#promptforpackagemanager-default-false) |
55 |
| - - [skipGitInit (default: `false`)](#skipgitinit-default-false) |
56 |
| - - [skipNpmInstall (default: `false`)](#skipnpminstall-default-false) |
57 |
| - - [after (default: `undefined`)](#after-default-undefined) |
58 |
| - - [caveat (default: `undefined`)](#caveat-default-undefined) |
59 |
| - - [`AfterHookOptions`](#afterhookoptions) |
60 |
| -- [Showcase](#showcase) |
61 |
| -- [Contribution](#contribution) |
62 |
| - - [Contributors ✨](#contributors-) |
| 22 | + |
| 23 | +- [✨ Create Create App](#-create-create-app) |
| 24 | + - [Why?](#why) |
| 25 | + - [Table of contents](#table-of-contents) |
| 26 | + - [Quick Start](#quick-start) |
| 27 | + - [1. Bootstrap your project](#1-bootstrap-your-project) |
| 28 | + - [2. Add and edit template files](#2-add-and-edit-template-files) |
| 29 | + - [3. Build the app (TypeScript only)](#3-build-the-app-typescript-only) |
| 30 | + - [4. Publish package to npm](#4-publish-package-to-npm) |
| 31 | + - [5. PROFIT](#5-profit) |
| 32 | + - [Template](#template) |
| 33 | + - [Advanced: Multiple templates](#advanced-multiple-templates) |
| 34 | + - [Helper functions](#helper-functions) |
| 35 | + - [`upper`](#upper) |
| 36 | + - [`lower`](#lower) |
| 37 | + - [`capital`](#capital) |
| 38 | + - [`camel`](#camel) |
| 39 | + - [`snake`](#snake) |
| 40 | + - [`kebab`](#kebab) |
| 41 | + - [`space`](#space) |
| 42 | + - [`uuid`](#uuid) |
| 43 | + - [Config](#config) |
| 44 | + - [templateRoot (required)](#templateroot-required) |
| 45 | + - [modifyName (default: `undefined`)](#modifyname-default-undefined) |
| 46 | + - [extra (default: `undefined`)](#extra-default-undefined) |
| 47 | + - [defaultDescription (default: `description`)](#defaultdescription-default-description) |
| 48 | + - [defaultAuthor (default: `user.name` in `~/.gitconfig` otherwise `Your name`)](#defaultauthor-default-username-in-gitconfig-otherwise-your-name) |
| 49 | + - [defaultEmail (default: `user.email` in `~/.gitconfig` otherwise `Your email`)](#defaultemail-default-useremail-in-gitconfig-otherwise-your-email) |
| 50 | + - [defaultTemplate (default: `default`)](#defaulttemplate-default-default) |
| 51 | + - [defaultLicense (default: `MIT`)](#defaultlicense-default-mit) |
| 52 | + - [defaultPackageManager (default: `undefined`)](#defaultpackagemanager-default-undefined) |
| 53 | + - [promptForDescription (default: `true`)](#promptfordescription-default-true) |
| 54 | + - [promptForAuthor (default: `true`)](#promptforauthor-default-true) |
| 55 | + - [promptForEmail (default: `true`)](#promptforemail-default-true) |
| 56 | + - [promptForTemplate (default: `false`)](#promptfortemplate-default-false) |
| 57 | + - [promptForLicense (default: `true`)](#promptforlicense-default-true) |
| 58 | + - [promptForPackageManager (default: `false`)](#promptforpackagemanager-default-false) |
| 59 | + - [skipGitInit (default: `false`)](#skipgitinit-default-false) |
| 60 | + - [skipNpmInstall (default: `false`)](#skipnpminstall-default-false) |
| 61 | + - [after (default: `undefined`)](#after-default-undefined) |
| 62 | + - [caveat (default: `undefined`)](#caveat-default-undefined) |
| 63 | + - [`AfterHookOptions`](#afterhookoptions) |
| 64 | + - [Showcase](#showcase) |
| 65 | + - [Contribution](#contribution) |
| 66 | + - [Contributors ✨](#contributors-) |
63 | 67 |
|
64 | 68 | <!-- END mdmod -->
|
65 | 69 |
|
@@ -120,6 +124,8 @@ Built-in variables are:
|
120 | 124 | - `{{contact}}` author name formatted with `{{name}} <{{email}}>`. If email is missing, simply `{{name}}`
|
121 | 125 | - `{{license}}` package license (e.g. `MIT`)
|
122 | 126 | - `{{year}}` current year (e.g. `2021`)
|
| 127 | +- `{{template}} selected template name (e.g. `typescript`) |
| 128 | +- `{{packageManager}} package manager (e.g. `yarn`) |
123 | 129 |
|
124 | 130 | ### Advanced: Multiple templates
|
125 | 131 |
|
@@ -346,6 +352,8 @@ create('create-greet', {
|
346 | 352 | ```typescript
|
347 | 353 | {
|
348 | 354 | // variables
|
| 355 | + name: string; // e.g. "create-greet" |
| 356 | + template: string; // e.g. "default" |
349 | 357 | packageDir: string; // e.g. "/path/to/ohayo"
|
350 | 358 | templateDir: string; // e.g. "/path/to/create-greet/templates/default"
|
351 | 359 | year: number; // e.g. 2020
|
|
0 commit comments