From aa96d401f8fcd2e1996171c78a5aec4d25593c7e Mon Sep 17 00:00:00 2001 From: Austin Cory Bart Date: Wed, 7 Aug 2019 08:35:14 -0400 Subject: [PATCH] Bug fixes --- .babelrc | 3 + .idea/workspace.xml | 38 +- dist/block_mirror.css | 391 -- dist/block_mirror.js | 11758 ++++++++++++++++++++----------------- package-lock.json | 4105 +++++++++---- package.json | 16 +- src/ast/ast_Call.js | 11 +- src/ast/ast_ClassDef.js | 6 +- src/ast/ast_functions.js | 70 +- src/block_editor.js | 154 +- src/block_mirror.js | 29 +- src/text_editor.js | 28 +- src/text_to_blocks.js | 22 +- src/toolbars.js | 100 + test/simple_dev.html | 1 + webpack.config.js | 28 +- 16 files changed, 10003 insertions(+), 6757 deletions(-) create mode 100644 .babelrc create mode 100644 src/toolbars.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..8aa924d --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-env"] +} \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 799bc58..38b7756 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,15 +2,20 @@ + + + + - - + + + - + @@ -85,7 +90,7 @@ - + @@ -99,12 +104,24 @@ + + + + + + diff --git a/webpack.config.js b/webpack.config.js index 962d03c..7ddd300 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ const path = require('path'); const MergeIntoSingleFilePlugin = require('webpack-merge-and-include-globally'); const Uglify = require("uglify-js"); +const babel = require("@babel/core"); // Blockly const JS_BLOCKLY_FILES = [ @@ -32,8 +33,9 @@ const JS_BLOCKMIRROR_FILES = [ path.resolve(__dirname, 'src/text_editor.js'), path.resolve(__dirname, 'src/block_editor.js'), path.resolve(__dirname, 'src/text_to_blocks.js'), - // AST Handlers path.resolve(__dirname, 'src/ast/ast_functions.js'), + path.resolve(__dirname, 'src/toolbars.js'), + // AST Handlers path.resolve(__dirname, 'src/ast/ast_For.js'), path.resolve(__dirname, 'src/ast/ast_If.js'), path.resolve(__dirname, 'src/ast/ast_While.js'), @@ -42,6 +44,7 @@ const JS_BLOCKMIRROR_FILES = [ path.resolve(__dirname, 'src/ast/ast_Name.js'), path.resolve(__dirname, 'src/ast/ast_Assign.js'), path.resolve(__dirname, 'src/ast/ast_AnnAssign.js'), + path.resolve(__dirname, 'src/ast/ast_AugAssign.js'), path.resolve(__dirname, 'src/ast/ast_Str.js'), path.resolve(__dirname, 'src/ast/ast_Expr.js'), path.resolve(__dirname, 'src/ast/ast_UnaryOp.js'), @@ -92,14 +95,11 @@ const config = { }, module: { rules: [ - /*{ - loader: 'babel-loader', - test: /\.js$/, - exclude: /node_modules/, - query: { - presets: ['es2015'] - } - }*/ + { + test: /(\.jsx|\.js)$/, + loader: "babel-loader", + exclude: /(node_modules|bower_components)/ + }, ] }, resolve: { @@ -110,11 +110,17 @@ const config = { files: { "block_mirror.js": JS_BLOCKMIRROR_FILES, "block_mirror.css": [ - path.resolve(__dirname, 'lib/codemirror/codemirror.css'), + /*path.resolve(__dirname, 'lib/codemirror/codemirror.css'), path.resolve(__dirname, 'lib/codemirror/fullscreen.css'), - path.resolve(__dirname, 'lib/codemirror/show-hint.css'), + path.resolve(__dirname, 'lib/codemirror/show-hint.css'),*/ path.resolve(__dirname, 'src/block_mirror.css'), ] + }, + transform: { + "block_mirror.js": code => + babel.transform(code, { + presets: ["@babel/preset-env"] + }).code } }) ]