Skip to content

Typescript port#1

Merged
Sander-Toonen merged 27 commits into
masterfrom
feature/typescript-port
Sep 22, 2025
Merged

Typescript port#1
Sander-Toonen merged 27 commits into
masterfrom
feature/typescript-port

Conversation

@Sander-Toonen

Copy link
Copy Markdown

This pull request modernizes the project's development, testing, and documentation infrastructure. It migrates CI/CD from Travis to GitHub Actions, introduces comprehensive performance benchmarking, and updates project documentation to reflect these changes and new features. The most significant changes are grouped below.

Continuous Integration and Publishing Modernization:

  • Added GitHub Actions workflows for CI (.github/workflows/ci.yml) and npm publishing (.github/workflows/publish.yml), supporting Node.js 18/20/22, running lint/type-check/tests/coverage, and automating npm publishing on release. [1] [2]
  • Removed legacy Travis CI configuration (.travis.yml).

Development and Linting Configuration:

  • Removed the .eslintrc.json file, indicating a possible shift in linting approach or configuration location.
  • Added .vscode/settings.json with TypeScript, formatting, and ESLint settings for a consistent developer experience.

Performance Benchmarking and Documentation:

  • Added PERFORMANCE.md, a comprehensive guide on running, interpreting, and contributing performance benchmarks using modern tools (Tinybench, Vitest), including CI integration examples.
  • Added a detailed evaluation benchmark suite (benchmarks/evaluation.bench.ts) to measure parsing and evaluation performance under various scenarios and contexts.
  • Updated README.md to include sections on performance testing, benchmarking quick start, and interpreting results.
  • Documented new features and enhancements in the README, including the json() function and the not in operator. [1] [2]

These updates collectively improve the project's maintainability, ease of contribution, performance transparency, and developer onboarding.

Sander Toonen added 25 commits September 19, 2025 15:56
- Add comprehensive CI workflow with Node.js 18, 20, 22 testing
- Add automatic NPM publishing workflow for releases
- Include lint, type-check, test, and coverage steps
- Remove deprecated .travis.yml configuration
- Upload build artifacts and coverage reports
- Remove default export object that bundles Parser and Expression
- Add sideEffects: false to package.json for better bundler optimization
- Update Vite configuration with proper tree-shaking settings
- Maintain clean named exports for optimal tree-shaking
- File sizes reduced: ESM 64.20→63.62 kB, UMD 69.37→68.71 kB, UMD-min 34.04→33.45 kB
- All tests passing (672/674, same 2 void 0 issues unrelated to tree-shaking)
- Replace Mocha/nyc with Vitest v3.2.4 and @vitest/coverage-v8
- Add comprehensive vitest.config.ts with coverage thresholds
- Update npm scripts (test, test:watch, test:ui, coverage)
- Fix test compatibility issues with V8 output formatting
- Remove deprecated .mocharc.json and bower.json files
- Achieve 673/674 tests passing (99.85% success rate)
- Significantly improve test execution speed and TypeScript support
- Add TEST_MODERNIZATION_PLAN.md with roadmap for remaining phases

BREAKING CHANGE: Replaces Mocha test framework with Vitest

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request transforms the project from JavaScript to TypeScript while modernizing the testing infrastructure, CI/CD pipelines, and documentation. The migration includes comprehensive test conversion, new benchmark infrastructure, and improved development tooling.

Key Changes:

  • TypeScript Migration: Converted all test files from JavaScript to TypeScript using Vitest instead of Mocha
  • CI/CD Modernization: Replaced Travis CI with GitHub Actions for continuous integration and npm publishing
  • Performance Infrastructure: Added comprehensive benchmarking suite with documentation and CI integration

Reviewed Changes

Copilot reviewed 117 out of 128 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/parsing/instruction.ts New TypeScript test for instruction parsing functionality
test/parser/parser-*.ts Core parser tests migrated to TypeScript with Vitest
test/operators/*.ts Operator tests converted to TypeScript with improved organization
test/functions/*.ts Function tests migrated to TypeScript with type safety
test/lib/spy.ts Test utility converted to TypeScript with proper type definitions
Legacy .js files Removed original JavaScript test files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test/operators/operators-math-basic.ts Outdated
Comment thread test/operators/operators-math-basic.ts Outdated
Comment on lines +205 to +206
// @ts-ignore - temporarily remove Math.sign to test fallback
delete (Math as any).sign;

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

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

Using @ts-ignore and deleting native Math functions is risky and could cause issues if tests fail or are interrupted. Consider using a more controlled approach like mocking or dependency injection for testing fallback implementations.

Copilot uses AI. Check for mistakes.
Sander-Toonen and others added 2 commits September 22, 2025 14:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Sander-Toonen Sander-Toonen merged commit 94f6f62 into master Sep 22, 2025
4 checks passed
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.

2 participants