11import { Listr , ListrTask } from 'listr2' ;
2- import { yellow } from 'chalk' ;
32import clear from 'clear' ;
43import Command from '../../lib/command' ;
54import Aliases from '../../common/constants/aliases' ;
65import FileWorker from '../../common/file-worker' ;
76import PromisifiedFs from '../../common/promisified-fs' ;
87import Paths from '../../common/constants/paths' ;
9- import { revertMigration , runMigration , compile } from '../../lib/child-cli' ;
10- import Logger from '../../lib/logger' ;
8+ import compile from '../../lib/compiler' ;
119
1210const firstLine = ( str : string ) : string => str . split ( '\n' ) [ 0 ] . replace ( / : $ / , '' ) ;
1311
@@ -22,7 +20,7 @@ export const generateFlow = (context: Command, error: (input: string | Error, op
2220 title : 'Compiling your code' ,
2321 task : async ( ) : Promise < void > => {
2422 await PromisifiedFs . rimraf ( Paths . DIST ) ;
25- await compile ( ) ;
23+ await compile ( await context . serviceWorker . loadResolversPaths ( ) , context ) ;
2624 } ,
2725 } ,
2826 {
@@ -33,7 +31,7 @@ export const generateFlow = (context: Command, error: (input: string | Error, op
3331 ctx . encodedZip = await FileWorker . zipFolder ( ) ;
3432 } ,
3533 } ,
36- {
34+ /* {
3735 title: 'Reverting extra migrations',
3836 task: async (ctx, task): Promise<void> => {
3937 const currentMigrations = await PromisifiedFs.readdir(Paths.MIGRATIONS);
@@ -52,10 +50,11 @@ export const generateFlow = (context: Command, error: (input: string | Error, op
5250 // eslint-disable-next-line no-param-reassign
5351 task.title = 'Extra migrations were successfully reverted';
5452 } catch (e) {
53+ console.log(e);
5554 task.skip(`Migrations were not reverted: ${firstLine(e.toString())}`);
5655 }
5756 },
58- } ,
57+ }, */
5958 {
6059 title : 'Uploading service to the generator' ,
6160 task : async ( ctx ) : Promise < void > => {
@@ -75,13 +74,13 @@ export const generateFlow = (context: Command, error: (input: string | Error, op
7574 await PromisifiedFs . rimraf ( Paths . ENTITIES ) ;
7675 await PromisifiedFs . rimraf ( Paths . DIST ) ;
7776 await FileWorker . saveZipFromB64 ( generated , Paths . DATA ) ;
78- await compile ( ) ;
77+ await compile ( await context . serviceWorker . loadResolversPaths ( ) , context ) ;
7978
8079 // eslint-disable-next-line no-param-reassign
8180 task . title = 'Generated code has been saved' ;
8281 } ,
8382 } ,
84- {
83+ /* {
8584 title: 'Running generated migration',
8685 task: async (ctx, task): Promise<void> => {
8786 try {
@@ -93,7 +92,7 @@ export const generateFlow = (context: Command, error: (input: string | Error, op
9392 task.skip(`Migrations were not ran: ${firstLine(e.toString())}`);
9493 }
9594 },
96- } ,
95+ }, */
9796] ;
9897
9998export default class Generate extends Command {
0 commit comments