Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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 组件库
The npm package @cosmic-design/san receives a total of 476 weekly downloads. As such, @cosmic-design/san popularity was classified as not popular.
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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.