[RRFC] Build Google Wireit's script runner into npm
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- cli, developer-experience, tooling
Direzione di ricerca
Inizia leggendo gli RFC di npm citati (190, 610, 548 e 691) e il repository Google Wireit per confrontare le capacità proposte del script-runner. Il lavoro sarà considerato completato quando sarà stato concordato l’ambito per integrare script objects, dependency graphs, caching, watch mode e long-running services in npm.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Motivation ("The Why")
There are a number of tools, and RRFCs (https://github.com/npm/rfcs/issues/190, https://github.com/npm/rfcs/issues/610 and https://github.com/npm/rfcs/issues/548, https://github.com/npm/rfcs/issues/691) that relate to running scripts in series, parallel, etc.
I opened https://github.com/npm/rfcs/issues/691 as a proposal to add pluggable script runners to npm to make using tools like Wireit easier. While I think that is a good idea, I honestly think that an even better solution is to build Wireit directly into npm, giving all npm uses the ability to define a graph of scripts and utilize caching, watch mode, and long-running services.
Wireit has a very robust feature set and implementation at this point, and has been designed to fit very seamlessly with the npm CLI's interface, configuration and workflow. It is not a tool that takes over and works over-top of npm, but one that tries to be as much of a part of npm as possible. As such, I think it should be quite easy to integrate with npm compared to tools that have their own CLI, config, and implementation (sometimes in non-JS languages).
Adding a full script graph with caching would solve all of the open issues around more powerful script running, and several issues that third-party tools cover now. For example, output caching can save significant build time for developers and CI. Services with watch mode make rebuilding and restarting servers on code changes (similar to nodemon) fast and seamless.
Example
It's probably best to view the Wireit repo for many examples of its features.
A basic Wireite configuration with dependencies between scripts looks like:
{
"scripts": {
"build": "wireit",
"bundle": "wireit"
},
"wireit": {
"build": {
"command": "tsc"
},
"bundle": {
"command": "rollup -c",
"dependencies": ["build"]
}
}
}
Integrated into npm, this could look like:
{
"scripts": {
"build": "tsc",
"bundle": {
"command": "rollup -c",
"dependencies": ["build"]
}
}
}
How
Current Behaviour
Currently, scripts are just strings with the command to run.
Desired Behaviour
I propose making scripts objects that describe their command, dependencies, inputs and output files (for caching) and more.
References
- https://github.com/npm/rfcs/issues/190
- https://github.com/npm/rfcs/issues/610
- https://github.com/npm/rfcs/issues/548
- https://github.com/npm/rfcs/issues/691
cc @aomarks, the author of Wireit
- Lingua principale
- JavaScript
- Stelle
- 780
- Fork
- 266
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di npm/rfcs
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Issue simili
-
docs: add SECURITY.md vulnerability reporting policyForse già presa @AK-Lmn l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
flisk-sh/linux2wasm#12 ·
I maintainer di solito rispondono entro 1 giorno
-
possible bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Mintplex-Labs/anything-llm#7388 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
I maintainer di solito rispondono entro 1 giorno
-
v6: Minified bootstrap.min.css is missing header infoForse già presa @lazerg l’ha presa oggi. Apertabug build confirmed has-pr v6
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
[workshop-sync] workshop/side-quest-26-01-forecast-costs.md: forecast default history window is inaccurateForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadocumentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
githubnext/gh-aw-workshop#6332 ·
I maintainer di solito rispondono entro 1 giorno