cli/import-jdl.js
function importJDL() {
    logger.info('The JDL is being parsed.');
    const jdlImporter = new jhiCore.JDLImporter(this.jdlFiles, {
        databaseType: this.prodDatabaseType,
        applicationType: this.applicationType,
        applicationName: this.baseName,
        generatorVersion: packagejs.version,
        forceNoFiltering: this.options.force
    });
    let importState = {
        exportedEntities: [],
        exportedApplications: [],
        exportedDeployments: []
    };
    try {
        importState = jdlImporter.import();
        logger.debug(`importState exportedEntities: ${importState.exportedEntities.length}`);
        logger.debug(`importState exportedApplications: ${importState.exportedApplications.length}`);
        logger.debug(`importState exportedDeployments: ${importState.exportedDeployments.length}`);
        updateDeploymentState(importState);
        if (importState.exportedEntities.length > 0) {
            const entityNames = _.uniq(importState.exportedEntities.map(exportedEntity => exportedEntity.name)).join(', ');
            logger.info(`Found entities: ${chalk.yellow(entityNames)}.`);
        } else {
            logger.info(chalk.yellow('No change in entity configurations, no entities were updated.'));
        }
        logger.info('The JDL has been successfully parsed');
    } catch (error) {
        logger.debug('Error:', error);
        if (error) {
            const errorName = `${error.name}:` || '';
            const errorMessage = error.message || '';
            logger.log(chalk.red(`${errorName} ${errorMessage}`));
        }
        logger.error(`Error while parsing applications and entities from the JDL ${error}`, error);
    }
    return importState;
}
function importJDL() {
    logger.info('The JDL is being parsed.');
    const jdlImporter = new jhiCore.JDLImporter(this.jdlFiles, {
        databaseType: this.prodDatabaseType,
        applicationType: this.applicationType,
        applicationName: this.baseName,
        generatorVersion: packagejs.version,
        forceNoFiltering: this.options.force
    });
    let importState = {
        exportedEntities: [],
        exportedApplications: [],
        exportedDeployments: []
    };
    try {
        importState = jdlImporter.import();
        logger.debug(`importState exportedEntities: ${importState.exportedEntities.length}`);
        logger.debug(`importState exportedApplications: ${importState.exportedApplications.length}`);
        logger.debug(`importState exportedDeployments: ${importState.exportedDeployments.length}`);
        updateDeploymentState(importState);
        if (importState.exportedEntities.length > 0) {
            const entityNames = _.uniq(importState.exportedEntities.map(exportedEntity => exportedEntity.name)).join(', ');
            logger.info(`Found entities: ${chalk.yellow(entityNames)}.`);
        } else {
            logger.info(chalk.yellow('No change in entity configurations, no entities were updated.'));
        }
        logger.info('The JDL has been successfully parsed');
    } catch (error) {
        logger.debug('Error:', error);
        if (error) {
            const errorName = `${error.name}:` || '';
            const errorMessage = error.message || '';
            logger.log(chalk.red(`${errorName} ${errorMessage}`));
        }
        logger.error(`Error while parsing applications and entities from the JDL ${error}`, error);
    }
    return importState;
}
function importJDL ( ) { logger . info ( 'The JDL is being parsed.' ) ; const jdlImporter = new jhiCore . JDLImporter ( this . jdlFiles , { databaseType : this . prodDatabaseType , applicationType : this . applicationType , applicationName : this . baseName , generatorVersion : packagejs . version , forceNoFiltering : this . options . force } ) ; let importState = { exportedEntities : [ ] , exportedApplications : [ ] , exportedDeployments : [ ] } ; try { importState = jdlImporter . import ( ) ; logger . debug ( ` ${ importState . exportedEntities . length } ` ) ; logger . debug ( ` ${ importState . exportedApplications . length } ` ) ; logger . debug ( ` ${ importState . exportedDeployments . length } ` ) ; updateDeploymentState ( importState ) ; if ( importState . exportedEntities . length > 0 ) { const entityNames = _ . uniq ( importState . exportedEntities . map ( exportedEntity => exportedEntity . name ) ) . join ( ', ' ) ; logger . info ( ` ${ chalk . yellow ( entityNames ) } ` ) ; } else { logger . info ( chalk . yellow ( 'No change in entity configurations, no entities were updated.' ) ) ; } logger . info ( 'The JDL has been successfully parsed' ) ; } catch ( error ) { logger . debug ( 'Error:' , error ) ; if ( error ) { const errorName = ` ${ error . name } ` || '' ; const errorMessage = error . message || '' ; logger . log ( chalk . red ( ` ${ errorName } ${ errorMessage } ` ) ) ; } logger . error ( ` ${ error } ` , error ) ; } return importState ; }
Imports the Applications and Entities defined in JDL
The app .yo-rc.json files and entity json files are written to disk
Imports the Applications and Entities defined in JDL The app . yo - rc . json files and entity json files are written to disk