Socket
Book a DemoInstallSign in
Socket

@ewtd/ewt

Package Overview
Dependencies
Maintainers
7
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewtd/ewt

An ewt component

2.0.61-beta.6
latest
Source
npmnpm
Version published
Maintainers
7
Created
Source

ewt 整包

Install

$ npm i @ewtd/ewt

Usage

import {
  Icon,
  EmptyData,
} from '@ewtd/ewt';
import '@ewtd/ewt/dist/index.css';

按需加载

安装 babel-plugin-import 插件

npm install babel-plugin-import --save-dev

.babelrc 文件配置如下

{
  "plugins": [
    [ "import", {
        "libraryName": "@ewtd/ewt"
      }
    ]
  ]
}

加入新组件流程

  • 拷贝 src/components/Template 文件夹重命名为新组件名称;
  • 更新 src/index.ts 加入该组件;
  • 更新 demo/index.tsx 加入新组件路由;
  • 访问 localhost:8080/#/组件名称,以 If 组件为例,访问地址为 localhost:8080/#/If
  • 新组件开发验收完成之后,发布即可

更新文档站

  • 打包
npm run build:site
  • 拷贝 dist 目录下的内容到文档站的 git 仓库 release 分支的 /dist/v2 目录下,文档站 git 仓库地址是 ssh://git@git.mistong.com:10022/ewtd/pc.git

  • 前往发布平台搜索 pc,找到应用名称 === pc 的站点发布即可

  • 文档站地址是http://eui.mistong.com/

单元测试

单元测试放在组件的 __test__ 目录即可,名称建议为 xxx.test.js,以模板组件 Template 为例,其目录结构为

Template
└── __test__
    └── template.test.js

全局单元测试验证

npm run test // 或者 npm run coverage

单个组件单元测试验证

// 其中 xxx 替换为组件目录即可
npx jest /src/components/xxx/__test__

Keywords

react

FAQs

Package last updated on 04 Apr 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.