Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@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/components
Grid
/Button
组件./site
npm 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.