Skip to content

Commit

Permalink
Merge pull request #776 from javascript-obfuscator/webpack-5
Browse files Browse the repository at this point in the history
2.6.0: issue 777, issue 778, Webpack 5 migration.
  • Loading branch information
sanex3339 committed Oct 13, 2020
2 parents 5c9f5ef + 551ae4b commit cfe2044
Show file tree
Hide file tree
Showing 31 changed files with 3,163 additions and 1,359 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
Change Log

v2.6.0
---
* Migration to `webpack@5`
* Optimized performance of `ExpressionStatementsMergeTransformer` when `simplify` option is enabled. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/777
* Fixed broken `identifierNamesGenerator: 'mangled-shuffled'` after `2.2.0`. Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/778

v2.5.0
---
* Improved hierarchy of generated directories when `--output` is a directory path
Expand Down
80 changes: 2 additions & 78 deletions dist/index.browser.js

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions dist/index.browser.js.LICENSE.txt
@@ -0,0 +1,67 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/

/*!
Copyright (C) 2016-2020 Timofey Kachalov <sanex3339@yandex.ru>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
26 changes: 2 additions & 24 deletions dist/index.cli.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions dist/index.cli.js.LICENSE.txt
@@ -0,0 +1,23 @@
/*!
Copyright (C) 2016-2020 Timofey Kachalov <sanex3339@yandex.ru>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
26 changes: 2 additions & 24 deletions dist/index.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions dist/index.js.LICENSE.txt
@@ -0,0 +1,23 @@
/*!
Copyright (C) 2016-2020 Timofey Kachalov <sanex3339@yandex.ru>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
31 changes: 16 additions & 15 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "javascript-obfuscator",
"version": "2.5.0",
"version": "2.6.0",
"description": "JavaScript obfuscator",
"keywords": [
"obfuscator",
Expand All @@ -21,9 +21,9 @@
},
"types": "index.d.ts",
"dependencies": {
"@gradecam/tsenum": "1.2.0",
"@nuxtjs/opencollective": "0.2.2",
"acorn": "8.0.3",
"acorn": "8.0.4",
"assert": "2.0.0",
"chalk": "4.1.0",
"chance": "1.1.7",
"class-validator": "0.12.2",
Expand All @@ -37,12 +37,13 @@
"js-string-escape": "1.0.1",
"md5": "2.3.0",
"mkdirp": "1.0.4",
"multimatch": "4.0.0",
"multimatch": "5.0.0",
"process": "0.11.10",
"reflect-metadata": "0.1.13",
"source-map-support": "0.5.19",
"string-template": "1.0.0",
"stringz": "2.1.0",
"tslib": "2.0.2"
"tslib": "2.0.3"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "1.0.1",
Expand All @@ -57,20 +58,20 @@
"@types/mkdirp": "1.0.1",
"@types/mocha": "8.0.3",
"@types/multimatch": "4.0.0",
"@types/node": "14.11.5",
"@types/node": "14.11.8",
"@types/rimraf": "3.0.0",
"@types/sinon": "9.0.8",
"@types/string-template": "1.0.2",
"@types/webpack-env": "1.15.3",
"@typescript-eslint/eslint-plugin": "4.4.0",
"@typescript-eslint/parser": "4.4.0",
"@typescript-eslint/eslint-plugin": "4.4.1",
"@typescript-eslint/parser": "4.4.1",
"chai": "4.2.0",
"chai-exclude": "2.0.2",
"coveralls": "3.1.0",
"cross-env": "7.0.2",
"eslint": "7.10.0",
"eslint": "7.11.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.6.3",
"eslint-plugin-jsdoc": "30.6.4",
"eslint-plugin-no-null": "1.0.2",
"eslint-plugin-prefer-arrow": "1.2.2",
"eslint-plugin-unicorn": "22.0.0",
Expand All @@ -83,11 +84,11 @@
"rimraf": "3.0.2",
"sinon": "9.2.0",
"threads": "1.6.3",
"ts-loader": "8.0.4",
"ts-loader": "8.0.5",
"ts-node": "9.0.0",
"typescript": "4.1.0-beta",
"webpack": "4.44.2",
"webpack-cli": "3.3.12",
"webpack": "5.1.0",
"webpack-cli": "4.0.0",
"webpack-node-externals": "2.5.2"
},
"repository": {
Expand All @@ -97,9 +98,9 @@
"homepage": "https://obfuscator.io/",
"scripts": {
"start": "yarn run watch",
"webpack:prod": "webpack --config webpack/webpack.node.config.js --config webpack/webpack.browser.config.js --mode production",
"webpack:prod": "webpack --config ./webpack/webpack.node.config.js --config ./webpack/webpack.browser.config.js --mode production",
"build": "yarn run webpack:prod && yarn run eslint && yarn test",
"watch": "webpack --config webpack/webpack.node.config.js --mode development --watch",
"watch": "webpack --config ./webpack/webpack.node.config.js --mode development --watch",
"test:dev": "ts-node --type-check test/dev/dev.ts",
"test:devCompilePerformance": "ts-node test/dev/dev-compile-performance.ts",
"test:devRuntimePerformance": "ts-node test/dev/dev-runtime-performance.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/enums/ObfuscationTarget.ts
@@ -1,10 +1,10 @@
import { MakeEnum } from '@gradecam/tsenum';
import { Utils } from '../utils/Utils';

export const ObfuscationTarget: Readonly<{
Browser: 'browser';
BrowserNoEval: 'browser-no-eval';
Node: 'node';
}> = MakeEnum({
}> = Utils.makeEnum({
Browser: 'browser',
BrowserNoEval: 'browser-no-eval',
Node: 'node'
Expand Down
@@ -1,11 +1,11 @@
import { MakeEnum } from '@gradecam/tsenum';
import { Utils } from '../../../utils/Utils';

export const IdentifierNamesGenerator: Readonly<{
DictionaryIdentifierNamesGenerator: 'dictionary';
HexadecimalIdentifierNamesGenerator: 'hexadecimal';
MangledIdentifierNamesGenerator: 'mangled';
MangledShuffledIdentifierNamesGenerator: 'mangled-shuffled';
}> = MakeEnum({
}> = Utils.makeEnum({
DictionaryIdentifierNamesGenerator: 'dictionary',
HexadecimalIdentifierNamesGenerator: 'hexadecimal',
MangledIdentifierNamesGenerator: 'mangled',
Expand Down
@@ -1,10 +1,10 @@
import { MakeEnum } from '@gradecam/tsenum';
import { Utils } from '../../../utils/Utils';

export const StringArrayEncoding: Readonly<{
None: 'none';
Base64: 'base64';
Rc4: 'rc4';
}> = MakeEnum({
}> = Utils.makeEnum({
None: 'none',
Base64: 'base64',
Rc4: 'rc4'
Expand Down
@@ -1,9 +1,9 @@
import { MakeEnum } from '@gradecam/tsenum';
import { Utils } from '../../../utils/Utils';

export const StringArrayWrappersType: Readonly<{
Variable: 'variable';
Function: 'function';
}> = MakeEnum({
}> = Utils.makeEnum({
Variable: 'variable',
Function: 'function',
});
4 changes: 2 additions & 2 deletions src/enums/options/presets/OptionsPreset.ts
@@ -1,11 +1,11 @@
import { MakeEnum } from '@gradecam/tsenum';
import { Utils } from '../../../utils/Utils';

export const OptionsPreset: Readonly<{
Default: 'default';
LowObfuscation: 'low-obfuscation';
MediumObfuscation: 'medium-obfuscation';
HighObfuscation: 'high-obfuscation';
}> = MakeEnum({
}> = Utils.makeEnum({
Default: 'default',
LowObfuscation: 'low-obfuscation',
MediumObfuscation: 'medium-obfuscation',
Expand Down
4 changes: 2 additions & 2 deletions src/enums/source-map/SourceMapMode.ts
@@ -1,9 +1,9 @@
import { MakeEnum } from '@gradecam/tsenum';
import { Utils } from '../../utils/Utils';

export const SourceMapMode: Readonly<{
Inline: 'inline';
Separate: 'separate';
}> = MakeEnum({
}> = Utils.makeEnum({
Inline: 'inline',
Separate: 'separate'
});

0 comments on commit cfe2044

Please sign in to comment.