Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@weimob-cloud/matrix

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weimob-cloud/matrix

Command line interface for convert miniprogram to react.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

wm-cloud-matrix

wm-cloud-matrix 介绍

这是一个尝试将 微信小程序的组件或页面 转换成 React组件 的编译转换工具。 同时也支持带条件编译的小程序代码编译为小程序平台的代码和H5平台的React代码。

用户安装使用

有两种使用方式:

一、JS API
$ npm install @weimob-cloud/matrix --save
const wmatrix = require('@weimob-cloud/matrix')
wmatrix.build(options)
Options
字段类型含义默认值/参数可选值
rootString项目根目录process.cwd()-
targetString编译目标平台allall h5 xapp
entryString/Array待编译的组件的相对路径./wmxapp./wmxapp 该目录下所有组件 \ ./wmxapp/comp1 ./wmxapp/comp2 指定单个组件或多个组件
outdirh5Stringh5平台的编译输出路径./web-
outdirxappString小程序平台的编译输出路径./xapp-
doneFunction编译完成后的回调函数f(成功组件,失败组件,耗时){}-
二、命令行工具
$ npm install -g @weimob-cloud/matrix

$ matrix -r /Users/xxx/.../myproject -e ./wmxapp/comp1 ./wmxapp/comp2 -oh ./web -ox ./xapp
or
$ matrix -e ./xapp
命令行参数的options:
option简写含义默认值/参数可选值
--root-r项目根目录process.cwd()-
--target-t编译目标平台allall h5 xapp
--entry-e待编译的组件的相对路径./wmxapp-
--outdirh5-ohh5平台的编译输出路径./web-
--outdirxapp-ox小程序平台的编译输出路径./xapp-

开发者参与开发

环境准备

  1. node: "12.x || >=14.0.0"
  2. npm: 与node配套即可
  3. 包管理工具:npm,镜像源:微盟镜像源,已默认配置.npmrc

本地联调方法

在vscode工具中配置launch.json

编译打包

$ npm run build

注:打包后最好测试一下功能是否正常,因为开发用ESM,打包后是CommonJS,会有部分差异。

Keywords

FAQs

Package last updated on 09 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc