andywer / andywer/puppet-run

Breaking API change: Export promise

Aperta
#33 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
56
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.