Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 20, 2025

Generate a debug build, in addition to the normal release build.

In the debug build, DEBUG global is defined as true and assertIsNonNull does a runtime assertion. In release build, DEBUG === false and minifier removes debug-only code.

Run the tests in debug mode.

Debug build is generated in a separate directory from dist, so is not included in NPM package.

Copy link
Member Author

overlookmotel commented Nov 20, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@graphite-app graphite-app bot changed the base branch from 11-20-test_linter_plugins_use_subpath_imports to graphite-base/15921 November 21, 2025 11:44
@graphite-app graphite-app bot force-pushed the 11-20-test_linter_plugins_debug_build_for_tests branch from 76a18b5 to 1d4a1b0 Compare November 21, 2025 11:51
@graphite-app graphite-app bot force-pushed the graphite-base/15921 branch from 8b6108a to 690abec Compare November 21, 2025 11:51
@graphite-app graphite-app bot changed the base branch from graphite-base/15921 to main November 21, 2025 11:52
@graphite-app graphite-app bot force-pushed the 11-20-test_linter_plugins_debug_build_for_tests branch from 1d4a1b0 to 2a97c99 Compare November 21, 2025 11:52
Copilot AI review requested due to automatic review settings November 21, 2025 12:45
@overlookmotel overlookmotel force-pushed the 11-20-test_linter_plugins_debug_build_for_tests branch from 2a97c99 to e3b26e6 Compare November 21, 2025 12:45
Copilot finished reviewing on behalf of overlookmotel November 21, 2025 12:48
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 introduces a dual-build system for oxlint's JavaScript/TypeScript code, generating both release and debug builds. The debug build enables runtime assertions through a DEBUG global constant, while the release build optimizes away debug-only code.

Key changes:

  • Debug builds generated alongside release builds with DEBUG: 'true' defined, enabling runtime checks in assertIsNonNull and similar functions
  • Tests configured to run against debug builds to catch assertion failures during development
  • Build infrastructure updated to output debug builds to a separate /debug directory (excluded from NPM packages)

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/oxlint/tsdown.config.ts Configures tsdown to generate both release (dist) and debug builds with different DEBUG constant values
apps/oxlint/vitest.config.ts Adds DEBUG define for test files (though tests run against pre-built debug code)
apps/oxlint/test/e2e.test.ts Updates CLI path to use debug build instead of release build
apps/oxlint/src-js/plugins/utils.ts Implements runtime null check in assertIsNonNull when DEBUG is true
apps/oxlint/src-js/globals.d.ts Declares DEBUG as a global boolean constant defined at build time
apps/oxlint/scripts/build.ts Copies native .node files to both dist and debug directories
apps/oxlint/package.json Updates #oxlint import alias to point to debug build for test fixtures
apps/oxlint/.gitignore Excludes /debug directory from version control

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

@overlookmotel overlookmotel force-pushed the 11-20-test_linter_plugins_debug_build_for_tests branch from e3b26e6 to 33ade07 Compare November 21, 2025 13:19
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 21, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 21, 2025

Merge activity

Generate a debug build, in addition to the normal release build.

In the debug build, `DEBUG` global is defined as `true` and `assertIsNonNull` does a runtime assertion. In release build, `DEBUG === false` and minifier removes debug-only code.

Run the tests in debug mode.

Debug build is generated in a separate directory from `dist`, so is *not* included in NPM package.
@graphite-app graphite-app bot force-pushed the 11-20-test_linter_plugins_debug_build_for_tests branch from 33ade07 to 325af32 Compare November 21, 2025 13:40
@graphite-app graphite-app bot merged commit 325af32 into main Nov 21, 2025
18 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 21, 2025
@graphite-app graphite-app bot deleted the 11-20-test_linter_plugins_debug_build_for_tests branch November 21, 2025 13:46
Copilot AI pushed a commit that referenced this pull request Nov 21, 2025
Generate a debug build, in addition to the normal release build.

In the debug build, `DEBUG` global is defined as `true` and `assertIsNonNull` does a runtime assertion. In release build, `DEBUG === false` and minifier removes debug-only code.

Run the tests in debug mode.

Debug build is generated in a separate directory from `dist`, so is *not* included in NPM package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants