npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alitajs/cordova

v2.9.0

Published

umi support cordova

Downloads

172

Readme

@alitajs/cordova

NPM version NPM downloads

umi support cordova

Usage

安装环境(Mac)

1.安装 XCode

2.安装 xcode-select

xcode-select --install

弹出软件一直下一步就好。

3.安装 ios-deploy

sudo yarn global add ios-deploy

4.全局安装 Cordova

sudo yarn global add cordova

接入 cordova

umi 项目

Configure in .umirc.js,

yarn add @alitajs/cordova
export default {
  plugins: ['@alitajs/cordova'],
  cordova: {
    packageId: '',
    displayName: '',
  },
};

alita 项目

Configure in config/config.js,

export default {
  appType: 'cordova',
};

添加 cordova 初始化命令

如果你全局安装了 umi ,可以使用umi cordova --init --ios

如果你没有全局安装 umi ,可以在 package.json 里面添加 scripts

{
  "scripts": {
    "cordova-init": "umi cordova --init",
    "cordova-add-ios": "umi cordova --ios",
    "cordova-add-android": "umi cordova --android",
    "start": "umi dev",
    "start-cordova-android": "CORDOVA=android umi dev",
    "build-cordova-android": "CORDOVA=android umi build",
    "build": "umi build"
  }
}

| 参数 | 说明 | | :-------- | :-------------------------------------------: | | --init | 初始化 Cordova 项目,添加配置文件和相关文件夹 | | --ios | 执行 cordova platforms add ios | | --android | 执行 cordova platforms add android |

环境变量 CORDOVA

默认使用的平台是 ios,如果开发安卓,需要设置环境变量

如果umi cordova --init --ios 一直没有动静,可以ctrl+c关闭进程,手动执行cordova platforms add ios

启动项目

开发环境执行 umi dev dev 环境有热更新,如果使用手机查看,要求需要在统一个网络环境下。

编译执行umi build

使用xcode打开项目 ./platforms/ios/Tutorial.xcworkspace 选择虚拟机,执行。

虚拟机中查看效果 umi-cordova.png

注意事项

Mac

Xcode10 要修改编译系统 File->Workspace Setting ioshelp 修改 Build System -> Legacy Build System ioshelp

Android Studio

umi devumi build 的时候要设置环境变量CORDOVA=android

如果使用的是 Mac,可以通过命令安装 java 环境

brew cask install java

对安卓开发不熟悉的朋友,注意看右下角的窗口,会有提示需要安装 sdk,先装完 sdk。

The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Open Manifest File
Move minSdkVersion to build file and sync project

点击 “Move minSdkVersion to build file and sync project”

接着点击运行项目,在 Android Studio 右上角,点击绿色小三角形按钮。

然后选择一个模拟器,如果没有就点击左下角新建,随便选一个你喜欢的下载,然后弹出提示全部选择蓝色默认的选项一直下一步。(就是选择完成,安装,之类的)。

androidsuccess

LICENSE

MIT