@@ -6,13 +6,15 @@ import * as os from 'os';
66import * as path from 'path' ;
77
88import { BaseIntegration , IntegrationConfig } from '../' ;
9- import { InfoItem , IntegrationAddDetails , IntegrationAddHandlers , IntegrationName , ProjectIntegration , ProjectPersonalizationDetails } from '../../../definitions' ;
9+ import { InfoItem , IntegrationAddDetails , IntegrationAddHandlers , IntegrationName , ProjectIntegration , ProjectPersonalizationDetails , ProjectType } from '../../../definitions' ;
1010import { FatalException } from '../../../lib/errors' ;
1111import { ancillary , input , strong } from '../../color' ;
1212
1313const debug = Debug ( 'ionic:lib:integrations:cordova' ) ;
1414
1515export class Integration extends BaseIntegration < ProjectIntegration > {
16+ readonly SUPPORTED_PROJECT_TYPES : readonly ProjectType [ ] = [ 'custom' , 'ionic1' , 'ionic-angular' , 'angular' ] ;
17+
1618 readonly name : IntegrationName = 'cordova' ;
1719 readonly summary = 'Target native iOS and Android with Apache Cordova' ;
1820 readonly archiveUrl = 'https://d2ql0qc7j8u4b2.cloudfront.net/integration-cordova.tar.gz' ;
@@ -22,12 +24,10 @@ export class Integration extends BaseIntegration<ProjectIntegration> {
2224 }
2325
2426 async add ( details : IntegrationAddDetails ) : Promise < void > {
25- if ( this . e . project . type === 'vue' || this . e . project . type === 'react' ) {
26- throw new FatalException (
27- `Cordova is not supported for ${ this . e . project . type } projects\n\n` +
28- `See ${ strong ( `https://ionicframework.com/docs/${ this . e . project . type } /overview` ) } for detailed information.\n`
29- ) ;
27+ if ( ! this . SUPPORTED_PROJECT_TYPES . includes ( this . e . project . type ) ) {
28+ throw new FatalException ( `Cordova is not supported for ${ this . e . project . type } projects` ) ;
3029 }
30+
3131 const handlers : IntegrationAddHandlers = {
3232 conflictHandler : async ( f , stats ) => {
3333 const isDirectory = stats . isDirectory ( ) ;
0 commit comments