aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst2
-rw-r--r--node_modules.patch13
-rw-r--r--package.json62
-rw-r--r--src_js/opcut/main.js3
-rw-r--r--src_web/static/main.html10
-rw-r--r--src_web/style/main.scss6
-rw-r--r--webpack.config.js96
7 files changed, 192 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 5add90d..9e6ced0 100644
--- a/README.rst
+++ b/README.rst
@@ -51,6 +51,8 @@ TODO
* organize build actions using pydoit and webpack
* create heroku configuration
* create CONTRIBUTING
+ * cleanup package.json
+ * cleanup webpack.config.js
* optimizer
diff --git a/node_modules.patch b/node_modules.patch
new file mode 100644
index 0000000..6ed69bd
--- /dev/null
+++ b/node_modules.patch
@@ -0,0 +1,13 @@
+--- node_modules/virtual-dom/vdom/apply-properties.js
++++ node_modules/virtual-dom/vdom/apply-properties.js
+@@ -36,9 +36,7 @@
+ node.removeAttribute(attrName)
+ }
+ } else if (propName === "style") {
+- for (var i in previousValue) {
+- node.style[i] = ""
+- }
++ node.style = ""
+ } else if (typeof previousValue === "string") {
+ node[propName] = ""
+ } else {
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..b043e76
--- /dev/null
+++ b/package.json
@@ -0,0 +1,62 @@
+{
+ "name": "opcut",
+ "version": "0.0.1",
+ "license": "GPL-3.0",
+ "scripts": {
+ "build": "webpack",
+ "watch": "webpack -w"
+ },
+ "devDependencies": {
+ "alertifyjs": "1.9.0",
+ "babel-core": "6.23.1",
+ "babel-loader": "6.3.2",
+ "babel-plugin-transform-async-to-generator": "6.22.0",
+ "babel-plugin-transform-async-to-module-method": "6.22.0",
+ "babel-plugin-transform-decorators": "6.22.0",
+ "babel-plugin-transform-runtime": "6.23.0",
+ "babel-preset-es2015": "6.22.0",
+ "babel-runtime": "6.23.0",
+ "bean": "1.0.15",
+ "bluebird": "3.4.7",
+ "bytebuffer": "5.0.1",
+ "core-decorators": "0.15.0",
+ "css-loader": "0.26.1",
+ "dom-delegator": "13.1.0",
+ "exports-loader": "0.6.3",
+ "file-loader": "0.10.0",
+ "file-saver": "1.3.3",
+ "font-awesome": "4.7.0",
+ "hint.css": "2.4.1",
+ "hyperscript": "2.0.2",
+ "imports-loader": "0.7.0",
+ "individual": "3.0.0",
+ "js-yaml": "3.8.1",
+ "jshashes": "1.0.6",
+ "json-formatter-js": "1.3.0",
+ "json-loader": "0.5.4",
+ "loglevel": "1.4.1",
+ "long": "3.2.0",
+ "material-design-lite": "1.3.0",
+ "moment": "2.17.1",
+ "node-css": "0.1.0",
+ "node-sass": "4.5.0",
+ "normalize.css": "5.0.0",
+ "papaparse": "4.1.4",
+ "purecss": "0.6.2",
+ "ramda": "0.23.0",
+ "raw-loader": "0.5.1",
+ "resolve-url-loader": "2.0.0",
+ "roboto-fontface": "0.7.0",
+ "roboto-mono-webfont": "2.0.986",
+ "sass-loader": "6.0.1",
+ "style-loader": "0.13.1",
+ "tern": "0.21.0",
+ "tmp": "0.0.31",
+ "tv4": "1.2.7",
+ "url-loader": "0.5.7",
+ "url-parse": "1.1.8",
+ "virtual-dom": "2.1.1",
+ "webpack": "2.2.1",
+ "yaml-loader": "0.4.0"
+ }
+}
diff --git a/src_js/opcut/main.js b/src_js/opcut/main.js
index e69de29..b7850ca 100644
--- a/src_js/opcut/main.js
+++ b/src_js/opcut/main.js
@@ -0,0 +1,3 @@
+
+import 'static!static/main.html';
+import 'style/main.scss';
diff --git a/src_web/static/main.html b/src_web/static/main.html
new file mode 100644
index 0000000..f6ff4eb
--- /dev/null
+++ b/src_web/static/main.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>opcut</title>
+ <script src="main.js"></script>
+</head>
+<body>
+</body>
+</html>
diff --git a/src_web/style/main.scss b/src_web/style/main.scss
new file mode 100644
index 0000000..2181a8b
--- /dev/null
+++ b/src_web/style/main.scss
@@ -0,0 +1,6 @@
+@import '~normalize.css/normalize';
+
+body {
+ font-size: 9pt;
+ margin: 5px;
+}
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644
index 0000000..46ee0a3
--- /dev/null
+++ b/webpack.config.js
@@ -0,0 +1,96 @@
+var path = require('path');
+var fs = require('fs');
+var webpack = require('webpack');
+
+// moment locales hack
+var momentLocalePath = path.join(
+ __dirname, 'node_modules', 'moment', 'src', 'lib', 'locale', 'locale');
+if (!fs.existsSync(momentLocalePath)) {
+ fs.mkdirSync(momentLocalePath);
+}
+
+module.exports = {
+ entry: {
+ main: '.' + path.sep + path.join('src_js', 'opcut', 'main')
+ },
+ output: {
+ filename: '[name].js',
+ path: path.join(__dirname, 'build', 'jsopcut'),
+ pathinfo: true
+ },
+ module: {
+ rules: [
+ {
+ test: /\.js$/,
+ exclude: [/node_modules(?!(\/moment\/src)|(\\moment\\src))/],
+ loader: 'babel-loader',
+ options: {
+ presets: [['es2015', {modules: false}]],
+ plugins: []
+ // plugins: ["transform-runtime",
+ // "transform-decorators",
+ // ["transform-async-to-module-method",
+ // {module: "bluebird",
+ // method: "coroutine"}]],
+ // retainLines: true
+ }
+ },
+ {
+ test: /\.scss$/,
+ use: ["style-loader", "css-loader", "resolve-url-loader", "sass-loader?sourceMap"]
+ },
+ {
+ test: /(\/|\\)buffer(\/|\\)index\.js$/,
+ use: 'imports-loader?global=>window'
+ },
+
+
+
+ { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, use: "url-loader?name=fonts/[hash].[ext]&limit=10000&mimetype=application/font-woff" },
+ { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, use: "url-loader?name=fonts/[hash].[ext]&limit=10000&mimetype=application/font-woff" },
+ { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: "url-loader?name=fonts/[hash].[ext]&limit=10000&mimetype=application/octet-stream" },
+ { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: "file-loader?name=fonts/[hash].[ext]" },
+ { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: "url-loader?name=fonts/[hash].[ext]&limit=10000&mimetype=image/svg+xml" }
+
+ ]
+ },
+ resolve: {
+ modules: [
+ path.join(__dirname, 'src_js'),
+ path.join(__dirname, 'src_web'),
+ path.join(__dirname, 'node_modules')],
+ alias: {
+ 'ByteBuffer': 'bytebuffer',
+ 'Long': 'long',
+ 'underscore': 'underscore/underscore',
+ 'moment': 'moment/src/moment'
+ }
+ },
+ resolveLoader: {
+ alias: {
+ static: 'file-loader?context=src_web/static&name=[path][name].[ext]',
+ template: 'raw'
+ }
+ },
+ externals: [{
+ 'fs': 'commonjs fs',
+ 'app': 'commonjs app',
+ 'browser-window': 'commonjs browser-window',
+ 'electron': 'commonjs electron',
+ 'child_process': 'commonjs child_process'
+ }],
+ node: {
+ console: false,
+ global: false,
+ process: false,
+ Buffer: false,
+ __filename: false,
+ __dirname: false,
+ setImmediate: false
+ },
+ //devtool: 'inline-source-map',
+ devtool: 'source-map',
+ plugins: [
+ //new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})
+ ]
+};