Skip to content

Commit

Permalink
v0.12.0 (#1023)
Browse files Browse the repository at this point in the history
* Renamed and alphabetized npm scripts (#1022)

* Renamed and alphabetized npm scripts

* Moved electron to deps from devDeps

* Reverted flow-runtime changes, moved react-hot-loader/babel

* Enforced immutability of redux actions and state using flow

* Changed webpack renderer dev node config (#1035)

* Increased timeout for e2e async test

* Remove progress and profile flags from npm scripts for cleaner output

* Removed babel-polyfill (#1052)

* Removed babel-polyfill

* Updated CI node versions

* Required npm >= 4

* Enable yarn on CI

* Fixed travis config spacing syntax error

* Converted tabs to spaces on CI configs

* Fixed duplicate key in appveyor config

* Misc commit

* Ignored node_modules from webpack dev-server watch

* Updated deps (#1100)

* Renamed webpack output filenames, fixed watchOptions of dev-server

Warn if main or renderer not built before e2e tests (#1117)

* Warn if main or renderer not built before e2e tests

* Fixed linter errors

Changed ordering of build and test scripts

* Updated changelog [ci skip]
  • Loading branch information
amilajack authored Jul 9, 2017
1 parent ded8bb7 commit 5369809
Show file tree
Hide file tree
Showing 25 changed files with 1,169 additions and 893 deletions.
3 changes: 1 addition & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"presets": [
["env", {
"targets": { "node": 6 },
"targets": { "node": 7 },
"useBuiltIns": true
}],
"stage-0",
Expand All @@ -17,7 +17,6 @@
"plugins": [
"transform-class-properties",
"transform-es2015-classes",
"react-hot-loader/babel",
["flow-runtime", {
"assert": true,
"annotate": true
Expand Down
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
root = true

[*]
indent_style = tab
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,js,jsx,html,css}]
[*.{json,js,jsx,html,css,yml}]
indent_style = space
indent_size = 2

Expand Down
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ flow-typed/npm/*
release
app/main.prod.js
app/main.prod.js.map
app/bundle.js
app/bundle.js.map
app/renderer.prod.js
app/renderer.prod.js.map
app/style.css
app/style.css.map
dist
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ flow-typed/npm/*
release
app/main.prod.js
app/main.prod.js.map
app/bundle.js
app/bundle.js.map
app/renderer.prod.js
app/renderer.prod.js.map
app/style.css
app/style.css.map
dist
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

15 changes: 0 additions & 15 deletions .tern-project

This file was deleted.

33 changes: 10 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@ sudo: false
language: node_js

node_js:
- 8
- 7
- 6

cache:
yarn: true
directories:
- node_modules

# Enable when https://github.com/yarnpkg/yarn/issues/1233 and
# https://github.com/yarnpkg/yarn/issues/1059 are resolved and disable npm cache
#
# cache:
# directories:
# - $HOME/.yarn-cache
- app/node_modules

addons:
apt:
Expand All @@ -30,26 +25,18 @@ addons:

install:
- export CXX="g++-4.8"
- npm install -g npm@latest
- npm install
- yarn
- cd app && yarn && cd ..
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"

# Enable when https://github.com/yarnpkg/yarn/issues/1233 and
# https://github.com/yarnpkg/yarn/issues/1059 are resolved and disable npm cache
#
# install:
# - export CXX="g++-4.8"
# - npm install -g yarnpkg
# - yarn
# - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start &
- sleep 3

script:
- npm run lint
- npm run test
- npm run test-e2e
- npm run package
- node --version
- yarn lint
- yarn package
- yarn test
- yarn test-e2e
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 0.12.0 (2017.7.8)

#### Misc
- Removed `babel-polyfill`
- Renamed and alphabetized npm scripts

#### Breaking
- Changed node dev `__dirname` and `__filename` to node built in fn's (https://github.com/chentsulin/electron-react-boilerplate/pull/1035)
- Renamed `app/bundle.js` to `app/renderer.prod.js` for consistency
- Renamed `dll/vendor.js` to `dll/renderer.dev.dll.js` for consistency

#### Additions
- Enable node_modules cache on CI

# 0.11.2 (2017.5.1)

Yay! Another patch release. This release mostly includes refactorings and router bug fixes. Huge thanks to @anthonyraymond!
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ $ npm run dev
You Run these two commands __simultaneously__ in different console tabs:

```bash
$ npm run hot-updates-server
$ npm run start-hot-renderer
$ npm run start-renderer-dev
$ npm run start-main-dev
```

## Editor Configuration
Expand Down
2 changes: 1 addition & 1 deletion app/actions/counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { counterStateType } from '../reducers/counter';

type actionType = {
type: string
+type: string
};

export const INCREMENT_COUNTER = 'INCREMENT_COUNTER';
Expand Down
6 changes: 3 additions & 3 deletions app/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
// Dynamically insert the DLL script in development env in the
// renderer process
if (process.env.NODE_ENV === 'development') {
scripts.push('../dll/vendor.dll.js');
scripts.push('../dll/renderer.dev.dll.js');
}

// Dynamically insert the bundled app script in the renderer process
const port = process.env.PORT || 1212;
scripts.push(
(process.env.HOT)
? 'http://localhost:' + port + '/dist/bundle.js'
: './dist/bundle.js'
? 'http://localhost:' + port + '/dist/renderer.dev.js'
: './dist/renderer.prod.js'
);

document.write(
Expand Down
4 changes: 2 additions & 2 deletions app/reducers/counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/counter';

export type counterStateType = {
counter: number
+counter: number
};

type actionType = {
type: string
+type: string
};

export default function counter(state: number = 0, action: actionType) {
Expand Down
32 changes: 8 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ os: unstable

environment:
matrix:
- nodejs_version: 8
- nodejs_version: 7
- nodejs_version: 6

cache:
- "%LOCALAPPDATA%/Yarn"
- node_modules -> package.json
- app/node_modules -> app/package.json

# Enable when https://github.com/yarnpkg/yarn/issues/1233 and
# https://github.com/yarnpkg/yarn/issues/1059 are resolved and disable npm cache
#
# cache:
# - "%LOCALAPPDATA%/Yarn"

matrix:
fast_finish: true

Expand All @@ -29,23 +24,12 @@ clone_depth: 1
install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
- npm install -g npm@latest
- set PATH=%APPDATA%\npm;%PATH%
- npm install

# Enable when https://github.com/yarnpkg/yarn/issues/1233 and
# https://github.com/yarnpkg/yarn/issues/1059 are resolved and disable npm cache
#
# install:
# - ps: Install-Product node $env:nodejs_version
# - set CI=true
# - choco install yarn
# - refreshenv
# - yarn
- yarn
- cd app && yarn

test_script:
- node --version
- npm run lint
- npm run test
- npm run test-e2e
- npm run package
- yarn lint
- yarn package
- yarn test
- yarn test-e2e
2 changes: 2 additions & 0 deletions internals/flow/WebpackAsset.js.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @flow
declare export default string
24 changes: 24 additions & 0 deletions internals/scripts/CheckBuiltsExist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @flow
// Check if the renderer and main bundles are built
import path from 'path';
import chalk from 'chalk';
import fs from 'fs';

function CheckBuildsExist() {
const mainPath = path.join(__dirname, '..', '..', 'app', 'main.prod.js');
const rendererPath = path.join(__dirname, '..', '..', 'app', 'dist', 'renderer.prod.js');

if (!fs.existsSync(mainPath)) {
throw new Error(chalk.whiteBright.bgRed.bold(
'The main process is not built yet. Build it by running "npm run build-main"'
));
}

if (!fs.existsSync(rendererPath)) {
throw new Error(chalk.whiteBright.bgRed.bold(
'The renderer process is not built yet. Build it by running "npm run build-renderer"'
));
}
}

CheckBuildsExist();
15 changes: 15 additions & 0 deletions internals/scripts/CheckNodeEnv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// @flow
import chalk from 'chalk';

export default function CheckNodeEnv(expectedEnv: string) {
if (!expectedEnv) {
throw new Error('"expectedEnv" not set');
}

if (process.env.NODE_ENV !== expectedEnv) {
console.log(chalk.whiteBright.bgRed.bold(
`"process.env.NODE_ENV" must be "${expectedEnv}" to use this webpack config`
));
process.exit(2);
}
}
Loading

0 comments on commit 5369809

Please sign in to comment.