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

miniprogram-to-uniapp

v2.2.6

Published

轻松将各种小程序转换为 uni-app 项目

Downloads

1,639

Readme

转换各种小程序为 uni-app 项目 v2.0

支持转换微信、QQ、头条/抖音、支付宝/钉钉和百度等小程序转换到 uni-app 项目

输入小程序项目路径,即可输出 uni-app 项目。

工具同时支持 Npm 安装 和 HbuilderX 插件(不依赖环境) 两种形式安装,安装方式如下:

Npm 安装

$ npm install miniprogram-to-uniapp -g

使用方法

Usage: wtu [options]

Options:

  -V, --version          output the version number [版本信息]
  -i, --input <target>   the input path for weixin miniprogram project [输入目录]
  -h, --help             output usage information [帮助信息]
  -c, --cli              the type of output project is vue-cli, which default value is false [是否转换为vue-cli项目,默认false]
  -m, --merge            merge wxss file into vue file, which default value is false [是否合并wxss到vue文件,默认false]
  -t, --template         transform template and include to component, which default value is false [转换template和include为单独组件,默认false]

示例:

默认转换:
$ wtu -i "./miniprogram-project"

注:"./miniprogram-project" 是要转换的小程序项目目录,如路径中有空格应该用引号引起来。

将 wxss 合并入 vue 文件:
$ wtu -i "./miniprogram-project" -m
转换项目为 vue-cli 项目:
$ wtu -i "./miniprogram-project" -c
将 template 里面的 import/template 和 include 标签转换为单独组件(实验性):
$ wtu -i "./miniprogram-project" -t

待命令行运行结束,会在小程序项目的同级目录有以 小程序项目名 + "_uni" 或 小程序目录名 + "_uni-cli" 目录,即是转换好的 uni-app 项目,转换好后,请使用 HBuilderX 导入并运行。

HbuilderX 插件安装

请参考项目:【HBuilder X 插件】 转换各种小程序为 uni-app 项目 进行食用。

说明文档

关于本工具转换原理及常见问题,请见:miniprogram-to-uniapp文档

问题答疑

对于使用有疑问或建议,欢迎加入 QQ 群进行指导和交流。

交流 QQ 群:

1 群:780359397 (已满)

2 群:361784059 (已满)

3 群:603659851 (已满)

4 群:555691239

参考资料

  1. GoGoCode 工具主要转换逻辑依赖 GoGoCode 构建
  2. 工具使用mp-html替换 wxParse
  3. 工具使用全兼容官方 picker mode=region 城市选择器替换 <picker mode="region"></picker>
  4. [AST 实战]从零开始写一个 wepy 转 VUE 的工具
  5. https://astexplorer.net/ AST 可视化工具
  6. Babylon-AST 初探-代码生成(Create) 系列文章
  7. Babel 插件手册 中文版 Babel 插件手册
  8. Babel 官网 有问题直接阅读官方文档哈
  9. 微信小程序转换 uni-app 详细指南 补充了我一些未考虑到的规则。

最后

如果觉得帮助到你的话,可以支持一下作者,请作者喝杯咖啡哈~

这样会更有动力更新哈~~

非常感谢~~

微信支付 支付宝支付

LICENSE

This repo is released under the Apache License 2.0.