-
-
Notifications
You must be signed in to change notification settings - Fork 727
test(linter/plugins): debug build for tests #15921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(linter/plugins): debug build for tests #15921
Conversation
76a18b5 to
1d4a1b0
Compare
8b6108a to
690abec
Compare
1d4a1b0 to
2a97c99
Compare
2a97c99 to
e3b26e6
Compare
There was a problem hiding this 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 inassertIsNonNulland 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
/debugdirectory (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.
e3b26e6 to
33ade07
Compare
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.
33ade07 to
325af32
Compare
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.

Generate a debug build, in addition to the normal release build.
In the debug build,
DEBUGglobal is defined astrueandassertIsNonNulldoes a runtime assertion. In release build,DEBUG === falseand 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.