mirror of
https://github.com/desktop/desktop
synced 2024-10-31 11:07:25 +00:00
Merge branch 'master' into fix-quotes
This commit is contained in:
commit
0b98bafce0
6 changed files with 50 additions and 50 deletions
14
.travis.yml
14
.travis.yml
|
@ -3,6 +3,9 @@ notifications:
|
||||||
on_success: never
|
on_success: never
|
||||||
on_failure: change
|
on_failure: change
|
||||||
|
|
||||||
|
os:
|
||||||
|
- osx
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
@ -21,17 +24,14 @@ addons:
|
||||||
packages:
|
packages:
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install
|
- npm install
|
||||||
|
|
||||||
before_script:
|
|
||||||
- export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run build:prod
|
- npm run build:prod
|
||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
|
|
10
README.md
10
README.md
|
@ -6,16 +6,8 @@ Just playin around with some computering.
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want hot loading:
|
To build and run the app:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Start the dev server
|
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you don't care:
|
|
||||||
|
|
||||||
```
|
|
||||||
npm run build
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
'use strict'
|
|
||||||
|
|
||||||
const express = require('express')
|
|
||||||
const webpack = require('webpack')
|
|
||||||
const config = require('./webpack.development')
|
|
||||||
|
|
||||||
const app = express()
|
|
||||||
const compiler = webpack(config)
|
|
||||||
const port = process.env.PORT || 3000
|
|
||||||
|
|
||||||
app.use(require('webpack-dev-middleware')(compiler, {
|
|
||||||
publicPath: config.output.publicPath
|
|
||||||
}))
|
|
||||||
|
|
||||||
app.use(require('webpack-hot-middleware')(compiler))
|
|
||||||
|
|
||||||
app.listen(port, 'localhost', err => {
|
|
||||||
if (err) {
|
|
||||||
console.log(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`Listening at http://localhost:${port}`)
|
|
||||||
})
|
|
|
@ -13,9 +13,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "electron-mocha --renderer --require ts-node/register test/*.ts test/*.tsx",
|
"test": "electron-mocha --renderer --require ts-node/register test/*.ts test/*.tsx",
|
||||||
"postinstall": "typings install",
|
"postinstall": "typings install",
|
||||||
"start-server": "node dev_server.js",
|
"start": "npm run build:dev && node script/start",
|
||||||
"start": "npm run build:dev && npm-run-all --parallel run start-server",
|
|
||||||
"run": "env NODE_ENV=development node script/run",
|
|
||||||
"compile:dev": "tsc && env NODE_ENV=development webpack --config webpack.development.js",
|
"compile:dev": "tsc && env NODE_ENV=development webpack --config webpack.development.js",
|
||||||
"compile:prod": "tsc && env NODE_ENV=production webpack --config webpack.production.js",
|
"compile:prod": "tsc && env NODE_ENV=production webpack --config webpack.production.js",
|
||||||
"build:dev": "npm run compile:dev && env NODE_ENV=development node script/build",
|
"build:dev": "npm run compile:dev && env NODE_ENV=development node script/build",
|
||||||
|
@ -50,12 +48,11 @@
|
||||||
"chai": "^3.5.0",
|
"chai": "^3.5.0",
|
||||||
"electron-mocha": "2.1.0",
|
"electron-mocha": "2.1.0",
|
||||||
"electron-packager": "^7.0.1",
|
"electron-packager": "^7.0.1",
|
||||||
"electron-prebuilt": "^1.1.2",
|
"electron-prebuilt": "1.1.3",
|
||||||
"electron-winstaller": "^2.3.0",
|
"electron-winstaller": "^2.3.0",
|
||||||
"express": "^4.13.4",
|
"express": "^4.13.4",
|
||||||
"fs-extra": "^0.30.0",
|
"fs-extra": "^0.30.0",
|
||||||
"mocha": "^2.4.5",
|
"mocha": "^2.4.5",
|
||||||
"npm-run-all": "^1.8.0",
|
|
||||||
"react-addons-test-utils": "^15.0.2",
|
"react-addons-test-utils": "^15.0.2",
|
||||||
"ts-loader": "^0.8.2",
|
"ts-loader": "^0.8.2",
|
||||||
"ts-node": "^0.7.2",
|
"ts-node": "^0.7.2",
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
@ -7,15 +5,19 @@ const cp = require('child_process')
|
||||||
const distInfo = require('./dist-info')
|
const distInfo = require('./dist-info')
|
||||||
|
|
||||||
const distPath = distInfo.getDistPath()
|
const distPath = distInfo.getDistPath()
|
||||||
|
const productName = distInfo.getProductName()
|
||||||
|
|
||||||
let binaryPath = ''
|
let binaryPath = ''
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
binaryPath = path.join(distPath, 'GitHub.app', 'Contents', 'MacOS', 'GitHub')
|
binaryPath = path.join(distPath, `${productName}.app`, 'Contents', 'MacOS', `${productName}`)
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
binaryPath = path.join(distPath, 'GitHub')
|
binaryPath = path.join(distPath, `${productName}`)
|
||||||
} else {
|
} else {
|
||||||
console.error(`I dunno how to run on ${process.arch} :(`)
|
console.error(`I dunno how to run on ${process.arch} :(`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
cp.spawn(binaryPath, [], {env: process.env})
|
module.exports = function () {
|
||||||
|
const env = Object.assign({}, process.env, {NODE_ENV: 'development'})
|
||||||
|
return cp.spawn(binaryPath, [], {env})
|
||||||
|
}
|
33
script/start
Normal file
33
script/start
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const express = require('express')
|
||||||
|
const webpack = require('webpack')
|
||||||
|
const config = require('../webpack.development')
|
||||||
|
const run = require('./run')
|
||||||
|
|
||||||
|
const server = express()
|
||||||
|
const compiler = webpack(config)
|
||||||
|
const port = process.env.PORT || 3000
|
||||||
|
|
||||||
|
server.use(require('webpack-dev-middleware')(compiler, {
|
||||||
|
publicPath: config.output.publicPath
|
||||||
|
}))
|
||||||
|
|
||||||
|
server.use(require('webpack-hot-middleware')(compiler))
|
||||||
|
|
||||||
|
server.listen(port, 'localhost', err => {
|
||||||
|
if (err) {
|
||||||
|
console.log(err)
|
||||||
|
process.exit(1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Server running at http://localhost:${port}`)
|
||||||
|
|
||||||
|
const runningApp = run()
|
||||||
|
runningApp.on('close', () => {
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in a new issue