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
@@ -98,7 +98,7 @@ export async function createCLI() {
98
98
### Open `templates` to write template files
99
99
- templates is the root directory for templates
100
100
- templates/default is a specific template directory, can be any name
101
-
- If there are multiple directories under templates, they will be available for user selection during project creation
101
+
- If there are multiple directories under templates, users can choose during project creation
102
102
103
103
## Examples
104
104
@@ -129,7 +129,7 @@ Created by: <%= author %>
129
129
Created at: <%= timestamp %>
130
130
```
131
131
132
-
### Conditionally render different template files
132
+
### Render different template files based on conditions
133
133
134
134
```ts
135
135
// src/index.ts
@@ -152,7 +152,7 @@ export async function createCLI() {
152
152
}
153
153
```
154
154
155
-
### Logging
155
+
### Print related logs
156
156
157
157
```ts
158
158
// src/index.ts
@@ -165,7 +165,7 @@ export async function createCLI() {
165
165
});
166
166
167
167
creator.on('before', ({prompts}) => {
168
-
prompts.log.info('Display some banner information');
168
+
prompts.log.info('Output some banner information');
169
169
});
170
170
171
171
creator.on('start', ({prompts}) => {
@@ -184,7 +184,7 @@ export async function createCLI() {
184
184
}
185
185
```
186
186
187
-
### Custom CLI selection
187
+
### Custom CLI selection interaction
188
188
```ts
189
189
// src/index.ts
190
190
import { promptSafe } from'create-creator';
@@ -216,22 +216,16 @@ export async function createCLI() {
216
216
}
217
217
```
218
218
219
-
### Dot files
220
-
To create dot files (e.g., .gitignore, .npmrc) in templates/default directory, prefix the filename with `_` since dot files are hidden in file systems.
221
-
```bash
222
-
templates/default/
223
-
├── _gitignore -> .gitignore
224
-
├── _npmrc -> .npmrc
225
-
└── README.md
226
-
```
219
+
### Special dot files
220
+
When publishing npm packages, `.gitignore` and `.npmignore` files are ignored by default. The conventional approach is:
227
221
228
-
### Underscore files
229
-
In `templates`, creating dot files requires `_*` prefix, so creating underscore (`_*`) files requires double underscore prefix (`__*`).
230
-
```bash
231
-
templates/default/
232
-
├── __gitignore -> _gitignore
233
-
├── __npmrc -> _npmrc
234
-
└── README.md
222
+
1. Rename `.gitignore` and `.npmignore` to `_gitignore` and `_npmignore`
223
+
2. Add custom interceptors for special handling
224
+
```ts
225
+
// Rename _gitignore and _npmignore files in any directory to .gitignore and .npmignore
0 commit comments