# jira_annie

> Annie 学习react-hooks demo

Latest version **1.0.1** (published 2023-04-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install jira_annie
pnpm add jira_annie
yarn add jira_annie
bun add jira_annie
```

## 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.1 |
| Published | 2023-04-13 |
| First published | 2023-04-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 6.7 MB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | annie_tim |
| Maintainers | annie_tim |
| Keywords | jira, react, hooks |

## Links

- npm: https://www.npmjs.com/package/jira_annie
- Repository: https://github.com/NoEnd-for-learning/jira
- Homepage: https://github.com/NoEnd-for-learning/jira#readme
- Issues: https://github.com/NoEnd-for-learning/jira/issues
- npm.io page: https://npm.io/package/jira_annie

## Dependencies (18)

- [qs](https://npm.io/package/qs.md) ^6.11.0
- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [typescript](https://npm.io/package/typescript.md) ^4.8.2
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [@types/jest](https://npm.io/package/@types/jest.md) ^27.5.2
- [@types/node](https://npm.io/package/@types/node.md) ^16.11.56
- [react-query](https://npm.io/package/react-query.md) ^3.39.2
- [@types/react](https://npm.io/package/@types/react.md) ^18.0.18
- [react-router](https://npm.io/package/react-router.md) ^6.3.0
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.1
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^18.0.6
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^6.3.0
- [react-beautiful-dnd](https://npm.io/package/react-beautiful-dnd.md) ^13.1.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^13.3.0
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.5
- [@types/react-beautiful-dnd](https://npm.io/package/@types/react-beautiful-dnd.md) ^13.1.2
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## 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.1 (latest) — 2023-04-13
- 1.0.0 — 2023-04-12

## README

# https://noend-for-learning.github.io/projects

## Available Scripts

In the project directory, you can run:

### `node >= 12.22.0`

### `#1 npm install`

### `#2 npm audit fix`

### `#3 npm start`
```text
http://localhost:3000/projects
```

### `#4 npm run json-server`
```text
 Resources
  http://localhost:4000/users
  http://localhost:4000/projects

  Home
  http://localhost:4000
```

### `npm test`

### `npm run build`


# jira

# prettier: https://www.prettier.cn/docs//install.html
```shell script
npm install --dev --exact prettier

echo {}> .prettierrc.json

npm install --save-dev husky lint-staged

"lint-staged": {
    "*.{js,css,md,ts,tsx}": "prettier --write"
  }
```

### json-server: https://github.com/typicode/json-server
```javascript
window.fetch('http://localhost:3000/users').then(r => r.json()).then(console.log);

GET /tickets // 列表
GET /tickets/12 // 详情
POST /tickets  // 增加
PUT /tickets/12 // 替换
PATCH /tickets/12 // 修改
DELETE /tickets/12 // 删除

```

# 安装 jira-dev-tool
```javascript
// 1. yarn add jira-dev-tool@1.5.1
// 2. npx msw init public
// 3. 如果本地不需要，可以删除json-server 的相关内容，因为jira-dev-tool插件已经集成了
```

## bug fix
```text
基于 "jira-dev-tool": "1.5.1", 由于有antd 样式引入的warning, 因此做了优化：

import 'antd/dist/antd.css';
改为
import 'antd/dist/antd.min.css';

然后项目引入改为：
"jira-dev-tool": "file:__jira-dev-tool__"
其中，__jira-dev-tool__ 为copy 1.5.1 版本的代码，并修改了样式引入，重新npm install 生成的依赖包
(参考：https://developer.aliyun.com/article/970973)
```

## 类型别名
```typescript
// interface 在这种情况下，没法替代type
type FavoriteNumber = string | number;
```
## Utility type
```typescript
type Person = {
    id: number,
    name: string,
    age: number,
}
const xiaoMing: Partial<Person> = {};
const xiaoHong: Omit<Person, 'name' | 'age'> = {id: 12};
```

## Partial 实现
```typescript
type Partial<T> = {
    [P in keyof T]?: T[P];
};
```

## Omit 实现
```typescript
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
```

### 拓展插件
```text
https://www.npmjs.com/package/react-error-boundary

https://www.npmjs.com/package/helmet

https://www.npmjs.com/package/why-did-you-render

https://www.npmjs.com/package/react-query

https://www.npmjs.com/package/swr


```

### 跨组件状态管理总结
```text
小场面：
·状态提升/组合组件

缓存状态：
·react-query / swr

客户端状态：
·url / redux / context
```
### 自动化测试
```text
- 目的: 让我们对自己写的代码更有信心，防止对出现“新代码破坏旧代码” 的无限循环；

- 分类
.单元测试：传统的单元测试，组件测试，hook测试
.集成测试
.e2e 测试（end2end）
```

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