Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with main repo #1

Merged
merged 4 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact = true
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ Redux/MobX, data persistence, modern styling frameworks and all the other bells

## Getting started

```bash
git clone https://github.com/ctrlplusb/react-universally my-project
cd my-project
yarn
yarn run develop
```

Or, if you aren't using [`yarn`](https://yarnpkg.com/):

```bash
git clone https://github.com/ctrlplusb/react-universally my-project
cd my-project
Expand Down
2 changes: 1 addition & 1 deletion client/polyfills/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Modernizr from 'modernizr';
// load a polyfill.
if (!Modernizr.picture) {
console.log('Client does not support "picture", polyfilling it...');
// If you want to use the below do a `yarn add picturefill --exact` and then
// If you want to use the below do a `npm install picturefill -E -S` and then
// uncomment the lines below:
/*
require('picturefill');
Expand Down
8 changes: 0 additions & 8 deletions internal/docs/DEPLOY_TO_NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ __Step 2: `cd` into the cloned directory__

__Step 3: Install the project's dependencies__

yarn

Or, if you aren't using [`yarn`](https://yarnpkg.com/):

npm install

__Step 4: Install the awesome [`now`](https://zeit.co/now) CLI globally__
Expand All @@ -29,10 +25,6 @@ __Step 4: Install the awesome [`now`](https://zeit.co/now) CLI globally__

__Step 5: Deploy to "now"__

yarn run deploy

Or, if you aren't using [`yarn`](https://yarnpkg.com/):

npm run deploy

That's it. Your clipboard will contain the address of the deployed app. Open your browser, paste, go. These guys are seriously awesome hosts. [Check them out.](https://zeit.co/now)
2 changes: 1 addition & 1 deletion internal/docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ git fetch upstream
# Then merge them into your project
git merge upstream/master

# Deal with the merge conflicts, delete the yarn.lock file and
# Deal with the merge conflicts, delete the package-lock.json file and
# rebuild it, then commit and push.
```

Expand Down
24 changes: 12 additions & 12 deletions internal/docs/PKG_SCRIPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,46 @@

# Package Scripts

## `yarn run analyze:client`
## `npm run analyze:client`

Creates an 'webpack-bundle-analyze' session against the production build of the client bundle.

## `yarn run analyze:server`
## `npm run analyze:server`

Creates an 'webpack-bundle-analyze' session against the production build of the server bundle.

## `yarn run build`
## `npm run build`

Builds the client and server bundles, with the output being optimized.

## `yarn run build:dev`
## `npm run build:dev`

Builds the client and server bundles, with the output including development related code.

## `yarn run clean`
## `npm run clean`

Deletes any build output that would have originated from the other commands.

## `yarn run deploy`
## `npm run deploy`

Deploys your application to [`now`](https://zeit.co/now). If you haven't heard of these guys, please check them out. They allow you to hit the ground running! I've included them within this repo as it requires almost zero configuration to allow your project to be deployed to their servers.

## `yarn run develop`
## `npm run develop`

Starts a development server for both the client and server bundles. We use `react-hot-loader` v3 to power the hot reloading of the client bundle, whilst a filesystem watch is implemented to reload the server bundle when any changes have occurred.

## `yarn run lint`
## `npm run lint`

Executes `eslint` against the project. Alternatively you could look to install the `eslint-loader` and integrate it into the `webpack` bundle process.

## `yarn run start`
## `npm run start`

Executes the server. It expects you to have already built the bundles using the `yarn run build` command.
Executes the server. It expects you to have already built the bundles using the `npm run build` command.

## `yarn run test`
## `npm run test`

Runs the `jest` tests.

## `yarn run test:coverage`
## `npm run test:coverage`

Runs the `jest` tests and generates a coverage report. I recommend you look at [codecov.io](https://codecov.io) to host your coverage reports.
8 changes: 4 additions & 4 deletions internal/docs/PROJECT_CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ When a server request is being processed this filtering configuration export wil

## Environment Specific Values

Environment specific values are support via host system environment variables (e.g. `FOO=bar yarn run start`) and/or by providing an "env" file.
Environment specific values are support via host system environment variables (e.g. `FOO=bar npm run start`) and/or by providing an "env" file.

"env" files is an optional feature that is supported by the [`dotenv`](https://github.com/motdotla/dotenv) module. This module allows you to define files containing key/value pairs representing your required environment variables (e.g. `PORT=1337`). To use this feature create an `.env` file within the root of the project (we have provided an example file called `.env_example`, which contains all the environment variables this project currently relies on).

Expand All @@ -65,14 +65,14 @@ If you do however have the requirement to create and persist "env" files for mul
In order to target a specific environment configuration file you have to provide a matching `DEPLOYMENT` environment variable. For example:

```bash
yarn run build
DEPLOYMENT=staging yarn run start # This will look for a .env.staging file
npm run build
DEPLOYMENT=staging npm run start # This will look for a .env.staging file
```

> Note: you may be used to using NODE_ENV to distinguish between environment configuration, however, when using the React ecosystem it is highly recommended that you set NODE_ENV=production any time you want an optimised version of React (and other libs). Given this requirement, we instead defer to the use of a "DEPLOYMENT" variable. See [here](https://github.com/facebook/react/issues/6582) for more info on this.

> Note: if an environment specific configuration file exists, it will be used over the more generic `.env` file.

As stated before, the application has been configured to accept a mix-match of sources for the environment variables. i.e. you can provide some/all of the environment variables via a `.env` file, and others via the cli/host (e.g. `FOO=bar yarn run build`). This gives you greater flexibility and grants you the opportunity to control the provision of sensitive values (e.g. db connection string). Please do note that "env" file values will take preference over any values provided by the host/CLI.
As stated before, the application has been configured to accept a mix-match of sources for the environment variables. i.e. you can provide some/all of the environment variables via a `.env` file, and others via the cli/host (e.g. `FOO=bar npm run build`). This gives you greater flexibility and grants you the opportunity to control the provision of sensitive values (e.g. db connection string). Please do note that "env" file values will take preference over any values provided by the host/CLI.

> Note: It is recommended that you bind your environment configuration values to the global `./config/values.js`. See the existing items within as an example.
Loading