Skip to content

Commit d3df2ac

Browse files
authored
chore: Bump main deps (#179)
* chore: Bump deps * chore: Switch to newer TS module resolution * fix: skipLibCheck to get around Rollup's broken plugin types * test: Correct test utils
1 parent c8e911f commit d3df2ac

File tree

8 files changed

+1093
-667
lines changed

8 files changed

+1093
-667
lines changed

package-lock.json

Lines changed: 1068 additions & 618 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,29 @@
3737
"@babel/plugin-transform-react-jsx": "^7.27.1",
3838
"@babel/plugin-transform-react-jsx-development": "^7.27.1",
3939
"@prefresh/vite": "^2.4.11",
40-
"@rollup/pluginutils": "^4.1.1",
4140
"babel-plugin-transform-hook-names": "^1.0.2",
4241
"debug": "^4.4.3",
4342
"picocolors": "^1.1.1",
44-
"vite-prerender-plugin": "^0.5.8"
43+
"vite-prerender-plugin": "^0.5.12"
4544
},
4645
"peerDependencies": {
4746
"@babel/core": "7.x",
48-
"vite": "2.x || 3.x || 4.x || 5.x || 6.x || 7.x"
47+
"vite": "7.x"
4948
},
5049
"devDependencies": {
5150
"@babel/core": "^7.28.5",
5251
"@types/babel__core": "^7.20.5",
5352
"@types/debug": "^4.1.12",
54-
"@types/estree": "^0.0.50",
55-
"@types/node": "^14.14.33",
53+
"@types/node": "^20.19.24",
5654
"nano-staged": "^0.8.0",
5755
"preact": "^10.27.2",
5856
"preact-iso": "^2.11.0",
5957
"preact-render-to-string": "^6.6.3",
6058
"premove": "^4.0.0",
6159
"prettier": "^2.2.1",
62-
"rollup": "^2.77.3",
6360
"simple-git-hooks": "^2.13.1",
64-
"typescript": "~5.4.0",
65-
"vite": "^2.6.7"
61+
"typescript": "^5.9.3",
62+
"vite": "^7.2.2"
6663
},
6764
"nano-staged": {
6865
"**/*.{js,jsx,ts,tsx,yml,json}": [

src/devtools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import path from "path";
33
import debug from "debug";
44
import pc from "picocolors";
55

6-
import type { RollupFilter } from "./utils.js";
6+
import type { createFilter } from "./utils.js";
77
import { parseId } from "./utils.js";
88

99
export interface PreactDevtoolsPluginOptions {
1010
devToolsEnabled?: boolean;
11-
shouldTransform: RollupFilter;
11+
shouldTransform: ReturnType<typeof createFilter>;
1212
}
1313

1414
export function preactDevtoolsPlugin({

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Plugin, ResolvedConfig } from "vite";
2-
import type { FilterPattern } from "@rollup/pluginutils";
2+
import type { FilterPattern } from "vite";
33
import type { ParserPlugin, ParserOptions } from "@babel/parser";
44
import type { TransformOptions } from "@babel/core";
55

src/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import type { CreateFilter } from "@rollup/pluginutils";
2-
3-
export { createFilter } from "@rollup/pluginutils";
4-
5-
export type RollupFilter = ReturnType<CreateFilter>;
1+
export { createFilter } from "vite";
62

73
// Allows to ignore query parameters, as in Vue SFC virtual modules.
84
export function parseId(url: string) {

test/dev.test.js

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import assert from "node:assert";
21
import { afterEach, beforeEach, describe, it } from "node:test";
32
import { devServerURL, launchDemoDevServer } from "./util.js";
43

@@ -9,33 +8,17 @@ describe("dev server", async () => {
98
});
109

1110
afterEach(() => {
12-
// Until nodejs/node#45204 is released in node v18, this won't be called on
13-
// test failures, so we'll need to manually wrap tests for now
1411
devServerProc.kill();
1512
});
1613

17-
// TODO: Remove this wrapper once nodejs/node#45204 is released
18-
const wrap = fn => {
19-
return async (...args) => {
20-
try {
21-
await fn(...args);
22-
} finally {
23-
devServerProc.kill();
24-
}
25-
};
26-
};
27-
28-
it(
29-
"serves src/main.tsx",
30-
wrap(async () => {
31-
const mainURL = new URL("/src/index.tsx", devServerURL);
32-
const res = await fetch(mainURL);
33-
if (!res.ok) {
34-
const body = await res.text();
35-
throw new Error(
36-
`Response for ${mainURL} indicated failure. Status code: ${res.status}. Full response:\n${body}`,
37-
);
38-
}
39-
}),
40-
);
14+
it("serves src/index.tsx", async () => {
15+
const mainURL = new URL("/src/index.tsx", devServerURL);
16+
const res = await fetch(mainURL);
17+
if (!res.ok) {
18+
const body = await res.text();
19+
throw new Error(
20+
`Response for ${mainURL} indicated failure. Status code: ${res.status}. Full response:\n${body}`,
21+
);
22+
}
23+
});
4124
});

test/util.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fileURLToPath } from "node:url";
55
const __dirname = path.dirname(fileURLToPath(import.meta.url));
66
export const dir = (...args) => path.join(__dirname, "..", ...args);
77

8-
export const devServerURL = new URL("http://127.0.0.1:3000/");
8+
export const devServerURL = new URL("http://localhost:5173/");
99

1010
/**
1111
* Wait for vite dev server to start
@@ -33,10 +33,9 @@ function waitForServerStart(devServerProc) {
3333
const data = Buffer.isBuffer(chunk)
3434
? chunk.toString("utf-8")
3535
: chunk.toString();
36-
3736
stdout += data;
3837

39-
if (stdout.match(/ready in [0-9]+ms/g) != null) {
38+
if (/ready in/.test(stdout)) {
4039
cleanup();
4140
resolve();
4241
}

tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"target": "ES2019",
44
"strict": true,
55
"esModuleInterop": true,
6-
"module": "ESNext",
7-
"moduleResolution": "Node",
6+
"module": "node20",
7+
"moduleResolution": "node16",
88
"declaration": true,
9-
"outDir": "dist/"
9+
"outDir": "dist/",
10+
"skipLibCheck": true
1011
},
1112
"files": ["./src/index.ts"]
1213
}

0 commit comments

Comments
 (0)