open-index/open-npm huggingface dataset:
npm package: @reactseed/create-app
Description: React seed command-line interface for creating a react app
Latest version: 0.0.2

# `reactseed`

[![LICENSE][LICENSE-image]][LICENSE-url]

[LICENSE-image]:https://img.shields.io/badge/license-BSD-blue.svg
[LICENSE-url]: https://github.com/reactseed/reactseed/blob/master/LICENSE
npm package: @reactseed/devserver
Description: Override webpack devServer
Latest version: 1.2.1

# `@reactseed/devserver`

[![LICENSE][LICENSE-image]][LICENSE-url] [![npm version][npm-image]][npm-url] [![download-image]][download-url]

[LICENSE-image]:https://img.shields.io/badge/license-BSD-blue.svg
[LICENSE-url]: https://github.com/reactseed/devserver/blob/master/LICENSE

[npm-image]: https://img.shields.io/npm/v/@reactseed/devserver.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/devserver

[download-image]: https://img.shields.io/npm/dm/@reactseed/devserver.svg?style=flat-square
[download-url]:  https://www.npmjs.com/package/@reactseed/devserver

Override webpack devServer configuration for create-react-app 2.0 order to support mockServer.

- [How to install](#how-to-install)
- [Usage](#usage)
 - [Configure customize-cra](#configure-customize-cra)
 - [Conventional Mock file](#conventional-mock-file)
 - [Write Mock files](#write-mock-files)
 
## How to install

This project relies on [`react-app-rewired`](https://github.com/timarney/react-app-rewired/)、[`customize-cra`](https://github.com/arackaf/customize-cra). You'll need to install that in order for `@reactseed/devserver` to work.

```bash
yarn add customize-cra react-app-rewired @reactseed/devserver --dev
```

## Usage

### Configure customize-cra

```js
/* config-overrides.js */
const { overrideDevServer } = require('customize-cra');
const devServer = require('@reactseed/devserver');

module.exports = {
    devServer: overrideDevServer(devServer),
};
```

### Conventional Mock file

Conventions All files in the `/mock` folder are mock files except files whose file name starts with `_`.

```
.
├── mock
    ├── _constant.js
    └── app.js
└── src
```
### Write Mock files

```js
/* _constant.js */
module.exports = {
  apiPrefix: '/api',
};
```
```js
/* app.js */
const { apiPrefix } = require('./_constant');
const packageJSON = require('../package.json');

module.exports = {
  [`GET ${apiPrefix}/app`]: packageJSON,
};
```
Visit `/api/app ` to get a response.
npm package: @reactseed/template
Description: React seed template for creating react app
Latest version: 2.4.0

# `@reactseed/template`

[![LICENSE][license-image]][license-url] [![npm version][npm-image]][npm-url] ![NPM-CI][ci-image]

[npm-image]: https://img.shields.io/npm/v/@reactseed/template.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/template
[license-image]: https://img.shields.io/badge/license-BSD-blue.svg
[license-url]: https://github.com/reactseed/template/blob/master/LICENSE
[ci-image]: https://github.com/reactseed/reactseed/workflows/publish/badge.svg

Default template for the React Seed.

## Trying Online

You can try Reactseed online on ⚡️ `stackblitz`.

[⚡️ Edit on StackBlitz ](https://stackblitz.com/edit/reactseed-template)

## Quick start

```sh
npx @reactseed/cli init
```

> If you use npm 5.1 or earlier, you can't use `npx`. Instead, install `@reactseed/cli` globally:

```sh
npm install -g @reactseed/cli
```

> Now you can run:

```sh
reactseed init
```

Select `Defalut Template`：

```sh
? The template you want to use?
  ❯ Defalut Template
    Ant Design Template (useRedux + useRequest)
    Ant Design Template using Vite (useRedux + useRequest)
    Ant Design Template (useRedux + useRequest + LinguiJs)
```

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.

When you’re ready to deploy to production, create a minified bundle with `npm run build`.

## What's inside?

Here are the top-level files and directories you'll see in an app created using this template.

```
@reactseed/template
├── public
├── src
│   ├── components
│   ├── pages
│   ├── routes
│   ├── index.tsx
│   ├── react-app-env.d.ts
│   ├── react.d.ts
│   ├── reportWebVitals.ts
│   ├── router.tsx
│   ├── setupTests.ts
│   └── setupProxy.js
├── .env
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierrc
├── .stylelintrc
├── craco.config.ts
├── README.md
├── tsconfig.json
└── package.json
```

## License

React Seed is open source software [licensed as BDS](https://github.com/reactseed/template/blob/master/LICENSE).
npm package: @reactseed/template-antd
Description: React seed ant design template for creating react app
Latest version: 2.4.0

# `@reactseed/template-antd`

[![LICENSE][license-image]][license-url] [![npm version][npm-image]][npm-url] ![NPM-CI][ci-image]

[npm-image]: https://img.shields.io/npm/v/@reactseed/template-antd.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/template-antd
[license-image]: https://img.shields.io/badge/license-BSD-blue.svg
[license-url]: https://github.com/reactseed/template-antd/blob/master/LICENSE
[ci-image]: https://github.com/reactseed/reactseed/workflows/publish/badge.svg

Ant Design template for the React Seed.

## Trying Online

You can try Reactseed online on ⚡️ `stackblitz`.

[⚡️ Edit on StackBlitz ](https://stackblitz.com/edit/reactseed-template-antd)

## Quick start

```sh
npx @reactseed/cli init
```

> If you use npm 5.1 or earlier, you can't use `npx`. Instead, install `@reactseed/cli` globally:

```sh
npm install -g @reactseed/cli
```

> Now you can run:

```sh
reactseed init
```

Select `Ant Design Template`：

```sh
? The template you want to use?
    Defalut Template
  ❯ Ant Design Template (useRedux + useRequest)
    Ant Design Template using Vite (useRedux + useRequest)
    Ant Design Template (useRedux + useRequest + LinguiJs)
```

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.

When you’re ready to deploy to production, create a minified bundle with `npm run build`.

## What's inside?

### Project structure

Here are the top-level files and directories you'll see in an app created using this template.

```
@reactseed/template-antd
├── mock
├── public
├── src
│   ├── components
│   ├── configs
│   ├── hooks
│   ├── pages
│   ├── routes
│   ├── themes
│   ├── typings
│   ├── utils
│   ├── defaultSettings.ts
│   ├── index.tsx
│   ├── react-app-env.d.ts
│   ├── react.d.ts
│   ├── reportWebVitals.ts
│   ├── router.tsx
│   ├── setupTests.ts
│   └── setupProxy.js
├── .env
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierrc
├── .stylelintrc
├── craco.config.ts
├── README.md
├── tsconfig.json
└── package.json
```

## License

React Seed is open source software [licensed as BDS](https://github.com/reactseed/template-antd/blob/master/LICENSE).
npm package: @reactseed/template-antd-i18n
Description: React seed ant design and i18n template for creating react app
Latest version: 2.4.0

# `@reactseed/template-antd-i18n`

[![LICENSE][license-image]][license-url] [![npm version][npm-image]][npm-url] ![NPM-CI][ci-image]

[npm-image]: https://img.shields.io/npm/v/@reactseed/template-antd-i18n.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/template-antd-i18n
[license-image]: https://img.shields.io/badge/license-BSD-blue.svg
[license-url]: https://github.com/reactseed/template-antd-i18n/blob/master/LICENSE
[ci-image]: https://github.com/reactseed/reactseed/workflows/publish/badge.svg

Ant Design template for the React Seed.

## Trying Online

You can try Reactseed online on ⚡️ `stackblitz`.

[⚡️ Edit on StackBlitz ](https://stackblitz.com/edit/reactseed-template-antd-i18n)

## Quick start

```sh
npx @reactseed/cli init
```

> If you use npm 5.1 or earlier, you can't use `npx`. Instead, install `@reactseed/cli` globally:

```sh
npm install -g @reactseed/cli
```

> Now you can run:

```sh
reactseed init
```

Select `Ant Design Template`：

```sh
? The template you want to use?
    Defalut Template
    Ant Design Template (useRedux + useRequest)
    Ant Design Template using Vite (useRedux + useRequest)
  ❯ Ant Design Template (useRedux + useRequest + LinguiJs)
```

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.

When you’re ready to deploy to production, create a minified bundle with `npm run build`.

## What's inside?

### Project structure

Here are the top-level files and directories you'll see in an app created using this template.

```
@reactseed/template-antd-i18n
├── mock
├── public
├── src
│   ├── components
│   ├── configs
│   ├── hooks
│   ├── locales
│   ├── pages
│   ├── routes
│   ├── themes
│   ├── typings
│   ├── utils
│   ├── defaultSettings.ts
│   ├── index.tsx
│   ├── react-app-env.d.ts
│   ├── react.d.ts
│   ├── reportWebVitals.ts
│   ├── router.tsx
│   ├── setupTests.ts
│   └── setupProxy.js
├── .env
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierrc
├── .stylelintrc
├── craco.config.ts
├── README.md
├── tsconfig.json
└── package.json
```

## License

React Seed is open source software [licensed as BDS](https://github.com/reactseed/template-antd-i18n/blob/master/LICENSE).
npm package: @reactseed/template-antd-vite
Description: React seed ant design template for vite and creating react app
Latest version: 2.4.0

# `@reactseed/template-antd-vite`

[![LICENSE][license-image]][license-url] [![npm version][npm-image]][npm-url] ![NPM-CI][ci-image]

[npm-image]: https://img.shields.io/npm/v/@reactseed/template-antd.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/template-antd
[license-image]: https://img.shields.io/badge/license-BSD-blue.svg
[license-url]: https://github.com/reactseed/template-antd/blob/master/LICENSE
[ci-image]: https://github.com/reactseed/reactseed/workflows/publish/badge.svg

Vite Ant Design Template for the React Seed (using vite in develop, using create-react-app in production).

## Trying Online

You can try Reactseed online on ⚡️ `stackblitz`.

[⚡️ Edit on StackBlitz ](https://stackblitz.com/edit/reactseed-template-antd-vite)

## Quick start

```sh
npx @reactseed/cli init
```

> If you use npm 5.1 or earlier, you can't use `npx`. Instead, install `@reactseed/cli` globally:

```sh
npm install -g @reactseed/cli
```

> Now you can run:

```sh
reactseed init
```

Select `Vite Ant Design Template`：

```sh
? The template you want to use?
    Defalut Template
    Ant Design Template (useRedux + useRequest)
  ❯ Ant Design Template using Vite (useRedux + useRequest)
    Ant Design Template (useRedux + useRequest + LinguiJs)
```

Then open [http://localhost:3000/](http://localhost:3000/) to see your app.

When you’re ready to deploy to production, create a minified bundle with `npm run build`.

## What's inside?

### Project structure

Here are the top-level files and directories you'll see in an app created using this template.

```
@reactseed/template-antd
├── mock
├── public
├── src
│   ├── components
│   ├── configs
│   ├── hooks
│   ├── locales
│   ├── pages
│   ├── themes
│   ├── typings
│   ├── utils
│   ├── defaultSettings.ts
│   ├── index.tsx
│   ├── react-app-env.d.ts
│   ├── react.d.ts
│   ├── reportWebVitals.ts
│   ├── router.tsx
│   ├── setupTests.ts
│   └── setupProxy.js
├── .env
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierrc
├── .stylelintrc
├── craco.config.ts
├── vite.config.ts
├── README.md
├── tsconfig.json
└── package.json
```

## License

React Seed is open source software [licensed as BDS](https://github.com/reactseed/template-antd/blob/master/LICENSE).
npm package: @reactseed/template-vite
Description: React seed ant design template for vite and creating react app
Latest version: 0.2.0

# `@reactseed/template-vite`

[![LICENSE][LICENSE-image]][LICENSE-url] [![npm version][npm-image]][npm-url] ![NPM-CI][CI-image]

[npm-image]: https://img.shields.io/npm/v/@reactseed/template-antd.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/template-antd
[LICENSE-image]:https://img.shields.io/badge/license-BSD-blue.svg
[LICENSE-url]: https://github.com/reactseed/template-antd/blob/master/LICENSE
[CI-image]:https://github.com/reactseed/template-antd/workflows/NPM-CI/badge.svg

Vite Ant Design template for the React Seed(use vite in dev, production still use webpack).
## Quick start
```sh
npx @reactseed/cli init
```

> If you use npm 5.1 or earlier, you can't use `npx`. Instead, install `@reactseed/cli` globally:
 
```sh
npm install -g @reactseed/cli 
```

> Now you can run:

```sh
reactseed init
```

Select `Vite Ant Design Template`：
```sh
? The template you want to use?
  Defalut Template
❯ Vite Ant Design Template (useRedux + useRequest)
```

Then open [http://localhost:3099/](http://localhost:3099/) to see your app.

When you’re ready to deploy to production, create a minified bundle with `npm run build`.


## What's inside?

### Project structure

Here are the top-level files and directories you'll see in an app created using this template.

```
@reactseed/template-antd
├── build
├── mock
├── public
├── src
│   ├── components
│   ├── configs
│   ├── hooks
│   ├── pages
│   ├── routes
│   ├── typings
│   ├── utils
│   ├── defaultSettings.js
│   ├── react-app-env.d.ts
|   ├── router.tsx
│   ├── serviceWorker.ts
│   └── setupProxy.js
├── .env
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierrc
├── .stylelintrc
├── config-overrides.js
├── README.md
├── tsconfig.json
├── paths.tsconfig.json
└── package.json
└── vite.config.ts
```

## License

React Seed is open source software [licensed as BDS](https://github.com/reactseed/template-antd/blob/master/LICENSE).
npm package: @reactseed/use-request
Description: Use request with a React hooks
Latest version: 1.2.1

# `@reactseed/use-request`

[![LICENSE][LICENSE-image]][LICENSE-url] [![npm version][npm-image]][npm-url] [![npm downloads][download-image]][download-url]

[LICENSE-image]:https://img.shields.io/badge/license-BSD-blue.svg
[LICENSE-url]: https://github.com/reactseed/use-request/blob/master/LICENSE

[npm-image]: https://img.shields.io/npm/v/@reactseed/use-request.svg
[npm-url]: https://www.npmjs.com/package/@reactseed/use-request

[download-image]: https://img.shields.io/npm/dm/@reactseed/use-request.svg?style=flat-square
[download-url]: https://npmjs.org/package/@reactseed/use-request

This project is extended based on [@umijs/use-request](https://github.com/umijs/hooks/tree/master/packages/use-request). Support all APIs of `@umijs/use-request`.

See the [document](https://hooks.umijs.org/hooks/async) about `@umijs/use-request` API for more information.


## Installation

```sh
npm install @reactseed/use-request
# or
yarn add @reactseed/use-request
```
## Features
- Built-in axios as the default request method.
- Support Restful style API.
- Support global error message handling and whether to handle error messages.
- Support typescript.

## How to use
A simple example:

[![Edit useRequest](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/userequest-4sike?fontsize=14&hidenavigation=1&theme=dark)


```jsx
import React from "react";
import ReactDOM from "react-dom";
import useRequest from "@reactseed/use-request";

const queryData = "https://randomuser.me/api";
const App = () => {
  const { data, run, loading } = useRequest(queryData, {
    manual: true
  });

  return (
    <>
      <button onClick={run} disabled={loading}>
        fetch
      </button>
      <div>{JSON.stringify(data)}</div>
    </>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));
```

### Use restful API
Request `/api/user/1`.

```jsx
const { data } = useRequest((data) => ({
  url: '/api/user/:id',
  data: {
    id:1,
  },
}));
```
### Custom error handling

```jsx
import { config } from "@reactseed/use-request";

config({
  onErrorBefore: error => {
    alert(error.messgae);
  }
});
```
### Disabled error message

```jsx
import useRequest from "@reactseed/use-request";

const { data } = useRequest('https://randomuser.me/api1', {
    disabledErrorMessage: false
});
```

Examples of error handling:

[![Edit useRequest-handleError](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/userequest-handleerror-7x6je?fontsize=14&hidenavigation=1&theme=dark)

## License

`@reactseed/use-request` is open source software [licensed as BDS](https://github.com/reactseed/use-request/blob/master/LICENSE).