Permalink
Browse files

Convert to webpack

  • Loading branch information...
Phoenixmatrix committed Jan 19, 2016
1 parent 93851df commit 85a338e92188d7b3d8cf0d15325488d369479e25
Showing with 99 additions and 83 deletions.
  1. +1 −1 .babelrc
  2. +0 −38 gulpfile.babel.js
  3. +1 −5 index.html
  4. +1 −2 index.js
  5. +18 −17 package.json
  6. +5 −0 src/components/PhoenixMatrixApp.jsx
  7. +12 −13 src/lib/certificate.js
  8. +9 −7 src/main.js
  9. +52 −0 webpack.config.babel.js
View
@@ -1,4 +1,4 @@
{
"presets": [ "react", "es2015-node5", "stage-1" ],
"plugins": [ "transform-runtime" ]
"plugins": [ "transform-runtime"]
}
View

This file was deleted.

Oops, something went wrong.
View
@@ -2,10 +2,6 @@
<html>
<head>
<title>PhoenixMatrix Proxy</title>
<link rel="stylesheet" type="text/css" href="./vendor/bootstrap/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="./vendor/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="./dist/css/splitter.css"/>
<link rel="stylesheet" type="text/css" href="./dist/css/style.css"/>
<script type="text/javascript">
window.$ = window.jQuery = require('./vendor/jquery/jquery.min.js');
</script>
@@ -15,7 +11,7 @@
<body>
<div id="main"></div>
<script type="text/javascript">
require('./dist/app');
require('./dist/bundle');
</script>
</body>
</html>
View
@@ -1,2 +1 @@
require('./dist/main');
require('./src/main');
View
@@ -4,15 +4,17 @@
"description": "A cross platform proxy for web developer that supports https",
"main": "index.js",
"scripts": {
"start": "gulp run",
"build": "gulp build"
"start": "electron .",
"build": "webpack --progress -c",
"build:hot": "webpack --progress -c -w"
},
"author": "Francois Ward",
"license": "MIT",
"dependencies": {
"babel": "^5.2.15",
"babel-plugin-syntax-decorators": "^6.3.13",
"babel-plugin-transform-decorators": "^6.3.13",
"babel": "^6.3.26",
"babel-core": "^6.4.0",
"babel-loader": "^6.2.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.4.0",
"babel-plugin-transform-runtime": "^6.3.13",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015-node5": "^1.1.1",
@@ -22,19 +24,15 @@
"bluebird": "=2.3.11",
"classnames": "^2.1.1",
"connect": "~3.1.1",
"domready": "^1.0.8",
"css-loader": "^0.22.0",
"electron-prebuilt": "^0.36.2",
"eslint-config-airbnb": "^2.1.1",
"flux": "^2.0.3",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.1",
"gulp-clean": "^0.3.1",
"gulp-less": "^3.0.3",
"gulp-run": "^1.6.6",
"gulp-sourcemaps": "^1.3.0",
"gulp-watch": "^4.1.0",
"file-loader": "^0.8.5",
"imports-loader": "^0.6.5",
"json-loader": "^0.5.4",
"keymirror": "^0.1.1",
"lodash": "^3.0.1",
"less": "^2.6.0",
"less-loader": "^2.2.2",
"lodash": "^3.10.1",
"mkdirp": "^0.5.1",
"moment": "^2.10.2",
"node-forge": "^0.6.26",
@@ -46,7 +44,10 @@
"react-redux": "^4.0.6",
"redux": "^3.0.5",
"redux-thunk": "^1.0.3",
"run-sequence": "^1.0.2"
"run-sequence": "^1.0.2",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.10"
},
"devDependencies": {
"eslint": "^1.10.3",
@@ -11,6 +11,11 @@ import Splitter from './Splitter';
import {loadConfig, toggleConnect} from '../actions/config';
import {setFilter, selectRequest, pushRequest, togglePause, clear} from '../actions/requests';
import '../../vendor/bootstrap/css/bootstrap.min';
import '../../vendor/font-awesome/css/font-awesome';
import '../../stylesheets/splitter';
import '../../stylesheets/style';
class PhoenixMatrixApp extends React.Component {
componentWillMount() {
const {onLoadConfig} = this.props;
View
@@ -1,38 +1,37 @@
import fsOrig from 'fs';
import crypto from 'crypto';
import { pki, md } from 'node-forge';
import {pki, md} from 'node-forge';
import Promise from 'bluebird';
import moment from 'moment'
import moment from 'moment';
import mkdirpOrig from 'mkdirp';
import helpers from './helpers';
import _ from 'lodash';
import config from './config';
const async = Promise.coroutine;
let fs = Promise.promisifyAll(fsOrig);
let mkdirp = Promise.promisify(mkdirpOrig);
const fs = Promise.promisifyAll(fsOrig);
const mkdirp = Promise.promisify(mkdirpOrig);
let directory = './certificate/';
let caCertPath = directory + 'ca.crt';
let caKeyPath = directory + 'ca.key';
const directory = './certificate/';
const caCertPath = directory + 'ca.crt';
const caKeyPath = directory + 'ca.key';
var domainCertificates = {};
var ca;
var getCA = () => ca;
const domainCertificates = {};
let ca;
const getCA = () => ca;
const getSerial = () => crypto.randomBytes(Math.ceil(16 / 2)).toString('hex').slice(0, 16).toUpperCase();
const keys = pki.rsa.generateKeyPair(2048);
var createCertificateAuthority = async(function* () {
const createCertificateAuthority = async(function* () {
const certificate = pki.createCertificate();
certificate.publicKey = keys.publicKey;
certificate.serialNumber = getSerial();
certificate.validity.notBefore = new Date();
certificate.validity.notAfter = new Date();
certificate.validity.notAfter.setFullYear(certificate.validity.notBefore.getFullYear() + 1);
var attrs = [{
const attrs = [{
name: 'commonName',
value: 'phoenixmatrix_do_not_trust'
}, {
View
@@ -1,13 +1,15 @@
'use strict';
/* eslint no-console: 0 */
import globalShortcut from 'global-shortcut';
const globalShortcut = require('global-shortcut');
process.on('error', function(err) {
process.on('error', function (err) {
console.log(err);
});
import app from 'app';
import BrowserWindow from 'browser-window';
const app = require('app');
const BrowserWindow = require('browser-window');
let mainWindow;
@@ -17,15 +19,15 @@ app.on('window-all-closed', () => {
}
});
app.on('ready', function() {
globalShortcut.register('CommandOrControl+Shift+i',() => {
app.on('ready', function () {
globalShortcut.register('CommandOrControl+Shift+i', () => {
const w = BrowserWindow.getFocusedWindow();
if (w) {
w.toggleDevTools();
}
});
mainWindow = new BrowserWindow({width: 1000, height: 800, icon: "./icon.png"});
mainWindow = new BrowserWindow({width: 1000, height: 800, icon: './icon.png'});
mainWindow.setMenu(null);
mainWindow.loadURL('file://' + __dirname + '/../index.html');
View
@@ -0,0 +1,52 @@
import webpack from 'webpack';
import path from 'path';
const config = {
entry: {
renderer: [
'./src/app'
]
},
target: 'electron',
output: {
path: './dist',
filename: 'bundle.js',
libraryTarget: 'commonjs2',
publicPath: 'dist/'
},
debug: true,
devtool: 'eval',
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
include: path.join(__dirname, 'src')
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.less$/,
loader: 'style!css?url=false&import=false!less'
},
{
test: /\.css$/,
loader: 'style!css?url=false&import=false'
},
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file'},
{test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?prefix=font/&limit=5000'},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream'},
{test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml'}
],
noParse: ['^./vendor']
},
resolve: {
extensions: ['', '.js', '.jsx', '.less', '.css']
},
externals: ['node-forge']
};
module.exports = config;

0 comments on commit 85a338e

Please sign in to comment.