nl_tokens: Find the framework directory lookup order - specify framework path - get framework name from - use egg by default
pl_tokens: function getFrameworkPath ( { framework , baseDir } ) { const pkgPath = path . join ( baseDir , 'package.json' ) ; assert ( fs . existsSync ( pkgPath ) , ` ${ pkgPath } ` ) ; const moduleDir = <mask> . join ( baseDir , 'node_modules' ) ; const pkg = utility . readJSONSync ( pkgPath ) ; // 1. pass framework or customEgg if ( framework ) { // 1.1 framework is an absolute path // framework: path.join(baseDir, 'node_modules/${frameworkName}') if ( path . isAbsolute ( framework ) ) { assert ( fs . existsSync ( framework ) , ` ${ framework } ` ) ; return framework ; } // 1.2 framework is a npm package that required by application // framework: 'frameworkName' return assertAndReturn ( framework , moduleDir ) ; } // 2. framework is not specified // 2.1 use framework name from pkg.egg.framework if ( pkg . egg && pkg . egg . framework ) { return assertAndReturn ( pkg . egg . framework , moduleDir ) ; } // 2.2 use egg by default return assertAndReturn ( 'egg' , moduleDir ) ; }