Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

The antlr4 package was listed as a runtime dependency but is bundled into dist/index.mjs by rollup, unnecessarily requiring package consumers to install it.

Changes

  • Moved antlr4 from dependencies to devDependencies in bnf/package.json
  • Updated bnf/package-lock.json accordingly

The rollup configuration uses @rollup/plugin-node-resolve to bundle all antlr4 runtime code into the distribution file, making it self-contained. The package is only needed during build to generate parsers from the ANTLR grammar files and provide the runtime code that gets bundled.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • central.sonatype.com
    • Triggering command: /home/REDACTED/.local/bin/antlr4 antlr4 -Dlanguage=JavaScript Dsp.g4 -visitor -no-listener -o atsds_bnf (dns block)
    • Triggering command: /home/REDACTED/.local/bin/antlr4 antlr4 -Dlanguage=JavaScript Ds.g4 -visitor -no-listener -o atsds_bnf (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>bnf下的那个js包,antlr4被打包进dist了,不需要是依赖,只需要是开发依赖。</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix antlr4 packaging by moving to dev dependencies Move antlr4 to devDependencies in bnf package Dec 12, 2025
Copilot AI requested a review from hzhangxyz December 12, 2025 00:56
@hzhangxyz hzhangxyz marked this pull request as ready for review December 12, 2025 01:09
Copilot AI review requested due to automatic review settings December 12, 2025 01:09
@hzhangxyz hzhangxyz merged commit 1f5982e into main Dec 12, 2025
7 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR correctly moves the antlr4 package from runtime dependencies to devDependencies in the BNF package. The antlr4 runtime is bundled into the distribution file by rollup, so package consumers don't need to install it separately.

  • Moved antlr4 from dependencies to devDependencies in bnf/package.json
  • Updated bnf/package-lock.json to reflect the dependency category change

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
bnf/package.json Moved antlr4 from dependencies to devDependencies since it's bundled by rollup
bnf/package-lock.json Updated lock file to reflect antlr4 as a dev dependency (marked with "dev": true)

The changes are correct and well-justified. The rollup configuration uses @rollup/plugin-node-resolve to bundle all antlr4 runtime code into dist/index.mjs, making the distribution file self-contained. Since the package's exports point to this bundled file, consumers don't need antlr4 as a runtime dependency. The antlr4 package is only needed during development for:

  1. Generating parsers from ANTLR grammar files (.g4 files)
  2. Providing the runtime code that gets bundled into the distribution

No issues were found with this change.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bnf下的那个js包,antlr4被打包进dist了,不需要是依赖,只需要是开发依赖。

2 participants