NativeScript / NativeScript/nativescript-cli
Use npm's semver rules for plugin's nativescript key
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 1.1k
- 分支
- 204
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 8
描述
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 tns plugin add 的驗證流程以及外掛程式 package.json 檔案中的 nativescript 區段著手;檢查目前如何比較執行階段版本。使用 npm 文件說明的 semver 範圍,讓精確值、caret 和 tilde 值產生所提議的相容性行為,並透過測試驗證受支援和遭拒絕的執行階段版本。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, node.js
- 領域
- cli, mobile-dev
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100