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

xcx-lint-qts

v2.2.13

Published

小程序代码Lint工具

Downloads

9

Readme

xcx_lint

介绍

小程序代码 自动打埋点 工具 根据注释生成Excel

遍历xml生成全局唯一点位,然后可以代理点击全局事件上报点位

转换前:

<view>
  <login bind:tap="loginSuccess">登录</login>
  <image src="xxx.jpg" />
  <view bind:tap="handleTap">点击</view>
</view>

转换后:

<view>
  <login ptpid="63cc-1976-9a62-096e" bind:tap="loginSuccess">登录</login>
  <image src="xxx.jpg" />
  <view ptpid="cbe0-1a20-a884-b6f1" bind:tap="handleTap">点击</view>
</view>

使用说明

安装

npm 全局

$ npm i -g xcx-lint-qts

yarn 全局

$ yarn global add xcx-lint-qts

使用

获取非活跃组件

$ qts-lint inactive alipay

lint自动打点

进入到要 lint 项目的根目录,执行: 微信:

$ qts-lint lint wx

支付宝:

$ qts-lint lint alipay

图片自动加 lazy-load

$ qts-lint lint alipay --lazy-load

生成文档(默认不生成文档)

# 简化名
$ qts-lint lint wx -c
# or
$ qts-lint lint wx --docs
# 线上文档
$ qts-lint lint wx -c online --docsId xxxxx
# 线上文档 用户名密码默认 lishixuan
$ qts-lint lint wx -c online --docsId xxxxx --user lishixuan --pass 123456
# json文档
$ qts-lint lint wx -c json

-c/--docs 默认excel -c online --docsId xxxxx 请传wiki文档id(需提前创建好)

文档注释格式

<!-- @ptp-title xxx页面 -->
<view>
  <!-- @ptp 登录按钮 -->
  <login ptpid="63cc-1976-9a62-096e" bind:tap="loginSuccess"></login>
  <image src="xxx.jpg" />
  <!-- 
    @ptp 点击按钮 
    @ptp-businessId
    @ptp-businessType
    @ptp-remark xxx 
  -->
  <view ptpid="cbe0-1a20-a884-b6f1" bind:tap="handleTap"></view>
</view>

生成excel:

| 名称 | 点位 | | -------- | ------------------- | | xxx页面 | | | 登录按钮 | 63cc-1976-9a62-096e | | 点击按钮 | cbe0-1a20-a884-b6f1 |

js接口说明

const { parseList, parseFile } = require("xcx-lint-qts")

parseList

parseList(files, options)

files 文件列表数组绝对路径,传相对路径 请传 options.root

options

  • options.type 转换的类型 wx或者alipay
  • options.docs 是否生成文档 boolean
  • root 根目录,如果传入files不是绝对路径会发出警告必须传root
  • docsRoot 文档生成的根目录,默认为包安装地址,传root会以root为路径,也可自行设置

无返回内容

parseFile

parseList(content, { type, docs, newDocs })

content 文件内容

options

  • options.type 转换的类型 wx或者alipay
  • options.docs 文档对象,null | Objectnull为不处理,传{}通过引用处理为 { '63cc-1976-9a62-096e': ['登录按钮'] } 的格式
  • options.newDocs 新文件对象,同上

@returns

  • content 转换后的内容
  • newPtp 新增的点位数量
  • newIndex 新增的index数量
  • isOperate 是否进行了操作,false 未对文件进行过处理
  • commentTitle 注释的标题