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

umi-plugin-auto

v0.0.28

Published

auto-build-hook-redux

Downloads

25

Readme

umi-plugin-auto

NPM version NPM downloads

myself

Usage

Configure in .umirc.js,

export default {
  plugins: [
    ['umi-plugin-auto', options],
  ],
}

全局参数

{
  quotes: 'single',    // 单引号还是双引号  默认双引号
  globalIndex:'$name'   // 全局设置每个模块的入口文件,默认index.tsx 可以指定设置为一个文字,也可以使用$xxx 动态取name字段为名字
  ...
}

三大分类

common: [],   // 组件,数组每项为obj,具体格式看模块参数
layouts: [],  // 数组每项为obj,具体格式看模块参数
pages: []     // 数组每项为obj,具体格式看模块参数

模块

{
    name: '',                  // 模块名字,必填
    state: [],                 // redux中可读的数据 
    func: [],                  // redux中可写的数据
    isPage:false               // 是否生成入口文件 默认是true
    isComponent:false :false   // 同上 仅仅为语义化
    index:'index',             // 入口文件的名字,先取这个,取不到取全局的,全局没有就是默认了
    type:'class'               // react风格,默认hook
    children:[]                // 子页面/模块
}

state

{
    'name': 'name',            //必须和func对应
    'type': 'string',          //必须和func对应
    'default': 'hello word'
}

func

{
    'method': 'setName',
    'parameter': 'name',       //必须和state对应
    'parmType': 'string'       //必须和state对应
}

Options

{
    quotes: 'single',
    common: [
        {
            name: 'formNameInput',
            state: [{
              'name': 'nameInput',
              'type': 'string',
              'default': 'user'
            }],
            func: [{
              'method': 'setNameInput',
              'parameter': 'nameInput',
              'parmType': 'string'
            }],
        },
        {
            name: 'formPasswordInput',
            state: [{
              'name': 'passwordInput',
              'type': 'string',
              'default': ''
            }],
            func: [{
              'method': 'setPasswordInput',
              'parameter': 'passwordInput',
              'parmType': 'string'
            }],
        }
    ],
    layouts: [
        {
            name: 'loginLayout',
            state: [],
            func: [],
        }, 
        {
            name: 'appLayout',
            state: [],
            func: [],
        }
    ],
    pages: [
        {
            name: 'login',
            state: [],
            func: [],
        },
        {
            name: 'app',
            state: [],
            func: [],
            children:[
                {
                    name:'components',
                    isPage: false,
                    state: [],
                    func: [],
                    children:[
                        {
                            name: 'user1',
                            state: [{
                                'name': 'title',
                                'type': 'string',
                                'default': ''
                            }],
                            func: [],
                        },
                        {
                            name: 'user2',
                            state: [{
                                'name': 'title',
                                'type': 'string',
                                'default': ''
                            }],
                            func: [{
                                'method': 'setTitle',
                                'parameter': 'title',
                                'parmType': 'string'
                            }],
                        }
                    ]
                }
            ]
        }
    ]
}

Introduction

http://upa.fzcode.com/

LICENSE

MIT