Repository navigation
Name moved script paths in their own literals and read hashbangs as comments in port-check (TS17 prep) - #28
Merged
Merged
Conversation
Port-check reads a string literal in tests/ and scripts/ as the base path only when the whole literal is the path, so the TS17 rename can't follow paths inside commands, messages or a regex. test-all passes each test file to a node() helper, devtools and e2e-local name their scripts through constants, and the release test checks deploy.yml with includes() on RELEASE. Commands, messages and assertions are unchanged.
oxc lists `#!/usr/bin/env node` as a comment when it parses JavaScript but only as program.hashbang when it parses TypeScript, so scanModule blanked the hashbang in a base .mjs and kept it in the ported .ts, and every ported script with one compared as different. scanModule now adds program.hashbang to the comments when the parser didn't. New port-check test: a hashbang script moved from .mjs to .ts is identical (it fails without the fix).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ive comments The live chat test rebuilds lineText inside the Twitch page with (0, eval)(src), since page callbacks only take serializable arguments. Strict files refuse lint directive comments, so the port needs a scoped rule override.
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.
Prep for TS17 (porting the browser tests, scripts and build config). Port-check reads a string literal in
tests/andscripts/as the base path only when the whole literal is the path, so the TS17 rename couldn't follow these paths and would show them as runtime differences.Path literals (commit 1). Runtime behavior is unchanged:
scripts/test-all.mjspasses each test file to anode(file)helper, so the commands it runs are the same.scripts/devtools.mjsnames itself throughSELFin the login error and in the usage text.node scripts/devtools.mjs helpprints the same as on main.tests/e2e-local.mjsnamesTEST_ALLandSEED_LOCALin its two setup errors.tests/dev-release.test.tschecksdeploy.ymlwithincludes("node " + RELEASE + " deploy|rollback")where it used a regex..mjsnames stay; the files move in TS17.Hashbang (commit 2). oxc's JavaScript parser reports
#!/usr/bin/env nodeas a comment, but its TypeScript parser keeps it only inprogram.hashbang. So port-check blanked the hashbang in a base.mjsand kept it in the ported.ts, andscripts/devtools.mjsandscripts/release.mjsshowed as different on a bare rename.scanModuleinscripts/lib/port.tsnow adds the hashbang to the comments when the parser didn't. A new port-check test fails without the fix. docs/DEVELOPMENT.md notes it.No-eval override (commit 3).
scripts/live-chat-e2e.mjsrebuildslineTextinside the Twitch page with(0, eval)(src), because page callbacks only take serializable arguments. Strict files refuse lint directive comments, so.oxlintrc.jsonturnsno-evaloff forscripts/live-chat-e2e.*only. With its two directive comments removed,oxlint --deny-warningspasses on that file. TS17 removes the comments.Checks
bun run check: pass (343 unit tests).bun run test:port: 101 pass, 0 fail.node scripts/port-check.ts --base origin/main:6 files compared, 6 different; 155 build output files compared, 0 different. The 6 are the intended edits to these tests and scripts; none ships.