
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@cosmic-design/san
Advanced tools
一个基于 San 开发的 UI 组件库
目前组件库提供了多种模块化规范,及全部打包和按需引入分包的编译产物,你可以结合适合的业务场景选择。
全局提供 san 的依赖即可,编译选择 vite / rollup 等工具即可,无特别配置,可参考。
/** package.json */
{
"exports": {
"./css/*": "./dist/css/*",
/** for @cosmic-design/san/css/Button.css */
/** for @cosmic-design/san/css/style.css */
/** for @cosmic-design/san/css/global.css */
"./*": {
"import": "./dist/esm/*/index.js",
"require": "./dist/cjs/*/index.js"
},
/** for @cosmic-design/san/Button */
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
/** for @cosmic-design/san */
},
}
/dist
├── css
│ ├── style.css # 所有样式,适用于全部引入,包括组件和global
| ├── global.css # 全局样式,适用于按需引入
| ├── Button.css # 组件样式,适用于按需引入
├── esm
│ ├── index.js # 组件esm bundle,适用于 esm/ts + 全部引入
│ ├── index.d.ts # 所有组件类型
│ ├── Button
│ │ ├── index.js # 组件esm, 适用于 esm/ts + 按需引入
│ │ ├── index.d.ts # 所有组件类型
├── cjs
│ ├── index.js # 组件commonJS bundle,适用于打包引入
│ ├── index.d.ts # 所有组件类型
│ ├── Button
│ │ ├── index.js # 组件commonJS, 适用于按需引入
│ │ ├── index.d.ts # 组件类型
├── umd
│ ├── index.js # 组件umd bundle,适用于 umd/amd + 打包引入
│ ├── Button.js # 分组件umd,适用于 umd/amd + 按需引入
import '@cosmic-design/san/css/style.css';
import { Button } from '@cosmic-design/san';
import '@cosmic-design/san/css/global.css'; // in global js
import '@cosmic-design/san/css/Button.css';
import Button from '@cosmic-design/san/Button';
全部引入 略
按需引入
/** CommonJS SSR **/
const Button = require('@cosmic-design/san/Button');
require.config({
packages: [
{
name: '@cosmic-design/san',
location: '/@cosmic-design/san/dist/es5',
main: 'index.js'
},
]
});
<link rel="stylesheet" type="text/css" href="/@cosmic-design/san/dist/css/style.css"/>
require(['@cosmic-design/san', 'san'], function({ Button }, { Component }) {
});
<link rel="stylesheet" type="text/css" href="/@cosmic-design/san/dist/css/global.css"/>
<link rel="stylesheet" type="text/css" href="/@cosmic-design/san/dist/css/Button.css"/>
require(['@cosmic-design/san/Button', 'san'], function(Button, { Component }) {
});
./packages/componentsGrid/Button组件./sitenpm run build使用 san-test-utils 进行单元测试
请使用npm run commit,不要使用git commit
FAQs
一个基于 San 开发的 UI 组件库
We found that @cosmic-design/san demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.