File tree Expand file tree Collapse file tree 3 files changed +26
-8
lines changed
packages/nx-firebase/src/generators/init Expand file tree Collapse file tree 3 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 1
- import type { GeneratorCallback , Tree } from '@nx/devkit'
1
+ import {
2
+ runTasksInSerial ,
3
+ type GeneratorCallback ,
4
+ type Tree ,
5
+ formatFiles ,
6
+ } from '@nx/devkit'
2
7
import { addDependencies } from './lib'
3
8
import { addGitIgnore , addNxIgnore } from './lib/add-git-ignore-entry'
4
9
import type { InitGeneratorOptions } from './schema'
@@ -11,12 +16,17 @@ import type { InitGeneratorOptions } from './schema'
11
16
*
12
17
*/
13
18
export async function initGenerator (
14
- tree : Tree ,
15
- _options : InitGeneratorOptions ,
19
+ host : Tree ,
20
+ schema : InitGeneratorOptions ,
16
21
) : Promise < GeneratorCallback > {
17
- addGitIgnore ( tree )
18
- addNxIgnore ( tree )
19
- return addDependencies ( tree )
22
+ const tasks : GeneratorCallback [ ] = [ ]
23
+ addGitIgnore ( host )
24
+ addNxIgnore ( host )
25
+ if ( ! schema . skipFormat ) {
26
+ await formatFiles ( host )
27
+ }
28
+ tasks . push ( addDependencies ( host ) )
29
+ return runTasksInSerial ( ...tasks )
20
30
}
21
31
22
32
export default initGenerator
Original file line number Diff line number Diff line change 1
- export type InitGeneratorOptions = unknown
1
+ export type InitGeneratorOptions = {
2
+ skipFormat ?: boolean
3
+ }
Original file line number Diff line number Diff line change 4
4
"title" : " Init Firebase Plugin" ,
5
5
"description" : " Init Firebase Plugin." ,
6
6
"type" : " object" ,
7
- "properties" : {},
7
+ "properties" : {
8
+ "skipFormat" : {
9
+ "description" : " Skip formatting files." ,
10
+ "type" : " boolean" ,
11
+ "default" : false
12
+ }
13
+ },
8
14
"required" : []
9
15
}
You can’t perform that action at this time.
0 commit comments