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

mym-template

v1.1.7

Published

根据命令,形如:mym g list [name],执行模板生成函数。即可在执行目录下生成代码文件。 web端项目新增内容: 1. 添加路径别名:@components、@utils,可在引入模块时使用 2. 创建表单的formItem函数,添加自定义组件的功能 ### 功能

Downloads

7

Readme

项目描述

一定程度上统一样式,少写代码,减少常见bug

根据命令,形如:mym g list [name],执行模板生成函数。即可在执行目录下生成代码文件。
web端项目新增内容:
    1. 添加路径别名:@components、@utils,可在引入模块时使用
    2. 创建表单的formItem函数,添加自定义组件的功能    

功能

生成list组件代码

生成页签+搜索条件+列表的代码,完成action+reduecer+容器+展示的文件结构, 完成分页、回车查询、批量操作、新建跳转、删除确认等基本代码。
1.命令: mym generate/g list [listName]

2.步骤

  1. 创建列表配置,创建目录、创建constant.js文件,执行命令
  2. 添加路由、combine reducer
  3. 完成TODO need修改

3.TODO need 涉及内容,共计11处、7类(不需要则删除),其中:

  • 1处,配置权限
  • 1处,配置redux中reducer的指向
  • 1处,配置页签内容
  • 1处,自定义查询组件
  • 1处,处理异常信息
  • 3处,查询条件处理
  • 3处,修改url

4.启动运行

5.如下图 列表生成结果

代码描述

~~1. 使用Symbol代替 Constant模块,避免Constant路径的手动配置(Symbol是不可序列化对象,会导致redux的时间旅行等功能失效,且实际上 reducer中也不支持不可序列话的action.type)~~

  1. 找到最近目录下的constant.js文件,并设置action、reducer中的路径
  2. 因为都在一个文件夹下,命名规则采用了 模块名.类型.文件类型 的格式,加以区分
  3. 后续可再增加各类型组件或页面结构。进而通过参数配置生成相应代码
  4. node语法,发布在npm平台