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

@xuanzai/code-generate

v1.5.3

Published

cider C端业务代码生成工具

Downloads

22

Readme

code-generate

cider C端前端代码生成工具

它帮你干了什么?

  • 不再需要手工创建 页面、store module、组件 目录,运行指令即可一键生成
  • 生成带有高度项目规范的代码

目前支持的C端项目

  • M:https://gitlab.shopcider.cn/shopcider/mobile-site-v2
  • PC:https://gitlab.shopcider.cn/shopcider/desktop

安装或更新

请先配置node环境,建议使用nvm并安装node >= 14版本

npm i @xuanzai/code-generate -g --registry=https://registry.npmjs.org/

yarn global add @xuanzai/code-generate --registry=https://registry.npmjs.org/

使用说明

以下所有操作都在终端项目根目录下执行:

生成页面模板代码

tips:它将自动为你导入页面 redux 模块 与 页面 scss 文件,无需手动导入

gen view <viewName:页面目录名称>
# 示例
gen view test-page
# 生成结果
|- views
  |- test-page
    |____index.tsx
    |____state.ts
    |____make-selector.ts
    |____types.ts
    |____selectors.ts
    |____reducer.ts
    |____actions.ts
    |____constants.ts
|- styles
  |- views
    |- test-page
      |____index.scoped.scss

生成页面组件模板代码

tips:它将自动为你导入 scss 样式模板,无需手动导入

# 页面名称必须与原有的页面目录名称一致,否则会导致组件生成失败
gen view-component <componentPath: 页面/组件目录/组件名称>
# 示例
gen view-component test-page/component/test-page-component
# 生成结果
|- views
  |- test-page
    |- component
      |- types
        |____test-page-component.ts
      |____test-page-component.tsx
|- styles
  |- views
    |- test-page
      |- component
        |____test-page-component.scoped.scss

生成 store module 模板代码

tips:它将自动为你导入页面 redux 模块,无需手动导入

gen store <storeModuleName:redux 模块名称>
# 示例
gen store my-module
# 生成结果
|- store
  |- modules
    |- my-module
      |____state.ts
      |____make-selector.ts
      |____types.ts
      |____selectors.ts
      |____reducer.ts
      |____actions.ts
      |____constants.ts

生成全局组件模板代码

tips:它将自动为你导入 scss 样式模板,无需手动导入

gen component <componentName:组件目录名称>
# 示例
gen component my-button
# 生成结果
|- components
  |- my-button
    |____index.tsx
    |____types
    | |____index.ts
    |____README.md
|- styles
  |- components
    |- my-button
      |____index.scoped.scss

生成全局组件子组件模板

tips:它将自动为你导入 scss 样式模板,无需手动导入

# 全局组件名称必须与原有的组件目录名称一致,否则会导致子组件生成失败
gen component-component <componentPath: 组件/组件目录/组件名称>
# 示例
gen component-component my-button/component/test-component
# 生成结果
|- components
  |- my-button
    |- component
      |- types
        |____test-component.ts
      |____test-component.tsx
|- styles
  |- components
    |- my-button
      |- component
        |____test-component.scoped.scss

其他问题

请在飞书上联系 @温子旋 Xuanzai