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

ykj-ui

v1.5.1-beta.2

Published

ykj-ui

Downloads

29

Readme

欢迎来到深圳市明源云空间 PC 端组件库

请你认真阅读以下所有内容!

开发构建流程

yarn doc:server 开启文档热更新模式

yarn doc:build 构建文档静态资源

npm run pub 构建发布新的版本(记得每次发布调整package.json文件的版本号,原则上小版本+0.0.01)

组件命名规则

  • myy开头
  • 租赁myy-zl前缀,例如:myy-zl-room
  • 资管myy-zg前缀,例如:myy-zg-room

组件库设计理念

  • 约定优于配置的思想

  • ant-design设计理念一样,环境与配置一样,支持tree-sharking,使用bable-import-plugin即可

开发一个新组件

  • 每新增一个组件,都要在 src 的 index.ts 文件中新增它的引入(与之前一其他组件一样的方式),例如:
export { default as FedUpload } from './components/fed-upload';
  • 每新增一个组件,都要在 src 的 index.d.ts 文件中新增它的引入(与之前一其他组件一样的方式),例如:
export { default as FedUpload } from './components/fed-upload';

特别注意: 这里的文件夹名字,一定要是这种使用-连接的方式,不要使用驼峰命名,部分操作系统对大小写不敏感,而且bable-import-plugin会自动把驼峰命名转换成-形式。让你找不到

  • 每新增一个组件,都要在组件对应的文件夹内新增一个style文件夹,里面写上index.less文件(即使是空的也需要,这是babel-import-plugin按需加载时候自动引入的),不然生产环境就会报错.

  • 使用组件文档热更新模式调试组件,需要在组件对应文件夹内新建index.md文件,然后编写tsx代码.

  • 本组件库只会打包tsx代码,所有的文件请使用.tsx结尾!

  • 编写组件和示例完成后,需要编写一份index.d.ts文件放置于组件文件夹内,用于代码提示和检验.

  • 一个基本组件,应该有一个index.tsx文件(组件根文件),index.d.ts(组件声明文件), index.md(组件文档示例文件),一个style文件夹下面的index.less文件(用于配合bable-import-plugin做按需加载引入样式)

  • 切记以上几点,webpack 配置如此,一定要按照此约定开发组件,不要更改配置...!

本地项目内调试

  • 进入ykj-ui根目录运行命令yarn link
  • 进入项目根目录运行命令 yarn link ykj-ui
  • 每次修改了ykj-ui都要yarn build才能生效
  • 重启运行项目,即可热更新本地调试组件

断开本地项目内调试

  • 在ykj-ui项目下运行yarn unlink
  • 在启动项目下运行yarn unlink ykj-ui,然后yarn add ykj-ui

使用流程

yanr add ykj-ui --save

yarn add babel-plugin-import
  • babel 配置
  [
    'import',
    {
        libraryName: 'ykj-ui',
        libraryDirectory: 'lib/components',
    },
    'ykj-ui',
    ],
  • 即可正常使用