Giter Club home page Giter Club logo

nutshell's Introduction

Nutshell

前端标准组件库

  • 基于 Vue 3.x
  • 是 nutui/ant-design-vue 的套娃

将 Nutshell 加入项目

git clone [email protected]:fed/nutshell.git
cd nutshell
yarn
cd ui
yarn patch
yarn build

在nutshell/ui目录下执行

yarn link

到项目目录下执行

yarn link @uxda/nutshell

Nutshell 部署到 npm 后,这一步骤相当于

yarn add @uxda/nutshell

其他注意事项

在 Nutshell 进入成熟迭代之前,需要同步开发组件库与项目,此时需要在 nutshell/ui 目录下执行

cd nutshell/ui
yarn start

此时修改 Nutshell 组件,可以即时编译。

文件目录结构

  • docs 组件库官网及文档
  • expo 范例应用
  • ui 核心代码库

Core/Vendor策略

Nutshell直接依赖 nutui。 也就是Nutshell会强制引入@nutui/nutui,除此之外,对于PC端项目,会引入ant-design-vue, 也就是PC端项目会多出@nuui/nutui部分的 bundle size。

Nutshell使用的core/vendor规范,可以在表面上实现单一组件库支持多个platform,然而多个vendor造成的问题是必须为多个platform,至少包含(PC、H5、微信小程序)实现多个vendor,这造成了一定程度上的机械式重复实现。

因此Nutshell选择部分组件仅实现一个vendor,例如NS-BUTTON。

NS-BUTTON仅实现了nutui的vendor,当组件库在PC端运行时,Fallback机制在vendor/antdv下面找不到NsButton的实现,会自动使用vendor/nutui下面的实现。

这样就可以省下一个vendor的开发成本。

维护组件库文档

在nutshell/docs目录下执行

yarn dev

在具体pages下面找到相应文档

新建组件文件的快捷命令

nsc: 新建组件
nsv: 新建 vendor

nutshell's People

Contributors

xujian avatar shaoxuanhuang-ei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.