# sails-generate-reactjs

> Generate a react JS based frontend for Sails.

Latest version **0.3.0** (published 2015-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install sails-generate-reactjs
pnpm add sails-generate-reactjs
yarn add sails-generate-reactjs
bun add sails-generate-reactjs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2015-09-17 |
| First published | 2015-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | Erik Schlegel |
| Maintainers | erikschlegel |
| Keywords | sailsjs, reactjs, mocha, web, nodejs, npm, browserfy, es6, babel |

## Links

- npm: https://www.npmjs.com/package/sails-generate-reactjs
- Repository: https://github.com/erikschlegel/sails-generate-reactjs
- Homepage: https://github.com/erikschlegel/sails-generate-reactjs#readme
- Issues: https://github.com/erikschlegel/sails-generate-reactjs/issues
- npm.io page: https://npm.io/package/sails-generate-reactjs

## Dependencies (4)

- [rc](https://npm.io/package/rc.md) ~0.5.0
- [grunt](https://npm.io/package/grunt.md) ^0.4.5
- [lodash](https://npm.io/package/lodash.md) >=2.4.x
- [merge-defaults](https://npm.io/package/merge-defaults.md) >=0.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2015-09-17
- 0.2.19 — 2015-09-17
- 0.2.18 — 2015-09-17
- 0.2.17 — 2015-06-09
- 0.2.16 — 2015-06-09
- 0.2.15 — 2015-06-09
- 0.2.14 — 2015-05-21
- 0.2.13 — 2015-05-21
- 0.2.12 — 2015-05-21
- 0.2.11 — 2015-05-19
- 0.2.10 — 2015-05-18
- 0.2.9 — 2015-05-18
- 0.2.7 — 2015-05-18
- 0.2.6 — 2015-05-11
- 0.2.5 — 2015-05-11
- … 4 more at https://npm.io/package/sails-generate-reactjs/versions

## README

[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/erikschlegel/sails-generate-reactjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

![image_squidhome@2x.png](http://i.imgur.com/RIvu9.png)

#### Overview
A `frontend` ReactJS generator for use with the Sails command-line interface. This bootstraps a full stack site using reactJS / Twitter Bootstrap, that enables you to spin up a modern stack web platform in a few commands. This repo comes bundled with Babel for converting ES6 components into ES5 compatible modules that can run across all browsers. This also ships with Browersify Grunt tasks to wrap all JS dependencies in a single JS file. 

#### Update your .sailsrc file
You'll need to configure Sails to use this extension for creating new Sails sites. This can be achieved by creating a file named `.sailsrc` in your home directory, or the parent directory of where you are creating projects. 
```json
{
    "generators" : {
        "modules" : {
            "frontend" : "sails-generate-reactjs"
        }
    }
}
```

### Installation
Certain generators are installed by default in Sails, but they can be overridden.  Check the [Sails docs](http://sailsjs.org/#!documentation) for information on installing generator overrides / custom generators. 

**Note** for Ubuntu environments, you'll need to run all the commands below as sudo(i.e. sudo npm install vs npm install).

##### On the command line
1. Install this package globally via NPM, and extends off the SailsJS baseline generator
```sh
$ npm install -g sails-generate-reactjs sails grunt-cli
```

2. This command will create your React Site
```sh
$ sails new <%-yourReactAppName> --force
```

3. Install your app's node modules locally
```sh
$ cd <%-yourReactAppName>
$ npm install
```

4. fire up your web app
```sh
$ sails lift
```
### Verifying a successful build

This package comes bundled with a starter Travis CI configuration file. You can use Travis CI to run your tests and build your app whenever a Git commit occurs. Getting started with [Travis](https://travis-ci.com/) is as easy as enabling your project on the travis portal, overriding the default .travis.yml config file and committing some code. Travis will automatically run your app's 'npm test' command and handle notifying your team the results of the build. 

### How to Test

Unit tests are powered by [Mocha](http://mochajs.org/), and are automatically triggered on every Git commit via Travis and whenever your sails site is lifted. The project comes packaged with [ESLint](http://eslint.org/), which can be easily configured and used to enforce valid javascript syntax and coding standards. A Grunt task(<i>called test</i>) runs all Mocha tests within the test folder of the project, while also verifying the site built successfully. You can explicitly run the unit tests by invoking the following command. 

By default Mocha runs all tests that are placed in the /test directory. You can change this by modifying the mocha grunt config in /tasks/config/mochaTest.js

```shell
$ npm test
```
### Configuring Package.json and Bower.json

This project has a feature where you can configure the bower and package.json template files, that's created when you run 'sails new'. 

```sh
vi ./templates/bower.ejs
```

```sh
vi /templates/package.ejs
```

### Roadmap
* Fix grunt tasks for production
* Integrate Protractor into this generator for front-end control testing, and Istanbul for code coverage reporting

### Questions?

Post questions/issues onto Gitter and I'll respond as soon as possible.

### More Resources

- [Stackoverflow](http://stackoverflow.com/questions/tagged/sails.js)
- [#sailsjs on Freenode](http://webchat.freenode.net/) (IRC channel)
- [Twitter](https://twitter.com/sailsjs)
- [Professional/enterprise](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#are-there-professional-support-options)
- [Tutorials](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#where-do-i-get-help)

### License

**[MIT](./LICENSE)**

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