@@ -5,22 +5,21 @@ import { exec } from "child_process";
55
66import { loadScannerOptions } from "../../libs/ScannerConfig.js" ;
77import { FindFlows } from "../../libs/FindFlows.js" ;
8- import { ScanResult } from "../../models/ScanResult.js" ;
8+ import { ScanResult as Output } from "../../models/ScanResult.js" ;
99
10- import {
11- ScanResult as ScanResults ,
10+ import pkg , {
11+ ParsedFlow ,
12+ ScanResult ,
1213 RuleResult ,
1314 ResultDetails ,
14- parse as parseFlows ,
15- scan as scanFlows ,
16- ParsedFlow ,
1715} from "lightning-flow-scanner-core" ;
16+ const { parse : parseFlows , scan : scanFlows } = pkg ;
1817
1918Messages . importMessagesDirectoryFromMetaUrl ( import . meta. url ) ;
2019
2120const messages = Messages . loadMessages ( "lightning-flow-scanner" , "command" ) ;
2221
23- export default class Scan extends SfCommand < ScanResult > {
22+ export default class Scan extends SfCommand < Output > {
2423 public static description = messages . getMessage ( "commandDescription" ) ;
2524 public static examples : string [ ] = [
2625 "sf flow scan" ,
@@ -83,7 +82,7 @@ export default class Scan extends SfCommand<ScanResult> {
8382 } ) ,
8483 } ;
8584
86- public async run ( ) : Promise < ScanResult > {
85+ public async run ( ) : Promise < Output > {
8786 const { flags } = await this . parse ( Scan ) ;
8887 this . failOn = flags . failon || "error" ;
8988 this . spinner . start ( "Loading Lightning Flow Scanner" ) ;
@@ -101,7 +100,7 @@ export default class Scan extends SfCommand<ScanResult> {
101100 const parsedFlows : ParsedFlow [ ] = await parseFlows ( flowFiles ) ;
102101 this . debug ( `parsed flows ${ parsedFlows . length } ` , ...parsedFlows ) ;
103102
104- const scanResults : ScanResults [ ] =
103+ const scanResults : ScanResult [ ] =
105104 this . userConfig && Object . keys ( this . userConfig ) . length > 0
106105 ? scanFlows ( parsedFlows , this . userConfig )
107106 : scanFlows ( parsedFlows ) ;
@@ -161,7 +160,7 @@ export default class Scan extends SfCommand<ScanResult> {
161160 chalk . bold (
162161 chalk . italic (
163162 chalk . yellowBright (
164- "Be a part of our mission to champion Flow Best Practices by starring us on GitHub:" ,
163+ "Be a part of our mission to champion Flow Best Practices by starring ⭐ us on GitHub:" ,
165164 ) ,
166165 ) ,
167166 ) ,
0 commit comments