From 4a2995e8add984297450a5d65eac8bf1e379b37e Mon Sep 17 00:00:00 2001 From: Muhammad Hammad Date: Thu, 17 Nov 2022 16:59:13 -0500 Subject: [PATCH 01/41] fix - invalid line wrap with signed numbers in json property This fix makes sure we can identify signed numbers correctly when they are used as an object property to avoid having issues with line wrapping fixes #1932 --- js/src/javascript/beautifier.js | 10 +++++++++- python/jsbeautifier/javascript/beautifier.py | 12 +++++++++++- test/data/javascript/tests.js | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/js/src/javascript/beautifier.js b/js/src/javascript/beautifier.js index 51cd10d8..880be6bd 100644 --- a/js/src/javascript/beautifier.js +++ b/js/src/javascript/beautifier.js @@ -891,7 +891,9 @@ Beautifier.prototype.handle_word = function(current_token) { } if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) { - if (!this.start_of_object_property()) { + if (!this.start_of_object_property() && !( + // start of object property is different for numeric values with +/- prefix operators + in_array(this._flags.last_token.text, ['+', '-']) && this._last_last_text === ':' && this._flags.parent.mode === MODE.ObjectLiteral)) { this.allow_wrap_or_preserved_newline(current_token); } } @@ -1172,6 +1174,12 @@ Beautifier.prototype.handle_operator = function(current_token) { return; } + if (in_array(current_token.text, ['-', '+']) && this.start_of_object_property()) { + // numeric value with +/- symbol in front as a property + this.print_token(current_token); + return; + } + // Allow line wrapping between operators when operator_position is // set to before or preserve if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) { diff --git a/python/jsbeautifier/javascript/beautifier.py b/python/jsbeautifier/javascript/beautifier.py index efeb584b..b0588902 100644 --- a/python/jsbeautifier/javascript/beautifier.py +++ b/python/jsbeautifier/javascript/beautifier.py @@ -974,7 +974,12 @@ def handle_word(self, current_token): TOKEN.EQUALS, TOKEN.OPERATOR, ]: - if not self.start_of_object_property(): + if not self.start_of_object_property() and not ( + # start of object property is different for numeric values with +/- prefix operators + self._flags.last_token.text in ["+", "-"] + and self._last_last_text == ":" + and self._flags.parent.mode == MODE.ObjectLiteral + ): self.allow_wrap_or_preserved_newline(current_token) if reserved_word(current_token, "function"): @@ -1324,6 +1329,11 @@ def handle_operator(self, current_token): self.print_token(current_token) return + if current_token.text in ["-", "+"] and self.start_of_object_property(): + # numeric value with +/- symbol in front as a property + self.print_token(current_token) + return + # Allow line wrapping between operators when operator_position is # set to before or preserve if ( diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index 367c3e23..aeed67e5 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -1216,6 +1216,21 @@ exports.test_data = { '}' ] }, + { + comment: "Issue #1932 - Javascript object property with -/+ symbol wraps issue", + input: [ + '{', + ' "1234567891234567891234567891234": -433,', + ' "abcdefghijklmnopqrstuvwxyz12345": +11', + '}' + ], + output: [ + '{', + ' "1234567891234567891234567891234": -433,', + ' "abcdefghijklmnopqrstuvwxyz12345": +11', + '}' + ] + }, { fragment: true, input: '\' + wrap_input_2 + \'', From 0051044b3b8791ade2eb4abe3169253a228f6592 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Mon, 12 Jun 2023 10:48:04 -0700 Subject: [PATCH 02/41] Add init files to re-enable python tests --- python/cssbeautifier/tests/__init__.py | 1 + python/cssbeautifier/tests/generated/__init__.py | 1 + python/jsbeautifier/tests/generated/__init__.py | 1 + 3 files changed, 3 insertions(+) create mode 100644 python/cssbeautifier/tests/__init__.py create mode 100644 python/cssbeautifier/tests/generated/__init__.py create mode 100644 python/jsbeautifier/tests/generated/__init__.py diff --git a/python/cssbeautifier/tests/__init__.py b/python/cssbeautifier/tests/__init__.py new file mode 100644 index 00000000..0c010554 --- /dev/null +++ b/python/cssbeautifier/tests/__init__.py @@ -0,0 +1 @@ +# Empty file :) diff --git a/python/cssbeautifier/tests/generated/__init__.py b/python/cssbeautifier/tests/generated/__init__.py new file mode 100644 index 00000000..0c010554 --- /dev/null +++ b/python/cssbeautifier/tests/generated/__init__.py @@ -0,0 +1 @@ +# Empty file :) diff --git a/python/jsbeautifier/tests/generated/__init__.py b/python/jsbeautifier/tests/generated/__init__.py new file mode 100644 index 00000000..0c010554 --- /dev/null +++ b/python/jsbeautifier/tests/generated/__init__.py @@ -0,0 +1 @@ +# Empty file :) From 66ce8c119f6c36f153b635bd71aaa47681b3d9ea Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Thu, 20 Jul 2023 00:35:19 -0700 Subject: [PATCH 03/41] Update milestone-publish.yml with latest dependency versions --- .github/workflows/milestone-publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/milestone-publish.yml b/.github/workflows/milestone-publish.yml index 31051eda..4ae51e28 100644 --- a/.github/workflows/milestone-publish.yml +++ b/.github/workflows/milestone-publish.yml @@ -12,18 +12,18 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 18 registry-url: https://registry.npmjs.org/ - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.10 - name: Set git user run: | git config --global user.email "github-action@users.noreply.github.com" From 4e76f78eb29fb0a6b4e0dae6402fa8375c511dc8 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Thu, 20 Jul 2023 09:23:03 -0700 Subject: [PATCH 04/41] Update minimum node version to 16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f92540f..a4682cc2 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ ], "license": "MIT", "engines": { - "node": ">=12" + "node": ">=16" }, "browserslist": "ie 11", "dependencies": { From 062e9d5f03f0b6d296a95ceedcf3b29aa59189bc Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Sun, 23 Jul 2023 17:23:12 -0700 Subject: [PATCH 05/41] Set nodejs minimum to v14 See #2168. Transitive dependency `commander v10.x` requires nodejs v14.x. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a4682cc2..2f3e46a0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ ], "license": "MIT", "engines": { - "node": ">=16" + "node": ">=14" }, "browserslist": "ie 11", "dependencies": { From ee06f62e158eb179f76e0c18f3de5341c4df6059 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Sun, 23 Jul 2023 17:34:34 -0700 Subject: [PATCH 06/41] Update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 6c7b6b86..8bdb7958 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "webpack-cli": "^4.10.0" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/@discoveryjs/json-ext": { From cea7cc23b9086fd2972e6d0545b62ca7dd9ca9bb Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 9 Aug 2023 10:28:01 -0700 Subject: [PATCH 07/41] Create dependabot.yml --- .github/dependabot.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..b21477ec --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From bef8061a9a31cfd53117acce22d1f22f084e56bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:28:37 +0000 Subject: [PATCH 08/41] Bump webpack from 5.81.0 to 5.88.2 Bumps [webpack](https://github.com/webpack/webpack) from 5.81.0 to 5.88.2. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.81.0...v5.88.2) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8bdb7958..a9a325c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -379,9 +379,9 @@ } }, "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -1252,9 +1252,9 @@ "dev": true }, "node_modules/enhanced-resolve": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz", - "integrity": "sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -2615,9 +2615,9 @@ ] }, "node_modules/schema-utils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.2.tgz", - "integrity": "sha512-pvjEHOgWc9OWA/f/DE3ohBWTD6EleVLf7iFUkoSwAxttdBhB9QUebQgxER2kWueOvRJXPHNnyrvvh9eZINB8Eg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", @@ -3101,9 +3101,9 @@ } }, "node_modules/webpack": { - "version": "5.81.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.81.0.tgz", - "integrity": "sha512-AAjaJ9S4hYCVODKLQTgG5p5e11hiMawBwV2v8MYLE0C/6UAGLuAF4n1qa9GOwdxnicaP+5k6M5HrLmD4+gIB8Q==", + "version": "5.88.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", + "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -3112,10 +3112,10 @@ "@webassemblyjs/wasm-edit": "^1.11.5", "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", + "acorn-import-assertions": "^1.9.0", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.13.0", + "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -3125,7 +3125,7 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.2", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", From 40fb2c8ca2c4ad0faed2516513cf2677a973df91 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 9 Aug 2023 10:52:36 -0700 Subject: [PATCH 09/41] Update dependabot.yml --- .github/dependabot.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b21477ec..d3d425ff 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,15 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + open-pull-requests-limit: 15 - package-ecosystem: "pip" # See documentation for possible values - directory: "/" # Location of package manifests + directory: "/python" # Location of package manifests + schedule: + interval: "weekly" + open-pull-requests-limit: 15 + - package-ecosystem: "github-actions" + directory: "/" schedule: + # Check for updates to GitHub Actions every week interval: "weekly" + open-pull-requests-limit: 15 From 6f487706f0f8b7b1145ffc3898abfc24a30dee00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:53:03 +0000 Subject: [PATCH 10/41] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/pr-staging.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 26b5ec55..650856f1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0c4431d..c1279902 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - python-version: 3.11 node-version: 20 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Node ${{ matrix.node-version }} uses: actions/setup-node@v1 with: diff --git a/.github/workflows/pr-staging.yml b/.github/workflows/pr-staging.yml index 8bdbd298..826e6a39 100644 --- a/.github/workflows/pr-staging.yml +++ b/.github/workflows/pr-staging.yml @@ -15,7 +15,7 @@ jobs: PR-from-staging: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: pull-request gh-pages From 28a32e690d5c244921c994b35f70ec565dd4772c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:53:08 +0000 Subject: [PATCH 11/41] Bump actions/cache from 2 to 3 Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0c4431d..c671e252 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Cached node_modules - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package*.json') }} From fd6e707e969c09c957b680e8dff361bf7c8510f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:53:22 +0000 Subject: [PATCH 12/41] Bump actions/setup-node from 1 to 3 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...v3) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0c4431d..97af7d41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Set up Python ${{ matrix.python-version }} From 138612165d568dfab6cb109a7af32c63032625e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:53:56 +0000 Subject: [PATCH 13/41] Bump jquery from 3.6.4 to 3.7.0 Bumps [jquery](https://github.com/jquery/jquery) from 3.6.4 to 3.7.0. - [Release notes](https://github.com/jquery/jquery/releases) - [Commits](https://github.com/jquery/jquery/compare/3.6.4...3.7.0) --- updated-dependencies: - dependency-name: jquery dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8bdb7958..fedfe93e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1830,9 +1830,9 @@ } }, "node_modules/jquery": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.4.tgz", - "integrity": "sha512-v28EW9DWDFpzcD9O5iyJXg3R3+q+mET5JhnjJzQUZMHOv67bpSIHq81GEYpPNZHG+XXHsfSme3nxp/hndKEcsQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==", "dev": true }, "node_modules/js-yaml": { From 1aaf0ce7a5bc4b737adb1dceccd52d8cccd02478 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:54:47 +0000 Subject: [PATCH 14/41] Bump github/codeql-action from 1 to 2 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 650856f1..38c4e962 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -50,7 +50,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -64,4 +64,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 5dee842cd020b69b2dcac3b10a7d5ea9925afdd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 17:54:59 +0000 Subject: [PATCH 15/41] Bump actions/setup-python from 2 to 4 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 49af3e00..4042dcc1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Cached node_modules From c89ba54a4b82af5b96198ffdf993c81fe892deb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:59:16 +0000 Subject: [PATCH 16/41] Bump nopt from 6.0.0 to 7.2.0 Bumps [nopt](https://github.com/npm/nopt) from 6.0.0 to 7.2.0. - [Release notes](https://github.com/npm/nopt/releases) - [Changelog](https://github.com/npm/nopt/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/nopt/compare/v6.0.0...v7.2.0) --- updated-dependencies: - dependency-name: nopt dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 21 ++++++++++++--------- package.json | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9a325c9..17472935 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "config-chain": "^1.1.13", "editorconfig": "^1.0.3", "glob": "^8.1.0", - "nopt": "^6.0.0" + "nopt": "^7.2.0" }, "bin": { "css-beautify": "js/bin/css-beautify.js", @@ -349,9 +349,12 @@ "dev": true }, "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/accepts": { "version": "1.3.8", @@ -2176,17 +2179,17 @@ "dev": true }, "node_modules/nopt": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", - "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz", + "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==", "dependencies": { - "abbrev": "^1.0.0" + "abbrev": "^2.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/normalize-path": { diff --git a/package.json b/package.json index 2f3e46a0..369e37fc 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "config-chain": "^1.1.13", "editorconfig": "^1.0.3", "glob": "^8.1.0", - "nopt": "^6.0.0" + "nopt": "^7.2.0" }, "devDependencies": { "ansi-regex": "^6.0.1", From 775e42a300c48776abbac4f9155307b667e1d59f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:59:26 +0000 Subject: [PATCH 17/41] Bump webpack-cli from 4.10.0 to 5.1.4 Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.10.0 to 5.1.4. - [Release notes](https://github.com/webpack/webpack-cli/releases) - [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.10.0...webpack-cli@5.1.4) --- updated-dependencies: - dependency-name: webpack-cli dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 112 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 60 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9a325c9..c8edc794 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "serve": "^14.2.0", "strip-ansi": "^7.0.1", "webpack": "^5.81.0", - "webpack-cli": "^4.10.0" + "webpack-cli": "^5.1.4" }, "engines": { "node": ">=14" @@ -295,34 +295,42 @@ } }, "node_modules/@webpack-cli/configtest": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", - "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", "dev": true, + "engines": { + "node": ">=14.15.0" + }, "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" + "webpack": "5.x.x", + "webpack-cli": "5.x.x" } }, "node_modules/@webpack-cli/info": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", - "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", "dev": true, - "dependencies": { - "envinfo": "^7.7.3" + "engines": { + "node": ">=14.15.0" }, "peerDependencies": { - "webpack-cli": "4.x.x" + "webpack": "5.x.x", + "webpack-cli": "5.x.x" } }, "node_modules/@webpack-cli/serve": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", - "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", "dev": true, + "engines": { + "node": ">=14.15.0" + }, "peerDependencies": { - "webpack-cli": "4.x.x" + "webpack": "5.x.x", + "webpack-cli": "5.x.x" }, "peerDependenciesMeta": { "webpack-dev-server": { @@ -1271,9 +1279,9 @@ "dev": true }, "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", + "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", "dev": true, "bin": { "envinfo": "dist/cli.js" @@ -1639,12 +1647,12 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true, "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, "node_modules/is-binary-path": { @@ -1660,9 +1668,9 @@ } }, "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -2492,15 +2500,15 @@ } }, "node_modules/rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", "dev": true, "dependencies": { - "resolve": "^1.9.0" + "resolve": "^1.20.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/registry-auth-token": { @@ -2557,12 +2565,12 @@ } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -3148,44 +3156,42 @@ } }, "node_modules/webpack-cli": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", - "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.2.0", - "@webpack-cli/info": "^1.5.0", - "@webpack-cli/serve": "^1.7.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", "colorette": "^2.0.14", - "commander": "^7.0.0", + "commander": "^10.0.1", "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", "fastest-levenshtein": "^1.0.12", "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", "webpack-merge": "^5.7.3" }, "bin": { "webpack-cli": "bin/cli.js" }, "engines": { - "node": ">=10.13.0" + "node": ">=14.15.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "webpack": "4.x.x || 5.x.x" + "webpack": "5.x.x" }, "peerDependenciesMeta": { "@webpack-cli/generators": { "optional": true }, - "@webpack-cli/migrate": { - "optional": true - }, "webpack-bundle-analyzer": { "optional": true }, @@ -3195,12 +3201,12 @@ } }, "node_modules/webpack-cli/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "engines": { - "node": ">= 10" + "node": ">=14" } }, "node_modules/webpack-merge": { diff --git a/package.json b/package.json index 2f3e46a0..8cd9adc3 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,6 @@ "serve": "^14.2.0", "strip-ansi": "^7.0.1", "webpack": "^5.81.0", - "webpack-cli": "^4.10.0" + "webpack-cli": "^5.1.4" } } From 8b4d35b2a4f5d2c4d7ee3bb30629bc090277b304 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 04:18:11 +0000 Subject: [PATCH 18/41] Bump glob from 8.1.0 to 10.3.3 Bumps [glob](https://github.com/isaacs/node-glob) from 8.1.0 to 10.3.3. - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v8.1.0...v10.3.3) --- updated-dependencies: - dependency-name: glob dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 281 +++++++++++++++++++++++++++++++++++++++------- package.json | 2 +- 2 files changed, 244 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index b16a8604..1cd7a34e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "config-chain": "^1.1.13", "editorconfig": "^1.0.3", - "glob": "^8.1.0", + "glob": "^10.3.3", "nopt": "^7.2.0" }, "bin": { @@ -47,6 +47,22 @@ "node": ">=10.0.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -110,6 +126,15 @@ "resolved": "https://registry.npmjs.org/@one-ini/wasm/-/wasm-0.1.1.tgz", "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==" }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@types/eslint": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", @@ -477,7 +502,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, "engines": { "node": ">=12" }, @@ -489,7 +513,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -960,7 +983,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -971,8 +993,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/colorette": { "version": "2.0.20", @@ -1080,7 +1101,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1208,8 +1228,7 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/editorconfig": { "version": "1.0.3", @@ -1259,8 +1278,7 @@ "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/enhanced-resolve": { "version": "5.15.0", @@ -1471,10 +1489,37 @@ "flat": "cli.js" } }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -1518,18 +1563,21 @@ } }, "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", + "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1634,6 +1682,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1642,7 +1691,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "1.3.8", @@ -1710,7 +1760,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -1814,8 +1863,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/isobject": { "version": "3.0.1", @@ -1826,6 +1874,23 @@ "node": ">=0.10.0" } }, + "node_modules/jackspeak": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.3.tgz", + "integrity": "sha512-pF0kfjmg8DJLxDrizHoCZGUFz4P4czQ3HyfW4BU0ffebYkzAVlBywp5zaxW/TM+r0sGbmrQdi8EQQVTJFxnGsQ==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -2013,14 +2078,17 @@ } }, "node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -2032,6 +2100,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.2.tgz", + "integrity": "sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mocha": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", @@ -2234,6 +2310,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -2320,7 +2397,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -2331,6 +2407,29 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", + "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/path-to-regexp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", @@ -2809,7 +2908,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -2821,7 +2919,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -2861,7 +2958,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -2874,11 +2970,48 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -2889,6 +3022,26 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -3238,7 +3391,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -3280,7 +3432,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -3293,11 +3444,64 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, "engines": { "node": ">=12" }, @@ -3308,7 +3512,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/y18n": { "version": "5.0.8", diff --git a/package.json b/package.json index c3ba2080..3a70500e 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "dependencies": { "config-chain": "^1.1.13", "editorconfig": "^1.0.3", - "glob": "^8.1.0", + "glob": "^10.3.3", "nopt": "^7.2.0" }, "devDependencies": { From a88e65a913e9198a0bcce19f421c7acb72ace620 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 10 Aug 2023 14:34:15 +0100 Subject: [PATCH 19/41] marked unpacking feature as unsafe --- index.html | 2 +- web/common-function.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2fdb417c..ff1d5e56 100644 --- a/index.html +++ b/index.html @@ -158,7 +158,7 @@

Options


- +
diff --git a/web/common-function.js b/web/common-function.js index 7514897c..2259636a 100644 --- a/web/common-function.js +++ b/web/common-function.js @@ -69,7 +69,7 @@ function run_tests() { function read_settings_from_cookie() { $('#tabsize').val(any(Cookies.get('tabsize'), '4')); $('#brace-style').val(any(Cookies.get('brace-style'), 'collapse')); - $('#detect-packers').prop('checked', Cookies.get('detect-packers') !== 'off'); + $('#detect-packers').prop('checked', Cookies.get('detect-packers') === 'on'); $('#max-preserve-newlines').val(any(Cookies.get('max-preserve-newlines'), '5')); $('#keep-array-indentation').prop('checked', Cookies.get('keep-array-indentation') === 'on'); $('#break-chained-methods').prop('checked', Cookies.get('break-chained-methods') === 'on'); From 97c9cd25b1a86c45fa2ae23172e1a2235afb2f4a Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Tue, 15 Aug 2023 11:51:44 -0700 Subject: [PATCH 20/41] Update for globSync --- js/src/cli.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/src/cli.js b/js/src/cli.js index 19a2a534..452d56bd 100755 --- a/js/src/cli.js +++ b/js/src/cli.js @@ -32,6 +32,9 @@ */ /*jshint strict:false */ +/*jshint esversion: 6 */ + +const { globSync } = require('glob'); var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? function() { console.error.apply(console, arguments); @@ -41,7 +44,7 @@ var fs = require('fs'), cc = require('config-chain'), beautify = require('../index'), nopt = require('nopt'), - glob = require('glob'); + glob = require("glob"); nopt.invalidHandler = function(key, val) { throw new Error(key + " was invalid with value \"" + val + "\""); @@ -634,8 +637,7 @@ function checkFiles(parsed) { // Input was a glob if (isGlob) { hadGlob = true; - foundFiles = glob(f, { - sync: true, + foundFiles = globSync(f, { absolute: true, ignore: ['**/node_modules/**', '**/.git/**'] }); From e64606abaf96ee1443444eeeadcec27d105b715d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 20:02:16 +0000 Subject: [PATCH 21/41] Bump strip-ansi from 7.0.1 to 7.1.0 Bumps [strip-ansi](https://github.com/chalk/strip-ansi) from 7.0.1 to 7.1.0. - [Release notes](https://github.com/chalk/strip-ansi/releases) - [Commits](https://github.com/chalk/strip-ansi/compare/v7.0.1...v7.1.0) --- updated-dependencies: - dependency-name: strip-ansi dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5935020a..26434a9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3009,9 +3009,9 @@ } }, "node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { "ansi-regex": "^6.0.1" }, From bff8bafa1522ff6ddb2b1d6a1c633f1c5eb048d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 23:37:41 +0000 Subject: [PATCH 22/41] Bump serve from 14.2.0 to 14.2.1 Bumps [serve](https://github.com/vercel/serve) from 14.2.0 to 14.2.1. - [Release notes](https://github.com/vercel/serve/releases) - [Commits](https://github.com/vercel/serve/compare/14.2.0...14.2.1) --- updated-dependencies: - dependency-name: serve dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 26434a9a..a65ee98e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2797,9 +2797,9 @@ } }, "node_modules/serve": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/serve/-/serve-14.2.0.tgz", - "integrity": "sha512-+HOw/XK1bW8tw5iBilBz/mJLWRzM8XM6MPxL4J/dKzdxq1vfdEWSwhaR7/yS8EJp5wzvP92p1qirysJvnEtjXg==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/serve/-/serve-14.2.1.tgz", + "integrity": "sha512-48er5fzHh7GCShLnNyPBRPEjs2I6QBozeGr02gaacROiyS/8ARADlj595j39iZXAqBbJHH/ivJJyPRWY9sQWZA==", "dev": true, "dependencies": { "@zeit/schemas": "2.29.0", From f66a3e2474a0e4fab50745f352fe060c8b026891 Mon Sep 17 00:00:00 2001 From: Roja A M Date: Sat, 26 Aug 2023 13:45:34 +0530 Subject: [PATCH 23/41] Fix - Invalid prettification of object with unicode as key --- js/src/javascript/tokenizer.js | 15 +++++++++++++++ python/jsbeautifier/javascript/tokenizer.py | 13 +++++++++++++ test/data/javascript/tests.js | 9 +++++++++ 3 files changed, 37 insertions(+) diff --git a/js/src/javascript/tokenizer.js b/js/src/javascript/tokenizer.js index ee35c571..1abbc598 100644 --- a/js/src/javascript/tokenizer.js +++ b/js/src/javascript/tokenizer.js @@ -57,6 +57,7 @@ var TOKEN = { BLOCK_COMMENT: 'TK_BLOCK_COMMENT', COMMENT: 'TK_COMMENT', DOT: 'TK_DOT', + UNICODE: 'TK_UNICODE', UNKNOWN: 'TK_UNKNOWN', START: BASETOKEN.START, RAW: BASETOKEN.RAW, @@ -129,6 +130,7 @@ var Tokenizer = function(input_string, options) { xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/), single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), + unicode: pattern_reader.matching(/\\u{[0-9a-fA-F]{4,5}}/), template_text: templatable.until(/[`\\$]/), template_expression: templatable.until(/[`}\\]/) }; @@ -174,6 +176,7 @@ Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // token = token || this._read_regexp(c, previous_token); token = token || this._read_xml(c, previous_token); token = token || this._read_punctuation(); + token = token || this._read_unicode_with_braces(c); token = token || this._create_token(TOKEN.UNKNOWN, this._input.next()); return token; @@ -457,6 +460,18 @@ Tokenizer.prototype._read_xml = function(c, previous_token) { return null; }; +Tokenizer.prototype._read_unicode_with_braces = function(c) { + var token = null; + if(c === '\\'){ + var unicode = ''; + if (this._input.peek(1) === 'u') { + unicode = this.__patterns.unicode.read(); + token = this._create_token(TOKEN.UNICODE, unicode); + } + } + return token; +}; + function unescape_string(s) { // You think that a regex would work for this // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) { diff --git a/python/jsbeautifier/javascript/tokenizer.py b/python/jsbeautifier/javascript/tokenizer.py index 0eeb8a07..1727cea9 100644 --- a/python/jsbeautifier/javascript/tokenizer.py +++ b/python/jsbeautifier/javascript/tokenizer.py @@ -51,6 +51,7 @@ class TokenTypes(BaseTokenTypes): BLOCK_COMMENT = "TK_BLOCK_COMMENT" COMMENT = "TK_COMMENT" DOT = "TK_DOT" + UNICODE = ("TK_UNICODE",) UNKNOWN = "TK_UNKNOWN" def __init__(self): @@ -164,6 +165,8 @@ def __init__(self, input_scanner, acorn, options): self.template_text = templatable.until(r"[`\\$]") self.template_expression = templatable.until(r"[`}\\]") + self.unicode = pattern.matching(r"\\u{[0-9a-fA-F]{4,5}}") + class Tokenizer(BaseTokenizer): positionable_operators = positionable_operators @@ -229,6 +232,7 @@ def _get_next_token(self, previous_token, open_token): token = token or self._read_regexp(c, previous_token) token = token or self._read_xml(c, previous_token) token = token or self._read_punctuation() + token = token or self._read_unicode_with_braces(c) token = token or self._create_token(TOKEN.UNKNOWN, self._input.next()) return token @@ -500,6 +504,15 @@ def _read_punctuation(self): return token + def _read_unicode_with_braces(self, c): + token = None + if c == "\\": + unicode = "" + if self._input.peek(1) == "u": + unicode = self._patterns.unicode.read() + token = self._create_token(TOKEN.UNICODE, unicode) + return token + __regexTokens = { TOKEN.COMMENT, TOKEN.START_EXPR, diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index 25967eea..a1fa610a 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -1750,6 +1750,15 @@ exports.test_data = { { input: 'fn[0]`tagged`', output: 'fn[0] `tagged`' + }, + { + comment: 'Issue #2159: Invalid prettification of object with unicode escape character as object key - test scenario: object with unicode as key', + input: '{\\\\u{1d4b6}:"ascr"}', + output: [ + '{', + ' \\\\u{1d4b6}: "ascr"', + '}' + ] } ] }, { From 8a4f552291348903dbb810a1efbde1736e3b20ba Mon Sep 17 00:00:00 2001 From: Roja A M Date: Sat, 26 Aug 2023 13:45:34 +0530 Subject: [PATCH 24/41] Fix - Invalid prettification of object with unicode as key --- js/src/javascript/tokenizer.js | 15 +++++++++++++++ python/jsbeautifier/javascript/tokenizer.py | 13 +++++++++++++ test/data/javascript/tests.js | 9 +++++++++ 3 files changed, 37 insertions(+) diff --git a/js/src/javascript/tokenizer.js b/js/src/javascript/tokenizer.js index ee35c571..1abbc598 100644 --- a/js/src/javascript/tokenizer.js +++ b/js/src/javascript/tokenizer.js @@ -57,6 +57,7 @@ var TOKEN = { BLOCK_COMMENT: 'TK_BLOCK_COMMENT', COMMENT: 'TK_COMMENT', DOT: 'TK_DOT', + UNICODE: 'TK_UNICODE', UNKNOWN: 'TK_UNKNOWN', START: BASETOKEN.START, RAW: BASETOKEN.RAW, @@ -129,6 +130,7 @@ var Tokenizer = function(input_string, options) { xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/), single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), + unicode: pattern_reader.matching(/\\u{[0-9a-fA-F]{4,5}}/), template_text: templatable.until(/[`\\$]/), template_expression: templatable.until(/[`}\\]/) }; @@ -174,6 +176,7 @@ Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // token = token || this._read_regexp(c, previous_token); token = token || this._read_xml(c, previous_token); token = token || this._read_punctuation(); + token = token || this._read_unicode_with_braces(c); token = token || this._create_token(TOKEN.UNKNOWN, this._input.next()); return token; @@ -457,6 +460,18 @@ Tokenizer.prototype._read_xml = function(c, previous_token) { return null; }; +Tokenizer.prototype._read_unicode_with_braces = function(c) { + var token = null; + if(c === '\\'){ + var unicode = ''; + if (this._input.peek(1) === 'u') { + unicode = this.__patterns.unicode.read(); + token = this._create_token(TOKEN.UNICODE, unicode); + } + } + return token; +}; + function unescape_string(s) { // You think that a regex would work for this // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) { diff --git a/python/jsbeautifier/javascript/tokenizer.py b/python/jsbeautifier/javascript/tokenizer.py index 0eeb8a07..1727cea9 100644 --- a/python/jsbeautifier/javascript/tokenizer.py +++ b/python/jsbeautifier/javascript/tokenizer.py @@ -51,6 +51,7 @@ class TokenTypes(BaseTokenTypes): BLOCK_COMMENT = "TK_BLOCK_COMMENT" COMMENT = "TK_COMMENT" DOT = "TK_DOT" + UNICODE = ("TK_UNICODE",) UNKNOWN = "TK_UNKNOWN" def __init__(self): @@ -164,6 +165,8 @@ def __init__(self, input_scanner, acorn, options): self.template_text = templatable.until(r"[`\\$]") self.template_expression = templatable.until(r"[`}\\]") + self.unicode = pattern.matching(r"\\u{[0-9a-fA-F]{4,5}}") + class Tokenizer(BaseTokenizer): positionable_operators = positionable_operators @@ -229,6 +232,7 @@ def _get_next_token(self, previous_token, open_token): token = token or self._read_regexp(c, previous_token) token = token or self._read_xml(c, previous_token) token = token or self._read_punctuation() + token = token or self._read_unicode_with_braces(c) token = token or self._create_token(TOKEN.UNKNOWN, self._input.next()) return token @@ -500,6 +504,15 @@ def _read_punctuation(self): return token + def _read_unicode_with_braces(self, c): + token = None + if c == "\\": + unicode = "" + if self._input.peek(1) == "u": + unicode = self._patterns.unicode.read() + token = self._create_token(TOKEN.UNICODE, unicode) + return token + __regexTokens = { TOKEN.COMMENT, TOKEN.START_EXPR, diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index 25967eea..a1fa610a 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -1750,6 +1750,15 @@ exports.test_data = { { input: 'fn[0]`tagged`', output: 'fn[0] `tagged`' + }, + { + comment: 'Issue #2159: Invalid prettification of object with unicode escape character as object key - test scenario: object with unicode as key', + input: '{\\\\u{1d4b6}:"ascr"}', + output: [ + '{', + ' \\\\u{1d4b6}: "ascr"', + '}' + ] } ] }, { From ddc12520b1c5b0fafe163e505348ed4181ce2dc2 Mon Sep 17 00:00:00 2001 From: Roja A M Date: Sun, 27 Aug 2023 11:57:59 +0530 Subject: [PATCH 25/41] spacing added to if condition --- js/src/javascript/tokenizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/javascript/tokenizer.js b/js/src/javascript/tokenizer.js index 1abbc598..b269933a 100644 --- a/js/src/javascript/tokenizer.js +++ b/js/src/javascript/tokenizer.js @@ -462,7 +462,7 @@ Tokenizer.prototype._read_xml = function(c, previous_token) { Tokenizer.prototype._read_unicode_with_braces = function(c) { var token = null; - if(c === '\\'){ + if (c === '\\') { var unicode = ''; if (this._input.peek(1) === 'u') { unicode = this.__patterns.unicode.read(); From c8309fcc7f40be97d0ec174409a5e1e50ad854d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 23:46:56 +0000 Subject: [PATCH 26/41] Bump jquery from 3.7.0 to 3.7.1 Bumps [jquery](https://github.com/jquery/jquery) from 3.7.0 to 3.7.1. - [Release notes](https://github.com/jquery/jquery/releases) - [Commits](https://github.com/jquery/jquery/compare/3.7.0...3.7.1) --- updated-dependencies: - dependency-name: jquery dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 26434a9a..af01d137 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1906,9 +1906,9 @@ } }, "node_modules/jquery": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", - "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", "dev": true }, "node_modules/js-yaml": { From a3d7c20a510014cecc399392c6ef28b5c9355090 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 30 Aug 2023 10:34:35 -0700 Subject: [PATCH 27/41] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7e2ebe3..4347e5e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,8 @@ Fixes and enhancements are totally welcome. We prefer you to file an issue befo * bash * make -* nodejs - v10.x (with npm) -* python - v2.7.x or v3.x (with pip) +* nodejs - v16.x or greater (with npm) +* python - v3.7 or greater (with pip) If you encounter issues and cannot build, come chat on gitter.im. We're happy to help. From 88c0ab57672963685540d9d00c6dc73048805441 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 30 Aug 2023 14:12:17 -0700 Subject: [PATCH 28/41] Fix tokenizer to recognize es6 code point syntax --- js/src/javascript/acorn.js | 7 +++--- js/src/javascript/tokenizer.js | 22 +++++------------ python/jsbeautifier/javascript/acorn.py | 14 ++++++++--- python/jsbeautifier/javascript/tokenizer.py | 19 ++++----------- test/data/javascript/node.mustache | 27 ++++++++++++++++++--- test/data/javascript/python.mustache | 19 +++++++++++++-- test/data/javascript/tests.js | 23 +++++++++++------- 7 files changed, 80 insertions(+), 51 deletions(-) diff --git a/js/src/javascript/acorn.js b/js/src/javascript/acorn.js index e5380ad0..e73c1e7b 100644 --- a/js/src/javascript/acorn.js +++ b/js/src/javascript/acorn.js @@ -35,12 +35,13 @@ var nonASCIIidentifierChars = "\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u0 //var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); //var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -var identifierStart = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])"; -var identifierChars = "(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*"; +var unicodeEscapeOrCodePoint = "\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}"; +var identifierStart = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])"; +var identifierChars = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*"; exports.identifier = new RegExp(identifierStart + identifierChars, 'g'); exports.identifierStart = new RegExp(identifierStart); -exports.identifierMatch = new RegExp("(?:\\\\u[0-9a-fA-F]{4}|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+"); +exports.identifierMatch = new RegExp("(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+"); var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; // jshint ignore:line diff --git a/js/src/javascript/tokenizer.js b/js/src/javascript/tokenizer.js index b269933a..ea3f2e26 100644 --- a/js/src/javascript/tokenizer.js +++ b/js/src/javascript/tokenizer.js @@ -57,7 +57,6 @@ var TOKEN = { BLOCK_COMMENT: 'TK_BLOCK_COMMENT', COMMENT: 'TK_COMMENT', DOT: 'TK_DOT', - UNICODE: 'TK_UNICODE', UNKNOWN: 'TK_UNKNOWN', START: BASETOKEN.START, RAW: BASETOKEN.RAW, @@ -130,7 +129,6 @@ var Tokenizer = function(input_string, options) { xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/), single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), - unicode: pattern_reader.matching(/\\u{[0-9a-fA-F]{4,5}}/), template_text: templatable.until(/[`\\$]/), template_expression: templatable.until(/[`}\\]/) }; @@ -176,7 +174,6 @@ Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // token = token || this._read_regexp(c, previous_token); token = token || this._read_xml(c, previous_token); token = token || this._read_punctuation(); - token = token || this._read_unicode_with_braces(c); token = token || this._create_token(TOKEN.UNKNOWN, this._input.next()); return token; @@ -460,18 +457,6 @@ Tokenizer.prototype._read_xml = function(c, previous_token) { return null; }; -Tokenizer.prototype._read_unicode_with_braces = function(c) { - var token = null; - if (c === '\\') { - var unicode = ''; - if (this._input.peek(1) === 'u') { - unicode = this.__patterns.unicode.read(); - token = this._create_token(TOKEN.UNICODE, unicode); - } - } - return token; -}; - function unescape_string(s) { // You think that a regex would work for this // return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) { @@ -499,6 +484,9 @@ function unescape_string(s) { matched = input_scan.match(/x([0-9A-Fa-f]{2})/g); } else if (input_scan.peek() === 'u') { matched = input_scan.match(/u([0-9A-Fa-f]{4})/g); + if (!matched) { + matched = input_scan.match(/u\{([0-9A-Fa-f]+)\}/g); + } } else { out += '\\'; if (input_scan.hasNext()) { @@ -522,7 +510,9 @@ function unescape_string(s) { } else if (escaped >= 0x00 && escaped < 0x20) { // leave 0x00...0x1f escaped out += '\\' + matched[0]; - continue; + } else if (escaped > 0x10FFFF) { + // If the escape sequence is out of bounds, keep the original sequence and continue conversion + out += '\\' + matched[0]; } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) { // single-quote, apostrophe, backslash - escape these out += '\\' + String.fromCharCode(escaped); diff --git a/python/jsbeautifier/javascript/acorn.py b/python/jsbeautifier/javascript/acorn.py index a983088e..933376e4 100644 --- a/python/jsbeautifier/javascript/acorn.py +++ b/python/jsbeautifier/javascript/acorn.py @@ -43,14 +43,20 @@ # _nonASCIIidentifierStart = re.compile("[" + _nonASCIIidentifierStartChars + "]") # _nonASCIIidentifier = re.compile("[" + _nonASCIIidentifierStartChars + _nonASCIIidentifierChars + "]") +_unicodeEscapeOrCodePoint = six.u(r"\\u[0-9a-fA-F]{4}|\\u\{[0-9a-fA-F]+\}") + _identifierStart = ( - six.u(r"(?:\\u[0-9a-fA-F]{4}|[") + six.u("(?:") + + _unicodeEscapeOrCodePoint + + six.u("|[") + _baseASCIIidentifierStartChars + _nonASCIIidentifierStartChars + six.u("])") ) _identifierChars = ( - six.u(r"(?:\\u[0-9a-fA-F]{4}|[") + six.u("(?:") + + _unicodeEscapeOrCodePoint + + six.u("|[") + _baseASCIIidentifierChars + _nonASCIIidentifierStartChars + _nonASCIIidentifierChars @@ -61,7 +67,9 @@ identifierStart = re.compile(_identifierStart) identifierMatch = re.compile( - six.u(r"(?:\\u[0-9a-fA-F]{4}|[") + six.u("(?:") + + _unicodeEscapeOrCodePoint + + six.u("|[") + _baseASCIIidentifierChars + _nonASCIIidentifierStartChars + _nonASCIIidentifierChars diff --git a/python/jsbeautifier/javascript/tokenizer.py b/python/jsbeautifier/javascript/tokenizer.py index 1727cea9..3beba9f2 100644 --- a/python/jsbeautifier/javascript/tokenizer.py +++ b/python/jsbeautifier/javascript/tokenizer.py @@ -51,7 +51,6 @@ class TokenTypes(BaseTokenTypes): BLOCK_COMMENT = "TK_BLOCK_COMMENT" COMMENT = "TK_COMMENT" DOT = "TK_DOT" - UNICODE = ("TK_UNICODE",) UNKNOWN = "TK_UNKNOWN" def __init__(self): @@ -165,8 +164,6 @@ def __init__(self, input_scanner, acorn, options): self.template_text = templatable.until(r"[`\\$]") self.template_expression = templatable.until(r"[`}\\]") - self.unicode = pattern.matching(r"\\u{[0-9a-fA-F]{4,5}}") - class Tokenizer(BaseTokenizer): positionable_operators = positionable_operators @@ -232,7 +229,6 @@ def _get_next_token(self, previous_token, open_token): token = token or self._read_regexp(c, previous_token) token = token or self._read_xml(c, previous_token) token = token or self._read_punctuation() - token = token or self._read_unicode_with_braces(c) token = token or self._create_token(TOKEN.UNKNOWN, self._input.next()) return token @@ -504,15 +500,6 @@ def _read_punctuation(self): return token - def _read_unicode_with_braces(self, c): - token = None - if c == "\\": - unicode = "" - if self._input.peek(1) == "u": - unicode = self._patterns.unicode.read() - token = self._create_token(TOKEN.UNICODE, unicode) - return token - __regexTokens = { TOKEN.COMMENT, TOKEN.START_EXPR, @@ -613,6 +600,8 @@ def unescape_string(self, s): matched = input_scan.match(re.compile(r"x([0-9A-Fa-f]{2})")) elif input_scan.peek() == "u": matched = input_scan.match(re.compile(r"u([0-9A-Fa-f]{4})")) + if not matched: + matched = input_scan.match(re.compile(r"u\{([0-9A-Fa-f]+)\}")) else: out += "\\" if input_scan.hasNext(): @@ -633,7 +622,9 @@ def unescape_string(self, s): elif escaped >= 0x00 and escaped < 0x20: # leave 0x00...0x1f escaped out += "\\" + matched.group(0) - continue + elif escaped > 0x10FFFF: + # If the escape sequence is out of bounds, keep the original sequence and continue conversion + out += "\\" + matched.group(0) elif escaped == 0x22 or escaped == 0x27 or escaped == 0x5C: # single-quote, apostrophe, backslash - escape these out += "\\" + chr(escaped) diff --git a/test/data/javascript/node.mustache b/test/data/javascript/node.mustache index 775d849f..89898239 100644 --- a/test/data/javascript/node.mustache +++ b/test/data/javascript/node.mustache @@ -453,21 +453,40 @@ function run_javascript_tests(test_obj, Urlencoded, js_beautify, html_beautify, bt('"—"'); bt('"\\x41\\x42\\x43\\x01"', '"\\x41\\x42\\x43\\x01"'); bt('"\\u2022"', '"\\u2022"'); + bt('"\\u{2022}"', '"\\u{2022}"'); bt('a = /\s+/'); // bt('a = /\\x41/','a = /A/'); bt('"\\u2022";a = /\s+/;"\\x41\\x42\\x43\\x01".match(/\\x41/);','"\\u2022";\na = /\s+/;\n"\\x41\\x42\\x43\\x01".match(/\\x41/);'); - test_fragment('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"', '"\\x22\\x27", \'\\x22\\x27\', "\\x5c", \'\\x5c\', "\\xff and \\xzz", "unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"'); + + test_fragment('"\\x41\\x42\\x01\\x43"'); + test_fragment('"\\x41\\x42\\u0001\\x43"'); + test_fragment('"\\x41\\x42\\u{0001}\\x43"'); + test_fragment('"\\x20\\x40\\x4a"'); + test_fragment('"\\xff\\x40\\x4a"'); + test_fragment('"\\u0072\\u016B\\u0137\\u012B\\u0074\\u0069\\u0073"'); + test_fragment('"\\u{0072}\\u{016B}\\u{110000}\\u{137}\\u012B\\x74\\u{0000069}\\u{073}"'); + test_fragment('"Google Chrome est\\u00E1 actualizado."'); + test_fragment( + '"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"', + '"\\x22\\x27", \'\\x22\\x27\', "\\x5c", \'\\x5c\', "\\xff and \\xzz", "unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"'); opts.unescape_strings = true; + + test_fragment('"\\x41\\x42\\x01\\x43"', '"AB\\x01C"'); + test_fragment('"\\x41\\x42\\u0001\\x43"', '"AB\\u0001C"'); + test_fragment('"\\x41\\x42\\u{0001}\\x43"', '"AB\\u{0001}C"'); test_fragment('"\\x20\\x40\\x4a"', '" @J"'); test_fragment('"\\xff\\x40\\x4a"'); test_fragment('"\\u0072\\u016B\\u0137\\u012B\\u0074\\u0069\\u0073"', '"\u0072\u016B\u0137\u012B\u0074\u0069\u0073"'); + test_fragment('"\\u{0072}\\u{016B}\\u{110000}\\u{137}\\u012B\\x74\\u{0000069}\\u{073}"', '"\u0072\u016B\\u{110000}\u0137\u012B\u0074\u0069\u0073"'); test_fragment('"Google Chrome est\\u00E1 actualizado."', '"Google Chrome está actualizado."'); - test_fragment('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff"', - '"\\"\\\'", \'\\"\\\'\', "\\\\", \'\\\\\', "\\xff and \\xzz", "unicode \\u0000 \\" \\\' \\\\ ' + unicode_char(0xffff) + '"'); + test_fragment( + '"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff"', + '"\\"\\\'", \'\\"\\\'\', "\\\\", \'\\\\\', "\\xff and \\xzz", "unicode \\u0000 \\" \\\' \\\\ ' + unicode_char(0xffff) + '"'); // For error case, return the string unchanged - test_fragment('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"', + test_fragment( + '"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"', '"\\"\\\'", \'\\"\\\'\', "\\\\", \'\\\\\', "\\xff and \\xzz", "unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"'); reset_options(); diff --git a/test/data/javascript/python.mustache b/test/data/javascript/python.mustache index bc3cdd3c..c9e882a5 100644 --- a/test/data/javascript/python.mustache +++ b/test/data/javascript/python.mustache @@ -78,17 +78,32 @@ class TestJSBeautifier(unittest.TestCase): bt('"—"') bt('"\\x41\\x42\\x43\\x01"', '"\\x41\\x42\\x43\\x01"') bt('"\\u2022"', '"\\u2022"') + bt('"\\u{2022}"', '"\\u{2022}"') bt('a = /\s+/') #bt('a = /\\x41/','a = /A/') bt('"\\u2022";a = /\s+/;"\\x41\\x42\\x43\\x01".match(/\\x41/);','"\\u2022";\na = /\s+/;\n"\\x41\\x42\\x43\\x01".match(/\\x41/);') - test_fragment('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"', '"\\x22\\x27", \'\\x22\\x27\', "\\x5c", \'\\x5c\', "\\xff and \\xzz", "unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"') + + test_fragment('"\\x41\\x42\\x01\\x43"') + test_fragment('"\\x41\\x42\\u0001\\x43"') + test_fragment('"\\x41\\x42\\u{0001}\\x43"') + test_fragment('"\\x20\\x40\\x4a"') + test_fragment('"\\xff\\x40\\x4a"') + test_fragment('"\\u0072\\u016B\\u0137\\u012B\\u0074\\u0069\\u0073"') + test_fragment('"\\u{0072}\\u{016B}\\u{110000}\\u{137}\\u012B\\x74\\u{0000069}\\u{073}"') + test_fragment('"Google Chrome est\\u00E1 actualizado."') + test_fragment( + '"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff and \\xzz","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"', + '"\\x22\\x27", \'\\x22\\x27\', "\\x5c", \'\\x5c\', "\\xff and \\xzz", "unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff \\uzzzz"') self.options.unescape_strings = True - bt('"\\x41\\x42\\x43\\x01"', '"ABC\\x01"') + bt('"\\x41\\x42\\x01\\x43"', '"AB\\x01C"') + bt('"\\x41\\x42\\u0001\\x43"', '"AB\\u0001C"') + bt('"\\x41\\x42\\u{0001}\\x43"', '"AB\\u{0001}C"') test_fragment('"\\x20\\x40\\x4a"', '" @J"') test_fragment('"\\xff\\x40\\x4a"') test_fragment('"\\u0072\\u016B\\u0137\\u012B\\u0074\\u0069\\u0073"', six.u('"\u0072\u016B\u0137\u012B\u0074\u0069\u0073"')) + test_fragment('"\\u{0072}\\u{016B}\\u{110000}\\u{137}\\u012B\\x74\\u{0000069}\\u{073}"', six.u('"\u0072\u016B\\u{110000}\u0137\u012B\u0074\u0069\u0073"')) bt('a = /\s+/') test_fragment('"\\x22\\x27",\'\\x22\\x27\',"\\x5c",\'\\x5c\',"\\xff","unicode \\u0000 \\u0022 \\u0027 \\u005c \\uffff"', diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index a1fa610a..00936194 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -137,6 +137,20 @@ exports.test_data = { }, { input_: "var' + unicode_char(160) + unicode_char(3232) + '_' + unicode_char(3232) + ' = \"hi\";", output: "var ' + unicode_char(3232) + '_' + unicode_char(3232) + ' = \"hi\";" + }, { + comment: 'Issue #2159: Invalid prettification of object with unicode escape character as object key - test scenario: object with unicode as key', + input: '{\\\\u{1d4b6}:"ascr"}', + output: [ + '{', + ' \\\\u{1d4b6}: "ascr"', + '}' + ] + }, { + unchanged: [ + "var \\\\u{E4}\\\\u{ca0}\\\\u{0cA0}\\\\u{000000Ca0} = {", + " \\\\u{ca0}rgerlich: true", + "};" + ] }] }, { name: "Test template and continuation strings", @@ -1750,15 +1764,6 @@ exports.test_data = { { input: 'fn[0]`tagged`', output: 'fn[0] `tagged`' - }, - { - comment: 'Issue #2159: Invalid prettification of object with unicode escape character as object key - test scenario: object with unicode as key', - input: '{\\\\u{1d4b6}:"ascr"}', - output: [ - '{', - ' \\\\u{1d4b6}: "ascr"', - '}' - ] } ] }, { From 3b5f18ac35aa1d9a7c76af6648b3b723b4311728 Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 30 Aug 2023 15:42:19 -0700 Subject: [PATCH 29/41] Turn python CSS tests back on --- js/src/css/beautifier.js | 8 +-- python/cssbeautifier/css/beautifier.py | 82 +++++++++++++++----------- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/js/src/css/beautifier.js b/js/src/css/beautifier.js index 737fe112..5c0e393f 100644 --- a/js/src/css/beautifier.js +++ b/js/src/css/beautifier.js @@ -258,13 +258,11 @@ Beautifier.prototype.beautify = function() { if (variable.match(/[ :]$/)) { // we have a variable or pseudo-class, add it and insert one space before continuing - variable = this.eatString(": ").replace(/\s$/, ''); + variable = this.eatString(": ").replace(/\s+$/, ''); this.print_string(variable); this._output.space_before_token = true; } - variable = variable.replace(/\s$/, ''); - // might be sass variable if (parenLevel === 0 && variable.indexOf(':') !== -1) { insidePropertyValue = true; @@ -284,13 +282,11 @@ Beautifier.prototype.beautify = function() { if (variableOrRule.match(/[ :]$/)) { // we have a variable or pseudo-class, add it and insert one space before continuing - variableOrRule = this.eatString(": ").replace(/\s$/, ''); + variableOrRule = this.eatString(": ").replace(/\s+$/, ''); this.print_string(variableOrRule); this._output.space_before_token = true; } - variableOrRule = variableOrRule.replace(/\s$/, ''); - // might be less variable if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { insidePropertyValue = true; diff --git a/python/cssbeautifier/css/beautifier.py b/python/cssbeautifier/css/beautifier.py index caae0b12..28734c53 100644 --- a/python/cssbeautifier/css/beautifier.py +++ b/python/cssbeautifier/css/beautifier.py @@ -110,14 +110,14 @@ def __init__(self, source_text, opts=default_options()): # https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule # also in CONDITIONAL_GROUP_RULE below self.NESTED_AT_RULE = { - "@page", - "@font-face", - "@keyframes", - "@media", - "@supports", - "@document", + "page", + "font-face", + "keyframes", + "media", + "supports", + "document", } - self.CONDITIONAL_GROUP_RULE = {"@media", "@supports", "@document"} + self.CONDITIONAL_GROUP_RULE = {"media", "supports", "document"} self.NON_SEMICOLON_NEWLINE_PROPERTY = ["grid-template-areas", "grid-template"] def eatString(self, endChars): @@ -220,8 +220,7 @@ def beautify(self): insideRule = False insidePropertyValue = False enteringConditionalGroup = False - insideAtExtend = False - insideAtImport = False + insideNonNestedAtRule = False insideScssMap = False topCharacter = self._ch insideNonSemiColonValues = False @@ -270,7 +269,29 @@ def beautify(self): # Ensures any new lines following the comment are preserved self.eatWhitespace(True) - elif self._ch == "@" or self._ch == "$": + elif self._ch == "$": + self.preserveSingleSpace(isAfterSpace) + + self.print_string(self._ch) + + # strip trailing space, for hash property check + variable = self._input.peekUntilAfter( + re.compile(r"[: ,;{}()[\]\/='\"]") + ) + + if variable[-1] in ": ": + # we have a variable or pseudo-class, add it and + # insert one space before continuing + variable = self.eatString(": ").rstrip() + self.print_string(variable) + self._output.space_before_token = True + + # might be sass variable + if parenLevel == 0 and ":" in variable: + insidePropertyValue = True + self.indent() + + elif self._ch == "@": self.preserveSingleSpace(isAfterSpace) # deal with less propery mixins @{...} @@ -284,32 +305,26 @@ def beautify(self): ) if variableOrRule[-1] in ": ": - # wwe have a variable or pseudo-class, add it and + # we have a variable or pseudo-class, add it and # insert one space before continuing - variableOrRule = self.eatString(": ") - if variableOrRule[-1].isspace(): - variableOrRule = variableOrRule[:-1] + variableOrRule = self.eatString(": ").rstrip() self.print_string(variableOrRule) self._output.space_before_token = True - if variableOrRule[-1].isspace(): - variableOrRule = variableOrRule[:-1] - - if variableOrRule == "extend": - insideAtExtend = True - elif variableOrRule == "import": - insideAtImport = True + # might be less variable + if parenLevel == 0 and ":" in variableOrRule: + insidePropertyValue = True + self.indent() # might be a nesting at-rule - if variableOrRule in self.NESTED_AT_RULE: + elif variableOrRule in self.NESTED_AT_RULE: self._nestedLevel += 1 if variableOrRule in self.CONDITIONAL_GROUP_RULE: enteringConditionalGroup = True - elif ( - not insideRule and parenLevel == 0 and variableOrRule[-1] == ":" - ): - insidePropertyValue = True - self.indent() + + # might be a non-nested at-rule + elif parenLevel == 0 and not insidePropertyValue: + insideNonNestedAtRule = True elif self._ch == "#" and self._input.peek() == "{": self.preserveSingleSpace(isAfterSpace) self.print_string(self._ch + self.eatString("}")) @@ -318,6 +333,9 @@ def beautify(self): insidePropertyValue = False self.outdent() + # non nested at rule becomes nested + insideNonNestedAtRule = False + # when entering conditional groups, only rulesets are # allowed if enteringConditionalGroup: @@ -359,8 +377,6 @@ def beautify(self): self._output.add_new_line() if previous_ch == "{": self._output.trim(True) - insideAtExtend = False - insideAtImport = False if insidePropertyValue: self.outdent() insidePropertyValue = False @@ -392,7 +408,7 @@ def beautify(self): (insideRule or enteringConditionalGroup) and not (self._input.lookBack("&") or self.foundNestedPseudoClass()) and not self._input.lookBack("(") - and not insideAtExtend + and not insideNonNestedAtRule and parenLevel == 0 ): # 'property: value' delimiter @@ -430,8 +446,7 @@ def beautify(self): if insidePropertyValue: self.outdent() insidePropertyValue = False - insideAtExtend = False - insideAtImport = False + insideNonNestedAtRule = False self.print_string(self._ch) self.eatWhitespace(True) @@ -501,8 +516,7 @@ def beautify(self): self._options.selector_separator_newline and (not insidePropertyValue or insideScssMap) and parenLevel == 0 - and not insideAtImport - and not insideAtExtend + and not insideNonNestedAtRule ): self._output.add_new_line() else: From aac9c873e9e2adf2545e9371d80f33c3883a8ab8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:04:49 +0000 Subject: [PATCH 30/41] Bump glob from 10.3.3 to 10.3.4 Bumps [glob](https://github.com/isaacs/node-glob) from 10.3.3 to 10.3.4. - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v10.3.3...v10.3.4) --- updated-dependencies: - dependency-name: glob dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3831391..39d974ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1563,9 +1563,9 @@ } }, "node_modules/glob": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", - "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz", + "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", From 97436d8bcd4fa4e5c61d8694299c6727df5750e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:52:00 +0000 Subject: [PATCH 31/41] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/milestone-publish.yml | 2 +- .github/workflows/pr-staging.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 38c4e962..d06cc572 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4042dcc1..120ca762 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: - python-version: 3.11 node-version: 20 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Node ${{ matrix.node-version }} uses: actions/setup-node@v3 with: diff --git a/.github/workflows/milestone-publish.yml b/.github/workflows/milestone-publish.yml index 4ae51e28..9bcdcf8a 100644 --- a/.github/workflows/milestone-publish.yml +++ b/.github/workflows/milestone-publish.yml @@ -12,7 +12,7 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Node diff --git a/.github/workflows/pr-staging.yml b/.github/workflows/pr-staging.yml index 826e6a39..8a9c7da1 100644 --- a/.github/workflows/pr-staging.yml +++ b/.github/workflows/pr-staging.yml @@ -15,7 +15,7 @@ jobs: PR-from-staging: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: pull-request gh-pages From 33d9bf2e5dbe8cb86379a35261bb95d4ba115be9 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 23 Sep 2023 13:44:14 +0300 Subject: [PATCH 32/41] Use raw strings to define a regex in `packer.py` `'\('` raises a `DeprecationWarning`, because `\(` is not a valid escape sequence in Python: ``` tests/unit/test_cli/test_schema_commands.py::test_openapi_typescript_command[Custom-] D:\a\litestar\litestar\.venv\Lib\site-packages\jsbeautifier\unpackers\packer.py:31: DeprecationWarning: invalid escape sequence '\(' "eval[ ]*\([ ]*function[ ]*\([ ]*p[ ]*,[ ]*a[ ]*,[ ]*c[" ``` Link: https://github.com/litestar-org/litestar/actions/runs/6282794210/job/17062629903#step:11:71 But, `r'\('` is actually fine. So, let use it! --- python/jsbeautifier/unpackers/packer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/jsbeautifier/unpackers/packer.py b/python/jsbeautifier/unpackers/packer.py index 9c8da2d7..117ff58a 100644 --- a/python/jsbeautifier/unpackers/packer.py +++ b/python/jsbeautifier/unpackers/packer.py @@ -28,7 +28,7 @@ def detect(source): begin_offset = -1 """Detects whether `source` is P.A.C.K.E.R. coded.""" mystr = re.search( - "eval[ ]*\([ ]*function[ ]*\([ ]*p[ ]*,[ ]*a[ ]*,[ ]*c[" + r"eval[ ]*\([ ]*function[ ]*\([ ]*p[ ]*,[ ]*a[ ]*,[ ]*c[" " ]*,[ ]*k[ ]*,[ ]*e[ ]*,[ ]*", source, ) From d5c8e9cf6deb9b9620e814425519c6ee42d6af81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 23:22:44 +0000 Subject: [PATCH 33/41] Bump glob from 10.3.4 to 10.3.10 Bumps [glob](https://github.com/isaacs/node-glob) from 10.3.4 to 10.3.10. - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v10.3.4...v10.3.10) --- updated-dependencies: - dependency-name: glob dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39d974ad..f98db64a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1563,18 +1563,18 @@ } }, "node_modules/glob": { - "version": "10.3.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz", - "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.5", "minimatch": "^9.0.1", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", "path-scurry": "^1.10.1" }, "bin": { - "glob": "dist/cjs/src/bin.js" + "glob": "dist/esm/bin.mjs" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -1875,9 +1875,9 @@ } }, "node_modules/jackspeak": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.3.tgz", - "integrity": "sha512-pF0kfjmg8DJLxDrizHoCZGUFz4P4czQ3HyfW4BU0ffebYkzAVlBywp5zaxW/TM+r0sGbmrQdi8EQQVTJFxnGsQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dependencies": { "@isaacs/cliui": "^8.0.2" }, From 5674bd8c9e9ed04f4d519465af12cb5806420f16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:03:06 +0000 Subject: [PATCH 34/41] Bump webpack from 5.88.2 to 5.89.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.88.2 to 5.89.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.88.2...v5.89.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f98db64a..9318b20f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3265,9 +3265,9 @@ } }, "node_modules/webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.89.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", + "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", From f176cec5b3423b0d0ded7eb2f2f98a7035dd7782 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:38:06 +0000 Subject: [PATCH 35/41] Bump actions/setup-node from 3 to 4 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/main.yml | 2 +- .github/workflows/milestone-publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 120ca762..4c65be9c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/milestone-publish.yml b/.github/workflows/milestone-publish.yml index 9bcdcf8a..62b440ec 100644 --- a/.github/workflows/milestone-publish.yml +++ b/.github/workflows/milestone-publish.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 0 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 registry-url: https://registry.npmjs.org/ From cb270b3d1da0ef82905ad31aa3cc7648ed62dc89 Mon Sep 17 00:00:00 2001 From: likendev Date: Tue, 24 Oct 2023 22:46:38 +0800 Subject: [PATCH 36/41] fix: update SRI verification hash --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ff1d5e56..813da6e4 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@ - + From 9d638cb5bf68b04d48a701be23c8d5fb57fc59f3 Mon Sep 17 00:00:00 2001 From: Liken Tan Date: Sun, 29 Oct 2023 02:16:18 +0800 Subject: [PATCH 37/41] fix: updated SRI hash to sha512 --- index.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 813da6e4..7d971d28 100644 --- a/index.html +++ b/index.html @@ -38,25 +38,25 @@ - - - + + + - - - - + + + + - - - - + + + + - + - - + + From 8feaca4f5399a07475f3f3a662b54931fa0e8e2e Mon Sep 17 00:00:00 2001 From: Liken Tan Date: Sun, 29 Oct 2023 02:23:52 +0800 Subject: [PATCH 38/41] fix: replace dracula to darcula * typo for css import --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 7d971d28..3bdf189e 100644 --- a/index.html +++ b/index.html @@ -39,7 +39,7 @@ - + From a6698f0d080e083ce91b87358ee922d862c9fd6c Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Mon, 6 Nov 2023 16:05:31 -0800 Subject: [PATCH 39/41] Update milestone-publish.yml --- .github/workflows/milestone-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/milestone-publish.yml b/.github/workflows/milestone-publish.yml index 62b440ec..5fa2256e 100644 --- a/.github/workflows/milestone-publish.yml +++ b/.github/workflows/milestone-publish.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: 3.11 - name: Set git user run: | git config --global user.email "github-action@users.noreply.github.com" From 5a27c900463269eb6345ceebc985031ea9c9438d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 7 Nov 2023 00:07:00 +0000 Subject: [PATCH 40/41] Update Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46a362ec..591fb5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.14.10 +* Editor not working https://beautifier.io/ ([#2201](https://github.com/beautify-web/js-beautify/issues/2201)) +* Set nodejs minimum to v14 ([#2169](https://github.com/beautify-web/js-beautify/pull/2169)) +* Invalid prettification of object with unicode escape character as object key ([#2159](https://github.com/beautify-web/js-beautify/issues/2159)) +* invalid json being generated with wrap\_line\_length ([#1932](https://github.com/beautify-web/js-beautify/issues/1932)) + ## v1.14.9 * Bump semver and editorconfig ([#2161](https://github.com/beautify-web/js-beautify/pull/2161)) * Update editorconfig package ([#2160](https://github.com/beautify-web/js-beautify/issues/2160)) From 4944f58769a5a0471ac85cbd0c302040308f491f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 7 Nov 2023 00:07:05 +0000 Subject: [PATCH 41/41] Bump version numbers for 1.14.10 --- README.md | 16 ++++++++-------- package-lock.json | 4 ++-- package.json | 2 +- python/cssbeautifier/__version__.py | 2 +- python/jsbeautifier/__version__.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 52891124..bcc69f70 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ JS Beautifier is hosted on two CDN services: [cdnjs](https://cdnjs.com/libraries To pull the latest version from one of these services include one set of the script tags below in your document: ```html - - - + + + - - - + + + ``` Example usage of a JS tag in html: @@ -76,7 +76,7 @@ Example usage of a JS tag in html: . . . - + @@ -434,4 +434,4 @@ Thanks also to Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, D Vasilevsky, Vital Batmanov, Ron Baldwin, Gabriel Harrison, Chris J. Shull, Mathias Bynens, Vittorio Gambaletta and others. -(README.md: js-beautify@1.14.9) +(README.md: js-beautify@1.14.10) diff --git a/package-lock.json b/package-lock.json index 9318b20f..2bbf0f86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "js-beautify", - "version": "1.14.9", + "version": "1.14.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "js-beautify", - "version": "1.14.9", + "version": "1.14.10", "license": "MIT", "dependencies": { "config-chain": "^1.1.13", diff --git a/package.json b/package.json index 3a70500e..f90a89d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-beautify", - "version": "1.14.9", + "version": "1.14.10", "description": "beautifier.io for node", "main": "js/index.js", "bin": { diff --git a/python/cssbeautifier/__version__.py b/python/cssbeautifier/__version__.py index 5f7706f0..29d13d69 100644 --- a/python/cssbeautifier/__version__.py +++ b/python/cssbeautifier/__version__.py @@ -1 +1 @@ -__version__ = "1.14.9" +__version__ = "1.14.10" diff --git a/python/jsbeautifier/__version__.py b/python/jsbeautifier/__version__.py index 5f7706f0..29d13d69 100644 --- a/python/jsbeautifier/__version__.py +++ b/python/jsbeautifier/__version__.py @@ -1 +1 @@ -__version__ = "1.14.9" +__version__ = "1.14.10"