From 02726f36f16f84a634d72f2ab84fc6bb23321682 Mon Sep 17 00:00:00 2001 From: Peter Wright Date: Thu, 14 Aug 2025 15:48:16 +0100 Subject: [PATCH 1/4] fix: switch to bundling a patched antlr4 --- npm/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/npm/package.json b/npm/package.json index e707c89..d02c537 100644 --- a/npm/package.json +++ b/npm/package.json @@ -21,7 +21,7 @@ "clean": "rm -rf dist", "init": "npm ci && npm run antlr", "lint": "eslint --cache --cache-location .eslintcache ./src --fix", - "postinstall": "patch-package", + "prepare": "patch-package", "prepack": "cp ../*.md .", "test": "jest --config jestconfig.json", "test:samples": "jest --config sys.jestconfig.json", @@ -32,6 +32,9 @@ "patches", "CHANGELOG.md" ], + "bundleDependencies": [ + "antlr4" + ], "dependencies": { "antlr4": "4.13.2" }, From cc3c18f50d235d01c3635881ab75742c100fcfdd Mon Sep 17 00:00:00 2001 From: Peter Wright Date: Thu, 14 Aug 2025 15:48:42 +0100 Subject: [PATCH 2/4] chore: update package-lock.json --- npm/package-lock.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/npm/package-lock.json b/npm/package-lock.json index d3e03ee..0039b7a 100644 --- a/npm/package-lock.json +++ b/npm/package-lock.json @@ -7,7 +7,9 @@ "": { "name": "@apexdevtools/apex-parser", "version": "5.0.0-beta.4", - "hasInstallScript": true, + "bundleDependencies": [ + "antlr4" + ], "license": "BSD-3-Clause", "dependencies": { "antlr4": "4.13.2" @@ -2325,6 +2327,7 @@ "version": "4.13.2", "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.13.2.tgz", "integrity": "sha512-QiVbZhyy4xAZ17UPEuG3YTOt8ZaoeOR1CvEAqrEsDBsOqINslaB147i9xqljZqoyf5S+EUlGStaj+t22LT9MOg==", + "inBundle": true, "license": "BSD-3-Clause", "engines": { "node": ">=16" From 1962ebac44fddbe704c4e7af2708bea2b8cc734c Mon Sep 17 00:00:00 2001 From: Peter Wright Date: Thu, 14 Aug 2025 15:50:45 +0100 Subject: [PATCH 3/4] chore: update changelog about bundled antlr --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4de5cae..71a5bf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,8 +39,8 @@ - **(BREAKING)** Updated to ES Module format. Node 20/22, TypeScript 5.9 support `require(esm)`. - Increased min node version to 20. - `antlr4` has to be patched to fix module resolution of the type declaration files. - - The patch can be copied to `patches/*` and applied with `patch-package` if needed. - - Until it is fixed, imports of `antlr4` will cause type errors (`skipLibCheck` can be used in some cases). + - The patch is applied to a bundled version of the package. + - For reference it is also published under `patches/*`. - **(BREAKING)** Re-exported antlr classes `CommonTokenStream` and `ParseTreeWalker` removed. - Added type aliases like `ApexTokenStream`, `ApexParseTree`, and more to use with listener/visitor/walker. From 8f0e6d2589f55bbe3c529c7356b300368ff6753c Mon Sep 17 00:00:00 2001 From: Peter Wright Date: Thu, 14 Aug 2025 15:51:48 +0100 Subject: [PATCH 4/4] chore: bump beta version --- npm/package-lock.json | 4 ++-- npm/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/npm/package-lock.json b/npm/package-lock.json index 0039b7a..9d65a57 100644 --- a/npm/package-lock.json +++ b/npm/package-lock.json @@ -1,12 +1,12 @@ { "name": "@apexdevtools/apex-parser", - "version": "5.0.0-beta.4", + "version": "5.0.0-beta.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apexdevtools/apex-parser", - "version": "5.0.0-beta.4", + "version": "5.0.0-beta.5", "bundleDependencies": [ "antlr4" ], diff --git a/npm/package.json b/npm/package.json index d02c537..21b788e 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "@apexdevtools/apex-parser", - "version": "5.0.0-beta.4", + "version": "5.0.0-beta.5", "description": "Javascript parser for Salesforce Apex Language", "author": "Apex Dev Tools Team (https://github.com/apex-dev-tools)", "bugs": "https://github.com/apex-dev-tools/apex-parser/issues",