From 25593494e5f761a00ccdbd8727a30f5b953b63cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20Kurt?= Date: Mon, 29 Jul 2024 00:37:16 +0300 Subject: [PATCH] fix(javascript): fix types not being recognized for NodeNext module resolution (#4540) * fix(javascript): fix types not being recognized for NodeNext module resolution Signed-off-by: Gokhan Kurt * remove unnecessary exports --------- Signed-off-by: Gokhan Kurt --- runtime/JavaScript/package.json | 11 ++++++++--- .../src/antlr4/{index.d.ts => index.d.cts} | 14 +++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) rename runtime/JavaScript/src/antlr4/{index.d.ts => index.d.cts} (68%) diff --git a/runtime/JavaScript/package.json b/runtime/JavaScript/package.json index 007e7ac436..ad3e3e472d 100644 --- a/runtime/JavaScript/package.json +++ b/runtime/JavaScript/package.json @@ -6,7 +6,7 @@ "browser": "dist/antlr4.web.mjs", "main": "dist/antlr4.node.cjs", "module": "dist/antlr4.node.mjs", - "types": "src/antlr4/index.d.ts", + "types": "src/antlr4/index.d.cts", "repository": "antlr/antlr4.git", "keywords": [ "lexer", @@ -15,6 +15,11 @@ "antlr4", "grammar" ], + "files": [ + "dist", + "src/**/*.d.cts", + "src/**/*.d.ts" + ], "license": "BSD-3-Clause", "bugs": { "url": "https://github.com/antlr/antlr4/issues" @@ -51,6 +56,7 @@ }, "exports": { ".": { + "types": "./src/antlr4/index.d.cts", "node": { "import": "./dist/antlr4.node.mjs", "require": "./dist/antlr4.node.cjs", @@ -60,8 +66,7 @@ "import": "./dist/antlr4.web.mjs", "require": "./dist/antlr4.web.cjs", "default": "./dist/antlr4.web.mjs" - }, - "types": "./src/antlr4/index.d.ts" + } } } } diff --git a/runtime/JavaScript/src/antlr4/index.d.ts b/runtime/JavaScript/src/antlr4/index.d.cts similarity index 68% rename from runtime/JavaScript/src/antlr4/index.d.ts rename to runtime/JavaScript/src/antlr4/index.d.cts index 3c6c9bcf8b..cf0e262bdd 100644 --- a/runtime/JavaScript/src/antlr4/index.d.ts +++ b/runtime/JavaScript/src/antlr4/index.d.cts @@ -9,13 +9,13 @@ export * from "./CommonTokenStream"; export * from "./Recognizer"; export * from "./Lexer"; export * from "./Parser"; -export * from './Token'; +export * from "./Token"; export * from "./atn"; export * from "./dfa"; export * from "./context"; -export * from './misc'; -export * from './tree'; -export * from './state'; -export * from './error'; -export * from './utils'; -export * from './TokenStreamRewriter'; +export * from "./misc"; +export * from "./tree"; +export * from "./state"; +export * from "./error"; +export * from "./utils"; +export * from "./TokenStreamRewriter";