Modernize foresta-js library with NPM build process, latest esprima, comprehensive tests, and CI/CD#2
Merged
Merged
Conversation
…latest esprima, and comprehensive tests Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Modernization
Modernize foresta-js library with NPM build process, latest esprima, and comprehensive tests
Aug 4, 2025
joelmartinez
requested changes
Aug 5, 2025
joelmartinez
left a comment
Owner
There was a problem hiding this comment.
Add a github action that will run the jest tests for now. Eventually it'll be used to publish new builds to npm when there's a checkin to the mainline branch, but for now it can just run the tests.
Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
Contributor
Author
Added GitHub Actions CI workflow in |
Copilot
AI
changed the title
Modernize foresta-js library with NPM build process, latest esprima, and comprehensive tests
Modernize foresta-js library with NPM build process, latest esprima, comprehensive tests, and CI/CD
Aug 5, 2025
joelmartinez
approved these changes
Aug 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernizes the foresta-js JavaScript library to bring it up to current standards with proper NPM build process, latest dependencies, comprehensive testing, and automated CI/CD pipeline.
Key Changes
Fixed Critical Bug
The original code had a critical syntax error on line 11 where
part.length = 0(assignment) was used instead ofpart.length === 0(comparison), which would have broken query parsing.Updated Dependencies
fx.defaultsproperty was removed)Modern Project Structure
Restructured the project to follow modern Node.js conventions:
Build System
Added Rollup-based build process that creates three distribution formats:
dist/foresta.js- CommonJS for Node.jsdist/foresta.esm.js- ES Module for modern bundlersdist/foresta.umd.js- UMD for browsersComprehensive Testing
Added Jest test suite with 17 tests covering all functionality described in the README:
"Literal""#theValue""Program VariableDeclaration VariableDeclarator""ObjectExpression Property #update:parent:value"Achieves 92% code coverage.
GitHub Actions CI/CD
Added automated CI workflow that:
npm ciExample Usage
The library is now ready for modern JavaScript development and NPM publishing with automated testing and CI/CD pipeline.
Fixes #1.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.