Use npm's semver rules for plugin's nativescript key
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
- Ambito
- cli, mobile-dev
Direzione di ricerca
Inizia con il flusso di verifica di tns plugin add e la sezione nativescript dei file package.json dei plugin; verifica come vengono attualmente confrontate le versioni del runtime. Usa gli intervalli semver documentati da npm, in modo che i valori esatti, con caret e con tilde producano il comportamento di compatibilità proposto, e verifica con dei test sia le versioni del runtime supportate sia quelle rifiutate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem with plugins verification with runtimes
Currently each NativeScript plugin must have nativescript key in it's package.json and define the minimum required version of each supported runtime. The structure is :
"name": "my-plugin",
"version": "1.0.0",
"nativescript": {
"platforms": {
"ios": "1.5.0",
"android": "1.5.0",
}
}
When tns plugin add my-plugin is executed, CLI checks the values against current runtimes versions and informs the user if a plugin cannot be used with current version.
However CLI uses the specified version in the plugin as minimum required. So for example in case the project uses tns-android 1.6.0, 1.6.2 or even 2.0.0 for example, it can use my-plugin.
This makes it really hard to control the versions against which the plugin is tested and verified by the plugin author.
Suggested solution
Do not reinvent the wheel!
Use semver rules for the nativescript key in package.json, for example:
"name": "my-plugin",
"version": "1.0.0",
"nativescript": {
"platforms": {
"ios": "^1.5.0",
"android": "~1.5.0",
}
}
This way in case the project targets android 1.5.2, the plugin can be installed, but in case it targets 1.6.0, the plugin will not be available. More information for the version ranges:
https://docs.npmjs.com/getting-started/semantic-versioning#semver-for-consumers
Breaking change
In case we implement this idea, all plugins, which currently has nativescript key inside their package.json, will not work, as the values: "1.5.0" will mean - can work with this version only.
- Lingua principale
- JavaScript
- Stelle
- 1.1k
- Fork
- 204
- Merge medio
- 1g 9h
- PR unite (30g)
- 8
Guida per i contributori
Apri 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 NativeScript/nativescript-cli
-
in-progress
NativeScript/nativescript-cli#6140 · 2 commenti · 1 assegnatario ·
-
NativeScript/nativescript-cli#6090 · 1 assegnatario ·
-
in progress
NativeScript/nativescript-cli#6015 · 1 reazione · 1 assegnatario ·
-
question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
NativeScript/nativescript-cli#5992 · 5 commenti ·
-
feature-pending-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
NativeScript/nativescript-cli#5975 ·
Tutte le issue di NativeScript/nativescript-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Seeed-Studio/wiki-documents#5655 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Edit: CW+ Apertachannels:edit check:passed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
01 type: bug 30 needs: triage 99 tag: UX Accessibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
quarto-dev/quarto-cli#14915 ·