Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #15 from freedomofpress/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
conorsch committed May 5, 2017
2 parents 9fdd83c + 6cad058 commit e76d232
Show file tree
Hide file tree
Showing 42 changed files with 133 additions and 105 deletions.
8 changes: 5 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"test": {
"plugins": [
["webpack-loaders", { "config": "webpack.config.node.js", "verbose": false }],
["babel-plugin-module-alias", [
{ "src": "test/mocks/electron.js" , "expose": "electron" }
]]
["module-resolver", {
"alias": {
"electron": "./test/mocks/electron.js"
}
}]
]
}
}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ dist
release
.nyc_output
.vagrant/
.DS_Store

# Linux builds require PNG-format icons extracted from app.icns file.
build/icons/*.png

# External roles are included from Ansible Galaxy, don't version control.
ansible/roles/geerlingguy.nodejs
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ansible:

clean:
rm -rf release/
rm -rf build/icons/*.png
rm -rf ansible/roles/geerlingguy.nodejs

build:
make ansible
Expand Down
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ You need a recent version of Node.js and NPM installed. Tested with:

* v4.1.0
* v5.7.0
* v7.5.0

### Quickstart
1. Clone the git repository
Expand All @@ -32,25 +33,18 @@ make build
to create a VM and run a full build of the Linux packages.
To build the OS X packages, read on.

### Step-by-step (required for OS X)
Compile the CSS and JavaScript:

```
npm run build-app
```
### OS X


The built assets end up in the `dist/` folder. Once the assets have been built,
open the app in production mode:
To package up the app for your current platform (e.g. OS X):

```
npm start
npm run dist
```

With built assets, you can now package up the app for your current platform (e.g. OS X):
Note that this will run `build-app` so there's no need to run that beforehand.

```
npm run dist
```
Packages will be stored in `dist/<platform>`.

### Code Signing

Packages will be stored in `release/`.
Code signing is handled automatically by the `electron-builder` package. All you should need to do is add the signing identity through xcode, and electron-builder will discover it automatically. See [Apple documentation](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html) and [electron-builder documentation](https://github.com/electron-userland/electron-builder/wiki/Code-Signing) for more info.
8 changes: 6 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ Vagrant.configure("2") do |config|
ansible.playbook = "ansible/playbook.yml"
end
sunder.vm.provider "virtualbox" do |vb|
# Building nodejs packages triggers the OOM killer with 512MB of RAM.
vb.memory = 1024
# Building nodejs packages triggers the OOM killer with 1GB of RAM.
vb.memory = 2048
end
sunder.vm.provider "libvirt" do |lv, override|
lv.memory = 2048
override.vm.synced_folder './', '/vagrant', type: 'nfs', disabled: false
end
end
end
2 changes: 1 addition & 1 deletion ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
roles:
- role: geerlingguy.nodejs
become: yes
nodejs_version: "4.x"
nodejs_version: "7.x"

- role: sunder-build
14 changes: 14 additions & 0 deletions ansible/roles/sunder-build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
- libgconf2-dev
- libgtk2.0-dev
- libnss3-dev
# Required for electron-builder:
# https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#linux
- icnsutils
- graphicsmagick
- xz-utils

- name: Generate PNG-format icons.
command: >
icns2png --extract
--output /vagrant/build/icons/
/vagrant/build/icons/app.icns
args:
# Use `make clean` in the project root to clear out old icons.
creates: /vagrant/build/icons/app_32x32x32.png

# These packages must be installed globally, because they're referenced
# as system-wide scripts in the build process. The geerlingguy.nodejs role
Expand Down
66 changes: 26 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register --recursive --require ./test/setup.js test/**/*.spec.js",
"test-watch": "npm test -- --watch",
"test-e2e": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register --require ./test/setup.js --require co-mocha ./test/e2e.js",
"test-e2e": "cross-env NODE_ENV=production mocha --compilers js:babel-core/register --require ./test/setup.js --require co-mocha ./test/e2e.js",
"coverage": "NODE_ENV=test node_modules/.bin/nyc --require babel-core/register node_modules/.bin/_mocha --recursive --require ./test/setup.js test/**/*.spec.js",
"lint": "eslint src test *.js",
"hot-server": "node server.js",
Expand All @@ -17,29 +17,21 @@
"clean-build": "npm prune && npm run clean && npm run build-app",
"start": "cross-env NODE_ENV=production electron ./",
"start-hot": "cross-env HOT=1 NODE_ENV=development electron ./",
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && install-app-deps && node tasks/postinstall.js",
"postinstall": "install-app-deps && node tasks/postinstall.js && electron-rebuild",
"dev": "concurrently --kill-others \"npm run hot-server\" \"npm run start-hot\"",
"dist": "build"
"dist": "npm run build-app && build"
},
"build": {
"app-bundle-id": "apple.app.id",
"app-category-type": "public.app-category.utilities",
"productName": "Sunder",
"asar": false,
"osx": {
"background": "build/bg.jpg",
"icon": "build/icons/app.icns"
},
"linux": {
"icon": "build/icons/app.icns"
"icon": "build/icons/",
"target": ["deb"]
}
},
"directories": {
"output": "release",
"app": "app"
},
"bin": {
"electron": "./node_modules/.bin/electron"
"electron": "./node_modules/.bin/electron",
"electron-rebuild": "./node_modules/.bin/electron-rebuild"
},
"license": "MIT",
"devDependencies": {
Expand All @@ -48,46 +40,43 @@
"babel-eslint": "^6.0.0",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-module-alias": "^1.3.0",
"babel-plugin-module-resolver": "^2.7.0",
"babel-plugin-webpack-loaders": "^0.4.0",
"babel-polyfill": "^6.6.1",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.0.1",
"babel-preset-stage-0": "^6.3.13",
"chai": "^3.3.0",
"chromedriver": "^2.19.0",
"co-mocha": "^1.1.2",
"chromedriver": "^2.29.0",
"co-mocha": "^1.2.0",
"concurrently": "^2.0.0",
"cross-env": "^1.0.7",
"css-loader": "^0.23.1",
"del": "^2.0.1",
"dirty-chai": "^1.2.2",
"electron-builder": "^3.16.1",
"electron-installer-debian": "^0.3.0",
"electron-packager": "^7.0.1",
"electron-prebuilt": "^0.37.4",
"electron-rebuild": "^1.1.3",
"electron": "^1.4.16",
"electron-builder": "^17.0.1",
"electron-rebuild": "^1.5.7",
"enzyme": "^2.2.0",
"eslint": "^2.7.0",
"eslint-config-airbnb": "^7.0.0",
"eslint-plugin-jsx-a11y": "^0.6.2",
"eslint-plugin-react": "^4.3.0",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"fbjs-scripts": "^0.6.0",
"file-loader": "^0.8.5",
"jsdom": "^8.4.0",
"json-loader": "^0.5.4",
"minimist": "^1.2.0",
"mocha": "^2.3.0",
"mocha": "^3.3.0",
"mockery": "^1.6.2",
"node-sass": "^3.4.2",
"nyc": "^6.4.0",
"nyc": "^10.3.0",
"react-addons-test-utils": "^15.0.0",
"redux-logger": "^2.6.1",
"sass-loader": "^3.2.0",
"selenium-webdriver": "^2.48.2",
"selenium-webdriver": "^3.3.0",
"sinon": "^1.17.3",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
Expand All @@ -97,21 +86,18 @@
"webpack-target-electron-renderer": "^0.4.0"
},
"dependencies": {
"electron-debug": "^0.6.0",
"electron-debug": "^1.1.0",
"font-awesome": "^4.4.0",
"react": "^15.0.1",
"react-dom": "^15.0.1",
"react-redux": "^4.4.5",
"react-router": "^2.3.0",
"prop-types": "^15.5.8",
"react": "^15.5.0",
"react-dom": "^15.5.0",
"react-redux": "^4.4.8",
"react-router": "^3.0.5",
"react-router-redux": "^4.0.0",
"redux": "^3.2.1",
"redux-form": "^5.1.1",
"redux-promise": "^0.5.0",
"redux-thunk": "^2.0.0"
},
"devEngines": {
"node": "4.x || 5.x || 6.x || 7.x",
"npm": "2.x || 3.x || 4.x"
"redux": "^3.6.0",
"redux-form": "^5.3.6",
"redux-promise": "^0.5.1",
"redux-thunk": "^2.2.0"
},
"nyc": {
"include": [
Expand Down
3 changes: 2 additions & 1 deletion src/components/BackButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from './Button';


Expand Down
3 changes: 2 additions & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import './Button.scss';

export default function Button(props) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/CopyButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from './Button';


Expand Down
3 changes: 2 additions & 1 deletion src/components/Distribute.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ShareRow from './ShareRow';
import Panel from './Panel';
import Info from './Info';
Expand Down
3 changes: 2 additions & 1 deletion src/components/ErrorMessage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './ErrorMessage.scss';


Expand Down
3 changes: 2 additions & 1 deletion src/components/Export.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Export.scss';
import Panel from './Panel';
import Button from './Button';
Expand Down
3 changes: 2 additions & 1 deletion src/components/FileInput.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from 'src/components/Button';
import fs from 'fs';

Expand Down
3 changes: 2 additions & 1 deletion src/components/FileOrTextInput.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import FileInput from './FileInput';
import './FileOrTextInput.scss';

Expand Down
3 changes: 2 additions & 1 deletion src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Home.scss';
import PuzzleIcon from 'src/components/PuzzleIcon';
import Button from './Button';
Expand Down
3 changes: 2 additions & 1 deletion src/components/HomeButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from './Button';


Expand Down
3 changes: 2 additions & 1 deletion src/components/Info.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Info.scss';


Expand Down
3 changes: 2 additions & 1 deletion src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import './Layout.scss';


Expand Down
3 changes: 2 additions & 1 deletion src/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Panel from './Panel';
import './Modal.scss';

Expand Down
3 changes: 2 additions & 1 deletion src/components/NumberField.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Field.scss';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/components/Panel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import './Panel.scss';


Expand Down
3 changes: 2 additions & 1 deletion src/components/PuzzleIcon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/components/Recover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Button from './Button';
import ShareInput from './ShareInput';
import RecoverStatus from './RecoverStatus';
Expand Down
3 changes: 2 additions & 1 deletion src/components/RecoverStatus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import RecoverStatusShare from './RecoverStatusShare';
import './RecoverStatus.scss';

Expand Down
3 changes: 2 additions & 1 deletion src/components/RecoverStatusShare.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { removeShare } from '../ducks/recover';
import './RecoverStatusShare.scss';
Expand Down
3 changes: 2 additions & 1 deletion src/components/SaveFileButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { remote } from 'electron';
import fs from 'fs';
import Button from './Button';
Expand Down
Loading

0 comments on commit e76d232

Please sign in to comment.