Skip to content

Commit

Permalink
docs: clappify (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip authored Jun 20, 2017
1 parent 206181e commit 17dffa6
Show file tree
Hide file tree
Showing 20 changed files with 558 additions and 631 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
## Commits

- [commit](http://github.com/electrode-io/electrode/commit/5b55a8dbdeed46752a3fa47a58e7df24fd53bf07) add config for mocha tests with es6
- [commit](http://github.com/electrode-io/electrode/commit/b2cf439c20794e54acb37f772edda375b30e701b) format gulpefile.js
- [commit](http://github.com/electrode-io/electrode/commit/b2cf439c20794e54acb37f772edda375b30e701b) format clap.js
- [commit](http://github.com/electrode-io/electrode/commit/6b3d49054c738c1f12d681cfc78ae74fe1ee31c8) ignore lerna no updating error
- [commit](http://github.com/electrode-io/electrode/commit/df369da6eff15744a56083d732d01f0699d4cdc5) update front facing README
- [commit](http://github.com/electrode-io/electrode/commit/b848a3a0342e62d2fb217a31eeb3a7615bb5000d) archetype-react-component: [minor][chore]move configs to component dev (#356)
- [commit](http://github.com/electrode-io/electrode/commit/87a6fb358da0199fd5f6f25c485621ec619fedc2) archetype-react-app-dev: [patch] add config for mocha tests with es6 (#373)
- [commit](http://github.com/electrode-io/electrode/commit/f51c1f7aa2f80566b63d6437dbe415ac0e55ef0a) archetype-react-app: [minor][chore] Modify gulp task based on flag (#371)
- [commit](http://github.com/electrode-io/electrode/commit/f51c1f7aa2f80566b63d6437dbe415ac0e55ef0a) archetype-react-app: [minor][chore] Modify clap task based on flag (#371)
- [commit](http://github.com/electrode-io/electrode/commit/829ff161b60c58591726066f13e20bb2a07c6408) archetype-react-app: [patch][chore] format code
- [commit](http://github.com/electrode-io/electrode/commit/6a85b4b72052464e3676c5bbf6f128a6e72feefa) archetype-react-app: [patch] use babel to optimize modules for PROD
- [commit](http://github.com/electrode-io/electrode/commit/a184fff313d41758efcbd7db8d5b095495435fc0) archetype-react-app: [patch][chore] prettier format all code (#378)
- [commit](http://github.com/electrode-io/electrode/commit/f804916d39e9239e13be9c475b56f2b8362aaebc) archetype-react-app: [patch] remove log files (#381)
- [commit](http://github.com/electrode-io/electrode/commit/62b19038de1d715c6c09cc314ff73cecdaf93fae) archetype-react-app: [patch] log loading custom webpack config (#382)
- [commit](http://github.com/electrode-io/electrode/commit/ed62e36d5a86925a62209d1eff1b8f8ebbbec8bc) (multiple): [patch][chore] update engines to node 8 (#379)
- [commit](http://github.com/electrode-io/electrode/commit/b6284abb52a8055be8406ee71b042d1815631473) generator-electrode: [patch][bug] Add default classNames to components (#376)
- [commit](http://github.com/electrode-io/electrode/commit/d81593a99f1bf324fae6c83f597db74e7dbc462a) generator-electrode: [minor][chore] Set ES6 flag in gulpfile. (#374)
- [commit](http://github.com/electrode-io/electrode/commit/d81593a99f1bf324fae6c83f597db74e7dbc462a) generator-electrode: [minor][chore] Set ES6 flag in clap.js. (#374)
- [commit](http://github.com/electrode-io/electrode/commit/da5e945b8f39ff5a6f5c64ef28bf2cb09afc5df9) generator-electrode: [patch][bug] Write all files before installing (#383)

# 6/13/2017
Expand Down Expand Up @@ -56,7 +56,7 @@
- [commit](http://github.com/electrode-io/electrode/commit/c2111967faf138e28a244483a0abe96a4402793d) archetype-react-app: [patch] FIX DeprecationWarning: loaderUtils.parseQuery() received a non-strin… (#347)
- [commit](http://github.com/electrode-io/electrode/commit/77f518601db3d0f96e29227adbb90f6755abd9f9) generator-electrode: Fix typo (#348)
- [commit](http://github.com/electrode-io/electrode/commit/a61e45832b67ac9c4bfad58895cb1ec9c32498be) archetype-react-app: Add Prettier and precommit hook packages (#349)
- [commit](http://github.com/electrode-io/electrode/commit/b3c007a40258aabc32fc57cf99c53ddc8e2aa640) archetype-react-app: [patch] FIX gulp lint as it skips src/server files (#353)
- [commit](http://github.com/electrode-io/electrode/commit/b3c007a40258aabc32fc57cf99c53ddc8e2aa640) archetype-react-app: [patch] FIX clap lint as it skips src/server files (#353)
- [commit](http://github.com/electrode-io/electrode/commit/2f16584b726b67407d97d5410ae7775ea1f98612) archetype-react-app: [patch] A Webpack plugin to optimize / minimize CSS assets. (#355)
- [commit](http://github.com/electrode-io/electrode/commit/2155b4e4b01de078d7185c16dfbc1786533ff490) update docs links in README
- [commit](http://github.com/electrode-io/electrode/commit/1066459dbcb1ac8159c06db01eefe84332e04359) archetype-react-app: [patch] fix webpack simple-progress output (#364)
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ There are [few guidelines](#contributing-guidelines) that we request contributor

This repo uses [Lerna] as a top level setup.

- Install `gulp` command
- Install `clap` command

```bash
$ npm install -g gulp-cli
$ npm install -g xclap-cli
```

- Fork and clone the repo at <https://github.com/electrode-io/electrode.git>
Expand All @@ -28,7 +28,7 @@ Run:
```bash
$ npm install
$ npm run bootstrap
$ gulp samples-local
$ clap samples-local
```

- Now you can go to the `samples` folder, pick or create any samples, develop and test your changes over there.
Expand All @@ -38,7 +38,7 @@ For example, run the `universal-react-node` samples in `dev` mode:
```bash
$ cd samples/universal-react-node
$ npm install
$ gulp dev
$ clap dev
```

After running above, you should see a similar text as `Hapi.js server running at http://m-C02SL0GSG8WM.local:3000` in command line.
Expand All @@ -48,7 +48,7 @@ And when you open the browser at `http://localhost:3000`, you should see a large
You can also run in `hot` mode. However, `hot` mode is still experimental and there are issues.

```bash
$ gulp hot
$ clap hot
```

## Contributing Guidelines
Expand Down
128 changes: 65 additions & 63 deletions docs/chapter1/advanced/powerful-electrode-tools/electrode-explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,116 +12,119 @@

## Prerequisites

* node: "&gt;=4.2.0"
* npm: "&gt;=3.0.0"
* Github access token
- node: ">=4.2.0"
- npm: ">=3.0.0"
- Github access token

## Overview

This is a central place where you can view

* demos of all the components under the organizations you specified
* documentation of your components
* dependencies your components have \(dependencies\)
* other components/applications that depend on your components \(usages\)
- demos of all the components under the organizations you specified
- documentation of your components
- dependencies your components have (dependencies)
- other components/applications that depend on your components (usages)

There are two ways the components can update dynamically:

1. Add GitHub hooks to send POST requests to `/api/update/{org}/{repoName}` when a new tag is created
2. Enable `./server/poll` plugin to set up cron job that sends the POST requests every day
1. Add GitHub hooks to send POST requests to `/api/update/{org}/{repoName}` when a new tag is created
2. Enable `./server/poll` plugin to set up cron job that sends the POST requests every day

It's recommended to use Method \#1 to see updates in near real time.
It's recommended to use Method #1 to see updates in near real time.

After the server receives the POST request, it will fetch the `package.json`file under `{yourGithubUrl}/{org}/{repoName}`, update [data/orgs.json](https://github.com/electrode-io/electrode-explorer/blob/master/data/orgs.json) and `data/{org}/{repoName}.json`files. If there is a newer version, it will try to download the new component through npm \([scripts/install-module.sh](https://github.com/electrode-io/electrode-explorer/blob/master/scripts/install-module.sh)\) after a waiting period, babel transpile, and webpack the demo module \([scripts/post-install-module.sh](https://github.com/electrode-io/electrode-explorer/blob/master/scripts/post-install-module.sh)\).
After the server receives the POST request, it will fetch the `package.json`file under `{yourGithubUrl}/{org}/{repoName}`, update [data/orgs.json](https://github.com/electrode-io/electrode-explorer/blob/master/data/orgs.json) and `data/{org}/{repoName}.json`files. If there is a newer version, it will try to download the new component through npm ([scripts/install-module.sh](https://github.com/electrode-io/electrode-explorer/blob/master/scripts/install-module.sh)) after a waiting period, babel transpile, and webpack the demo module ([scripts/post-install-module.sh](https://github.com/electrode-io/electrode-explorer/blob/master/scripts/post-install-module.sh)).

To make the server update immediately or force an update, add a url parameter to the POST request,`/api/update/{org}/{repoName}?updateNow=1`.

This post processing script works well with all electrode components \(meaning components using our [archetype](https://github.com/electrode-io/electrode-archetype-react-component)\). If you have non-electrode components, you can modify your [scripts/post-install-module.sh](https://github.com/electrode-io/electrode-explorer/blob/master/scripts/post-install-module.sh) to babel transpile and bundle your demo files.
This post processing script works well with all electrode components (meaning components using our [archetype](https://github.com/electrode-io/electrode-archetype-react-component)). If you have non-electrode components, you can modify your [scripts/post-install-module.sh](https://github.com/electrode-io/electrode-explorer/blob/master/scripts/post-install-module.sh) to babel transpile and bundle your demo files.

## Config

// config/default.json
{
"plugins": {
"./server/poll": {
"options": {
"enable": true
}
}
},

"githubApi": {
"version": "3.0.0",
"pathPrefix": "/api/v3",
"protocol": "https",
"host": "github.com"
},

"ORGS": [
// org/user names under which components will be included in the explorer
// for example, put ["xxx", "yyy"] to include every repo under github.com/xxx and github.com/yyy
],

"REPOS_USAGE_INCLUDE": [
// consumers need to contain one of these substrings to be included in usages
// for example, put ["react"] so consumers named /*react*/ will be included in usages
],

"REPOS_USAGE_EXCLUDE": [
// consumers containing any of these substrings won't be included in usages
// for example, put ["training"] so consumers named /*training*/ will be excluded in usages
],

"MODULE_PREFIXES_INCLUDE": [
// only module names beginning with one of these strings will be included in dependencies
// for example, put ["react"] so only modules with name starting with "react" will be included in dependencies
],

"NPM_WAITING_TIME": 300000, // wait for 5 minutes before `npm install`

"GHACCESS_TOKEN_NAME": "GHACCESS_TOKEN" // github token variable name, your token would be accessible via `process.env["GHACCESS_TOKEN"]`}
```js
// config/default.json
{
"plugins": {
"./server/poll": {
"options": {
"enable": true
}
}
},

"githubApi": {
"version": "3.0.0",
"pathPrefix": "/api/v3",
"protocol": "https",
"host": "github.com"
},

"ORGS": [
// org/user names under which components will be included in the explorer
// for example, put ["xxx", "yyy"] to include every repo under github.com/xxx and github.com/yyy
],

"REPOS_USAGE_INCLUDE": [
// consumers need to contain one of these substrings to be included in usages
// for example, put ["react"] so consumers named /*react*/ will be included in usages
],

"REPOS_USAGE_EXCLUDE": [
// consumers containing any of these substrings won't be included in usages
// for example, put ["training"] so consumers named /*training*/ will be excluded in usages
],

"MODULE_PREFIXES_INCLUDE": [
// only module names beginning with one of these strings will be included in dependencies
// for example, put ["react"] so only modules with name starting with "react" will be included in dependencies
],

"NPM_WAITING_TIME": 300000, // wait for 5 minutes before `npm install`

"GHACCESS_TOKEN_NAME": "GHACCESS_TOKEN" // github token variable name, your token would be accessible via `process.env["GHACCESS_TOKEN"]`
}
```

## Start server

First install dependencies

```
```bash
$ npm install
```

Export github access token or set it as an environment variable

```
```bash
export GHACCESS_TOKEN=YOUR_GITHUB_TOKEN
```

For development mode

```
$ gulp dev
```bash
$ clap dev
```

or

```
GHACCESS_TOKEN=YOUR_GITHUB_TOKEN gulp dev
```bash
GHACCESS_TOKEN=YOUR_GITHUB_TOKEN clap dev
```

For production mode

```
$ gulp build
```bash
$ clap build
```

and

```
```bash
NODE_ENV=production node .
```

or

```
```bash
GHACCESS_TOKEN=YOUR_GITHUB_TOKEN NODE_ENV=production node .
```

Expand All @@ -134,4 +137,3 @@ Since this is an Electrode application, it can be deployed the same way as any o
## Learn more

Wish to learn more? Check our [wiki](https://github.com/electrode-io/electrode-explorer/wiki) page!

Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,47 @@

### Maximum Performance Out of the Box

In our [Getting Started](/chapter1.md) section, we introduced you to our Yeoman Electrode [Generator](https://github.com/electrode-io/electrode#yeoman-generator) and we constructed an impressive application with the built in technologies that the simple `yo electrode` command gave us \(read our Getting Started: [What's Inside](/chapter1/quick-start/whats-inside.md) to learn more\):
In our [Getting Started](/chapter1.md) section, we introduced you to our Yeoman Electrode [Generator](https://github.com/electrode-io/electrode#yeoman-generator) and we constructed an impressive application with the built in technologies that the simple `yo electrode` command gave us (read our Getting Started: [What's Inside](/chapter1/quick-start/whats-inside.md) to learn more):

* [React](https://facebook.github.io/react/index.html)
- [React](https://facebook.github.io/react/index.html)

* [Redux](http://redux.js.org/docs/basics/UsageWithReact.html)
- [Redux](http://redux.js.org/docs/basics/UsageWithReact.html)

* [React Router](https://github.com/ReactTraining/react-router/tree/master/docs)
- [React Router](https://github.com/ReactTraining/react-router/tree/master/docs)

* [CSS Modules](https://github.com/css-modules/css-modules)
- [CSS Modules](https://github.com/css-modules/css-modules)

* [Universal rendering](https://medium.com/@mjackson/universal-javascript-4761051b7ae9#.xjxr5yj5z)
- [Universal rendering](https://medium.com/@mjackson/universal-javascript-4761051b7ae9#.xjxr5yj5z)

* [Webpack](https://webpack.github.io/docs/motivation.html)
- [Webpack](https://webpack.github.io/docs/motivation.html)

* [Webpack Isomorphic Loader](https://github.com/jchip/isomorphic-loader)
- [Webpack Isomorphic Loader](https://github.com/jchip/isomorphic-loader)

* [Babel](https://babeljs.io/)
- [Babel](https://babeljs.io/)

* [ESLint](http://eslint.org/)
- [ESLint](http://eslint.org/)

* [Mocha](https://mochajs.org/)+[Enzyme](https://github.com/airbnb/enzyme)+[TravisCI](https://travis-ci.org/)
- [Mocha](https://mochajs.org/)+[Enzyme](https://github.com/airbnb/enzyme)+[TravisCI](https://travis-ci.org/)

* [Gulp](http://gulpjs.com/)
- [Yeoman](http://yeoman.io/)

* [Yeoman](http://yeoman.io/)
- [History](https://www.npmjs.com/package/history)

* [History](https://www.npmjs.com/package/history)
- [Bluebird](http://bluebirdjs.com/docs/why-promises.html)

* [Bluebird](http://bluebirdjs.com/docs/why-promises.html)
- [Electrode Confippet](https://github.com/electrode-io/electrode-confippet)

* [Electrode Confippet](https://github.com/electrode-io/electrode-confippet)
- [Electrode-Server](https://github.com/electrode-io/electrode-server)

* [Electrode-Server](https://github.com/electrode-io/electrode-server)

* [Electrode-Docgen](https://github.com/electrode-io/electrode-docgen)
- [Electrode-Docgen](https://github.com/electrode-io/electrode-docgen)

This is the beginning foundation of the [Electrode Boilerplate](/chapter1/advanced/you-can-view-an-example-bundleanalyzetsv-output-using-the-electrode-boilerplate-code.md). You have learned in the [Stand Alone Modules](/chapter1/advanced/stand-alone-modules.md) section that each of the Electrode modules are agnostic and can be used individually to enhance one specific area of your application. However, integrated together, you have a supercharged application; one that is capable of handling the complex problems we face at WalmartLabs and reach maximum efficiency and performance.

This boilerplate includes the [Electrode Generator](/chapter1/quick-start/whats-inside.md) and it also has the following stand alone modules and tools built in for peak optimization out-of-the-box:

* [Above the Fold Rendering](/chapter1/advanced/stand-alone-modules/above-the-fold-rendering.md)
* [Server Side Render Cache + Profiling](/chapter1/advanced/stand-alone-modules/server-side-render-caching-+-profiling.md)
* [Stateless CSRF Validation](/chapter1/advanced/stand-alone-modules/stateless-csrf-validation.md)
* [Electrode Redux Router Engine](/chapter1/advanced/stand-alone-modules/redux-router-engine.md)
* [Electrode Bundle Analyzer](/chapter1/advanced/powerful-electrode-tools/bundle-analyzer.md)
* [Electrify](/chapter1/advanced/powerful-electrode-tools/electrify.md)



- [Above the Fold Rendering](/chapter1/advanced/stand-alone-modules/above-the-fold-rendering.md)
- [Server Side Render Cache + Profiling](/chapter1/advanced/stand-alone-modules/server-side-render-caching-+-profiling.md)
- [Stateless CSRF Validation](/chapter1/advanced/stand-alone-modules/stateless-csrf-validation.md)
- [Electrode Redux Router Engine](/chapter1/advanced/stand-alone-modules/redux-router-engine.md)
- [Electrode Bundle Analyzer](/chapter1/advanced/powerful-electrode-tools/bundle-analyzer.md)
- [Electrify](/chapter1/advanced/powerful-electrode-tools/electrify.md)
Loading

0 comments on commit 17dffa6

Please sign in to comment.