forked from trazyn/weweChat
-
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
Showing
41 changed files
with
12,866 additions
and
2 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,18 @@ | ||
// NOTE: These options are overriden by the babel-loader configuration | ||
// for webpack, which can be found in ~/build/webpack.config. | ||
// | ||
// Why? The react-transform-hmr plugin depends on HMR (and throws if | ||
// module.hot is disabled), so keeping it and related plugins contained | ||
// within webpack helps prevent unexpected errors. | ||
{ | ||
"presets": ['es2015', "react", "stage-0"], | ||
"plugins": ["babel-polyfill", "transform-decorators-legacy"], | ||
"env": { | ||
"production": { | ||
"presets": ["react-optimize"] | ||
}, | ||
"development": { | ||
"presets": ["react-hmre"] | ||
}, | ||
}, | ||
} |
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,7 @@ | ||
node_modules | ||
ios | ||
DS_Store | ||
android | ||
git | ||
dist | ||
__tests__ |
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 @@ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
insert_final_newnewline = true |
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,4 @@ | ||
|
||
dist/* | ||
__tests__/* | ||
|
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,31 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"impliedStrict": true, | ||
"jsx": true | ||
} | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "babel-eslint", | ||
"plugins": ["react"], | ||
"rules": { | ||
"semi": [2, "always"], | ||
"new-cap": [0], | ||
"indent": [2, 4, { "SwitchCase": 1 }], | ||
"comma-dangle": [2, "only-multiline"], | ||
"space-before-function-paren": [2, "never"], | ||
"operator-linebreak": [2, "before"], | ||
"no-floating-decimal": [0], | ||
"react/jsx-indent": [2, 4], | ||
"react/jsx-indent-props": [2, 4], | ||
"react/jsx-boolean-value": [2, "always"], | ||
"react/prop-types": [0], | ||
"jsx-quotes": [2, "prefer-double"] | ||
}, | ||
"extends": ["standard", "standard-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,42 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
project.xcworkspace | ||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
|
||
# BUCK | ||
buck-out/ | ||
\.buckd/ | ||
android/app/libs | ||
*.keystore |
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 @@ | ||
{} |
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 @@ | ||
{"title":"_title_55ln5_2"} |
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 @@ | ||
|
||
import path from 'path'; | ||
|
||
const config = { | ||
server: { | ||
port: process.env.PORT || 3000, | ||
host: 'localhost' | ||
}, | ||
|
||
client: path.resolve(__dirname, '../src'), | ||
assets: path.resolve(__dirname, '../src/assets'), | ||
dist: path.resolve(__dirname, '../dist'), | ||
|
||
/** Bebug namespace */ | ||
namespace: 'app:*', | ||
}; | ||
|
||
export default config; |
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,92 @@ | ||
|
||
import path from 'path'; | ||
import config from './index'; | ||
|
||
export default { | ||
|
||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.jsx?$/, | ||
loader: 'babel-loader', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
'style-loader', | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
// Note that we’ve set importLoaders: 1 on css-loader. | ||
// We’re setting this because we want PostCSS to git @import statements first | ||
importLoaders: 1, | ||
localIdentName: '[path][name]__[local]--[hash:base64:5]' | ||
}, | ||
}, | ||
{ | ||
loader: 'postcss-loader', | ||
options: { | ||
plugins: (loader) => [ | ||
require('postcss-import')(), | ||
require('postcss-autoreset')(), | ||
require('postcss-cssnext')({ | ||
browsers: [ | ||
'last 2 Chrome versions', | ||
'last 2 Edge versions', | ||
'last 2 Safari versions', | ||
'last 2 Firefox versions', | ||
], | ||
}), | ||
] | ||
} | ||
} | ||
], | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json-loader', | ||
}, | ||
{ | ||
test: /\.woff(\?.*)?$/, | ||
loader: 'url-loader?prefix=fonts/&name=[path][name].[ext]&limit=40000&mimetype=application/font-woff', | ||
}, | ||
{ | ||
test: /\.woff2(\?.*)?$/, | ||
loader: 'url-loader?prefix=fonts/&name=[path][name].[ext]&limit=40000&mimetype=application/font-woff2', | ||
}, | ||
{ | ||
test: /\.otf(\?.*)?$/, | ||
loader: 'file-loader?prefix=fonts/&name=[path][name].[ext]&limit=40000&mimetype=font/opentype', | ||
}, | ||
{ | ||
test: /\.ttf(\?.*)?$/, | ||
loader: 'url-loader?prefix=fonts/&name=[path][name].[ext]&limit=40000&mimetype=application/octet-stream', | ||
}, | ||
{ | ||
test: /\.eot(\?.*)?$/, | ||
loader: 'file-loader?prefix=fonts/&name=[path][name].[ext]', | ||
}, | ||
{ | ||
test: /\.svg(\?.*)?$/, | ||
loader: 'url-loader?prefix=fonts/&name=[path][name].[ext]&limit=40000&mimetype=image/svg+xml', | ||
}, | ||
] | ||
}, | ||
|
||
output: { | ||
path: config.dist, | ||
filename: 'bundle.js', | ||
|
||
// https://github.com/webpack/webpack/issues/1114 | ||
libraryTarget: 'commonjs2' | ||
}, | ||
|
||
resolve: { | ||
extensions: ['.js', '.jsx', '.json'], | ||
alias: { | ||
images: path.join(config.client, 'assets/images/'), | ||
fonts: path.join(config.client, 'assets/fonts/'), | ||
}, | ||
}, | ||
}; |
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,41 @@ | ||
|
||
import webpack from 'webpack'; | ||
import config from './index'; | ||
import baseConfig from './webpack.config.base'; | ||
|
||
const { host, port } = config.server; | ||
|
||
export default { | ||
|
||
...baseConfig, | ||
|
||
devtool: 'cheap-module-eval-source-map', | ||
|
||
entry: [ | ||
`webpack-hot-middleware/client?path=http://${host}:${port}/__webpack_hmr`, | ||
'babel-polyfill', | ||
`${config.client}/app.js`, | ||
], | ||
|
||
output: { | ||
...baseConfig.output, | ||
publicPath: `http://${host}:${port}/dist/`, | ||
}, | ||
|
||
plugins: [ | ||
// “If you are using the CLI, the webpack process will not exit with an error code by enabling this plugin.” | ||
// https://github.com/webpack/docs/wiki/list-of-plugins#noerrorsplugin | ||
new webpack.NoEmitOnErrorsPlugin(), | ||
|
||
// https://webpack.github.io/docs/hot-module-replacement-with-webpack.html | ||
new webpack.HotModuleReplacementPlugin(), | ||
|
||
// NODE_ENV should be production so that modules do not perform certain development checks | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('development') | ||
}), | ||
], | ||
|
||
// https://github.com/chentsulin/webpack-target-electron-renderer#how-this-module-works | ||
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,38 @@ | ||
|
||
import { app, BrowserWindow } from 'electron'; | ||
import windowStateKeeper from 'electron-window-state'; | ||
|
||
let mainWindow; | ||
|
||
const createMainWindow = () => { | ||
var mainWindowState = windowStateKeeper({ | ||
defaultWidth: 1024, | ||
defaultHeight: 720 | ||
}); | ||
|
||
mainWindow = new BrowserWindow({ | ||
width: mainWindowState.width, | ||
hieght: mainWindowState.height, | ||
x: mainWindowState.x, | ||
y: mainWindowState.y, | ||
webPreferences: { | ||
scrollBounce: true | ||
} | ||
}); | ||
|
||
mainWindowState.manage(mainWindow); | ||
|
||
mainWindow.loadURL(`file://${__dirname}/src/index.html`); | ||
|
||
mainWindow.webContents.on('did-finish-load', () => { | ||
mainWindow.show(); | ||
mainWindow.focus(); | ||
}); | ||
|
||
mainWindow.on('closed', () => { | ||
mainWindow = null; | ||
app.quit(); | ||
}); | ||
}; | ||
|
||
app.on('ready', createMainWindow); |
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
Binary file not shown.
Oops, something went wrong.