Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate js for other plugins #1

Open
colinfindlay-nz opened this issue Apr 20, 2017 · 8 comments
Open

Generate js for other plugins #1

colinfindlay-nz opened this issue Apr 20, 2017 · 8 comments

Comments

@colinfindlay-nz
Copy link

Is it possible to generate the JavaScript into the .build folder for other plugins to use? I.e. The mocha unit testing plugin and the offline plugin?

@schickling
Copy link
Contributor

Could you describe your use case with a bit more details pls?

@colinfindlay-nz
Copy link
Author

Currently your plugin only generates the JavaScript before deployment. This means that all other serverless plugins are unable to work if they don't do a deployment.
The best example is the SC5 serverless-mocha-plugin

@schickling
Copy link
Contributor

So you'd like to have a separate command to build from typescript to javascript?

@colinfindlay-nz
Copy link
Author

colinfindlay-nz commented Apr 23, 2017 via email

@schickling
Copy link
Contributor

A separate command is certainly doable. However, combining this plugin with other plugins could be problematic with the current plugin infrastructure provided by Serverless. Maybe @pmuens can provide some feedback on when this might change?

@pmuens
Copy link

pmuens commented Apr 28, 2017

Hey @silver2k the TypeScript plugin could expose own lifecycle events which can then be used to hook into via your own custom plugin.

Here you can e.g. see the lifecycle events of the main Serverless package plugin (https://github.com/serverless/serverless/blob/e82e6265e3f9bcd62ac907f576b284f35c7863f4/lib/plugins/package/package.js#L26-L34) and here's an example how to hook into the package:createDeploymentArtifacts lifecycle event (https://github.com/serverless/serverless/blob/e82e6265e3f9bcd62ac907f576b284f35c7863f4/lib/plugins/package/package.js#L61-L62).

The only thing to note is that you'll then have a dependency to the TypeScript plugin. So you need to make sure that both plugins are installed / usable.

@kandros
Copy link
Contributor

kandros commented Apr 28, 2017

having a custom lifecycle would also make it easier to test i think

@schickling
Copy link
Contributor

@kandros would you be up for creating a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants