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

@qts-mini/cli

v0.0.31-alpha.0

Published

@qts-mini/cli

Downloads

4

Readme

@qts-mini/cli

小程序多端同构 & 使用微信小程序或者支付宝小程序进行多端开发

简单,基于小程序语法,无接入成本和逃离成本(依然可以在转换后的代码继续开发)

支持多种同构语法

  • 条件注释
  • js 多态
  • 组件文件多态

Installing

Using npm:

$ npm i -g @qts-mini/cli

Using yarn:

$ yarn global add @qts-mini/cli

Use

qts-mini transform 'target/**'

查看命令运行目录有dist目录,注意'target/**'的引号

Example

avatar

配置 和 API

qts-mini.config.js

在项目根目录配置qts-mini.config.js

module.exports = {
  files: {
    'example/**': {
      out: {
        wx: 'dist/wx',
        alipay: 'dist/alipay'
      }
    }
  }
}

transform

简单命令行模式

qts-mini transform 'target1/**' 'target2/**' 忽略qts-mini.config.js,代码自动转换到当前命令运行目录下的'dist/wx'和'dist/alipay'

qts-mini transform 'target1/**' 'target2/**' -w

配置文件模式

qts-mini transform 转换代码,根据qts-mini.config.js文件输出目录,可配置多个

qts-mini transform -w 监听代码,默认不转换监听到改动才转换

qts-mini transform -w --init-run 先转换一次后监听

同构模式

条件注释 preprocess

js:

// @ifdef WX
const text = '专属于微信'
// @endif

xml:

<!-- @ifdef ALIPAY -->
<view>专属于支付宝</view>
<!-- @endif -->

javascriptxmlcssbash等文件中使用条件注释,导出到不同端

js 多态 interface语法

test.interface 文件

<script type="wx">
  export function show() {
    wx.show()
  }
</script>

<script type="alipay">
  export function show() {
    my.show()
  }
</script>
import { show } from './a.interface'

组件目录条件编译

|- component
  |- login.interface
    |- wx
      |- index.wxml
      |- ...
    |- alipay
      |- index.axml
      |- ...
|- pages
  |- index
    |- index.json

最终会根据目录编译,例如微信(wx):

|- component
  |- login
    |- index.wxml
    |- ...
|- pages
  |- index
    |- index.json

所以直接在 pages/index/index.json中使用组件login: 'component/login/index'

根据目录的多态组件的格式 ${组件名称}.interface/${wx/alipay}/${原生代码}

原生代码不会经过转换,原样输出