Skip to content

chore: Remove ts-node usage#931

Merged
timfish merged 3 commits into
mainfrom
timfish/chore/remove-ts-node
May 21, 2026
Merged

chore: Remove ts-node usage#931
timfish merged 3 commits into
mainfrom
timfish/chore/remove-ts-node

Conversation

@timfish
Copy link
Copy Markdown
Collaborator

@timfish timfish commented May 21, 2026

Just stripping out stuff we've already removed from the JavaScript repository!

@timfish timfish requested a review from chargome May 21, 2026 11:14
Comment thread packages/esbuild-plugin/prepack.mjs Outdated
Copy link
Copy Markdown
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

Looks good, just minor nits

Comment thread packages/dev-utils/rollup.config.mjs Outdated
@@ -0,0 +1,15 @@
import packageJson from "./package.json" with { type: "json" };
import modulePackage from "module";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
import modulePackage from "module";

Do we need this?

res.write = function (chunk) {
resBody.push(chunk);

// @ts-ignore
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some ts-ignores in here that we can probably get rid of

@timfish timfish enabled auto-merge (squash) May 21, 2026 12:51
@timfish timfish merged commit df2c876 into main May 21, 2026
25 of 26 checks passed
@timfish timfish deleted the timfish/chore/remove-ts-node branch May 21, 2026 12:53
Comment on lines 52 to 56
}
);

// @ts-ignore
oldEnd.apply(res, arguments);
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The script request-logger-proxy.mjs uses the CommonJS-only global __dirname in an ES Module context, which will cause a ReferenceError at runtime.
Severity: HIGH

Suggested Fix

Define a __dirname constant at the top of the file using the standard pattern for ES Modules. For example: import path from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename);

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/playground/scripts/request-logger-proxy.mjs#L52-L56

Potential issue: The file `packages/playground/scripts/request-logger-proxy.mjs` was
converted from a TypeScript file running in a CommonJS context to a native ES Module
(`.mjs`). However, it still uses the `__dirname` global variable inside the `res.end`
callback. `__dirname` is not available in ES Modules, which will cause a
`ReferenceError: __dirname is not defined` at runtime every time a proxied HTTP response
completes, breaking the request logging functionality.

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