diff --git a/packages/core/package.json b/packages/core/package.json index 018f1e7bd..ac2f8aec6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -59,7 +59,7 @@ "prebundle": "1.6.4", "rsbuild-plugin-publint": "^0.3.4", "rslib": "npm:@rslib/core@0.20.0", - "rslog": "^1.3.2", + "rslog": "^2.0.1", "tinyglobby": "0.2.14", "tsconfck": "3.1.6", "typescript": "^5.9.3" diff --git a/packages/core/prebundle.config.mjs b/packages/core/prebundle.config.mjs index 51284c3ba..18ed7b6d5 100644 --- a/packages/core/prebundle.config.mjs +++ b/packages/core/prebundle.config.mjs @@ -20,13 +20,7 @@ export default { }, { name: 'rslog', - afterBundle(task) { - // use the cjs bundle of rslog - fs.copyFileSync( - join(task.depPath, 'dist/index.cjs'), - join(task.distPath, 'index.js'), - ); - }, + dtsOnly: true, }, { name: 'picocolors', diff --git a/packages/core/rslib.config.ts b/packages/core/rslib.config.ts index 86dc00a4a..537d1a2cd 100644 --- a/packages/core/rslib.config.ts +++ b/packages/core/rslib.config.ts @@ -32,6 +32,10 @@ export default defineConfig({ syntax: ['es2023'], dts: { bundle: false, + // alias to pre-bundled types as they are public API + alias: { + rslog: './compiled/rslog', + }, // Only use tsgo in local dev for faster build, disable it in CI until it's more stable tsgo: !process.env.CI, distPath: './dist-types', @@ -53,7 +57,6 @@ export default defineConfig({ externals: { picocolors: '../compiled/picocolors/index.js', chokidar: '../compiled/chokidar/index.js', - rslog: '../compiled/rslog/index.js', tinyglobby: '../compiled/tinyglobby/index.js', }, }, diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 71fd82147..d86daa2e7 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -12,7 +12,6 @@ "paths": { "chokidar": ["./compiled/chokidar"], "picocolors": ["./compiled/picocolors"], - "rslog": ["./compiled/rslog"], "tinyglobby": ["./compiled/tinyglobby"] } }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8a6e4a8f2..fff679151 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -383,8 +383,8 @@ importers: specifier: npm:@rslib/core@0.20.0 version: '@rslib/core@0.20.0(@microsoft/api-extractor@7.57.7(@types/node@25.2.0))(@module-federation/runtime-tools@0.24.1)(@typescript/native-preview@7.0.0-dev.20260315.1)(typescript@5.9.3)' rslog: - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^2.0.1 + version: 2.0.1 tinyglobby: specifier: 0.2.14 version: 0.2.14 @@ -6648,8 +6648,9 @@ packages: '@rsbuild/core': optional: true - rslog@1.3.2: - resolution: {integrity: sha512-1YyYXBvN0a2b1MSIDLwDTqqgjDzRKxUg/S/+KO6EAgbtZW1B3fdLHAMhEEtvk1patJYMqcRvlp3HQwnxj7AdGQ==} + rslog@2.0.1: + resolution: {integrity: sha512-BdZYILSV4V5Ms7IweGZyo9udJZHQCeUm5cEzlA8KzeY4aEJr2QA6qYWGzgA7yShBU7Igp3qQM6krKUXzze5pqw==} + engines: {node: ^20.19.0 || >=22.12.0} rspress-plugin-devkit@1.0.0: resolution: {integrity: sha512-Xe+yxu9X9a+SBH8CSPZJSiqm0OtaIvx9FCXI1MQMpfmaK75/F+3Rvbz/zJw7nFxxpo5HsePb86ScGOYNIKNLFg==} @@ -13900,7 +13901,7 @@ snapshots: - vue - yaml - rslog@1.3.2: {} + rslog@2.0.1: {} rspress-plugin-devkit@1.0.0(@rspress/core@2.0.5(@module-federation/runtime-tools@0.24.1)(@types/mdast@4.0.4)(@types/react@19.2.14)(micromark-util-types@2.0.2)(micromark@4.0.2)): dependencies: