Skip to content

Commit 70dd1d6

Browse files
author
John Reeves
committed
chore(serverless#281): cleanup commented out code, remove logging
1 parent 953c437 commit 70dd1d6

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/index.ts

-19
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export class TypeScriptPlugin {
168168

169169
if (!this.originalServicePath) {
170170
// 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)}))
172171
this.originalServicePath = this.getServicePath()
173172
// Fake service path so that serverless will know what to zip
174173
this.setServicePath(path.join(this.originalServicePath, BUILD_FOLDER))
@@ -190,8 +189,6 @@ export class TypeScriptPlugin {
190189

191190
const emitedFiles = await typescript.run(this.rootFileNames, tsconfig)
192191
this.serverless.cli.log('Typescript compiled.')
193-
// this.setServicePath(this.originalServicePath)
194-
// this.originalServicePath = null
195192
return emitedFiles
196193
}
197194

@@ -201,7 +198,6 @@ export class TypeScriptPlugin {
201198

202199
private getServicePath(): string {
203200
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
205201
if (!path) {
206202
throw new Error('Could not find serverless serviceDir or servicePath')
207203
}
@@ -211,12 +207,6 @@ export class TypeScriptPlugin {
211207
private setServicePath(value: string) {
212208
this.serverless.config.serviceDir = value
213209
this.serverless.config.servicePath = value
214-
// if ('serviceDir' in this.serverless.config) {
215-
// // serverless V3 config
216-
// }
217-
// else {
218-
// // Serverless <V3 config
219-
// }
220210
}
221211

222212
/**
@@ -228,7 +218,6 @@ export class TypeScriptPlugin {
228218
const { service } = this.serverless
229219

230220
const patterns = [...(service.package.include || []), ...(service.package.patterns || [])]
231-
this.serverless.cli.log(`TS: copyExtras: ${JSON.stringify(patterns)}`)
232221
// include any "extras" from the "include" section
233222
if (patterns.length > 0) {
234223
const files = await globby(patterns)
@@ -254,7 +243,6 @@ export class TypeScriptPlugin {
254243
* @param isPackaging Provided if serverless is packaging the service for deployment
255244
*/
256245
async copyDependencies(isPackaging = false) {
257-
this.serverless.cli.log('TS: copyDependencies')
258246
const outPkgPath = path.resolve(path.join(BUILD_FOLDER, 'package.json'))
259247
const outModulesPath = path.resolve(path.join(BUILD_FOLDER, 'node_modules'))
260248

@@ -288,7 +276,6 @@ export class TypeScriptPlugin {
288276
path.join(this.getRealServicePath(), BUILD_FOLDER, SERVERLESS_FOLDER),
289277
path.basename(oldHome)
290278
)
291-
this.serverless.cli.log(`TS: copying ${oldHome} to ${newHome}`)
292279
await fs.copy(oldHome, newHome)
293280
functionObject.package.artifact = newHome
294281
}
@@ -302,12 +289,10 @@ export class TypeScriptPlugin {
302289
async moveArtifacts(): Promise<void> {
303290
const { service } = this.serverless
304291

305-
this.serverless.cli.log('TS: moveArtifacts .serverless')
306292
await fs.copy(
307293
path.join(this.getRealServicePath(), BUILD_FOLDER, SERVERLESS_FOLDER),
308294
path.join(this.getRealServicePath(), SERVERLESS_FOLDER)
309295
)
310-
this.serverless.cli.log('TS: post-copy')
311296

312297
const layerNames = service.getAllLayers()
313298
layerNames.forEach(name => {
@@ -316,7 +301,6 @@ export class TypeScriptPlugin {
316301
SERVERLESS_FOLDER,
317302
path.basename(service.layers[name].package.artifact)
318303
)
319-
this.serverless.cli.log('TS: ' + name + ' ' + service.layers[name].package.artifact)
320304
})
321305

322306
if (this.options.function) {
@@ -338,7 +322,6 @@ export class TypeScriptPlugin {
338322
SERVERLESS_FOLDER,
339323
path.basename(service.functions[name].package.artifact)
340324
)
341-
this.serverless.cli.log(`TS: ${name} - ${service.functions[name].package.artifact}`)
342325
})
343326
return
344327
}
@@ -348,11 +331,9 @@ export class TypeScriptPlugin {
348331
SERVERLESS_FOLDER,
349332
path.basename(service.package.artifact)
350333
)
351-
this.serverless.cli.log(`TS: service.package.artifact: ${service.package.artifact}`)
352334
}
353335

354336
async cleanup(): Promise<void> {
355-
this.serverless.cli.log('TS: cleanup')
356337
await this.moveArtifacts()
357338
// Restore service path
358339
this.setServicePath(this.originalServicePath)

0 commit comments

Comments
 (0)