@@ -168,7 +168,6 @@ export class TypeScriptPlugin {
168
168
169
169
if ( ! this . originalServicePath ) {
170
170
// Save original service path and functions
171
- // console.error('HEYO! ' + JSON.stringify({v: this.serverless['version'], serverlessPath: this.serverless.config['serverlessPath'], serviceDir: this.serverless.config['serviceDir'], slsServiceDir: this.serverless['serviceDir'], top: Object.keys(this.serverless), conf: Object.keys(this.serverless.config)}))
172
171
this . originalServicePath = this . getServicePath ( )
173
172
// Fake service path so that serverless will know what to zip
174
173
this . setServicePath ( path . join ( this . originalServicePath , BUILD_FOLDER ) )
@@ -190,8 +189,6 @@ export class TypeScriptPlugin {
190
189
191
190
const emitedFiles = await typescript . run ( this . rootFileNames , tsconfig )
192
191
this . serverless . cli . log ( 'Typescript compiled.' )
193
- // this.setServicePath(this.originalServicePath)
194
- // this.originalServicePath = null
195
192
return emitedFiles
196
193
}
197
194
@@ -201,7 +198,6 @@ export class TypeScriptPlugin {
201
198
202
199
private getServicePath ( ) : string {
203
200
const path = this . serverless . config . servicePath || this . serverless . config . serviceDir
204
- // const path = 'servicePath' in this.serverless.config ? this.serverless.config.servicePath : this.serverless.config.serviceDir
205
201
if ( ! path ) {
206
202
throw new Error ( 'Could not find serverless serviceDir or servicePath' )
207
203
}
@@ -211,12 +207,6 @@ export class TypeScriptPlugin {
211
207
private setServicePath ( value : string ) {
212
208
this . serverless . config . serviceDir = value
213
209
this . serverless . config . servicePath = value
214
- // if ('serviceDir' in this.serverless.config) {
215
- // // serverless V3 config
216
- // }
217
- // else {
218
- // // Serverless <V3 config
219
- // }
220
210
}
221
211
222
212
/**
@@ -228,7 +218,6 @@ export class TypeScriptPlugin {
228
218
const { service } = this . serverless
229
219
230
220
const patterns = [ ...( service . package . include || [ ] ) , ...( service . package . patterns || [ ] ) ]
231
- this . serverless . cli . log ( `TS: copyExtras: ${ JSON . stringify ( patterns ) } ` )
232
221
// include any "extras" from the "include" section
233
222
if ( patterns . length > 0 ) {
234
223
const files = await globby ( patterns )
@@ -254,7 +243,6 @@ export class TypeScriptPlugin {
254
243
* @param isPackaging Provided if serverless is packaging the service for deployment
255
244
*/
256
245
async copyDependencies ( isPackaging = false ) {
257
- this . serverless . cli . log ( 'TS: copyDependencies' )
258
246
const outPkgPath = path . resolve ( path . join ( BUILD_FOLDER , 'package.json' ) )
259
247
const outModulesPath = path . resolve ( path . join ( BUILD_FOLDER , 'node_modules' ) )
260
248
@@ -288,7 +276,6 @@ export class TypeScriptPlugin {
288
276
path . join ( this . getRealServicePath ( ) , BUILD_FOLDER , SERVERLESS_FOLDER ) ,
289
277
path . basename ( oldHome )
290
278
)
291
- this . serverless . cli . log ( `TS: copying ${ oldHome } to ${ newHome } ` )
292
279
await fs . copy ( oldHome , newHome )
293
280
functionObject . package . artifact = newHome
294
281
}
@@ -302,12 +289,10 @@ export class TypeScriptPlugin {
302
289
async moveArtifacts ( ) : Promise < void > {
303
290
const { service } = this . serverless
304
291
305
- this . serverless . cli . log ( 'TS: moveArtifacts .serverless' )
306
292
await fs . copy (
307
293
path . join ( this . getRealServicePath ( ) , BUILD_FOLDER , SERVERLESS_FOLDER ) ,
308
294
path . join ( this . getRealServicePath ( ) , SERVERLESS_FOLDER )
309
295
)
310
- this . serverless . cli . log ( 'TS: post-copy' )
311
296
312
297
const layerNames = service . getAllLayers ( )
313
298
layerNames . forEach ( name => {
@@ -316,7 +301,6 @@ export class TypeScriptPlugin {
316
301
SERVERLESS_FOLDER ,
317
302
path . basename ( service . layers [ name ] . package . artifact )
318
303
)
319
- this . serverless . cli . log ( 'TS: ' + name + ' ' + service . layers [ name ] . package . artifact )
320
304
} )
321
305
322
306
if ( this . options . function ) {
@@ -338,7 +322,6 @@ export class TypeScriptPlugin {
338
322
SERVERLESS_FOLDER ,
339
323
path . basename ( service . functions [ name ] . package . artifact )
340
324
)
341
- this . serverless . cli . log ( `TS: ${ name } - ${ service . functions [ name ] . package . artifact } ` )
342
325
} )
343
326
return
344
327
}
@@ -348,11 +331,9 @@ export class TypeScriptPlugin {
348
331
SERVERLESS_FOLDER ,
349
332
path . basename ( service . package . artifact )
350
333
)
351
- this . serverless . cli . log ( `TS: service.package.artifact: ${ service . package . artifact } ` )
352
334
}
353
335
354
336
async cleanup ( ) : Promise < void > {
355
- this . serverless . cli . log ( 'TS: cleanup' )
356
337
await this . moveArtifacts ( )
357
338
// Restore service path
358
339
this . setServicePath ( this . originalServicePath )
0 commit comments