@@ -11,17 +11,55 @@ export type FileResponseFn<T> = (fullPath: string, basedir: string, basename: st
11
11
export type FileResponse < T > = T | FileResponseFn < T >
12
12
13
13
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
+ */
15
18
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
+ */
17
24
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. */
19
27
output : FileResponse < string >
28
+
29
+ /**
30
+ * Create subfolder with the input name (default: `false`)
31
+ */
20
32
createSubFolder ?: boolean
33
+
34
+ /**
35
+ * Add custom data to the templates. By default, only your app name is included as `{{name}}` and `{{Name}}`.
36
+ */
21
37
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
+ */
22
45
overwrite ?: FileResponse < boolean >
46
+
47
+ /** Suppress output logs (Same as `verbose: 0` or `verbose: LogLevel.None`) */
23
48
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
+ */
24
57
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
+ */
25
63
dryRun ?: boolean
26
64
}
27
65
export interface ScaffoldCmdConfig {
@@ -32,5 +70,6 @@ export interface ScaffoldCmdConfig {
32
70
data ?: Record < string , string >
33
71
overwrite : boolean
34
72
quiet : boolean
73
+ verbose : LogLevel
35
74
dryRun : boolean
36
75
}
0 commit comments