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

Breaking API change: Export promise #33

Open
andywer opened this issue Oct 18, 2019 · 0 comments
Open

Breaking API change: Export promise #33

andywer opened this issue Oct 18, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@andywer
Copy link
Owner

andywer commented Oct 18, 2019

Instead of having to manually call puppet.exit(), make it a convention-based API:

Each JS/TS entrypoint must export default a promise or a function returning a promise. When this promise resolves, the script is considered to be finished.

Allow manual dynamic tasks by calling puppet.run(functionOrPromise).

If you export / run a function, we can pass the original shell argv and runtime data created by plugins.

For your convenience:
Consider that the script might be a CommonJS module, not an ES module. Also gracefully deal with entrypoint functions that don't return a promise.

@andywer andywer added the enhancement New feature or request label Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant