diff --git a/packages/rrweb/record/package.json b/packages/rrweb/record/package.json index b6e6255124..1c3aed6c43 100644 --- a/packages/rrweb/record/package.json +++ b/packages/rrweb/record/package.json @@ -7,10 +7,11 @@ "scripts": { "dev": "vite build --watch", "build": "pnpm turbo run prepublish", + "build:declarations": "rolldown -c rolldown.dts.config.mts", "test": "vitest run", "test:watch": "vitest watch", "check-types": "tsc -noEmit", - "prepublish": "tsc -noEmit && vite build", + "prepublish": "tsc -noEmit && vite build && pnpm build:declarations", "lint": "oxlint src" }, "repository": { @@ -41,6 +42,8 @@ ], "devDependencies": { "puppeteer": "^23.11.1", + "rolldown": "catalog:", + "rolldown-plugin-dts": "catalog:", "vite": "catalog:", "vite-plugin-dts": "catalog:", "vitest": "^1.4.0", diff --git a/packages/rrweb/record/rolldown.dts.config.mts b/packages/rrweb/record/rolldown.dts.config.mts new file mode 100644 index 0000000000..30bc6a916a --- /dev/null +++ b/packages/rrweb/record/rolldown.dts.config.mts @@ -0,0 +1,32 @@ +import { copyFileSync } from 'node:fs'; +import path from 'node:path'; +import { defineConfig, type Plugin } from 'rolldown'; +import { dts } from 'rolldown-plugin-dts'; + +function copyDeclarationsForCommonJs(): Plugin { + return { + name: 'copy-declarations-for-commonjs', + writeBundle(outputOptions) { + if (!outputOptions.dir) return; + + const declarationPath = path.resolve(outputOptions.dir, 'index.d.ts'); + copyFileSync(declarationPath, declarationPath.replace(/\.d\.ts$/, '.d.cts')); + }, + }; +} + +export default defineConfig({ + input: 'src/index.ts', + external: ['@posthog/rrweb'], + output: { + dir: 'dist', + format: 'es', + }, + plugins: [ + ...dts({ + emitDtsOnly: true, + generator: 'oxc', + }), + copyDeclarationsForCommonJs(), + ], +}); diff --git a/packages/rrweb/record/test/build-output.test.ts b/packages/rrweb/record/test/build-output.test.ts index 236ba1ee55..3d9218ce95 100644 --- a/packages/rrweb/record/test/build-output.test.ts +++ b/packages/rrweb/record/test/build-output.test.ts @@ -9,4 +9,26 @@ describe('build output', () => { expect(bundle).not.toContain('sourceMappingURL=image-bitmap-data-url-worker-') expect(bundle).toContain('sourceMappingURL=rrweb-record.js.map') }) + + it('emits matching ESM and CommonJS declarations', () => { + const esmDeclarations = readFileSync(resolve(__dirname, '../dist/index.d.ts'), 'utf8') + const commonJsDeclarations = readFileSync(resolve(__dirname, '../dist/index.d.cts'), 'utf8') + + const expectedExports = [ + 'DeferredStylesheetStats', + 'MutationCost', + 'SnapshotCost', + 'getDeferredStylesheetStats', + 'getDiscardedDurationSamples', + 'getLastSnapshotCost', + 'getMutationCost', + 'record', + 'resetMaxDepthState', + 'resetSnapshotCostState', + 'wasMaxDepthReached', + ] + + expect(commonJsDeclarations).toBe(esmDeclarations) + expectedExports.forEach((exportName) => expect(esmDeclarations).toContain(exportName)) + }) }) diff --git a/packages/rrweb/record/tsconfig.json b/packages/rrweb/record/tsconfig.json index a1db100890..ab9ba25287 100644 --- a/packages/rrweb/record/tsconfig.json +++ b/packages/rrweb/record/tsconfig.json @@ -5,7 +5,8 @@ ], "compilerOptions": { "rootDir": "src", - "tsBuildInfoFile": "./tsconfig.tsbuildinfo" + "tsBuildInfoFile": "./tsconfig.tsbuildinfo", + "isolatedDeclarations": true }, "references": [ { diff --git a/packages/rrweb/record/vite.config.ts b/packages/rrweb/record/vite.config.ts index 9f52ab6eef..5fb14f88a8 100644 --- a/packages/rrweb/record/vite.config.ts +++ b/packages/rrweb/record/vite.config.ts @@ -11,6 +11,7 @@ const workspacePackages: Record = { }; export default config(path.resolve(__dirname, 'src/index.ts'), 'rrweb', { + generateDeclarations: process.argv.includes('--watch'), plugins: [ { name: 'resolve-workspace-sources', diff --git a/packages/rrweb/vite.config.default.ts b/packages/rrweb/vite.config.default.ts index 3e4b818480..e220961eae 100644 --- a/packages/rrweb/vite.config.default.ts +++ b/packages/rrweb/vite.config.default.ts @@ -1,196 +1,190 @@ /// -import dts from 'vite-plugin-dts'; -import { copyFileSync } from 'node:fs'; -import { defineConfig, LibraryOptions, LibraryFormats, Plugin } from 'vite'; -import { build, Format } from 'esbuild'; -import { resolve } from 'path'; -import { umdWrapper } from 'esbuild-plugin-umd-wrapper'; -import { visualizer } from 'rollup-plugin-visualizer'; -import { ensureSourcemap } from './vite.config.utils.ts'; +import dts from 'vite-plugin-dts' +import { copyFileSync } from 'node:fs' +import { defineConfig, LibraryOptions, LibraryFormats, Plugin } from 'vite' +import { build, Format } from 'esbuild' +import { resolve } from 'path' +import { umdWrapper } from 'esbuild-plugin-umd-wrapper' +import { visualizer } from 'rollup-plugin-visualizer' +import { ensureSourcemap } from './vite.config.utils.ts' // don't empty out dir if --watch flag is passed -const emptyOutDir = !process.argv.includes('--watch'); +const emptyOutDir = !process.argv.includes('--watch') -function minifyAndUMDPlugin({ - name, - outDir, -}: { - name: LibraryOptions['name']; - outDir: string; -}): Plugin { - return { - name: 'minify-plugin', - async writeBundle(outputOptions, bundle) { - for (const file of Object.values(bundle)) { - const isCSS = file.type === 'asset' && file.fileName.endsWith('.css'); - const isCJS = - file.type === 'chunk' && file.isEntry && file.fileName.endsWith('.cjs'); - const isJS = - file.type === 'chunk' && - (file.fileName.endsWith('.js') || file.fileName.endsWith('.cjs')); - if (!isCSS && !isCJS) { - if (isJS) { - ensureSourcemap(outputOptions.dir!, file.fileName); - } - continue; - } +function minifyAndUMDPlugin({ name, outDir }: { name: LibraryOptions['name']; outDir: string }): Plugin { + return { + name: 'minify-plugin', + async writeBundle(outputOptions, bundle) { + for (const file of Object.values(bundle)) { + const isCSS = file.type === 'asset' && file.fileName.endsWith('.css') + const isCJS = file.type === 'chunk' && file.isEntry && file.fileName.endsWith('.cjs') + const isJS = file.type === 'chunk' && (file.fileName.endsWith('.js') || file.fileName.endsWith('.cjs')) + if (!isCSS && !isCJS) { + if (isJS) { + ensureSourcemap(outputOptions.dir!, file.fileName) + } + continue + } - const inputFilePath = resolve(outputOptions.dir!, file.fileName); - const baseFileName = file.fileName.replace(/(\.cjs|\.css)$/, ''); - const outputFilePath = resolve(outputOptions.dir!, baseFileName); - // console.log(outputFilePath, 'minifying', file.fileName); - if (isCSS) { - await buildFile({ - input: inputFilePath, - output: `${outputFilePath}.min.css`, - minify: true, - isCss: true, - outDir, - }); - } else { - await buildFile({ - name, - input: inputFilePath, - output: `${outputFilePath}.umd.cjs`, - minify: false, - isCss: false, - outDir, - }); - await buildFile({ - name, - input: inputFilePath, - output: `${outputFilePath}.umd.min.cjs`, - minify: true, - isCss: false, - outDir, - }); - ensureSourcemap(outputOptions.dir!, file.fileName); - } - } - }, - }; + const inputFilePath = resolve(outputOptions.dir!, file.fileName) + const baseFileName = file.fileName.replace(/(\.cjs|\.css)$/, '') + const outputFilePath = resolve(outputOptions.dir!, baseFileName) + // console.log(outputFilePath, 'minifying', file.fileName); + if (isCSS) { + await buildFile({ + input: inputFilePath, + output: `${outputFilePath}.min.css`, + minify: true, + isCss: true, + outDir, + }) + } else { + await buildFile({ + name, + input: inputFilePath, + output: `${outputFilePath}.umd.cjs`, + minify: false, + isCss: false, + outDir, + }) + await buildFile({ + name, + input: inputFilePath, + output: `${outputFilePath}.umd.min.cjs`, + minify: true, + isCss: false, + outDir, + }) + ensureSourcemap(outputOptions.dir!, file.fileName) + } + } + }, + } } async function buildFile({ - name, - input, - output, - minify, - isCss, - outDir, + name, + input, + output, + minify, + isCss, + outDir, }: { - name?: LibraryOptions['name']; - input: string; - output: string; - outDir: string; - minify: boolean; - isCss: boolean; + name?: LibraryOptions['name'] + input: string + output: string + outDir: string + minify: boolean + isCss: boolean }) { - await build({ - entryPoints: [input], - outfile: output, - minify, - sourcemap: true, - format: isCss ? undefined : ('umd' as Format), - target: isCss ? undefined : 'es2017', - treeShaking: !isCss, - plugins: [ - umdWrapper({ - libraryName: name, - }), - ], - }); - const filename = output.replace(new RegExp(`^.+/(${outDir}/)`), '$1'); - console.log(filename); - console.log(`${filename}.map`); + await build({ + entryPoints: [input], + outfile: output, + minify, + sourcemap: true, + format: isCss ? undefined : ('umd' as Format), + target: isCss ? undefined : 'es2017', + treeShaking: !isCss, + plugins: [ + umdWrapper({ + libraryName: name, + }), + ], + }) + const filename = output.replace(new RegExp(`^.+/(${outDir}/)`), '$1') + console.log(filename) + console.log(`${filename}.map`) } export default function ( - entry: LibraryOptions['entry'], - name: LibraryOptions['name'], - options?: { - outputDir?: string; - fileName?: string; - plugins?: Plugin[]; - external?: string[]; - }, + entry: LibraryOptions['entry'], + name: LibraryOptions['name'], + options?: { + outputDir?: string + fileName?: string + plugins?: Plugin[] + generateDeclarations?: boolean + external?: string[] + } ) { - const { - fileName, - outputDir: outDir = 'dist', - plugins = [], - external = [], - } = options || {}; + const { + fileName, + outputDir: outDir = 'dist', + plugins = [], + generateDeclarations = true, + external = [], + } = options || {} - let formats: LibraryFormats[] = ['es', 'cjs']; + let formats: LibraryFormats[] = ['es', 'cjs'] - return defineConfig(() => ({ - // Inline workers run from blob URLs, so relative source map URLs cannot resolve. - worker: { - plugins: () => [ - { - name: 'disable-inline-worker-sourcemaps', - outputOptions(options) { - return { ...options, sourcemap: false }; - }, + return defineConfig(() => ({ + // Inline workers run from blob URLs, so relative source map URLs cannot resolve. + worker: { + plugins: () => [ + { + name: 'disable-inline-worker-sourcemaps', + outputOptions(options) { + return { ...options, sourcemap: false } + }, + }, + ], }, - ], - }, - build: { - // Preserve Vite 6's browser support instead of adopting Vite 7/8's newer defaults. - target: ['chrome87', 'edge88', 'firefox78', 'safari14'], + build: { + // Preserve Vite 6's browser support instead of adopting Vite 7/8's newer defaults. + target: ['chrome87', 'edge88', 'firefox78', 'safari14'], - // See https://vite.dev/guide/build.html#library-mode - lib: { - cssFileName: 'style', - entry, - name, - fileName, - // TODO: turn on `umd` for rrweb when https://github.com/schummar/vite/tree/feature/libMultiEntryUMD gets merged - // More info: https://github.com/vitejs/vite/pull/7047#issuecomment-1288080855 - // formats: ['es', 'umd', 'cjs'], - formats, - }, + // See https://vite.dev/guide/build.html#library-mode + lib: { + cssFileName: 'style', + entry, + name, + fileName, + // TODO: turn on `umd` for rrweb when https://github.com/schummar/vite/tree/feature/libMultiEntryUMD gets merged + // More info: https://github.com/vitejs/vite/pull/7047#issuecomment-1288080855 + // formats: ['es', 'umd', 'cjs'], + formats, + }, - outDir, + outDir, - emptyOutDir, + emptyOutDir, - rolldownOptions: { - external, - output: { - exports: 'named', - }, - }, + rolldownOptions: { + external, + output: { + exports: 'named', + }, + }, - // Leaving this unminified so you can see what exactly gets included in - // the bundles - minify: false, + // Leaving this unminified so you can see what exactly gets included in + // the bundles + minify: false, - sourcemap: true, - }, - plugins: [ - dts({ - insertTypesEntry: true, - bundleTypes: true, - afterBuild: (emittedFiles: Map) => { - // To pass publint (`npm x publint@latest`) and ensure the - // package is supported by all consumers, we must export types that are - // read as ESM. To do this, there must be duplicate types with the - // correct extension supplied in the package.json exports field. - const files: string[] = Array.from(emittedFiles.keys()); - files.forEach((file) => { - const ctsFile = file.replace('.d.ts', '.d.cts'); - copyFileSync(file, ctsFile); - }); + sourcemap: true, }, - }), - minifyAndUMDPlugin({ name, outDir }), - visualizer({ - filename: resolve(__dirname, name + '-bundle-analysis.html'), // Path for the HTML report - open: false, // don't Automatically open the report in the browser - }), - ...plugins, - ], - })); + plugins: [ + generateDeclarations && + dts({ + insertTypesEntry: true, + bundleTypes: true, + afterBuild: (emittedFiles: Map) => { + // To pass publint (`npm x publint@latest`) and ensure the + // package is supported by all consumers, we must export types that are + // read as ESM. To do this, there must be duplicate types with the + // correct extension supplied in the package.json exports field. + const files: string[] = Array.from(emittedFiles.keys()) + files.forEach((file) => { + const ctsFile = file.replace('.d.ts', '.d.cts') + copyFileSync(file, ctsFile) + }) + }, + }), + minifyAndUMDPlugin({ name, outDir }), + visualizer({ + filename: resolve(__dirname, name + '-bundle-analysis.html'), // Path for the HTML report + open: false, // don't Automatically open the report in the browser + }), + ...plugins, + ], + })) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 251ad964aa..16860ea775 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,8 +70,11 @@ catalogs: specifier: ^19.2.1 version: 19.2.7 rolldown: - specifier: 1.2.1 - version: 1.2.1 + specifier: 1.2.4 + version: 1.2.4 + rolldown-plugin-dts: + specifier: 0.27.14 + version: 0.27.14 rollup: specifier: ^4.53.3 version: 4.53.3 @@ -443,7 +446,7 @@ importers: version: 6.3.1(preact@10.29.3) rolldown: specifier: 'catalog:' - version: 1.2.1 + version: 1.2.4 rollup: specifier: 'catalog:' version: 4.53.3 @@ -452,7 +455,7 @@ importers: version: 6.2.3(rollup@4.53.3)(typescript@5.8.2) rollup-plugin-visualizer: specifier: ^6.0.3 - version: 6.0.3(rolldown@1.2.1)(rollup@4.53.3) + version: 6.0.3(rolldown@1.2.4)(rollup@4.53.3) sinon: specifier: 9.0.2 version: 9.0.2 @@ -1337,6 +1340,12 @@ importers: puppeteer: specifier: ^23.11.1 version: 23.11.1(typescript@5.8.2) + rolldown: + specifier: 'catalog:' + version: 1.2.4 + rolldown-plugin-dts: + specifier: 'catalog:' + version: 0.27.14(@volar/typescript@2.4.28)(rolldown@1.2.4)(typescript@5.8.2) typescript: specifier: 'catalog:' version: 5.8.2 @@ -3469,9 +3478,6 @@ packages: '@emnapi/core@1.11.3': resolution: {integrity: sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg==} - '@emnapi/core@2.0.0-alpha.3': - resolution: {integrity: sha512-AZypUeJ/yByuxyS7BlSNRDOMLMlROYtjYdIAuBmJssVz1UJDSeYxLrdizhXCFYhedC5bqd/ASy8EuNXbVVXp9g==} - '@emnapi/runtime@1.11.2': resolution: {integrity: sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==} @@ -3481,18 +3487,12 @@ packages: '@emnapi/runtime@1.7.1': resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} - '@emnapi/runtime@2.0.0-alpha.3': - resolution: {integrity: sha512-hFPAhMUjJD9BSyCANEISPOogeXC9Zo9ZQl7L6vKnaVsMkCtzznaW/naYypeyl0Gv5rYfWYsZbpixTMpjDJzQeA==} - '@emnapi/wasi-threads@1.2.2': resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} '@emnapi/wasi-threads@1.2.3': resolution: {integrity: sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==} - '@emnapi/wasi-threads@2.0.1': - resolution: {integrity: sha512-9DsSk+o5NBX0CCJT8s0EROGSGxjR/tKu6aBTaVyq+SjAEQH4XcdcRxPBRzsBLizTTJ49MJjF+jgu3qnO9GLQcQ==} - '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -5826,9 +5826,6 @@ packages: '@oxc-project/types@0.140.0': resolution: {integrity: sha512-h5LUOzGArYemnW1NMz/DuuQhBi96J6JL2Bk8zE4kvqxB5Sg3jxmCiH4uyOWHDkiKSt5vWlG4FIwCR/DbstcNRQ==} - '@oxc-project/types@0.142.0': - resolution: {integrity: sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==} - '@oxc-project/types@0.144.0': resolution: {integrity: sha512-nuhZIOLuI6TFQ32I/WnUx+SCPY7SdSKwgnFHydAuoS1+Z4BRcaP+RRJmGzl9lw+0OFF7UmaESf7KQRXaNLHypg==} @@ -6513,73 +6510,36 @@ packages: '@nestjs/platform-fastify': optional: true - '@rolldown/binding-android-arm64@1.2.1': - resolution: {integrity: sha512-02hOeOSryYxVrOIphmLAsqnCJWxwlzFk+pEt/N/i6OgT3lShHO7xGCU5cpgchRDHboAEbSjzgGh+O/u1GswQmA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - '@rolldown/binding-android-arm64@1.2.4': resolution: {integrity: sha512-jHC2cnyKz5xU2fhECtFl8OZ83cYNt13GZQD+0uMJ/X3o+ijmd56okHhTUwxVSHPx1IRVIJEZ1/1pPzeLCU6XKA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.2.1': - resolution: {integrity: sha512-fMsTOnN0OjFm3CyppWPitKnc8UlliVARUULW6cfU6AIqjdtgmSFWSk9vecHzZduv/yMWIHDlRhM1e8Iff9uAfA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - '@rolldown/binding-darwin-arm64@1.2.4': resolution: {integrity: sha512-Dc5mPD8F5F/FS8i01syd7FTF6yB2fVthH/TRkjwJkzUK6EpoxHtqvZQP5Zwq80/5z19TWYHIg1KOHboCgVx/aQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.2.1': - resolution: {integrity: sha512-1wjKdz/XLGKHaTNHjQveQ/B23TKx4ItAqm1JbyVuvNPc4Ze0Fb48s49TAd/2zcplPl8okE/UbTgmlVfwT7eFeQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - '@rolldown/binding-darwin-x64@1.2.4': resolution: {integrity: sha512-fpDm4oBo6SqLvWUYCmFhdde3U9KH2fRNNMeAnAPAIwxRL345xutL0EtEUcuoxsoazdJGv/MuDBQHlCDrtbvqOg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.2.1': - resolution: {integrity: sha512-Fa0jHR07E7YBN4vOEsbVf2briYNsuOowfLJaXULZM0ldMlaCaj2LJgLMbMe4iacRyZmvR8efFhgR9wKuGclQUg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - '@rolldown/binding-freebsd-x64@1.2.4': resolution: {integrity: sha512-rSJoreDE/HoIzoaib6MTp5jQtCTdMHKIvItAKT/ImS6Y6Ww76oUaeMyp4Vc/fAgd/ehji068IxetHXAnqUwN9A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.2.1': - resolution: {integrity: sha512-pzkgu1SSHGgRRyRZ4fbmSgmajbVt+epaLP99NDjFft69v/ypfTi6swBMiVdh2EkQ0OSnHE1lZDM7DRGkyAzUpA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - '@rolldown/binding-linux-arm-gnueabihf@1.2.4': resolution: {integrity: sha512-/jm8OGHgn7oGaJu3i/qZI9spUGcJ+y/lk43ttQ/iO1tOd9NissG6o97bighBCiL+BKRngmcDuR6ikfwYdJmVuQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.2.1': - resolution: {integrity: sha512-QI5SEDY8cbiYWHx0VO4vIc3UlS6a32vXHjU8Qy/17adEmZIPuByJg13UEvo9c/UCiUkdcVWY83C+b+JrwnNyUg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - '@rolldown/binding-linux-arm64-gnu@1.2.4': resolution: {integrity: sha512-tIP06BeD9EqvECBrPZ+sqdPlYrT+aYaAiu1wYziVx5elRK/ftm33JxVDy2bXGbr6J0CrtirCkR87/X5a2euEng==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6587,13 +6547,6 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.2.1': - resolution: {integrity: sha512-Sm41FyCeXqmYcERoYOCbGIL5hNfd8w9LQ7Y61Bev48HkcjaJqV/iiVOaiDxjVTRMS+QKrZmD8cfPt4uMVnvM+A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - '@rolldown/binding-linux-arm64-musl@1.2.4': resolution: {integrity: sha512-Ql1Q0EQqVThvn9VAVlwNzsUvbSFtCMGjLpRRi4pk5i7NZZ4n5ISiLMjHYtus4VQ2PvkSw24zyaCVsiS+sXPj1w==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6601,13 +6554,6 @@ packages: os: [linux] libc: [musl] - '@rolldown/binding-linux-ppc64-gnu@1.2.1': - resolution: {integrity: sha512-2x+WhXTGl9yJYPbltW/BSEPTVz9OIWQyER4N+gJEDWkkn904eRcBzELqh/Hf7K0w/ubGbKNMv0ZC+94QK/IFEg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - '@rolldown/binding-linux-ppc64-gnu@1.2.4': resolution: {integrity: sha512-GjbjXD4XXfN19D0LZNbmiCBUoDiRACsYHr0yaIbbn8aFsXjHZifcYqu/W5Er5X2X990WjHXFrxarn5chzItorQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6615,13 +6561,6 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.2.1': - resolution: {integrity: sha512-eEjmQpuRQayHPWWnywaWHkFT3ToPbP3RYy42VVd/B9aBGDA+Ol25EIWHxKQST3IiWJjikCWUF7KtbfqwZrzVwQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.2.4': resolution: {integrity: sha512-p5WR0NOwaRmJ/B1b6IjEFLLivwEsf3PrdBIhRbhTCQisbo2SvHHpG4ELB/+FgQNnB88LTOF86upmJmbvZdQ2lw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6629,13 +6568,6 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.2.1': - resolution: {integrity: sha512-/Orga1fZYkLc/56jBICcHrKchl8Z2UKdDSr3LG9ToWO1lQ6a4Livk9Xz+9WN91zsz5QR3XQz2NNoSDEvP6qadw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.2.4': resolution: {integrity: sha512-4/GyVjmhR+Tc6HLJvwc1sOhPqAZtySiSMesOZyX6JQ5XBxoTDEMKQzvo07NIK6nTon/SivlZqvhzvuVBNQhObQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6643,13 +6575,6 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.2.1': - resolution: {integrity: sha512-xxBJRL+0q0Kce7orznGWLuylHDY65vuARXZRpX+hPdv+DqK2c3NlCsVA98tlWzWNEE7yPqA/1NQ5nnCrj49Y5A==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - '@rolldown/binding-linux-x64-musl@1.2.4': resolution: {integrity: sha512-l9eeLsCNvPpmSXUej0etw/J1eqV0Jj1D5G/xG6YTijmE6dkv6E2QezgWbTfQk63v952DPqrjOCoiqxq7Bw0YUQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6657,40 +6582,18 @@ packages: os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.2.1': - resolution: {integrity: sha512-M6AdXIXw3s+/8XpKMzdGDEXGS1S7kwUsy+rcTIUIOx5Ge4nXKCtAFHFV9YKkXvGcC5WMoTjAteLzlsQROVI0Yw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - '@rolldown/binding-openharmony-arm64@1.2.4': resolution: {integrity: sha512-e0F355MSTMm3+UOqtV3L24gFUp2N5m1f8L/7d56deik6va+AXdrt9F8LbzGpeWGWRbZEDq4m8NVnJDeBtf9DZg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.2.1': - resolution: {integrity: sha512-/TX0SoRGojHzSAHpfVBbavRVSazg5U3h3Y3VXfcc0cdugq6kxdqw8LPGFiPr+/7gE/60zRcsOY2Vi9b9eT0jww==} - engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} - - '@rolldown/binding-win32-arm64-msvc@1.2.1': - resolution: {integrity: sha512-EvRrivJieyHG+AO9lleZWgq+g0+S7oV2C51yuqlcyU/R9net+sI4Pj0F+lUoP2bEr6TWX3SqFaaS0SzfLxSzkw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - '@rolldown/binding-win32-arm64-msvc@1.2.4': resolution: {integrity: sha512-AWLi0uBRYh6QlE7OKhiz+phZC0qwtij2QZmhmOdsLdFn64m7oMpooE9ICE3lhm9xMb4SpDo2WbHcxX1iFLFtqw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.2.1': - resolution: {integrity: sha512-Z4eCmn5QJ/5+azF9knpLWKfVd9aidn0mAe9TpJgvBLId9Ax3t0+JVxBmT25Bv7NBbVW1TZyKjQjQReouMeH5UQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - '@rolldown/binding-win32-x64-msvc@1.2.4': resolution: {integrity: sha512-UwSDJOg3dqCAejWdxclJjCsh3Qq4vLYMDxmyHqo1btz3stK2VqgwNd3mm5tuIwzSlGIQ/1H9Hr+Zn09mrezNqQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -15440,11 +15343,6 @@ packages: rolldown: optional: true - rolldown@1.2.1: - resolution: {integrity: sha512-4FKJhg8d3OiyQOA6Q1Q0hoFFpW9/OoX+VsHzpECsdsIZoOArrAK90gl59YK/Z+gnDel45bgJZK03ozH/9bCqEw==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - rolldown@1.2.4: resolution: {integrity: sha512-rSr7irW0K7QRWzjdJXqZowkcRdDtjRduh43rBltnVKd0VFq839l1lJoDvGJb6gl7+4rTTCrPWu+YfujUL8Ug7w==} engines: {node: ^20.19.0 || >=22.12.0} @@ -21139,12 +21037,6 @@ snapshots: tslib: 2.8.1 optional: true - '@emnapi/core@2.0.0-alpha.3': - dependencies: - '@emnapi/wasi-threads': 2.0.1 - tslib: 2.8.1 - optional: true - '@emnapi/runtime@1.11.2': dependencies: tslib: 2.8.1 @@ -21160,11 +21052,6 @@ snapshots: tslib: 2.8.1 optional: true - '@emnapi/runtime@2.0.0-alpha.3': - dependencies: - tslib: 2.8.1 - optional: true - '@emnapi/wasi-threads@1.2.2': dependencies: tslib: 2.8.1 @@ -21175,11 +21062,6 @@ snapshots: tslib: 2.8.1 optional: true - '@emnapi/wasi-threads@2.0.1': - dependencies: - tslib: 2.8.1 - optional: true - '@esbuild/aix-ppc64@0.21.5': optional: true @@ -22945,13 +22827,6 @@ snapshots: '@tybys/wasm-util': 0.10.3 optional: true - '@napi-rs/wasm-runtime@1.2.3(@emnapi/core@2.0.0-alpha.3)(@emnapi/runtime@2.0.0-alpha.3)': - dependencies: - '@emnapi/core': 2.0.0-alpha.3 - '@emnapi/runtime': 2.0.0-alpha.3 - '@tybys/wasm-util': 0.10.3 - optional: true - '@nestjs/common@11.1.29(reflect-metadata@0.2.2)(rxjs@7.8.2)': dependencies: file-type: 21.3.4 @@ -23853,8 +23728,6 @@ snapshots: '@oxc-project/types@0.140.0': {} - '@oxc-project/types@0.142.0': {} - '@oxc-project/types@0.144.0': {} '@oxfmt/binding-android-arm-eabi@0.65.0': @@ -24818,94 +24691,45 @@ snapshots: rxjs: 7.8.2 zod: 3.25.76 - '@rolldown/binding-android-arm64@1.2.1': - optional: true - '@rolldown/binding-android-arm64@1.2.4': optional: true - '@rolldown/binding-darwin-arm64@1.2.1': - optional: true - '@rolldown/binding-darwin-arm64@1.2.4': optional: true - '@rolldown/binding-darwin-x64@1.2.1': - optional: true - '@rolldown/binding-darwin-x64@1.2.4': optional: true - '@rolldown/binding-freebsd-x64@1.2.1': - optional: true - '@rolldown/binding-freebsd-x64@1.2.4': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.2.1': - optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.2.4': optional: true - '@rolldown/binding-linux-arm64-gnu@1.2.1': - optional: true - '@rolldown/binding-linux-arm64-gnu@1.2.4': optional: true - '@rolldown/binding-linux-arm64-musl@1.2.1': - optional: true - '@rolldown/binding-linux-arm64-musl@1.2.4': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.2.1': - optional: true - '@rolldown/binding-linux-ppc64-gnu@1.2.4': optional: true - '@rolldown/binding-linux-s390x-gnu@1.2.1': - optional: true - '@rolldown/binding-linux-s390x-gnu@1.2.4': optional: true - '@rolldown/binding-linux-x64-gnu@1.2.1': - optional: true - '@rolldown/binding-linux-x64-gnu@1.2.4': optional: true - '@rolldown/binding-linux-x64-musl@1.2.1': - optional: true - '@rolldown/binding-linux-x64-musl@1.2.4': optional: true - '@rolldown/binding-openharmony-arm64@1.2.1': - optional: true - '@rolldown/binding-openharmony-arm64@1.2.4': optional: true - '@rolldown/binding-wasm32-wasi@1.2.1': - dependencies: - '@emnapi/core': 2.0.0-alpha.3 - '@emnapi/runtime': 2.0.0-alpha.3 - '@napi-rs/wasm-runtime': 1.2.3(@emnapi/core@2.0.0-alpha.3)(@emnapi/runtime@2.0.0-alpha.3) - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.2.1': - optional: true - '@rolldown/binding-win32-arm64-msvc@1.2.4': optional: true - '@rolldown/binding-win32-x64-msvc@1.2.1': - optional: true - '@rolldown/binding-win32-x64-msvc@1.2.4': optional: true @@ -35978,27 +35802,6 @@ snapshots: optionalDependencies: rolldown: 1.2.4 - rolldown@1.2.1: - dependencies: - '@oxc-project/types': 0.142.0 - '@rolldown/pluginutils': 1.0.1 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.2.1 - '@rolldown/binding-darwin-arm64': 1.2.1 - '@rolldown/binding-darwin-x64': 1.2.1 - '@rolldown/binding-freebsd-x64': 1.2.1 - '@rolldown/binding-linux-arm-gnueabihf': 1.2.1 - '@rolldown/binding-linux-arm64-gnu': 1.2.1 - '@rolldown/binding-linux-arm64-musl': 1.2.1 - '@rolldown/binding-linux-ppc64-gnu': 1.2.1 - '@rolldown/binding-linux-s390x-gnu': 1.2.1 - '@rolldown/binding-linux-x64-gnu': 1.2.1 - '@rolldown/binding-linux-x64-musl': 1.2.1 - '@rolldown/binding-openharmony-arm64': 1.2.1 - '@rolldown/binding-wasm32-wasi': 1.2.1 - '@rolldown/binding-win32-arm64-msvc': 1.2.1 - '@rolldown/binding-win32-x64-msvc': 1.2.1 - rolldown@1.2.4: dependencies: '@oxc-project/types': 0.144.0 @@ -36038,14 +35841,14 @@ snapshots: optionalDependencies: '@babel/code-frame': 7.29.7 - rollup-plugin-visualizer@6.0.3(rolldown@1.2.1)(rollup@4.53.3): + rollup-plugin-visualizer@6.0.3(rolldown@1.2.4)(rollup@4.53.3): dependencies: open: 8.4.2 picomatch: 4.0.2 source-map: 0.7.4 yargs: 17.7.2 optionalDependencies: - rolldown: 1.2.1 + rolldown: 1.2.4 rollup: 4.53.3 rollup-plugin-visualizer@7.0.1(rolldown@1.2.4)(rollup@4.62.3): diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1ab8a895fb..7712b0816e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -31,7 +31,8 @@ catalog: react-dom: ^19.2.1 react-test-renderer: ^19.2.1 rollup: ^4.53.3 - rolldown: 1.2.1 + rolldown: 1.2.4 + rolldown-plugin-dts: 0.27.14 terser: 5.48.0 tsdown: 0.22.14 tslib: ^2.5.0 diff --git a/turbo.json b/turbo.json index 8334651398..0349b32269 100644 --- a/turbo.json +++ b/turbo.json @@ -12,6 +12,7 @@ ".babelrc", "babel.config.js", "rollup.config.mjs", + "rolldown.dts.config.mts", "scripts/check-mangled-property-consistency.js", "scripts/check-sourcemap-ignore-list.js", "terser-cross-bundle-properties.cjs",