kuashe / serverless-async-await

Frictionless Async Await transpiling for Serverless in Node 0.12 and above
8 stars 3 forks source link

Handle more complex module structures #5

Closed nilsga closed 7 years ago

nilsga commented 7 years ago

I got a few issues when trying out the plugin in a more complex structure where I had a serverless project with individual handler directories with their own npm modules. The problem was that it did not exclude all node_modules directories from the files to transpile, and it also include stuff twice due to entries matching multiple listings in in listFilesFoldersToCopy.

nilsga commented 7 years ago

A somewhat unfortunate side effect of this change is that one of the templates, cloudformation-template-create-stack.json is not created because it is no longer included (by accident perhaps?) by the now "stricter" globs. And since this.serverless.config.servicePath = pluginOutputPath happens in transpileProject, which is executed after the aws plugin has created this template, it is not generated in the build folder of the plugin, so waitForFiles won't see it, and hang. So this file either needs to be included too, or this plugin needs to hook into a phase earlier than the aws plugin to set the service path before it generates this template.

kuashe commented 7 years ago

Only for the nested folders or for a simple project too ? The test passed when looking for cloudformation-template-create-stack.json

nilsga commented 7 years ago

I would think it was the same regardless of structure.