1+ /* eslint-disable @typescript-eslint/camelcase */
2+ /* eslint-disable @typescript-eslint/no-use-before-define */
3+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
14import commander from "commander" ;
25import GitUrlParse from "git-url-parse" ;
36import open = require( "open" ) ;
@@ -7,18 +10,18 @@ import { getRepositoryName } from "../../lib/gitutils";
710import { exec } from "../../lib/shell" ;
811import { isPortNumberString , validatePrereqs } from "../../lib/validator" ;
912import { logger } from "../../logger" ;
10- import { IConfigYaml } from "../../types" ;
13+ import { ConfigYaml } from "../../types" ;
1114import decorator from "./dashboard.decorator.json" ;
1215
13- export interface IIntrospectionManifest {
16+ export interface IntrospectionManifest {
1417 githubUsername ?: string ;
1518 manifestRepoName : string ;
1619}
1720
1821/**
1922 * Command line option values from commander
2023 */
21- export interface ICommandOptions {
24+ export interface CommandOptions {
2225 port : string ;
2326 removeAll : boolean ;
2427}
@@ -29,7 +32,10 @@ export interface ICommandOptions {
2932 * @param config SPK Configuration
3033 * @param opts Command Line option values
3134 */
32- export const validateValues = ( config : IConfigYaml , opts : ICommandOptions ) => {
35+ export const validateValues = (
36+ config : ConfigYaml ,
37+ opts : CommandOptions
38+ ) : void => {
3339 if ( opts . port ) {
3440 if ( ! isPortNumberString ( opts . port ) ) {
3541 throw new Error ( "value for port option has to be a valid port number" ) ;
@@ -61,9 +67,9 @@ export const validateValues = (config: IConfigYaml, opts: ICommandOptions) => {
6167 * @param exitFn exit function
6268 */
6369export const execute = async (
64- opts : ICommandOptions ,
70+ opts : CommandOptions ,
6571 exitFn : ( status : number ) => Promise < void >
66- ) => {
72+ ) : Promise < void > => {
6773 try {
6874 const config = Config ( ) ;
6975 validateValues ( config , opts ) ;
@@ -84,7 +90,7 @@ export const execute = async (
8490 * @param command Commander command object to decorate
8591 */
8692export const commandDecorator = ( command : commander . Command ) : void => {
87- buildCmd ( command , decorator ) . action ( async ( opts : ICommandOptions ) => {
93+ buildCmd ( command , decorator ) . action ( async ( opts : CommandOptions ) => {
8894 await execute ( opts , async ( status : number ) => {
8995 await exitCmd ( logger , process . exit , status ) ;
9096 } ) ;
@@ -94,7 +100,9 @@ export const commandDecorator = (command: commander.Command): void => {
94100/**
95101 * Cleans previously launched spk dashboard docker containers
96102 */
97- export const cleanDashboarContainers = async ( config : IConfigYaml ) => {
103+ export const cleanDashboardContainers = async (
104+ config : ConfigYaml
105+ ) : Promise < void > => {
98106 let dockerOutput = await exec ( "docker" , [
99107 "ps" ,
100108 "-a" ,
@@ -120,7 +128,7 @@ export const cleanDashboarContainers = async (config: IConfigYaml) => {
120128 * @param removeAll true to remove all previously launched instances of the dashboard
121129 */
122130export const launchDashboard = async (
123- config : IConfigYaml ,
131+ config : ConfigYaml ,
124132 port : number ,
125133 removeAll : boolean
126134) : Promise < string > => {
@@ -130,7 +138,7 @@ export const launchDashboard = async (
130138 }
131139
132140 if ( removeAll ) {
133- await cleanDashboarContainers ( config ) ;
141+ await cleanDashboardContainers ( config ) ;
134142 }
135143
136144 const dockerRepository = config . introspection ! . dashboard ! . image ! ;
@@ -157,7 +165,7 @@ export const launchDashboard = async (
157165 * Creates and returns an array of env vars that need to be passed into the
158166 * docker run command
159167 */
160- export const getEnvVars = async ( config : IConfigYaml ) : Promise < string [ ] > => {
168+ export const getEnvVars = async ( config : ConfigYaml ) : Promise < string [ ] > => {
161169 const key = await config . introspection ! . azure ! . key ;
162170 const envVars = [ ] ;
163171 envVars . push ( "-e" ) ;
@@ -236,8 +244,8 @@ export const getEnvVars = async (config: IConfigYaml): Promise<string[]> => {
236244 * information on dashboard
237245 */
238246export const extractManifestRepositoryInformation = (
239- config : IConfigYaml
240- ) : IIntrospectionManifest | undefined => {
247+ config : ConfigYaml
248+ ) : IntrospectionManifest | undefined => {
241249 const { azure_devops } = config ;
242250 if ( azure_devops ! . manifest_repository ) {
243251 const manifestRepoName = getRepositoryName (
0 commit comments