# mini-program-develop-tool

> 小程序开发工具

Latest version **1.0.0** (published 2021-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install mini-program-develop-tool
pnpm add mini-program-develop-tool
yarn add mini-program-develop-tool
bun add mini-program-develop-tool
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-06-08 |
| First published | 2021-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 22 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | chemzqm@gmail.com |
| Maintainers | chemzqm |

## Links

- npm: https://www.npmjs.com/package/mini-program-develop-tool
- Repository: git@gitlab.idianyou.cn:mini-program/mini-program-develop-tool
- npm.io page: https://npm.io/package/mini-program-develop-tool

## Dependencies (3)

- [mobx](https://npm.io/package/mobx.md) 5.15.7
- [mobx-react](https://npm.io/package/mobx-react.md) 6.3.1
- [@electron/remote](https://npm.io/package/@electron/remote.md) ^1.1.0

## Recent versions

- 1.0.0 (latest) — 2021-06-08

## README

# 小程序开发工具

## Proposal plugins

- @babel/plugin-proposal-class-static-block
- @babel/plugin-proposal-decorators
- @babel/plugin-proposal-do-expressions
- @babel/plugin-proposal-export-default-from
- @babel/plugin-proposal-export-namespace-from
- @babel/plugin-proposal-function-bind
- @babel/plugin-proposal-function-sent
- @babel/plugin-proposal-partial-application
- @babel/plugin-proposal-pipeline-operator, { "proposal": "minimal" }
- @babel/plugin-proposal-throw-expressions
- @babel/plugin-proposal-private-property-in-object
- @babel/plugin-proposal-record-and-tuple

注意：其它所有分支请不要 merge 或者 pull trunk 分支代码，使用
`git pull && git rebase trunk` 来同步最新的 trunk 分支的代码

合并最新的 trunk 分支代码

```sh
git stash
git fetch origin
git rebase origin/trunk
git stash apply
```

需调整清除文件缓存 api， getRealPath 接口

主要模块：

- `main` 其中 server 为 electron 后台，client 为 renderer 层代码
- `editor` 编辑器模块
- `wechat` 小程序 http 服务后台代码，包含监控功能
- `release` 最终打包使用的代码

主要依赖：

- [electron](https://electronjs.org/docs)
- [monaco-editor](https://github.com/Microsoft/monaco-editor)
- [react](https://github.com/facebook/react)
- [mobx](https://mobx.js.org/)
- [material-ui](https://material-ui.com/)
- [koa](https://github.com/koajs/koa)

https://cdn.v2ex.com/assets/sidebar/openinstall_20190910.gif

## 安装 & 运行

```sh
" 安装所有依赖然后开发版本的 js
npm install
npm run start
```

安装 electron 可能需要些时间

编辑 typescript 或 javascript 文件后需要编译文件，statics 模块使用 webpack
构建，编译时需要在目录下执行

```sh
./node_modules/.bin/webpack
```

其它模块都使用 esbuild 编译，需要在目录下执行：

```sh
node esbuild.js
```

编译当前目录下的 ts/js 文件，编译后文件保存在 `release/build` 目录下。

使用 `-w` 支持 watch build。

## npm 脚本

- `build` 生成生产环境 javascript 打包文件
- `bundle` 使用 electron-builder 打包安装文件
- `publish` 发布新版本到 git 和服务器：http://alcgdevtools.chigua.cn/,
  支持正式版和测试版
- `start`

## 发布新版本流程

- `npm run build` 执行生产环境 js 编译
- 修改 `release/package.json` 中版本号
- `npm run bundle` 打包
- `npm run publish` 发布

## 特别提示

- 必须使用吃瓜帐号登录才能正常使用 api 相关功能
- 小程序 project.config.json 中必须添加相应 CGCLIENTID 才能正常使用 api 相关功能
- 预览功能暂时仅支持测试版服务器
- 上传功能编辑器做了限制，现在必须是小程序创建者才能上传新版
- IDE 不监听 node_modules 目录下文件变化
- 编辑器和 Chrome Devtools 插件增强暂时还没加

## 编译可执行文件

```sh
npm run build
npm run bundle
```

该命令生成所需 javascript 文件的 production 打包文件，然后使用
electron-builder 将 release 目录下文件打包生成 exe 和 dmg 文件到
release/dist 目录下。

## Resources for Learning Electron

- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app
- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further
- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - an Electron app that teaches you how to use Electron
- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs

---
_Source: https://npm.io/package/mini-program-develop-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
