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

@justwe7/mp-devtool-plugin

v0.0.3

Published

解决小程序自带vconsole无法查看网络请求,storage等痛点。避免测试过程需要使用抓包工具或者在开发者工具进行。 ![20220915_113250.gif](https://s2.loli.net/2022/09/15/JX9pO6ZotFbSs3k.gif)

Downloads

4

Readme

小程序devtool增强工具

解决小程序自带vconsole无法查看网络请求,storage等痛点。避免测试过程需要使用抓包工具或者在开发者工具进行。 20220915_113250.gif

安装

npm i @justwe7/mp-devtool-plugin -D

使用

uniapp

  1. 修改src/pages.json,新增全局自定义组件: "jw-tool": "/wxcomponents/jw-devtool/index"
{
  "pages": [],
  "globalStyle": {
    "usingComponents": {
      "jw-tool": "/wxcomponents/jw-devtool/index"
    }
  }
}
  1. vue.config.js:
const { JwDevtoolPlugin } = require('@justwe7/mp-devtool-plugin');
module.exports = {
  chainWebpack: config => {
    // 禁止在生产环境注入!
    // if (process.env.NODE_ENV !== 'production') { // TODO 增加环境变量标识作为判断条件
    config.module
        .rule('mp-devtool-loader')
        .test(/\.vue$/)
        .use('@justwe7/mp-devtool-plugin')
        .loader('@justwe7/mp-devtool-plugin')
        .options({})

    config.plugin('mp-devtool-plugin').use(JwDevtoolPlugin)
    // }
  }
};

实现思路

  1. 通过plugin注入新的entry,劫持network,与后续引入的组件进行数据通信
  2. 通过loader,将每个页面template下插入自定义组件名称
  3. 通过loader,将自定义组件定义到全局:pages.json->globalStyle->usingComponents (区分uniapp)
  4. 上一步的组件定义需要复制组件源码(考虑平台,看是否需要插件处理。使用者自行处理是否更灵活或者需要接收参数进行配置)

TODO

  • [x] network查看
  • [x] uniapp兼容
  • [ ] storage查看
  • [ ] 支持小程序path携带指定参数跳转
  • [ ] 原生小程序兼容