Skip to content

Commit c2bc8b7

Browse files
committed
update docs [skip publish]
1 parent b1b1aca commit c2bc8b7

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

Diff for: src/types.ts

+42-3
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,55 @@ export type FileResponseFn<T> = (fullPath: string, basedir: string, basename: st
1111
export type FileResponse<T> = T | FileResponseFn<T>
1212

1313
export interface ScaffoldConfig {
14-
/** The name supplied for the output templates */
14+
/**
15+
* Name to be passed to the generated files. `{{name}}` and `{{Name}}` inside contents and file names will be replaced
16+
* accordingly.
17+
*/
1518
name: string
16-
/** Template input files/dirs/glob patterns to use as template input. These will be copied to the output directory. */
19+
20+
/**
21+
* Template files to use as input. You may provide multiple files, each of which can be a relative or absolute path,
22+
* or a glob pattern for multiple file matching easily. (default: current working directory)
23+
*/
1724
templates: string[]
18-
/** Output directory to put scaffolded files in. */
25+
26+
/** Path to output to. If `createSubFolder` is `true`, the subfolder will be created inside this path. */
1927
output: FileResponse<string>
28+
29+
/**
30+
* Create subfolder with the input name (default: `false`)
31+
*/
2032
createSubFolder?: boolean
33+
34+
/**
35+
* Add custom data to the templates. By default, only your app name is included as `{{name}}` and `{{Name}}`.
36+
*/
2137
data?: Record<string, string>
38+
39+
/**
40+
* Enable to override output files, even if they already exist. (default: `false`)
41+
*
42+
* You may supply a function to this option, which can take the arguments `(fullPath, baseDir, baseName)` and returns
43+
* a string, to return a dynamic path for each file.
44+
*/
2245
overwrite?: FileResponse<boolean>
46+
47+
/** Suppress output logs (Same as `verbose: 0` or `verbose: LogLevel.None`) */
2348
quiet?: boolean
49+
50+
/**
51+
* Determine amount of logs to display.
52+
*
53+
* The values are: `0 (none) | 1 (debug) | 2 (info) | 3 (warn) | 4 (error)`. The provided level will display messages
54+
* of the same level or higher. (default: `2 (info)`)
55+
* @see LogLevel
56+
*/
2457
verbose?: LogLevel
58+
59+
/**
60+
* Don't emit files. This is good for testing your scaffolds and making sure they don't fail, without having to write
61+
* actual file contents or create directories. (default: `false`)
62+
*/
2563
dryRun?: boolean
2664
}
2765
export interface ScaffoldCmdConfig {
@@ -32,5 +70,6 @@ export interface ScaffoldCmdConfig {
3270
data?: Record<string, string>
3371
overwrite: boolean
3472
quiet: boolean
73+
verbose: LogLevel
3574
dryRun: boolean
3675
}

0 commit comments

Comments
 (0)