npm i --save nativescript-fonepaisa
- 版本:1.0.2
- GitHub: https://github.com/tushar-1health/nativescript-fonepaisa
- NPM: https://npmjs.net.cn/package/nativescript-fonepaisa
- 下载
- 昨天: 0
- 上周: 0
- 上个月: 5
开发 NativeScript 插件
入门
git clone https://github.com/NathanWalker/nativescript-plugin-seed.git myplugin
cd myplugin
npm run postclone
npm run setup
- 开始工作。
这个种子扩展了在这里介绍的几个方面。
用法
种子已准备就绪,允许您通过 demo
文件夹测试和试用您的插件。此外,它还提供了一个适当的 .gitignore
,以保持 GitHub 的整洁,以及 .npmignore
,以确保您通过 npm 发布插件时每个人都很满意。
链接到 CocoaPod 或 Android Arsenal 插件
您需要在根目录下创建这些文件夹和文件
platforms --
ios --
Podfile
android --
include.gradle
这样做将使这些原生 api 对您的插件开放 :)
查看这些现有插件了解如何非常简单地做到这一点
典型开发工作流程
- 修改插件文件
- 在
demo
中进行更改,以测试这些更改 npm run demo.ios
或npm run demo.android
(必须从根目录运行)
这些 demo
任务只是通用助手。您可能希望对要运行的设备和/或模拟器有更细粒度的控制。为此,您可以手动运行这些操作
cd demo
// when developing, to ensure the latest code is built into the demo, it's a guarantee to remove the plugin and add it back
tns plugin remove nativescript-fonepaisa
tns plugin add ..
// manual platform adds
tns platform add ios
// and/or
tns platform add android
然后使用 tns
命令行中的任何可用选项
单元测试
此插件自动为您的插件添加基于 Jasmine 的单元测试支持。打开 demo/app/tests/tests.js
并调整其内容。
您可以在这里了解更多关于此主题的信息。
一旦您准备好测试插件 API,请在插件根目录中执行以下其中一个命令
npm run test.ios
npm run test.android
发布
当您准备发布时
- 在
package.json
中增加版本号 npm run build
- 非常重要 - 在您发布之前确保构建了最新版本npm publish
贡献 - 想要使种子更好吗?
或者至少帮助保持它与 NativeScript 发布保持最新,这将非常出色。
npm install -g typescript // if you don't already have it
git clone https://github.com/NathanWalker/nativescript-plugin-seed
cd nativescript-plugin-seed
// Improve!