From afd806c637a3d94aa37ae6d11f52559b69626eef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 01:10:03 +0000 Subject: [PATCH 1/2] fix(deps): update dependency chokidar to v5 --- package.json | 2 +- pnpm-lock.yaml | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7b19f0be..92b0de9a 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "dependencies": { "bundle-require": "^5.1.0", "cac": "^6.7.14", - "chokidar": "^4.0.3", + "chokidar": "^5.0.0", "consola": "^3.4.0", "debug": "^4.4.0", "esbuild": "^0.27.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f9b79e4..c77f12a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^6.7.14 version: 6.7.14 chokidar: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^5.0.0 + version: 5.0.0 consola: specifier: ^3.4.0 version: 3.4.2 @@ -1137,6 +1137,10 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} @@ -1549,6 +1553,10 @@ packages: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} + readdirp@5.0.0: + resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} + engines: {node: '>= 20.19.0'} + require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} @@ -2665,6 +2673,10 @@ snapshots: dependencies: readdirp: 4.1.2 + chokidar@5.0.0: + dependencies: + readdirp: 5.0.0 + citty@0.1.6: dependencies: consola: 3.4.2 @@ -3084,6 +3096,8 @@ snapshots: readdirp@4.1.2: {} + readdirp@5.0.0: {} + require-from-string@2.0.2: {} resolve-from@5.0.0: {} From 9d47238a71ae3d9e1c239762e38347bb4ac2fbbb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Dec 2025 01:10:23 +0000 Subject: [PATCH 2/2] chore(ci): [bot] format code --- assets/cjs_shims.js | 13 +++++++------ docs/README.md | 17 +++++++++-------- src/esbuild/swc.ts | 5 ++++- src/options.ts | 4 ++-- vitest.config.mts | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/assets/cjs_shims.js b/assets/cjs_shims.js index ea603830..9342fe24 100644 --- a/assets/cjs_shims.js +++ b/assets/cjs_shims.js @@ -3,11 +3,12 @@ // if we export it as `const importMetaUrl = ... __filename ...` // But using a function will not cause this issue -const getImportMetaUrl = () => - typeof document === "undefined" - ? new URL(`file:${__filename}`).href - : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') - ? document.currentScript.src - : new URL("main.js", document.baseURI).href; +const getImportMetaUrl = () => + typeof document === 'undefined' + ? new URL(`file:${__filename}`).href + : document.currentScript && + document.currentScript.tagName.toUpperCase() === 'SCRIPT' + ? document.currentScript.src + : new URL('main.js', document.baseURI).href export const importMetaUrl = /* @__PURE__ */ getImportMetaUrl() diff --git a/docs/README.md b/docs/README.md index e9816cec..e095f33f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -615,6 +615,7 @@ When you use legacy TypeScript decorator by enabling `emitDecoratorMetadata` in decorators. In this case, you can give extra swc configuration in the `tsup.config.ts` file. For example, if you have to define `useDefineForClassFields`, you can do that as follows: + ```ts import { defineConfig } from 'tsup' @@ -626,10 +627,10 @@ export default defineConfig({ swc: { jsc: { transform: { - useDefineForClassFields: true - } - } - } + useDefineForClassFields: true, + }, + }, + }, }) ``` @@ -648,9 +649,9 @@ Note: some SWC options cannot be configured: "keepClassNames": true, "target": "es2022" } - ``` +``` -You can also define a custom `.swcrc` configuration file. Just set `swcrc` to `true` +You can also define a custom `.swcrc` configuration file. Just set `swcrc` to `true` in `tsup.config.ts` to allow SWC plugin to discover automatically your custom swc config file. ```ts @@ -662,8 +663,8 @@ export default defineConfig({ sourcemap: true, clean: true, swc: { - swcrc: true - } + swcrc: true, + }, }) ``` diff --git a/src/esbuild/swc.ts b/src/esbuild/swc.ts index 755009d3..ee12c1dc 100644 --- a/src/esbuild/swc.ts +++ b/src/esbuild/swc.ts @@ -9,7 +9,10 @@ import type { Logger } from '../log' export type SwcPluginConfig = { logger: Logger } & Options -export const swcPlugin = ({ logger, ...swcOptions }: SwcPluginConfig): Plugin => { +export const swcPlugin = ({ + logger, + ...swcOptions +}: SwcPluginConfig): Plugin => { return { name: 'swc', diff --git a/src/options.ts b/src/options.ts index 6bbee23b..7f68bd8c 100644 --- a/src/options.ts +++ b/src/options.ts @@ -257,8 +257,8 @@ export type Options = { * @default true */ removeNodeProtocol?: boolean - - swc?: SwcPluginConfig; + + swc?: SwcPluginConfig } export interface NormalizedExperimentalDtsConfig { diff --git a/vitest.config.mts b/vitest.config.mts index 8f6d3ac6..7e032eda 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -4,6 +4,6 @@ export default defineConfig({ test: { testTimeout: 50000, globalSetup: 'vitest-global.ts', - include: ["test/*.test.ts", "src/**/*.test.ts"] + include: ['test/*.test.ts', 'src/**/*.test.ts'], }, })