🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

mistc

Package Overview
Dependencies
Maintainers
3
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mistc

compiler for mist templates

latest
npmnpm
Version
2.1.3
Version published
Maintainers
3
Created
Source

mistc

Mist 组件编译工具

Install

npm install -g mistc

CLI Usage

mistc [options] file
mistc --help  

Mist 模板编译工具

Usage:
  mistc [options] file

Options:
  -o,--output <file>    输出到指定文件
  -m,--minify           是否进行最小化
  -b,--binary           是否编译为二进制产物
  -u,--check-update     检查更新,输出 JSON 字符串,属性有 hasUpdate, currentVersion, newVersion
  -p,--platform         编译平台
  -d,--debug            是否调试
  -v,--version          输出版本号
  -h,--help             显示帮助

API Usage

import { compile } from 'mistc'

async function test() {
  const templatePath = '/path/to/the/template/file.mist'
  const compiledTemplate = await compile(templatePath, { minify: true, tsxOptions: {
    removeConsoleLog: false,
    symbolNameOptimization: true,
    shortStyleKeyOptimization: false
  }});
  console.log(compiledTemplate)
}

开发指南

.
├── FEATURE.md
├── README.md
├── bin
│   └── mistc
├── dev            // 测试
│   └── test.js
├── package-lock.json
├── package.json
├── src            // 代码
│   ├── binary
│   ├── cli.ts
│   ├── constantFolding.ts
│   ├── convertExpressions.ts
│   ├── exp
│   ├── index.ts
│   ├── inlineComponents.ts
│   └── tsx
├── test            // 单元测试
│   ├── index.js
│   ├── mist
│   └── tsx

1 安装依赖

npm i

2 编写代码

执行测试代码

ts-node ./dev/test.js    

断点调试 打开test.js文件,按F5启动调试

3 跑单元测试

npm run test

4 发布beta版 修改版本号

npm publish --tag=beta

5 发布正式版 修改版本号

npm publish

性能优化

node性能分析

node --prof ./dev/prof.js
node --prof-process isolate-0x7f949e700000-43913-v8.log > processed.txt 

FAQs

Package last updated on 17 Jul 2023

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