chore(benchmarks): renovate, use ESM#2454
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
7 issues found across 10 files
Prompt for AI agents (all 7 issues)
Understand the root cause of the following 7 issues and fix them.
<file name="benchmarks/preview-server/package.json">
<violation number="1" location="benchmarks/preview-server/package.json:5">
Setting type: "module" makes this package ESM, but several scripts use __dirname, which is undefined in ESM. This risks runtime failures when running the benchmark scripts.</violation>
</file>
<file name="benchmarks/preview-server/src/local-vs-2.1.7-canary.2.ts">
<violation number="1" location="benchmarks/preview-server/src/local-vs-2.1.7-canary.2.ts:35">
Ensure server subprocesses are terminated via try/finally so they’re killed even if an await (fetch/run/writeFile) throws.</violation>
</file>
<file name="benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts">
<violation number="1" location="benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts:24">
Awaiting runServer without a timeout can hang indefinitely if the child process fails to emit the expected stdout.</violation>
<violation number="2" location="benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts:24">
Subprocess may be left running if fetch throws; wrap server lifecycle in a try/finally so kill() always runs for cleanup.</violation>
<violation number="3" location="benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts:26">
kill() is asynchronous; await the child process 'close' event after sending the signal to ensure the server fully exits before the next iteration.</violation>
<violation number="4" location="benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts:29">
Subprocess may be left running if fetch throws; wrap server lifecycle in a try/finally so kill() always runs for cleanup.</violation>
</file>
<file name="benchmarks/tailwind-component/README.md">
<violation number="1" location="benchmarks/tailwind-component/README.md:13">
README structure lists wrong extension; the file is .tsx, not .ts.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| "name": "@benchmarks/preview-server", | ||
| "private": true, | ||
| "version": "0.0.0", | ||
| "type": "module", |
There was a problem hiding this comment.
Setting type: "module" makes this package ESM, but several scripts use __dirname, which is undefined in ESM. This risks runtime failures when running the benchmark scripts.
Prompt for AI agents
Address the following comment on benchmarks/preview-server/package.json at line 5:
<comment>Setting type: "module" makes this package ESM, but several scripts use __dirname, which is undefined in ESM. This risks runtime failures when running the benchmark scripts.</comment>
<file context>
@@ -2,6 +2,7 @@
"name": "@benchmarks/preview-server",
"private": true,
"version": "0.0.0",
+ "type": "module",
"scripts": {
"local-vs-2.1.7-canary.2": "tsx ./src/local-vs-2.1.7-canary.2.ts",
</file context>
| await fetch(`${localServer.url}/preview/magic-links/notion-magic-link`); | ||
| await fetch(`${canaryServer.url}/preview/magic-links/notion-magic-link`); | ||
|
|
||
| await bench.run(); |
There was a problem hiding this comment.
Ensure server subprocesses are terminated via try/finally so they’re killed even if an await (fetch/run/writeFile) throws.
Prompt for AI agents
Address the following comment on benchmarks/preview-server/src/local-vs-2.1.7-canary.2.ts at line 35:
<comment>Ensure server subprocesses are terminated via try/finally so they’re killed even if an await (fetch/run/writeFile) throws.</comment>
<file context>
@@ -15,32 +15,30 @@ const pathToLocalCliScript = path.resolve(
+await fetch(`${localServer.url}/preview/magic-links/notion-magic-link`);
+await fetch(`${canaryServer.url}/preview/magic-links/notion-magic-link`);
+
+await bench.run();
+
+localServer.subprocess.kill();
</file context>
| }); | ||
| bench | ||
| .add('startup on local', async () => { | ||
| const server = await runServer(pathToLocalCliScript); |
There was a problem hiding this comment.
Awaiting runServer without a timeout can hang indefinitely if the child process fails to emit the expected stdout.
Prompt for AI agents
Address the following comment on benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts at line 24:
<comment>Awaiting runServer without a timeout can hang indefinitely if the child process fails to emit the expected stdout.</comment>
<file context>
@@ -15,28 +15,26 @@ const pathToLocalCliScript = path.resolve(
- });
+bench
+ .add('startup on local', async () => {
+ const server = await runServer(pathToLocalCliScript);
+ await fetch(`${server.url}/preview/magic-links/notion-magic-link`);
+ server.subprocess.kill();
</file context>
| .add('startup on local', async () => { | ||
| const server = await runServer(pathToLocalCliScript); | ||
| await fetch(`${server.url}/preview/magic-links/notion-magic-link`); | ||
| server.subprocess.kill(); |
There was a problem hiding this comment.
kill() is asynchronous; await the child process 'close' event after sending the signal to ensure the server fully exits before the next iteration.
Prompt for AI agents
Address the following comment on benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts at line 26:
<comment>kill() is asynchronous; await the child process 'close' event after sending the signal to ensure the server fully exits before the next iteration.</comment>
<file context>
@@ -15,28 +15,26 @@ const pathToLocalCliScript = path.resolve(
+ .add('startup on local', async () => {
+ const server = await runServer(pathToLocalCliScript);
+ await fetch(`${server.url}/preview/magic-links/notion-magic-link`);
+ server.subprocess.kill();
+ })
+ .add('startup on 2.1.7-canary.2', async () => {
</file context>
| server.subprocess.kill(); | ||
| }) | ||
| .add('startup on 2.1.7-canary.2', async () => { | ||
| const server = await runServer(pathToCanaryCliScript); |
There was a problem hiding this comment.
Subprocess may be left running if fetch throws; wrap server lifecycle in a try/finally so kill() always runs for cleanup.
Prompt for AI agents
Address the following comment on benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts at line 29:
<comment>Subprocess may be left running if fetch throws; wrap server lifecycle in a try/finally so kill() always runs for cleanup.</comment>
<file context>
@@ -15,28 +15,26 @@ const pathToLocalCliScript = path.resolve(
+ server.subprocess.kill();
+ })
+ .add('startup on 2.1.7-canary.2', async () => {
+ const server = await runServer(pathToCanaryCliScript);
+ await fetch(`${server.url}/preview/magic-links/notion-magic-link`);
+ server.subprocess.kill();
</file context>
| }); | ||
| bench | ||
| .add('startup on local', async () => { | ||
| const server = await runServer(pathToLocalCliScript); |
There was a problem hiding this comment.
Subprocess may be left running if fetch throws; wrap server lifecycle in a try/finally so kill() always runs for cleanup.
Prompt for AI agents
Address the following comment on benchmarks/preview-server/src/local-vs-2.1.7-canary.2-on-startup.ts at line 24:
<comment>Subprocess may be left running if fetch throws; wrap server lifecycle in a try/finally so kill() always runs for cleanup.</comment>
<file context>
@@ -15,28 +15,26 @@ const pathToLocalCliScript = path.resolve(
- });
+bench
+ .add('startup on local', async () => {
+ const server = await runServer(pathToLocalCliScript);
+ await fetch(`${server.url}/preview/magic-links/notion-magic-link`);
+ server.subprocess.kill();
</file context>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. Learn more about Socket for GitHub.
|
8128be7 to
19de23f
Compare
Summary by cubic
Switch benchmarks to native ESM and run them with tsx instead of precompiling. This simplifies running benchmarks and aligns configs across packages.