GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - raxjs/universal-api: Universal apis for web and miniapps.

BranchesTags
Open more actions menu

Latest commit

 

History

550 Commits
550 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
docs
docs
 
 
scripts
scripts
 
 
src
src
 
 
types
types
 
 
.czrc
.czrc
 
 
.editorconfig
.editorconfig
 
 
.eslintignore
.eslintignore
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.prettierrc
.prettierrc
 
 
.umirc.js
.umirc.js
 
 
README.en-US.md
README.en-US.md
 
 
README.md
README.md
 
 
api-config.js
api-config.js
 
 
build.json
build.json
 
 
commitlint.config.js
commitlint.config.js
 
 
jest.config.js
jest.config.js
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Rax

Uni API 是一套支持小程序和 Web 容器的跨端 API 解决方案。


🎉 多容器支持 目前支持 Web、微信小程序、头条小程序、阿里小程序、百度小程序、快手小程序

🐂 API 丰富 覆盖 90+ API 实现

😯 文档完善 提供双语文档、丰富样例

0️⃣ 无框架依赖 无框架依赖,纯原生实现,可以兼容任意框架

🚀 极致体积 支持按需加载,按环境剔除无用代码

👍🏻 简易使用,快速接入 提供完善的 TypeScript 声明,让你可以摆脱文档,沉浸编程

快速使用

以 @uni/toast 为例

$ npm install @uni/toast
import { showToast } from '@uni/toast';

// string
showToast('Hi');

// object
showToast({
  content: 'hello',
  type: 'success',
  duration: 1000,
  success: () => {
    console.log('toast')
  }
});

// promise
showToast({
  content: 'hello',
  type: 'success',
  duration: 1000,
}).then(() => {});

文档

官方站点:https://universal-api.js.org/

示例

微信小程序 支付宝小程序

贡献代码

请首先阅读 Rax 贡献代码指南,了解基础的规范。

起步

$ git clone [email protected]:raxjs/universal-api.git
$ yarn
$ yarn build

调试 API

$ yarn demo:init
$ yarn demo:dev

然后使用小程序 IDE 即可开始调试:

更新版本

API package 版本统一维护在根目录下的api-config.js,以 @uni/toast 为例:

module.exports = {
  toast: {
    path: 'src/packages/interactive/toast/src/index.ts',
    pkgInfo: [
      {
        version: '1.0.5',
        name: '@uni/toast',
      },
    ],
  },
}
参数 含义 默认值
path 在源文件的路径 -
pkgInfo npm包的属性(同packagejson写法) -
needCommonUtil 是否需要公共utils true
unNeedSplit 是否需要安环境分包 false

大包版本需要更新根目录下的 package.json 的 version

协议

BSD License

About

Universal apis for web and miniapps.

universal-api.js.org/

Topics

mini-programminiappraxuniversal-apiswechatwechat-mini-program

Resources

Readme
Activity
Custom properties

Stars

269 stars

Watchers

17 watching

Forks

61 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.