d98762625 6 лет назад
Родитель
Сommit
c70f14419a

+ 1 - 1
.travis.yml

@@ -13,7 +13,7 @@ script:
   - grunt test
   - grunt test
   - grunt test-node
   - grunt test-node
   - grunt docs
   - grunt docs
-  - NODE_ENV=production grunt node
+  - npm run node-prod
   - grunt prod --msg="$COMPILE_MSG"
   - grunt prod --msg="$COMPILE_MSG"
   - xvfb-run --server-args="-screen 0 1200x800x24" grunt testui
   - xvfb-run --server-args="-screen 0 1200x800x24" grunt testui
 before_deploy:
 before_deploy:

+ 1 - 24
Gruntfile.js

@@ -6,7 +6,6 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPl
 const NodeExternals = require("webpack-node-externals");
 const NodeExternals = require("webpack-node-externals");
 const glob = require("glob");
 const glob = require("glob");
 const path = require("path");
 const path = require("path");
-const UglifyJSWebpackPlugin = require("uglifyjs-webpack-plugin");
 
 
 /**
 /**
  * Grunt configuration for building the app in various formats.
  * Grunt configuration for building the app in various formats.
@@ -91,7 +90,7 @@ module.exports = function (grunt) {
                 return typeof importScripts === "function";
                 return typeof importScripts === "function";
             },
             },
             ENVIRONMENT_IS_NODE: function() {
             ENVIRONMENT_IS_NODE: function() {
-                return typeof process === "object" && typeof require === "function";
+                return typeof process === "object" && process.versions !== null && process.versions.node !== null && typeof require === "function";
             },
             },
             ENVIRONMENT_IS_WEB: function() {
             ENVIRONMENT_IS_WEB: function() {
                 return typeof window === "object";
                 return typeof window === "object";
@@ -226,17 +225,6 @@ module.exports = function (grunt) {
                         maxChunks: 1
                         maxChunks: 1
                     })
                     })
                 ],
                 ],
-                optimization: {
-                    minimizer: NODE_PROD ? [
-                        new UglifyJSWebpackPlugin({
-                            cache: true,
-                            parallel: true,
-                            uglifyOptions: {
-                                "keep_fnames": true,
-                            }
-                        })
-                    ] : []
-                }
             },
             },
             nodeRepl: {
             nodeRepl: {
                 mode: NODE_PROD ? "production" : "development",
                 mode: NODE_PROD ? "production" : "development",
@@ -257,17 +245,6 @@ module.exports = function (grunt) {
                         maxChunks: 1
                         maxChunks: 1
                     })
                     })
                 ],
                 ],
-                optimization: {
-                    minimizer: NODE_PROD ? [
-                        new UglifyJSWebpackPlugin({
-                            parallel: true,
-                            cache: true,
-                            uglifyOptions: {
-                                "keep_fnames": true,
-                            }
-                        })
-                    ] : []
-                }
             }
             }
         },
         },
         "webpack-dev-server": {
         "webpack-dev-server": {

+ 1 - 2
package.json

@@ -158,7 +158,6 @@
     "testui": "grunt testui",
     "testui": "grunt testui",
     "docs": "grunt docs",
     "docs": "grunt docs",
     "lint": "grunt lint",
     "lint": "grunt lint",
-    "newop": "node --experimental-modules src/core/config/scripts/newOperation.mjs",
-    "postinstall": "[ -f node_modules/crypto-api/src/crypto-api.mjs ] || npx j2m node_modules/crypto-api/src/crypto-api.js"
+    "newop": "node --experimental-modules src/core/config/scripts/newOperation.mjs"
   }
   }
 }
 }

+ 1 - 1
src/core/Dish.mjs

@@ -19,7 +19,7 @@ import {
     DishListFile,
     DishListFile,
     DishNumber,
     DishNumber,
     DishString,
     DishString,
-} from "./dishTranslationTypes";
+} from "./dishTypes";
 
 
 
 
 /**
 /**

+ 2 - 2
src/core/dishTranslationTypes/DishBigNumber.mjs → src/core/dishTypes/DishBigNumber.mjs

@@ -4,14 +4,14 @@
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 import Utils from "../Utils";
 import Utils from "../Utils";
 import BigNumber from "bignumber.js";
 import BigNumber from "bignumber.js";
 
 
 /**
 /**
  * translation methods for BigNumber Dishes
  * translation methods for BigNumber Dishes
  */
  */
-class DishBigNumber extends DishTranslationType {
+class DishBigNumber extends DishType {
 
 
     /**
     /**
      * convert the given value to a ArrayBuffer
      * convert the given value to a ArrayBuffer

+ 2 - 2
src/core/dishTranslationTypes/DishByteArray.mjs → src/core/dishTypes/DishByteArray.mjs

@@ -4,12 +4,12 @@
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 
 
 /**
 /**
  * Translation methods for ArrayBuffer Dishes
  * Translation methods for ArrayBuffer Dishes
  */
  */
-class DishByteArray extends DishTranslationType {
+class DishByteArray extends DishType {
 
 
     /**
     /**
      * convert the given value to a ArrayBuffer
      * convert the given value to a ArrayBuffer

+ 2 - 2
src/core/dishTranslationTypes/DishFile.mjs → src/core/dishTypes/DishFile.mjs

@@ -4,13 +4,13 @@
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 import Utils from "../Utils";
 import Utils from "../Utils";
 
 
 /**
 /**
  * Translation methods for file Dishes
  * Translation methods for file Dishes
  */
  */
-class DishFile extends DishTranslationType {
+class DishFile extends DishType {
 
 
     /**
     /**
      * convert the given value to an ArrayBuffer
      * convert the given value to an ArrayBuffer

+ 0 - 0
src/core/dishTranslationTypes/DishHTML.mjs → src/core/dishTypes/DishHTML.mjs


+ 2 - 2
src/core/dishTranslationTypes/DishJSON.mjs → src/core/dishTypes/DishJSON.mjs

@@ -4,13 +4,13 @@
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 import Utils from "../Utils";
 import Utils from "../Utils";
 
 
 /**
 /**
  * Translation methods for JSON dishes
  * Translation methods for JSON dishes
  */
  */
-class DishJSON extends DishTranslationType {
+class DishJSON extends DishType {
 
 
     /**
     /**
      * convert the given value to a ArrayBuffer
      * convert the given value to a ArrayBuffer

+ 3 - 2
src/core/dishTranslationTypes/DishListFile.mjs → src/core/dishTypes/DishListFile.mjs

@@ -4,13 +4,14 @@
  * @license Apache-2.0
  * @license Apache-2.0
  */
  */
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 import Utils from "../Utils.mjs";
 import Utils from "../Utils.mjs";
 
 
+
 /**
 /**
  * Translation methods for ListFile Dishes
  * Translation methods for ListFile Dishes
  */
  */
-class DishListFile extends DishTranslationType {
+class DishListFile extends DishType {
 
 
     /**
     /**
      * convert the given value to a ArrayBuffer
      * convert the given value to a ArrayBuffer

+ 2 - 2
src/core/dishTranslationTypes/DishNumber.mjs → src/core/dishTypes/DishNumber.mjs

@@ -5,13 +5,13 @@
  */
  */
 
 
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 import Utils from "../Utils";
 import Utils from "../Utils";
 
 
 /**
 /**
  * Translation methods for number dishes
  * Translation methods for number dishes
  */
  */
-class DishNumber extends DishTranslationType {
+class DishNumber extends DishType {
 
 
     /**
     /**
      * convert the given value to a ArrayBuffer
      * convert the given value to a ArrayBuffer

+ 2 - 2
src/core/dishTranslationTypes/DishString.mjs → src/core/dishTypes/DishString.mjs

@@ -5,13 +5,13 @@
  */
  */
 
 
 
 
-import DishTranslationType from "./DishTranslationType";
+import DishType from "./DishType";
 import Utils from "../Utils";
 import Utils from "../Utils";
 
 
 /**
 /**
  * Translation methods for string dishes
  * Translation methods for string dishes
  */
  */
-class DishString extends DishTranslationType {
+class DishString extends DishType {
 
 
     /**
     /**
      * convert the given value to a ArrayBuffer
      * convert the given value to a ArrayBuffer

+ 4 - 4
src/core/dishTranslationTypes/DishTranslationType.mjs → src/core/dishTypes/DishType.mjs

@@ -8,7 +8,7 @@
 /**
 /**
  * Abstract class for dish translation methods
  * Abstract class for dish translation methods
  */
  */
-class DishTranslationType {
+class DishType {
 
 
     /**
     /**
      * Warn translations dont work without value from bind
      * Warn translations dont work without value from bind
@@ -24,7 +24,7 @@ class DishTranslationType {
      * @param {*} value
      * @param {*} value
      */
      */
     static toArrayBuffer() {
     static toArrayBuffer() {
-        throw new Error("toByteArray has not been implemented");
+        throw new Error("toArrayBuffer has not been implemented");
     }
     }
 
 
     /**
     /**
@@ -32,8 +32,8 @@ class DishTranslationType {
      * @param {boolean} notUTF8
      * @param {boolean} notUTF8
      */
      */
     static fromArrayBuffer(notUTF8=undefined) {
     static fromArrayBuffer(notUTF8=undefined) {
-        throw new Error("toType has not been implemented");
+        throw new Error("fromArrayBuffer has not been implemented");
     }
     }
 }
 }
 
 
-export default DishTranslationType;
+export default DishType;

+ 0 - 0
src/core/dishTranslationTypes/index.mjs → src/core/dishTypes/index.mjs