# @uralys/reactor

> 🦊 Tooling to create and build your React app

Latest version **1.4.12** (published 2022-05-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @uralys/reactor
pnpm add @uralys/reactor
yarn add @uralys/reactor
bun add @uralys/reactor
```

Provides the command `reactor`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.12 |
| Published | 2022-05-28 |
| First published | 2021-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 11 |
| Unpacked size | 22.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | chrisdugne |

## Links

- npm: https://www.npmjs.com/package/@uralys/reactor
- npm.io page: https://npm.io/package/@uralys/reactor

## Dependencies (11)

- [chalk](https://npm.io/package/chalk.md) ^5.0.1
- [yargs](https://npm.io/package/yargs.md) ^17.5.0
- [doctoc](https://npm.io/package/doctoc.md) ^2.2.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [esbuild](https://npm.io/package/esbuild.md) ^0.14.39
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.5
- [sitemap](https://npm.io/package/sitemap.md) ^7.1.1
- [esbuild-plugin-svgr](https://npm.io/package/esbuild-plugin-svgr.md) ^1.0.1
- [@compodoc/live-server](https://npm.io/package/@compodoc/live-server.md) ^1.2.3
- [connect-history-api-fallback](https://npm.io/package/connect-history-api-fallback.md) ^1.6.0

## Recent versions

- 1.4.12 (latest) — 2022-05-28
- 1.4.11 — 2022-05-20
- 1.4.10 — 2022-05-20
- 1.4.9 — 2022-05-15
- 1.4.8 — 2022-05-14
- 1.4.7 — 2022-05-14
- 1.4.6 — 2022-05-14
- 1.4.5 — 2022-05-14
- 1.4.4 — 2022-05-14
- 1.4.3 — 2022-05-14
- 1.4.2 — 2022-05-14
- 1.4.1 — 2022-05-14
- 1.4.0 — 2022-05-14
- 1.3.0 — 2022-05-14
- 1.2.9 — 2022-05-14
- … 45 more at https://npm.io/package/@uralys/reactor/versions

## README

# Reactor

[![Build Status](https://travis-ci.com/uralys/reactor.svg?branch=master)](https://travis-ci.com/uralys/reactor)
[![License](https://img.shields.io/badge/License-MIT-green.svg?colorB=3cc712)](./license)
[![version](https://img.shields.io/github/package-json/v/uralys/reactor)](https://github.com/uralys/reactor/tags)

🪄 A simple "CreateReactApp-like", using **esbuild**, to bootstrap your `React app` and `npm scripts`.

```sh
> npx reactor
Usage: reactor <command>

Commands:
  reactor create  bootstrap your React app with initial files
  reactor start   run the local dev server
  reactor build   use esbuild to create the distribution files
  reactor toc     generate TOC for your documentation from your markdown files
```

## create your app

First prepare your new project with a startup package.json:

```sh
> mkdir yourApp; cd yourApp
> npm i --save-dev @uralys/reactor
```

Let's create your boot files:

```sh
> npx reactor create

☢️ reactor updated you files successfully.
✅ you can now start your App
> npm run start:dev
```

You can now version and push your project to your repository

```sh
> git init
> git add .
> git commit -m "Initial commit from @uralys/reactor"
> git remote add origin https://github.com/your-new-repo
> git push origin master
```

## commands

Once your app is created, you can use:

- `npm run start:dev` to run a local server with `esbuild` and `live-server`
- `npm run build` to build you `/public` distribution with `esbuild`

### TOC (Optional)

- `npm run toc` to generate TOC from you markdowns if you use `Reactor` to generate a documentation website. I'll document this later.

### indexation (Optional)

- add a sitemap config to generate your `sitemap.xml`
- for Google configure your indexation on <https://search.google.com/search-console>
- for DuckDuckGo configure your indexation on Bing (import from google search-console) <https://www.bing.com/webmasters>

## Config

You can update `reactor.config.js`:

```js
{
  esbuild: {
    ...esbuildOptions
  },
  documentation: {
    source: './path/to/docs',
    dist: './path/to/tocs'
  },
  start: {
    hosts: ["platform.localhost"]
  },
  sitemap: {
    publicPath = './public',
    links = [],
    hostname: 'https://your.domain',
    outputName = 'sitemap.xml'
  }
}
```

If your project uses `dotenv`, call it from the top of `reactor.config.js`

```js
import dotenv from 'dotenv';
dotenv.config();
```

## Tips and suggestions

### monitoring

- analyse perfs with <https://pagespeed.web.dev/>

### frontend

- use [`La Taverne`](https://github.com/uralys/taverne) for your state management
- add [`reactrouter`](https://reactrouter.com/web/guides/quick-start)
- add [`axios`](https://github.com/axios/axios) for http requests
- use this [`auth0 guide`](https://auth0.com/blog/complete-guide-to-react-user-authentication/) for the authentication
- add animations with [`react-spring`](https://github.com/pmndrs/react-spring)

### backend

- use [serverless](https://www.serverless.com/)!
- use [`netlify`](https://app.netlify.com/) to deploy. (Note: set `NODE_VERSION` in environnment vars)

## dev:publish Reactor

```sh
> npm version patch
> ggpush --tags
> npm run release
```

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