andywer / andywer/puppet-run

Breaking API change: Export promise

Open
#33 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
56
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.