@@ -85,7 +85,7 @@ module.exports = class Server {
8585 this . serverSetup . seedSamples = seedSamples
8686 }
8787
88- async create ( ) {
88+ async create ( options = { } ) {
8989 const { name, context, createCompleteCbs, serverSetup } = this
9090
9191 const run = ( command , args ) => {
@@ -140,7 +140,7 @@ module.exports = class Server {
140140 // run generator
141141 log ( )
142142 log ( `🚀 Invoking generators...` )
143- const plugins = this . resolvePlugins ( preset . plugins )
143+ const plugins = this . resolvePlugins ( preset . plugins , options . debug )
144144 const generator = new Generator ( context , {
145145 pkg,
146146 plugins,
@@ -175,7 +175,7 @@ module.exports = class Server {
175175 generator . printExitLogs ( )
176176 }
177177
178- async syncModels ( defaultConnection ) {
178+ async syncModels ( defaultConnection , options = { } ) {
179179 const run = ( command , args ) => {
180180 if ( ! args ) { [ command , ...args ] = command . split ( / \s + / ) }
181181 return execa ( command , args , { cwd : context } )
@@ -227,7 +227,7 @@ module.exports = class Server {
227227
228228 log ( )
229229 log ( `⚙️ Synchronizing tables...` )
230- const plugins = this . resolvePlugins ( preset . plugins )
230+ const plugins = this . resolvePlugins ( preset . plugins , options . debug )
231231 const generator = new Generator ( context , {
232232 pkg : { _ignore : true } ,
233233 plugins,
@@ -245,7 +245,7 @@ module.exports = class Server {
245245 log ( `👉 Run ${ chalk . cyan ( 'git add . && git stash' ) } to revert the changes safely.\n\n` )
246246 }
247247
248- async newSeed ( defaultConnection ) {
248+ async newSeed ( defaultConnection , options = { } ) {
249249 const run = ( command , args ) => {
250250 if ( ! args ) { [ command , ...args ] = command . split ( / \s + / ) }
251251 return execa ( command , args , { cwd : context } )
@@ -313,7 +313,7 @@ module.exports = class Server {
313313
314314 log ( )
315315 log ( `⚙️ Creating data.sql...` )
316- const plugins = this . resolvePlugins ( preset . plugins )
316+ const plugins = this . resolvePlugins ( preset . plugins , options . debug )
317317 const generator = new Generator ( context , {
318318 pkg : { _ignore : true } ,
319319 plugins,
@@ -329,12 +329,13 @@ module.exports = class Server {
329329 log ( `🎉 Successfully created data.sql` )
330330 }
331331
332- resolvePlugins ( rawPlugins ) {
332+ resolvePlugins ( rawPlugins , debug = false ) {
333333 // ensure cli-service is invoked first
334334 rawPlugins = sortObject ( rawPlugins , [ '@simpli/cli-server' ] )
335335 return Object . keys ( rawPlugins ) . map ( id => {
336- const module = resolve . sync ( `${ id } /generator` , { basedir : this . context } )
337- // const module = resolve.sync(`../../../cli-server/generator`)
336+ const module = ! debug
337+ ? resolve . sync ( `${ id } /generator` , { basedir : this . context } )
338+ : resolve . sync ( `../../../cli-server/generator` )
338339 return {
339340 id,
340341 apply : require ( module ) ,
0 commit comments