Convert Figma logo to code with AI

cytle logowechat_web_devtools

微信开发者工具(微信小程序)linux完美支持

2,674
428
2,674
90

Top Related Projects

22,616

小程序组件化开发框架

208,514

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

40,560

A cross-platform framework using Vue.js

36,420

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

🦎 一套代码运行多端,一端所见即多端所见

微信小程序组件 / API / 云开发示例

Quick Overview

The cytle/wechat_web_devtools repository is an unofficial Linux port of the WeChat Web DevTools. It allows developers to run WeChat mini-programs and official account development tools on Linux systems, which are officially only supported on Windows and macOS.

Pros

  • Enables WeChat development on Linux platforms
  • Provides a workaround for developers who prefer or require Linux environments
  • Regularly updated to keep pace with official WeChat Web DevTools releases
  • Includes installation scripts and detailed documentation for easy setup

Cons

  • Unofficial port, which may lack full feature parity with official versions
  • Potential for compatibility issues or bugs not present in official releases
  • May require additional setup steps compared to official Windows/macOS versions
  • Could be affected by changes in WeChat's policies or development tools

Getting Started

To install and run the WeChat Web DevTools on Linux:

  1. Clone the repository:

    git clone https://github.com/cytle/wechat_web_devtools.git
    
  2. Navigate to the project directory:

    cd wechat_web_devtools
    
  3. Run the installation script:

    ./bin/wxdt install
    
  4. Launch the WeChat Web DevTools:

    ./bin/wxdt
    

For more detailed instructions and troubleshooting, refer to the project's README.md file.

Competitor Comparisons

22,616

小程序组件化开发框架

Pros of wepy

  • Official framework developed by Tencent, ensuring long-term support and compatibility
  • Offers a Vue.js-like development experience, making it easier for Vue developers to transition
  • Provides a more comprehensive ecosystem with plugins and components

Cons of wepy

  • Steeper learning curve for developers not familiar with Vue.js
  • May introduce additional complexity for simpler projects
  • Less flexibility compared to using native WeChat Mini Program development tools

Code Comparison

wepy:

<template>
  <view>{{ message }}</view>
</template>

<script>
import wepy from 'wepy'

export default class MyComponent extends wepy.component {
  data = {
    message: 'Hello, WePY!'
  }
}
</script>

wechat_web_devtools:

Page({
  data: {
    message: 'Hello, WeChat Mini Program!'
  }
})

wepy provides a more structured, component-based approach similar to Vue.js, while wechat_web_devtools uses the native WeChat Mini Program syntax. wepy's code structure may be more familiar to web developers, but it requires additional compilation steps. wechat_web_devtools offers a more direct development experience within the WeChat ecosystem.

208,514

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

Pros of Vue

  • Larger community and ecosystem, with more resources and third-party libraries
  • More versatile, suitable for a wide range of web applications
  • Better documentation and learning resources

Cons of Vue

  • Steeper learning curve for beginners compared to wechat_web_devtools
  • May be overkill for simple projects or specific WeChat mini-program development
  • Requires additional setup and configuration for WeChat-specific features

Code Comparison

Vue component example:

<template>
  <div>{{ message }}</div>
</template>

<script>
export default {
  data() {
    return {
      message: 'Hello, Vue!'
    }
  }
}
</script>

wechat_web_devtools WeChat mini-program example:

Page({
  data: {
    message: 'Hello, WeChat!'
  },
  onLoad: function() {
    // Page initialization
  }
})

The Vue example shows a component-based structure with separate template and script sections, while the wechat_web_devtools example demonstrates a more straightforward page-based approach specific to WeChat mini-programs.

40,560

A cross-platform framework using Vue.js

Pros of uni-app

  • Cross-platform development: Supports multiple platforms including iOS, Android, Web, and various mini-programs
  • Rich ecosystem: Extensive plugin library and UI components
  • Vue.js-based: Familiar syntax for Vue developers

Cons of uni-app

  • Steeper learning curve: Requires understanding of uni-app specific concepts
  • Limited customization: Some platform-specific features may be challenging to implement

Code Comparison

uni-app:

<template>
  <view>
    <text>{{ message }}</text>
  </view>
</template>

<script>
export default {
  data() {
    return {
      message: 'Hello uni-app!'
    }
  }
}
</script>

wechat_web_devtools:

Page({
  data: {
    message: 'Hello WeChat!'
  }
})

Key Differences

  • uni-app uses Vue.js syntax, while wechat_web_devtools uses WeChat's proprietary framework
  • uni-app offers cross-platform development, whereas wechat_web_devtools is specific to WeChat mini-programs
  • uni-app has a more extensive ecosystem, but wechat_web_devtools provides deeper integration with WeChat features

Use Cases

  • Choose uni-app for cross-platform projects targeting multiple app stores and platforms
  • Opt for wechat_web_devtools when focusing solely on WeChat mini-program development with native WeChat capabilities
36,420

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

Pros of Taro

  • Cross-platform development: Taro supports multiple platforms, including WeChat Mini Programs, H5, React Native, and more
  • Unified development experience: Uses React-like syntax for consistent coding across platforms
  • Active community and regular updates: Maintained by a large team with frequent releases and improvements

Cons of Taro

  • Learning curve: Requires understanding of React concepts and Taro-specific APIs
  • Build process complexity: May require additional configuration for optimal performance across platforms

Code Comparison

Taro (React-like syntax):

import { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'

export default class Index extends Component {
  render() {
    return <View><Text>Hello, World!</Text></View>
  }
}

wechat_web_devtools (Native WeChat Mini Program syntax):

Page({
  data: {},
  onLoad: function() {
    console.log('Page loaded')
  }
})

Key Differences

  • Taro provides a more familiar React-like development experience
  • wechat_web_devtools focuses specifically on WeChat Mini Programs
  • Taro offers greater flexibility for cross-platform development
  • wechat_web_devtools provides a more direct approach to WeChat-specific features

Both projects aim to improve the development experience for WeChat Mini Programs, but Taro extends its reach to multiple platforms while wechat_web_devtools specializes in the WeChat ecosystem.

🦎 一套代码运行多端,一端所见即多端所见

Pros of Chameleon

  • Cross-platform development framework supporting multiple platforms (Web, WeChat Mini Program, Alipay Mini Program, Baidu Smart Program, etc.)
  • Unified development experience with a single codebase for multiple platforms
  • Rich set of UI components and APIs for rapid development

Cons of Chameleon

  • Steeper learning curve due to its custom syntax and framework-specific concepts
  • Potentially less flexibility compared to native platform development
  • May have limitations in accessing certain platform-specific features

Code Comparison

Chameleon:

<template>
  <view>
    <text>Hello, {{name}}!</text>
  </view>
</template>

<script>
class Index {
  data = {
    name: 'Chameleon'
  }
}
export default new Index();
</script>

wechat_web_devtools:

Page({
  data: {
    name: 'WeChat'
  },
  onLoad: function() {
    // Page initialization
  }
})

Key Differences

  • Chameleon uses a Vue-like syntax for component development, while wechat_web_devtools follows WeChat Mini Program's native syntax
  • Chameleon aims for cross-platform compatibility, whereas wechat_web_devtools is specifically for WeChat Mini Program development
  • Chameleon provides a more abstracted development approach, while wechat_web_devtools offers direct access to WeChat-specific APIs and features

微信小程序组件 / API / 云开发示例

Pros of miniprogram-demo

  • Official demo from WeChat, ensuring up-to-date and accurate implementation
  • Comprehensive examples covering various WeChat Mini Program features
  • Well-structured and documented, making it easier for developers to learn and implement

Cons of miniprogram-demo

  • Focused solely on WeChat Mini Program development, lacking cross-platform compatibility
  • May not include advanced or custom implementations that some developers might need

Code Comparison

miniprogram-demo:

Page({
  data: {
    text: 'This is page data.'
  },
  onLoad: function(options) {
    // Page load
  },
  onReady: function() {
    // Page ready
  }
})

wechat_web_devtools:

const nw = require('nw.gui');
const path = require('path');
const fs = require('fs');

function createWindow() {
  // Create window logic
}

The code snippets highlight the different focus of each repository. miniprogram-demo showcases actual WeChat Mini Program page structure and lifecycle methods, while wechat_web_devtools deals with creating a development environment using NW.js.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Linux微信web开发者工具

linux 下使用微信web开发者工具.

wx_dev_tools v1.02.1910121 nw.js v0.24.4

Description

Linux微信web开发者工具, 可在 linux 桌面环境跑起 微信开发者工具, 原理是 微信开发者工具 本质是 nw.js 程序, 把它移植到 linux 下没大问题. 负责编译 wxml 和 wxss 的 wcc 和 wcsc (可能还有其他功能), 则利用 wine 来跑即可.

Usage

下载项目和初始化

git clone https://github.com/cytle/wechat_web_devtools.git
cd wechat_web_devtools
# 自动下载最新 `nw.js` , 同时部署目录 `~/.config/wechat_web_devtools/`
./bin/wxdt install

启动ide,开发和调试网页

运行准备:

  1. GUI环境
./bin/wxdt # 启动

启动ide,开发和预览小程序

运行准备:

  1. GUI环境
  2. 需要安装wine
  3. 并且已经执行过./bin/wxdt install
./bin/wxdt # 启动

命令行和HTTP调用

运行准备:

  1. GUI环境,命令行和HTTP调用会自动启动ide(服务器没条件的可以使用docker)
  2. 并且已经执行过./bin/wxdt install
  3. 在ide的设置中开启服务端口: 设置 -> 安全 -> 服务端口(开启)

命令行工具所在位置: <安装路径>/bin/cli

端口号文件位置:~/.config/wechat_web_devtools/Default/.ide

微信文档参考:

Docker

未安装wine,仅限cli调用

可以直接run

docker run -it \
    -v $PWD:/projects \
    canyoutle/wxdt \
    sh -c "cli -l && cli -p /projects/your-project"

或是启动一个持久的容器

docker run -d \
    --name wxdt \
    -p 6080:80 \
    -v $PWD:/projects \
    canyoutle/wxdt

docker exec -it wxdt cli -l # 登录
docker exec -it wxdt cli -p /projects/your-project # 预览工程

docker stop wxdt # 暂停容器
docker start wxdt # 下次使用,不用再run,可以直接exec

其它说明

安装Wine

请参考搜索引擎安装 Wine,以下是Ubuntu下两种安装

1. 安装wine-binfmt

sudo apt-get install wine-binfmt
sudo update-binfmts --import /usr/share/binfmts/wine

2. 正常安装wine

dpkg --add-architecture i386 \
  && wget -nc https://dl.winehq.org/wine-builds/winehq.key \
  && apt-key add winehq.key \
  && apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' \
  && apt-get update \
  && apt-get install -y --no-install-recommends --allow-unauthenticated winehq-stable

./bin/wxdt install 报错失败

./nw: error while loading shared libraries: libnw.so: cannot open shared object file: No such file or directory

该错误是由 nw.js 下载失败所致. 删除缓存, 重新下载即可.

rm -rf /path/to/wechat_web_devtools/dist
rm -rf /tmp/wxdt_xsp
# 请务必等待执行完成
./bin/wxdt install

参考

wcc 和 wcsc 编译错误

是wine没安装好导致的,或是没有成功替换wcc 和 wcsc两个二进制文件

  • 方案一: 安装wine并且执行./bin/wxdt install
  • 方案二: 安装wine-binfmt

完成后, 点击 编译 即可.

参考:

  1. https://github.com/cytle/wechat_web_devtools/issues/66#issuecomment-368434141
  2. https://github.com/cytle/wechat_web_devtools/issues/56#issuecomment-371999385

更新到最新版

方案一: 直接从当前项目源码 进行 更新 (稳定, 推荐)

git pull origin

方案二: 使用腾讯原始安装程序 进行 自助复制更新 (及时, 自行折腾)

注: 如果抽风了, 可以尝试使用 git reset --hard 等操作, 还原到最初的状态.

执行更新, 自动下载最新 Windows x64 版开发者工具, 并且使用7z解压.  

./bin/update_package_nw.sh

方案三: 同上 手动指定 -l <微信开发工具下载地址> -v <版本号> (可指定预发布版或开发版)

注: -l -v 选项务必同时指定, 并且版本号 形如1.02.2001191

./bin/update_package_nw.sh -l <微信开发工具下载地址> -v <版本号>

Tips

  • 运行没问题,欢迎PR

Ubuntu环境下编辑器字体安装

Ubuntu环境下默认没有Cosolas字体,同时目前无法修改字体,因此下载安装Consolas字体是较优方案,使得编辑器将显示更舒服。

  • 下载https://github.com/kakkoyun/linux.files/raw/master/fonts/Consolas.ttf 至/usr/local/share/fonts or ~/.fonts
  • sudo fc-cache -f重建字体缓存
  • 确认字体安装成功
sudo fc-list|grep Consol
.fonts/Consolas.ttf: Consolas:style=Regular
  • 重启微信开发者工具

卸载

  1. 关闭 微信web开发者工具
  2. 项目文件夹下运行 ./bin/wxdt uninstall (删除桌面图标、微信web开发者工具配置目录), 开发者工具配置文件, 所有工程和登录信息均会消失
  3. 删除项目文件夹

Arch Linux

Arch Linux 及其衍生发行版,如 Manjaro,可以通过 AUR 进行安装:https://aur.archlinux.org/packages/wechat-devtool/

截图

截图1

调试界面

上面项目来自wechat-v2ex

赞赏

赞赏码

Changelog

免责声明

微信开发者工具版权归腾讯公司所有,本项目旨在交流学习之用。如有不当之处,请联系本人,邮箱:canyoutle@gmail.com