Pārlūkot izejas kodu

Removed babel from project compilation flow

sanex3339 5 gadi atpakaļ
vecāks
revīzija
596d208ee0

+ 0 - 16
.babelrc

@@ -1,16 +0,0 @@
-{
-  "generatorOpts": {
-    "retainFunctionParens": true
-  },
-  "presets": [
-    ["@babel/preset-env", {
-      "targets": {
-        "node": "6.11"
-      },
-      "forceAllTransforms": true
-    }]
-  ],
-  "plugins": [
-    "@babel/plugin-transform-runtime"
-  ]
-}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.cli.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/index.js


+ 0 - 6
package.json

@@ -21,7 +21,6 @@
   },
   "types": "index.d.ts",
   "dependencies": {
-    "@babel/runtime": "7.7.4",
     "chalk": "3.0.0",
     "chance": "1.1.3",
     "class-validator": "0.11.0",
@@ -42,10 +41,6 @@
     "tslib": "1.10.0"
   },
   "devDependencies": {
-    "@babel/cli": "7.7.4",
-    "@babel/core": "7.7.4",
-    "@babel/plugin-transform-runtime": "7.7.4",
-    "@babel/preset-env": "7.7.4",
     "@types/chai": "4.2.5",
     "@types/chance": "1.0.7",
     "@types/escodegen": "0.0.6",
@@ -61,7 +56,6 @@
     "@types/string-template": "1.0.2",
     "@types/webpack-env": "1.14.1",
     "awesome-typescript-loader": "5.2.1",
-    "babel-loader": "8.0.6",
     "chai": "4.2.0",
     "coveralls": "3.0.9",
     "istanbul": "1.1.0-alpha.1",

+ 1 - 2
scripts/test-compile

@@ -1,5 +1,4 @@
 #!/bin/bash
 
-$(yarn bin)/tsc -p test/tsconfig.test.json &&
-$(yarn bin)/babel test-tmp --out-dir test-tmp --source-maps inline &&
+$(yarn bin)/tsc -p test/tsconfig.test.json --outDir test-tmp &&
 rsync -a --prune-empty-dirs --include '*/' --include '*.js' --include '*.json' --exclude '*' test/ test-tmp/test/

+ 7 - 7
src/generators/identifier-names-generators/DictionaryIdentifierNamesGenerator.ts

@@ -15,9 +15,9 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
     private readonly arrayUtils: IArrayUtils;
 
     /**
-     * @type {string[]}
+     * @type {Set<string>}
      */
-    private identifierNames: string[] = [];
+    private identifierNamesSet: Set<string>;
     
     /**
      * @type {IterableIterator<string>}
@@ -37,8 +37,8 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
         super(randomGenerator, options);
 
         this.arrayUtils = arrayUtils;
-        this.identifierNames = this.getInitialIdentifierNames(this.options.identifiersDictionary);
-        this.identifiersIterator = this.identifierNames.values();
+        this.identifierNamesSet = new Set(this.getInitialIdentifierNames(this.options.identifiersDictionary));
+        this.identifiersIterator = this.identifierNamesSet.values();
     }
 
     /**
@@ -68,7 +68,7 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
     }
 
     public generate (): string {
-        if (!this.identifierNames.length) {
+        if (!this.identifierNamesSet.size) {
             throw new Error('Too many identifiers in the code, add more words to identifiers dictionary');
         }
 
@@ -78,8 +78,8 @@ export class DictionaryIdentifierNamesGenerator extends AbstractIdentifierNamesG
             return iteratorResult.value;
         }
 
-        this.identifierNames = this.getIncrementedIdentifierNames(this.identifierNames);
-        this.identifiersIterator = this.identifierNames.values();
+        this.identifierNamesSet = new Set(this.getIncrementedIdentifierNames([...this.identifierNamesSet]));
+        this.identifiersIterator = this.identifierNamesSet.values();
 
         return this.generate();
     }

+ 0 - 2
webpack/webpack.browser.config.js

@@ -19,8 +19,6 @@ module.exports = {
                 loader: 'awesome-typescript-loader',
                 query: {
                     configFileName: 'src/tsconfig.browser.json',
-                    useBabel: true,
-                    babelCore: '@babel/core',
                     useCache: true,
                     forceIsolatedModules: true
                 }

+ 0 - 2
webpack/webpack.node.config.js

@@ -24,8 +24,6 @@ module.exports = {
                 loader: 'awesome-typescript-loader',
                 query: {
                     configFileName: 'src/tsconfig.node.json',
-                    useBabel: true,
-                    babelCore: '@babel/core',
                     useCache: true,
                     forceIsolatedModules: true
                 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 15 - 812
yarn.lock


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels