andywer / andywer/puppet-run

Breaking API change: Export promise

Ouverte
#33 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
TypeScript
Étoiles
56
Forks
2
Métriques de merge des PR
Aucune PR mergée en 30 j

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.