Skip to content

Commit

Permalink
add sketch mockup
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Jul 2, 2017
1 parent f05eb2b commit a4dbfee
Show file tree
Hide file tree
Showing 41 changed files with 12,866 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .babelrc
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"]
},
},
}
7 changes: 7 additions & 0 deletions .ctrlpignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
ios
DS_Store
android
git
dist
__tests__
10 changes: 10 additions & 0 deletions .editorconfig
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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

dist/*
__tests__/*

31 changes: 31 additions & 0 deletions .eslintrc.json
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"]
}
42 changes: 42 additions & 0 deletions .gitignore
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
1 change: 1 addition & 0 deletions buildglobal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions buildstyle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"title":"_title_55ln5_2"}
18 changes: 18 additions & 0 deletions config/index.js
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;
92 changes: 92 additions & 0 deletions config/webpack.config.base.js
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/'),
},
},
};
41 changes: 41 additions & 0 deletions config/webpack.config.dev.js
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'
};
38 changes: 38 additions & 0 deletions index.js
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);
61 changes: 59 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,65 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint --format=node_modules/eslint-formatter-pretty .",
"hot-server": "cross-env NODE_ENV=development node -r babel-register scripts/dev.js",
"start-hot": "cross-env HOT=1 NODE_ENV=development ./node_modules/.bin/electron -r babel-register -r babel-polyfill ./index",
"dev": "concurrently --kill-others \"npm run hot-server\" \"npm run start-hot\""
},
"author": "",
"license": "ISC"
"license": "ISC",
"dependencies": {
"axios": "^0.16.2",
"electron": "^1.6.11",
"electron-window-state": "^4.1.1",
"ionicons": "^3.0.0",
"mobx": "^3.1.16",
"mobx-react": "^4.2.1",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-router": "2.8.1"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.24.1",
"concurrently": "^3.5.0",
"cross-env": "^5.0.1",
"css-loader": "^0.28.4",
"cssnano": "^3.10.0",
"devtron": "^1.4.0",
"eslint": "^4.1.1",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-react": "^5.0.0",
"eslint-formatter-pretty": "^1.1.0",
"eslint-plugin-import": "^2.6.1",
"eslint-plugin-node": "^5.1.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.1.0",
"eslint-plugin-standard": "^3.0.1",
"express": "^4.15.3",
"file-loader": "^0.11.2",
"json-loader": "^0.5.4",
"postcss-autoreset": "^2.0.0",
"postcss-cssnext": "^2.11.0",
"postcss-import": "^10.0.0",
"postcss-loader": "^2.0.6",
"postcss-modules": "^0.8.0",
"style-loader": "^0.18.2",
"url-loader": "^0.5.9",
"webpack": "^3.0.0",
"webpack-dev-middleware": "^1.11.0",
"webpack-hot-middleware": "^2.18.0"
}
}
Binary file added resource/weweChat.sketch
Binary file not shown.
Loading

0 comments on commit a4dbfee

Please sign in to comment.