generator-jhipster-react-native
Version:
React Native Blueprint for existing JHipster Apps
38 lines (32 loc) • 1.17 kB
JavaScript
const { dirname, basename, join } = require('path');
const { version, bin } = require('../package.json');
// Get package name to use as namespace.
// Allows blueprints to be aliased.
const packagePath = dirname(__dirname);
const packageFolderName = basename(packagePath);
const devBlueprintPath = join(packagePath, '.blueprint');
const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packageFolderName}` : packageFolderName;
(async () => {
const { runJHipster, done, logger } = await import('generator-jhipster/cli');
const executableName = Object.keys(bin)[0];
runJHipster({
executableName,
executableVersion: version,
defaultCommand: 'app',
devBlueprintPath,
blueprints: {
[blueprint]: version,
},
printBlueprintLogo: () => {
console.log('===================== JHipster React Native =====================');
console.log('');
},
lookups: [{ packagePaths: [packagePath] }],
...require('./cli-customizations.cjs'),
}).catch(done);
process.on('unhandledRejection', up => {
logger.error('Unhandled promise rejection at:');
logger.fatal(up);
});
})();