Skip to content

Commit ff29dc8

Browse files
committed
Bump SWC plugins
1 parent dd4480c commit ff29dc8

File tree

8 files changed

+36
-35
lines changed

8 files changed

+36
-35
lines changed

playground/emotion-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"@types/react": "^19.0.8",
1818
"@types/react-dom": "^19.0.3",
1919
"@vitejs/plugin-react-swc": "../../dist",
20-
"@swc/plugin-emotion": "^4.0.3"
20+
"@swc/plugin-emotion": "^8.6.0"
2121
}
2222
}

playground/styled-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"styled-components": "^6.1.15"
1515
},
1616
"devDependencies": {
17-
"@swc/plugin-styled-components": "^3.0.3",
17+
"@swc/plugin-styled-components": "^6.7.0",
1818
"@types/react": "^19.0.8",
1919
"@types/react-dom": "^19.0.3",
2020
"@types/styled-components": "^5.1.34",

playground/utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, Locator, Page } from "@playwright/test";
1+
import { expect, type Locator, type Page } from "@playwright/test";
22
import {
33
createServer,
44
loadConfigFromFile,
@@ -33,7 +33,7 @@ export const setupWaitForLogs = async (page: Page) => {
3333

3434
let port = 5173;
3535
export const setupDevServer = async (name: string) => {
36-
process.env.NODE_ENV = "development";
36+
process.env["NODE_ENV"] = "development";
3737
const root = `playground-temp/${name}`;
3838
const res = await loadConfigFromFile(
3939
{ command: "serve", mode: "development" },
@@ -68,7 +68,7 @@ export const setupDevServer = async (name: string) => {
6868
};
6969

7070
export const setupBuildAndPreview = async (name: string) => {
71-
process.env.NODE_ENV = "production";
71+
process.env["NODE_ENV"] = "production";
7272
const root = `playground-temp/${name}`;
7373
const res = await loadConfigFromFile(
7474
{ command: "build", mode: "production" },

playwright.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fileURLToPath } from "node:url";
2-
import { devices, PlaywrightTestConfig } from "@playwright/test";
2+
import { devices, type PlaywrightTestConfig } from "@playwright/test";
33
import fs from "fs-extra";
44

55
const tempDir = fileURLToPath(new URL("playground-temp", import.meta.url));
@@ -13,10 +13,10 @@ fs.copySync(fileURLToPath(new URL("playground", import.meta.url)), tempDir, {
1313
});
1414

1515
const config: PlaywrightTestConfig = {
16-
forbidOnly: !!process.env.CI,
16+
forbidOnly: !!process.env["CI"],
1717
workers: 1,
1818
timeout: 10_000,
19-
reporter: process.env.CI ? "github" : "list",
19+
reporter: process.env["CI"] ? "github" : "list",
2020
projects: [{ name: "chromium", use: devices["Desktop Chrome"] }],
2121
};
2222

pnpm-lock.yaml

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/bundle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { rmSync, writeFileSync, copyFileSync } from "node:fs";
22
import { execSync } from "node:child_process";
3-
import { build, BuildOptions, context } from "esbuild";
3+
import { build, type BuildOptions, context } from "esbuild";
44

55
import packageJSON from "../package.json";
66

src/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { readFileSync } from "fs";
22
import { dirname, join } from "path";
33
import { fileURLToPath } from "url";
4-
import { SourceMapPayload } from "module";
4+
import type { SourceMapPayload } from "module";
55
import {
6-
Output,
7-
ParserConfig,
8-
ReactConfig,
9-
JscTarget,
6+
type Output,
7+
type ParserConfig,
8+
type ReactConfig,
9+
type JscTarget,
1010
transform,
1111
type Options as SWCOptions,
1212
} from "@swc/core";
13-
import { PluginOption, UserConfig, BuildOptions } from "vite";
13+
import type { PluginOption, UserConfig, BuildOptions } from "vite";
1414
import { createRequire } from "module";
1515

1616
const runtimePublicPath = "/@react-refresh";
@@ -69,7 +69,7 @@ type Options = {
6969
useAtYourOwnRisk_mutateSwcOptions?: (options: SWCOptions) => void;
7070
};
7171

72-
const isWebContainer = globalThis.process?.versions?.webcontainer;
72+
const isWebContainer = globalThis.process?.versions?.["webcontainer"];
7373

7474
const react = (_options?: Options): PluginOption[] => {
7575
let hmrDisabled = false;

tsconfig.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,25 @@
77
"playground/*/__tests__"
88
],
99
"compilerOptions": {
10-
/* Target node 14 */
11-
"module": "ES2020",
12-
"lib": ["ES2020", "DOM"],
13-
"target": "ES2020",
10+
/* Target node 22 */
11+
"module": "ESNext",
12+
"lib": ["ES2023", "DOM"],
13+
"target": "ES2023",
1414
"skipLibCheck": true,
1515

16-
/* Transpile with esbuild */
16+
/* Bundler mode */
1717
"moduleResolution": "bundler",
18-
"noEmit": true,
19-
"isolatedModules": true,
2018
"allowImportingTsExtensions": true,
21-
"resolveJsonModule": true,
19+
"verbatimModuleSyntax": true,
20+
"noEmit": true,
2221

2322
/* Linting */
2423
"strict": true,
2524
"noUnusedLocals": true,
2625
"noUnusedParameters": true,
2726
"noFallthroughCasesInSwitch": true,
28-
"useUnknownInCatchVariables": true
27+
"useUnknownInCatchVariables": true,
28+
"noUncheckedSideEffectImports": true,
29+
"noPropertyAccessFromIndexSignature": true
2930
}
3031
}

0 commit comments

Comments
 (0)