@@ -47,6 +47,7 @@ export type AppGeneratorArguments = FeathersBaseContext & Partial<AppGeneratorDa
4747
4848export const generate = ( ctx : AppGeneratorArguments ) =>
4949 generator ( ctx )
50+ . then ( initializeBaseContext ( ) )
5051 . then ( ( ctx ) => ( {
5152 ...ctx ,
5253 dependencies : [ ] ,
@@ -104,7 +105,8 @@ export const generate = (ctx: AppGeneratorArguments) =>
104105 message : 'Which package manager are you using?' ,
105106 choices : [
106107 { value : 'npm' , name : 'npm' } ,
107- { value : 'yarn' , name : 'Yarn' }
108+ { value : 'yarn' , name : 'Yarn' } ,
109+ { value : 'pnpm' , name : 'pnpm' }
108110 ]
109111 } ,
110112 ...connectionPrompts ( ctx ) ,
@@ -149,50 +151,58 @@ export const generate = (ctx: AppGeneratorArguments) =>
149151 )
150152 )
151153 . then (
152- install < AppGeneratorContext > ( ( { transports, framework, dependencyVersions, dependencies } ) => {
153- const hasSocketio = transports . includes ( 'websockets' )
154+ install < AppGeneratorContext > (
155+ ( { transports, framework, dependencyVersions, dependencies } ) => {
156+ const hasSocketio = transports . includes ( 'websockets' )
154157
155- dependencies . push (
156- '@feathersjs/feathers' ,
157- '@feathersjs/errors' ,
158- '@feathersjs/schema' ,
159- '@feathersjs/configuration' ,
160- '@feathersjs/transport-commons' ,
161- '@feathersjs/authentication' ,
162- 'winston'
163- )
158+ dependencies . push (
159+ '@feathersjs/feathers' ,
160+ '@feathersjs/errors' ,
161+ '@feathersjs/schema' ,
162+ '@feathersjs/configuration' ,
163+ '@feathersjs/transport-commons' ,
164+ '@feathersjs/authentication' ,
165+ 'winston'
166+ )
164167
165- if ( hasSocketio ) {
166- dependencies . push ( '@feathersjs/socketio' )
167- }
168+ if ( hasSocketio ) {
169+ dependencies . push ( '@feathersjs/socketio' )
170+ }
168171
169- if ( framework === 'koa' ) {
170- dependencies . push ( '@feathersjs/koa' , 'koa-static' )
171- }
172+ if ( framework === 'koa' ) {
173+ dependencies . push ( '@feathersjs/koa' , 'koa-static' )
174+ }
172175
173- if ( framework === 'express' ) {
174- dependencies . push ( '@feathersjs/express' , 'compression' )
175- }
176+ if ( framework === 'express' ) {
177+ dependencies . push ( '@feathersjs/express' , 'compression' )
178+ }
176179
177- return addVersions ( dependencies , dependencyVersions )
178- } )
180+ return addVersions ( dependencies , dependencyVersions )
181+ } ,
182+ false ,
183+ ctx . packager
184+ )
179185 )
180186 . then (
181- install < AppGeneratorContext > ( ( { language, framework, devDependencies, dependencyVersions } ) => {
182- devDependencies . push ( 'nodemon' , 'axios' , 'mocha' , 'cross-env' , 'prettier' )
187+ install < AppGeneratorContext > (
188+ ( { language, framework, devDependencies, dependencyVersions } ) => {
189+ devDependencies . push ( 'nodemon' , 'axios' , 'mocha' , 'cross-env' , 'prettier' , '@feathersjs/cli' )
183190
184- if ( language === 'ts' ) {
185- devDependencies . push (
186- '@types/mocha' ,
187- framework === 'koa' ? '@types/koa-static' : '@types/compression' ,
188- '@types/node' ,
189- 'nodemon' ,
190- 'ts-node' ,
191- 'typescript' ,
192- 'shx'
193- )
194- }
191+ if ( language === 'ts' ) {
192+ devDependencies . push (
193+ '@types/mocha' ,
194+ framework === 'koa' ? '@types/koa-static' : '@types/compression' ,
195+ '@types/node' ,
196+ 'nodemon' ,
197+ 'ts-node' ,
198+ 'typescript' ,
199+ 'shx'
200+ )
201+ }
195202
196- return addVersions ( devDependencies , dependencyVersions )
197- } , true )
203+ return addVersions ( devDependencies , dependencyVersions )
204+ } ,
205+ true ,
206+ ctx . packager
207+ )
198208 )
0 commit comments