# c-react-component

> 前端基建内容，快速构建项目组件脚手架并发布到 npm 站点。

Latest version **1.0.2** (published 2020-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install c-react-component
pnpm add c-react-component
yarn add c-react-component
bun add c-react-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-03-23 |
| First published | 2020-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ruizhengyun |
| Maintainers | jianghuzaijian |
| Keywords | react, npm, component |

## Links

- npm: https://www.npmjs.com/package/c-react-component
- Repository: https://github.com/ruizhengyun/c-react-component
- Homepage: https://github.com/ruizhengyun/c-react-component#readme
- Issues: https://github.com/ruizhengyun/c-react-component/issues
- npm.io page: https://npm.io/package/c-react-component

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-03-23
- 1.0.0 — 2020-03-23

## README

# 创建 React 组件脚手架并发布

## 启动

- 安装依赖 `npm i`;
- 开发环境 `npm start`;

## 开发 && 测试

### 项目根目录下执行

```bash
npm link
npm link c-react-component
```

### 实时开发

1.修改 `package.json`

```json
{
  "main": "src/index.js",
}
```

发布时再改为

```json
{
  "main": "lib/index.js",
}
```

2.修改 `example/app.js`

将本地组件改为打包后依赖包组件。

```js
// import CReactComponent from '../src';
import CReactComponent from 'c-react-component';
import 'c-react-component/lib/main.min.css'; 
```
  
3.根目录执行

```bash
npm start
```

这样一边开发，就可以一边查看组件发布后的样子了。
  
## 发布

1.查看源地址

```bash
npm config list
```

2.切换到 npm 官方源地址

```bash
npm config set registry http://registry.npmjs.org
```

3.发布

```bash
npm whoami # 当前 npm 登录信息
npm run publish
```

4.取消发布（最好不要，别人可能下载了你的包）

```bash
npm unpublish c-react-component --force # 此处为package.json中定义的name字段
```

## 下载 && 使用

1.下载

``` bash
npm i react-demo-component
```

2.使用方法
  
```js
import CReactComponent from 'c-react-component';
import 'c-react-component/lib/main.min.css'; // 组件的样式，需要手动导入css文件
```

---
_Source: https://npm.io/package/c-react-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
