-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 53b5a36
Showing
12 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"es2015", | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "babel-eslint", | ||
"plugins": [ | ||
"react" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended" | ||
], | ||
"rules": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "nicomentron", | ||
"version": "0.1.0", | ||
"description": "comments viewer for live.nicovideo.jp", | ||
"main": "app/main.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "./node_modules/.bin/eslint ./src", | ||
"build": "npm run build:main && npm run build:renderer", | ||
"build:main": "cross-env NODE_ENV=production node -r babel-register ./node_modules/.bin/webpack --config webpack.config.electron.js --progress --profile --colors", | ||
"build:renderer": "cross-env NODE_ENV=production node -r babel-register ./node_modules/.bin/webpack --config webpack.config.production.js --progress --profile --colors", | ||
"start": "./node_modules/.bin/electron .", | ||
"start:dev": "cross-env NODE_ENV=development electron -r babel-register ./src/main.js", | ||
"watch": "cross-env NODE_ENV=development node -r babel-register ./node_modules/.bin/webpack-dev-server --config webpack.config.development.js", | ||
"dev": "./node_modules/.bin/npm-run-all -p watch start:dev" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tsuwatch/nicomentron.git" | ||
}, | ||
"author": "tsuwatch", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/tsuwatch/nicomentron/issues" | ||
}, | ||
"homepage": "https://github.com/tsuwatch/nicomentron#readme", | ||
"dependencies": { | ||
"nicolive": "0.0.4", | ||
"react": "^15.3.2", | ||
"react-dom": "^15.3.2" | ||
}, | ||
"devDependencies": { | ||
"babel": "^6.5.2", | ||
"babel-core": "^6.18.0", | ||
"babel-eslint": "^7.1.0", | ||
"babel-loader": "^6.2.7", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-register": "^6.18.0", | ||
"concurrently": "^3.1.0", | ||
"cross-env": "^3.1.3", | ||
"electron-prebuilt": "^1.3.8", | ||
"eslint": "^3.9.1", | ||
"eslint-plugin-react": "^6.5.0", | ||
"html-webpack-plugin": "^2.24.1", | ||
"npm-run-all": "^3.1.1", | ||
"react-hot-loader": "^3.0.0-beta.6", | ||
"webpack": "^1.13.3", | ||
"webpack-dev-server": "^1.16.2", | ||
"webpack-merge": "^0.15.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
|
||
export default class App extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Nicomentron</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script> | ||
{ | ||
const script = document.createElement('script'); | ||
const port = process.env.PORT || 3000; | ||
script.src = process.env.NODE_ENV === 'development' ? | ||
'http://localhost:' + port + '/index.js' : 'index.js'; | ||
document.write(script.outerHTML); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import App from './components/App'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {app, BrowserWindow} from 'electron'; | ||
|
||
let mainWindow = null; | ||
|
||
app.on('ready', () => { | ||
if (mainWindow) return; | ||
|
||
mainWindow = new BrowserWindow({width: 800, height: 600}); | ||
mainWindow.loadURL(`file://${__dirname}/../src/index.html`); | ||
mainWindow.on('closed', () => { | ||
mainWindow = null; | ||
}); | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
mainWindow.openDevTools(); | ||
} | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import path from 'path'; | ||
|
||
export default { | ||
output: { | ||
path: path.join(__dirname, 'app'), | ||
filename : 'bundle.js', | ||
libraryTarget: 'commonjs2' | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', 'jsx'] | ||
}, | ||
module: { | ||
loaders: [{ | ||
test : /\.jsx?$/, | ||
loaders: ['babel-loader'], | ||
exclude: /node_modules/ | ||
}] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import path from 'path'; | ||
import webpack from 'webpack'; | ||
import merge from 'webpack-merge'; | ||
import HtmlWebpackPlugin from 'html-webpack-plugin'; | ||
import baseConfig from './webpack.config.base'; | ||
|
||
const port = process.env.PORT || 3000; | ||
|
||
export default merge(baseConfig, { | ||
debug: true, | ||
devtool: 'cheap-module-eval-source-map', | ||
entry: { | ||
app: ['./src/index'] | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'app'), | ||
filename : 'index.js', | ||
publicPath: `http://localhost:${port}/` | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin(), | ||
new HtmlWebpackPlugin({ | ||
filename: 'index.html', | ||
template: 'src/index.html', | ||
inject: false | ||
}) | ||
], | ||
devServer: { | ||
port: port, | ||
inline: true, | ||
colors: true | ||
}, | ||
target: 'electron-renderer' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import path from 'path'; | ||
import webpack from 'webpack'; | ||
import merge from 'webpack-merge'; | ||
import baseConfig from './webpack.config.base'; | ||
|
||
export default merge(baseConfig, { | ||
devtool: 'source-map', | ||
entry: ['./src/main'], | ||
output: { | ||
path: path.join(__dirname, 'app'), | ||
filename : 'main.js', | ||
}, | ||
target: 'electron-main', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import path from 'path'; | ||
import webpack from 'webpack'; | ||
import merge from 'webpack-merge'; | ||
import HtmlWebpackPlugin from 'html-webpack-plugin'; | ||
import baseConfig from './webpack.config.base'; | ||
|
||
export default merge(baseConfig, { | ||
devtool: 'cheap-module-eval-source-map', | ||
entry: ['./src/index'], | ||
output: { | ||
path: path.join(__dirname, 'app'), | ||
filename : 'index.js', | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
filename: 'index.html', | ||
template: 'src/index.html', | ||
inject: false | ||
}) | ||
], | ||
target: 'electron-renderer' | ||
}); |