Skip to content

Name moved script paths in their own literals and read hashbangs as comments in port-check (TS17 prep) - #28

Merged
Finesssee merged 3 commits into
mainfrom
ts/ts17-prep-path-literals
Oct 11, 2026
Merged

Finesssee merged 3 commits into
mainfrom
ts/ts17-prep-path-literals

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Prep for TS17 (porting the browser tests, scripts and build config). 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 couldn't follow these paths and would show them as runtime differences.

Path literals (commit 1). Runtime behavior is unchanged:

  • scripts/test-all.mjs passes each test file to a node(file) helper, so the commands it runs are the same.
  • scripts/devtools.mjs names itself through SELF in the login error and in the usage text. node scripts/devtools.mjs help prints the same as on main.
  • tests/e2e-local.mjs names TEST_ALL and SEED_LOCAL in its two setup errors.
  • tests/dev-release.test.ts checks deploy.yml with includes("node " + RELEASE + " deploy|rollback") where it used a regex.
  • The .mjs names stay; the files move in TS17.

Hashbang (commit 2). oxc's JavaScript parser reports #!/usr/bin/env node as a comment, but its TypeScript parser keeps it only in program.hashbang. So port-check blanked the hashbang in a base .mjs and kept it in the ported .ts, and scripts/devtools.mjs and scripts/release.mjs showed as different on a bare rename. scanModule in scripts/lib/port.ts now 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.mjs rebuilds lineText inside the Twitch page with (0, eval)(src), because page callbacks only take serializable arguments. Strict files refuse lint directive comments, so .oxlintrc.json turns no-eval off for scripts/live-chat-e2e.* only. With its two directive comments removed, oxlint --deny-warnings passes 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.

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).
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: nesszer/pixfray/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 601c41df-6ce0-4761-b48e-d1eb14492821

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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.
@Finesssee
Finesssee merged commit efbe22a into main Oct 11, 2026
3 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.

1 participant