From 0936e06708d0320ddca6062c937565c79192125f Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Tue, 14 Oct 2025 17:14:00 -0400 Subject: [PATCH 1/4] Replace rollup with tsdown --- package.json | 13 +- pnpm-lock.yaml | 671 +++++++++++++----- rollup.config.ts | 50 -- rollup.dts.config.ts | 17 - .../init-rocksdb/build-rocksdb-from-source.ts | 2 +- scripts/init-rocksdb/download-rocksdb.ts | 2 +- scripts/init-rocksdb/get-prebuild.ts | 2 +- src/database.ts | 24 +- src/dbi-iterator.ts | 2 +- src/dbi.ts | 16 +- src/index.ts | 7 +- src/load-binding.ts | 2 +- src/store.ts | 33 +- src/transaction.ts | 4 +- src/util.ts | 6 +- test/events.test.ts | 60 +- test/lib/util.ts | 4 +- test/lock.test.ts | 2 +- test/ranges.test.ts | 1 - test/transactions.test.ts | 8 +- test/user-shared-buffer.test.ts | 4 +- test/util.test.ts | 6 +- tsconfig.check.json | 1 + tsconfig.json | 6 +- 24 files changed, 588 insertions(+), 355 deletions(-) delete mode 100644 rollup.config.ts delete mode 100644 rollup.dts.config.ts diff --git a/package.json b/package.json index 6adb4fe2..f2430fef 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,13 @@ "bench:bun": "bun --bun bench", "bench:deno": "deno run --allow-all --sloppy-imports ./node_modules/vitest/vitest.mjs bench", "build": "pnpm build:bundle && pnpm rebuild", - "build:bundle": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript && pnpm build:types", + "build:bundle": "rimraf dist && tsdown -c tsdown.config.ts", + "build:bundle2": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript && pnpm build:types", "build:debug": "SKIP_MINIFY=1 pnpm build:bundle", "build:types": "pnpm build:types:temp && pnpm build:types:roll && pnpm build:types:check", "build:types:temp": "tsc --declaration --emitDeclarationOnly --outDir temp --project tsconfig.build.json", - "build:types:roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", + "build:types:roll": "rolldown --config rolldown.dts.config.ts && rimraf temp", + "build:types:roll2": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", "build:types:check": "tsc --project tsconfig.check.json", "check": "pnpm type-check && pnpm lint", "clean": "node-gyp clean", @@ -52,10 +54,7 @@ "ordered-binary": "1.6.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "^28.0.6", - "@rollup/plugin-node-resolve": "16.0.3", "@rollup/plugin-replace": "6.0.2", - "@rollup/plugin-typescript": "12.1.4", "@types/node": "24.7.2", "@vitest/coverage-v8": "3.2.4", "dotenv": "17.2.3", @@ -66,10 +65,8 @@ "oxlint": "1.22.0", "prebuildify": "6.0.1", "rimraf": "6.0.1", - "rollup": "4.52.4", - "rollup-plugin-dts": "6.2.3", - "rollup-plugin-esbuild": "6.2.1", "semver": "7.7.3", + "tsdown": "0.15.7", "tslib": "2.8.1", "tsx": "4.20.6", "typescript": "5.9.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 555b04f1..07afeac0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,24 +18,15 @@ importers: specifier: 1.6.0 version: 1.6.0 devDependencies: - '@rollup/plugin-commonjs': - specifier: ^28.0.6 - version: 28.0.6(rollup@4.52.4) - '@rollup/plugin-node-resolve': - specifier: 16.0.3 - version: 16.0.3(rollup@4.52.4) '@rollup/plugin-replace': specifier: 6.0.2 version: 6.0.2(rollup@4.52.4) - '@rollup/plugin-typescript': - specifier: 12.1.4 - version: 12.1.4(rollup@4.52.4)(tslib@2.8.1)(typescript@5.9.3) '@types/node': specifier: 24.7.2 version: 24.7.2 '@vitest/coverage-v8': specifier: 3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@24.7.2)(tsx@4.20.6)) + version: 3.2.4(vitest@3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6)) dotenv: specifier: 17.2.3 version: 17.2.3 @@ -60,18 +51,12 @@ importers: rimraf: specifier: 6.0.1 version: 6.0.1 - rollup: - specifier: 4.52.4 - version: 4.52.4 - rollup-plugin-dts: - specifier: 6.2.3 - version: 6.2.3(rollup@4.52.4)(typescript@5.9.3) - rollup-plugin-esbuild: - specifier: 6.2.1 - version: 6.2.1(esbuild@0.25.10)(rollup@4.52.4) semver: specifier: 7.7.3 version: 7.7.3 + tsdown: + specifier: 0.15.7 + version: 0.15.7(@typescript/native-preview@7.0.0-dev.20251014.1)(typescript@5.9.3) tslib: specifier: 2.8.1 version: 2.8.1 @@ -83,7 +68,7 @@ importers: version: 5.9.3 vitest: specifier: 3.2.4 - version: 3.2.4(@types/node@24.7.2)(tsx@4.20.6) + version: 3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6) packages: @@ -91,8 +76,8 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@babel/code-frame@7.27.1': - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + '@babel/generator@7.28.3': + resolution: {integrity: sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==} engines: {node: '>=6.9.0'} '@babel/helper-string-parser@7.27.1': @@ -116,6 +101,15 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} + '@emnapi/core@1.5.0': + resolution: {integrity: sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==} + + '@emnapi/runtime@1.5.0': + resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} + + '@emnapi/wasi-threads@1.1.0': + resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} + '@esbuild/aix-ppc64@0.24.2': resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} engines: {node: '>=18'} @@ -515,6 +509,9 @@ packages: cpu: [x64] os: [win32] + '@napi-rs/wasm-runtime@1.0.7': + resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==} + '@npmcli/agent@3.0.0': resolution: {integrity: sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==} engines: {node: ^18.17.0 || >=20.5.0} @@ -523,6 +520,9 @@ packages: resolution: {integrity: sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==} engines: {node: ^18.17.0 || >=20.5.0} + '@oxc-project/types@0.94.0': + resolution: {integrity: sha512-+UgQT/4o59cZfH6Cp7G0hwmqEQ0wE+AdIwhikdwnhWI9Dp8CgSY081+Q3O67/wq3VJu8mgUEB93J9EHHn70fOw==} + '@oxlint/darwin-arm64@1.22.0': resolution: {integrity: sha512-vfgwTA1CowVaU3QXFBjfGjbPsHbdjAiJnWX5FBaq8uXS8tksGgl0ue14MK6fVnXncWK9j69LRnkteGTixxDAfA==} cpu: [arm64] @@ -567,23 +567,94 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/plugin-commonjs@28.0.6': - resolution: {integrity: sha512-XSQB1K7FUU5QP+3lOQmVCE3I0FcbbNvmNT4VJSj93iUjayaARrTQeoRdiYQoftAJBLrR9t2agwAd3ekaTgHNlw==} - engines: {node: '>=16.0.0 || 14 >= 14.17'} - peerDependencies: - rollup: ^2.68.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true + '@quansync/fs@0.1.5': + resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==} + + '@rolldown/binding-android-arm64@1.0.0-beta.43': + resolution: {integrity: sha512-TP8bcPOb1s6UmY5syhXrDn9k0XkYcw+XaoylTN4cJxf0JOVS2j682I3aTcpfT51hOFGr2bRwNKN9RZ19XxeQbA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-beta.43': + resolution: {integrity: sha512-kuVWnZsE4vEjMF/10SbSUyzucIW2zmdsqFghYMqy+fsjXnRHg0luTU6qWF8IqJf4Cbpm9NEZRnjIEPpAbdiSNQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.43': + resolution: {integrity: sha512-u9Ps4sh6lcmJ3vgLtyEg/x4jlhI64U0mM93Ew+tlfFdLDe7yKyA+Fe80cpr2n1mNCeZXrvTSbZluKpXQ0GxLjw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.43': + resolution: {integrity: sha512-h9lUtVtXgfbk/tnicMpbFfZ3DJvk5Zn2IvmlC1/e0+nUfwoc/TFqpfrRRqcNBXk/e+xiWMSKv6b0MF8N+Rtvlg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.43': + resolution: {integrity: sha512-IX2C6bA6wM2rX/RvD75ko+ix9yxPKjKGGq7pOhB8wGI4Z4fqX5B1nDHga/qMDmAdCAR1m9ymzxkmqhm/AFYf7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.43': + resolution: {integrity: sha512-mcjd57vEj+CEQbZAzUiaxNzNgwwgOpFtZBWcINm8DNscvkXl5b/s622Z1dqGNWSdrZmdjdC6LWMvu8iHM6v9sQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.43': + resolution: {integrity: sha512-Pa8QMwlkrztTo/1mVjZmPIQ44tCSci10TBqxzVBvXVA5CFh5EpiEi99fPSll2dHG2uT4dCOMeC6fIhyDdb0zXA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] - '@rollup/plugin-node-resolve@16.0.3': - resolution: {integrity: sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==} + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.43': + resolution: {integrity: sha512-BgynXKMjeaX4AfWLARhOKDetBOOghnSiVRjAHVvhiAaDXgdQN8e65mSmXRiVoVtD3cHXx/cfU8Gw0p0K+qYKVQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.43': + resolution: {integrity: sha512-VIsoPlOB/tDSAw9CySckBYysoIBqLeps1/umNSYUD8pMtalJyzMTneAVI1HrUdf4ceFmQ5vARoLIXSsPwVFxNg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.43': + resolution: {integrity: sha512-YDXTxVJG67PqTQMKyjVJSddoPbSWJ4yRz/E3xzTLHqNrTDGY0UuhG8EMr8zsYnfH/0cPFJ3wjQd/hJWHuR6nkA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.43': + resolution: {integrity: sha512-3M+2DmorXvDuAIGYQ9Z93Oy1G9ETkejLwdXXb1uRTgKN9pMcu7N+KG2zDrJwqyxeeLIFE22AZGtSJm3PJbNu9Q==} engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.78.0||^3.0.0||^4.0.0 - peerDependenciesMeta: - rollup: - optional: true + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.43': + resolution: {integrity: sha512-/B1j1pJs33y9ywtslOMxryUPHq8zIGu/OGEc2gyed0slimJ8fX2uR/SaJVhB4+NEgCFIeYDR4CX6jynAkeRuCA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.43': + resolution: {integrity: sha512-29oG1swCz7hNP+CQYrsM4EtylsKwuYzM8ljqbqC5TsQwmKat7P8ouDpImsqg/GZxFSXcPP9ezQm0Q0wQwGM3JA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.43': + resolution: {integrity: sha512-eWBV1Ef3gfGNehxVGCyXs7wLayRIgCmyItuCZwYYXW5bsk4EvR4n2GP5m3ohjnx7wdiY3nLmwQfH2Knb5gbNZw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-beta.43': + resolution: {integrity: sha512-5Uxg7fQUCmfhax7FJke2+8B6cqgeUJUD9o2uXIKXhD+mG0mL6NObmVoi9wXEU1tY89mZKgAYA6fTbftx3q2ZPQ==} '@rollup/plugin-replace@6.0.2': resolution: {integrity: sha512-7QaYCf8bqF04dOy7w/eHmJeNExxTYwvKAmlSAH/EaWWUzbT0h5sbF6bktFoX/0F/0qwng5/dWFMyf3gzaM8DsQ==} @@ -594,19 +665,6 @@ packages: rollup: optional: true - '@rollup/plugin-typescript@12.1.4': - resolution: {integrity: sha512-s5Hx+EtN60LMlDBvl5f04bEiFZmAepk27Q+mr85L/00zPDn1jtzlTV6FWn81MaIwqfWzKxmOJrBWHU6vtQyedQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.14.0||^3.0.0||^4.0.0 - tslib: '*' - typescript: '>=3.7.0' - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - '@rollup/pluginutils@5.3.0': resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} engines: {node: '>=14.0.0'} @@ -726,6 +784,9 @@ packages: cpu: [x64] os: [win32] + '@tybys/wasm-util@0.10.1': + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@types/chai@5.2.2': resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} @@ -738,8 +799,44 @@ packages: '@types/node@24.7.2': resolution: {integrity: sha512-/NbVmcGTP+lj5oa4yiYxxeBjRivKQ5Ns1eSZeB99ExsEQ6rX5XYU1Zy/gGxY/ilqtD4Etx9mKyrPxZRetiahhA==} - '@types/resolve@1.20.2': - resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-7rQoLlerWnwnvrM56hP4rdEbo4xDE4zr7cch+EzgENq/tbXYereGq1fmnR83UNglb1Eyy53OvJZ3O2csYBa2vg==} + cpu: [arm64] + os: [darwin] + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-SF29o9NFRGDM23Jz0nVO4/yS78GQ81rtOemmCVNXuJotoY4bP3npGDyEmfkZQHZgDOXogs2OWy3t7NUJ235ANQ==} + cpu: [x64] + os: [darwin] + + '@typescript/native-preview-linux-arm64@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-+YWbW/JF4uggEUBr+vflqI5i7bL4Z3XInCOyUO1qQEY7VmfDCsPEzIwGi37O1mixfxw9Qj8LQsptCkU+fqKwGw==} + cpu: [arm64] + os: [linux] + + '@typescript/native-preview-linux-arm@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-o5cu7h+BBAp6V4qxYY5RWuaYouN3j+MGFLrrUtvvNj4XKM+kbq5qwsgVRsmJZ1LfUvHmzyQs86vt9djAWedzjQ==} + cpu: [arm] + os: [linux] + + '@typescript/native-preview-linux-x64@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-3LC4tgcgi6zWJWBUpBNXOGSY3yISJrQezSP/T+v+mQRApkdoIpTSHIyQAhgaagcs3MOQRaqiIPaLOVrdHXdU6A==} + cpu: [x64] + os: [linux] + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-P0D4UEXwzFZh3pHexe2Ky1tW/HjY/HxTBTIajz2ViDCNPw7uDSEsXSB4H9TTiFJw8gVdTUFbsoAQp1MteTeORA==} + cpu: [arm64] + os: [win32] + + '@typescript/native-preview-win32-x64@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-fi53g2ihH7tkQLlz8hZGAb2V+3aNZpcxrZ530CQ4xcWwAqssEj0EaZJX0VLEtIQBar1ttGVK9Pz/wJU9sYyVzg==} + cpu: [x64] + os: [win32] + + '@typescript/native-preview@7.0.0-dev.20251014.1': + resolution: {integrity: sha512-IqmX5CYCBqXbfL+HKlcQAMaDlfJ0Z8OhUxvADFV2TENnzSYI4CuhvKxwOB2wFSLXufVsgtAlf3Fjwn24KmMyPQ==} + hasBin: true '@vitest/coverage-v8@3.2.4': resolution: {integrity: sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ==} @@ -803,10 +900,18 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + ansis@4.2.0: + resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} + engines: {node: '>=14'} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + ast-kit@2.1.3: + resolution: {integrity: sha512-TH+b3Lv6pUjy/Nu0m6A2JULtdzLpmqF9x1Dhj00ZoEiML8qvVA9j1flkzTKNYgdEhWrjDwtWNpyyCUbfQe514g==} + engines: {node: '>=20.19.0'} + ast-v8-to-istanbul@0.3.5: resolution: {integrity: sha512-9SdXjNheSiE8bALAQCQQuT6fgQaoxJh7IRYrRGZ8/9nv8WhJeC1aXAwN8TbaOssGOukUvyvnkgD9+Yuykvl1aA==} @@ -816,6 +921,9 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + birpc@2.6.1: + resolution: {integrity: sha512-LPnFhlDpdSH6FJhJyn4M0kFO7vtQ5iPw24FnG0y21q09xC7e8+1LeR31S1MAIrDAHp4m7aas4bEkTDTvMAtebQ==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -841,6 +949,10 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} + chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} @@ -855,9 +967,6 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - commondir@1.0.1: - resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -875,18 +984,30 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + diff@8.0.2: + resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==} + engines: {node: '>=0.3.1'} + dotenv@17.2.3: resolution: {integrity: sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==} engines: {node: '>=12'} + dts-resolver@2.1.2: + resolution: {integrity: sha512-xeXHBQkn2ISSXxbJWD828PFjtyg+/UrMDo7W4Ffcs7+YWCquxU8YjV1KoxuiL+eJ5pg3ll+bC6flVv61L3LKZg==} + engines: {node: '>=20.18.0'} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -896,6 +1017,10 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + empathic@2.0.0: + resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==} + engines: {node: '>=14'} + encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} @@ -960,9 +1085,6 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - get-tsconfig@4.10.1: resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==} @@ -982,9 +1104,8 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -1018,20 +1139,10 @@ packages: resolution: {integrity: sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==} engines: {node: '>= 12'} - is-core-module@2.16.1: - resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} - engines: {node: '>= 0.4'} - is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-module@1.0.0: - resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - - is-reference@1.2.1: - resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} - isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -1062,12 +1173,18 @@ packages: resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} engines: {node: 20 || >=22} - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + jiti@2.6.1: + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} + hasBin: true js-tokens@9.0.1: resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + lefthook-darwin-arm64@1.13.6: resolution: {integrity: sha512-m6Lb77VGc84/Qo21Lhq576pEvcgFCnvloEiP02HbAHcIXD0RTLy9u2yAInrixqZeaz13HYtdDaI7OBYAAdVt8A==} cpu: [arm64] @@ -1271,9 +1388,6 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.11.1: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} @@ -1315,18 +1429,20 @@ packages: pump@3.0.3: resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} - engines: {node: '>= 0.4'} - hasBin: true - retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} @@ -1336,19 +1452,29 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup-plugin-dts@6.2.3: - resolution: {integrity: sha512-UgnEsfciXSPpASuOelix7m4DrmyQgiaWBnvI0TM4GxuDh5FkqW8E5hu57bCxXB90VvR1WNfLV80yEDN18UogSA==} - engines: {node: '>=16'} + rolldown-plugin-dts@0.16.11: + resolution: {integrity: sha512-9IQDaPvPqTx3RjG2eQCK5GYZITo203BxKunGI80AGYicu1ySFTUyugicAaTZWRzFWh9DSnzkgNeMNbDWBbSs0w==} + engines: {node: '>=20.18.0'} peerDependencies: - rollup: ^3.29.4 || ^4 - typescript: ^4.5 || ^5.0 + '@ts-macro/tsc': ^0.3.6 + '@typescript/native-preview': '>=7.0.0-dev.20250601.1' + rolldown: ^1.0.0-beta.9 + typescript: ^5.0.0 + vue-tsc: ~3.1.0 + peerDependenciesMeta: + '@ts-macro/tsc': + optional: true + '@typescript/native-preview': + optional: true + typescript: + optional: true + vue-tsc: + optional: true - rollup-plugin-esbuild@6.2.1: - resolution: {integrity: sha512-jTNOMGoMRhs0JuueJrJqbW8tOwxumaWYq+V5i+PD+8ecSCVkuX27tGW7BXqDgoULQ55rO7IdNxPcnsWtshz3AA==} - engines: {node: '>=14.18.0'} - peerDependencies: - esbuild: '>=0.18.0' - rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 + rolldown@1.0.0-beta.43: + resolution: {integrity: sha512-6RcqyRx0tY1MlRLnjXPp/849Rl/CPFhzpGGwNPEPjKwqBMqPq/Rbbkxasa8s0x+IkUk46ty4jazb5skZ/Vgdhw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true rollup@4.52.4: resolution: {integrity: sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==} @@ -1433,10 +1559,6 @@ packages: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} - tar-fs@2.1.2: resolution: {integrity: sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==} @@ -1458,6 +1580,9 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyexec@1.0.1: + resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} + tinyglobby@0.2.15: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} @@ -1474,6 +1599,32 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + tsdown@0.15.7: + resolution: {integrity: sha512-uFaVgWAogjOMqjY+CQwrUt3C6wzy6ynt82CIoXymnbS17ipUZ8WDXUceJjkislUahF/BZc5+W44Ue3p2oWtqUg==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + '@arethetypeswrong/core': ^0.18.1 + publint: ^0.3.0 + typescript: ^5.0.0 + unplugin-lightningcss: ^0.4.0 + unplugin-unused: ^0.5.0 + peerDependenciesMeta: + '@arethetypeswrong/core': + optional: true + publint: + optional: true + typescript: + optional: true + unplugin-lightningcss: + optional: true + unplugin-unused: + optional: true + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -1487,6 +1638,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + unconfig@7.3.3: + resolution: {integrity: sha512-QCkQoOnJF8L107gxfHL0uavn7WD9b3dpBcFX6HtfQYmjw2YzWxGuFQ0N0J6tE9oguCBJn9KOvfqYDCMPHIZrBA==} + undici-types@7.14.0: resolution: {integrity: sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==} @@ -1498,10 +1652,6 @@ packages: resolution: {integrity: sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==} engines: {node: ^18.17.0 || >=20.5.0} - unplugin-utils@0.2.5: - resolution: {integrity: sha512-gwXJnPRewT4rT7sBi/IvxKTjsms7jX7QIDLOClApuZwR49SXbrB1z2NLUZ+vDHyqCj/n58OzRRqaW+B8OZi8vg==} - engines: {node: '>=18.12.0'} - util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -1621,12 +1771,13 @@ snapshots: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 - '@babel/code-frame@7.27.1': + '@babel/generator@7.28.3': dependencies: - '@babel/helper-validator-identifier': 7.27.1 - js-tokens: 4.0.0 - picocolors: 1.1.1 - optional: true + '@babel/parser': 7.28.4 + '@babel/types': 7.28.4 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 '@babel/helper-string-parser@7.27.1': {} @@ -1643,6 +1794,22 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} + '@emnapi/core@1.5.0': + dependencies: + '@emnapi/wasi-threads': 1.1.0 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.5.0': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.1.0': + dependencies: + tslib: 2.8.1 + optional: true + '@esbuild/aix-ppc64@0.24.2': optional: true @@ -1866,6 +2033,13 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true + '@napi-rs/wasm-runtime@1.0.7': + dependencies: + '@emnapi/core': 1.5.0 + '@emnapi/runtime': 1.5.0 + '@tybys/wasm-util': 0.10.1 + optional: true + '@npmcli/agent@3.0.0': dependencies: agent-base: 7.1.4 @@ -1880,6 +2054,8 @@ snapshots: dependencies: semver: 7.7.3 + '@oxc-project/types@0.94.0': {} + '@oxlint/darwin-arm64@1.22.0': optional: true @@ -1907,27 +2083,55 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/plugin-commonjs@28.0.6(rollup@4.52.4)': + '@quansync/fs@0.1.5': dependencies: - '@rollup/pluginutils': 5.3.0(rollup@4.52.4) - commondir: 1.0.1 - estree-walker: 2.0.2 - fdir: 6.5.0(picomatch@4.0.3) - is-reference: 1.2.1 - magic-string: 0.30.19 - picomatch: 4.0.3 - optionalDependencies: - rollup: 4.52.4 + quansync: 0.2.11 + + '@rolldown/binding-android-arm64@1.0.0-beta.43': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-beta.43': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.43': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.43': + optional: true - '@rollup/plugin-node-resolve@16.0.3(rollup@4.52.4)': + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.43': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.43': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.43': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.43': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.43': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.43': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.43': dependencies: - '@rollup/pluginutils': 5.3.0(rollup@4.52.4) - '@types/resolve': 1.20.2 - deepmerge: 4.3.1 - is-module: 1.0.0 - resolve: 1.22.10 - optionalDependencies: - rollup: 4.52.4 + '@napi-rs/wasm-runtime': 1.0.7 + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.43': + optional: true + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.43': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.43': + optional: true + + '@rolldown/pluginutils@1.0.0-beta.43': {} '@rollup/plugin-replace@6.0.2(rollup@4.52.4)': dependencies: @@ -1936,15 +2140,6 @@ snapshots: optionalDependencies: rollup: 4.52.4 - '@rollup/plugin-typescript@12.1.4(rollup@4.52.4)(tslib@2.8.1)(typescript@5.9.3)': - dependencies: - '@rollup/pluginutils': 5.3.0(rollup@4.52.4) - resolve: 1.22.10 - typescript: 5.9.3 - optionalDependencies: - rollup: 4.52.4 - tslib: 2.8.1 - '@rollup/pluginutils@5.3.0(rollup@4.52.4)': dependencies: '@types/estree': 1.0.8 @@ -2019,6 +2214,11 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.52.4': optional: true + '@tybys/wasm-util@0.10.1': + dependencies: + tslib: 2.8.1 + optional: true + '@types/chai@5.2.2': dependencies: '@types/deep-eql': 4.0.2 @@ -2031,9 +2231,39 @@ snapshots: dependencies: undici-types: 7.14.0 - '@types/resolve@1.20.2': {} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20251014.1': + optional: true + + '@typescript/native-preview-darwin-x64@7.0.0-dev.20251014.1': + optional: true - '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@24.7.2)(tsx@4.20.6))': + '@typescript/native-preview-linux-arm64@7.0.0-dev.20251014.1': + optional: true + + '@typescript/native-preview-linux-arm@7.0.0-dev.20251014.1': + optional: true + + '@typescript/native-preview-linux-x64@7.0.0-dev.20251014.1': + optional: true + + '@typescript/native-preview-win32-arm64@7.0.0-dev.20251014.1': + optional: true + + '@typescript/native-preview-win32-x64@7.0.0-dev.20251014.1': + optional: true + + '@typescript/native-preview@7.0.0-dev.20251014.1': + optionalDependencies: + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20251014.1 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20251014.1 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20251014.1 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20251014.1 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20251014.1 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20251014.1 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20251014.1 + optional: true + + '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 @@ -2048,7 +2278,7 @@ snapshots: std-env: 3.9.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/node@24.7.2)(tsx@4.20.6) + vitest: 3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6) transitivePeerDependencies: - supports-color @@ -2060,13 +2290,13 @@ snapshots: chai: 5.3.1 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@6.0.11(@types/node@24.7.2)(tsx@4.20.6))': + '@vitest/mocker@3.2.4(vite@6.0.11(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.19 optionalDependencies: - vite: 6.0.11(@types/node@24.7.2)(tsx@4.20.6) + vite: 6.0.11(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6) '@vitest/pretty-format@3.2.4': dependencies: @@ -2108,8 +2338,15 @@ snapshots: ansi-styles@6.2.1: {} + ansis@4.2.0: {} + assertion-error@2.0.1: {} + ast-kit@2.1.3: + dependencies: + '@babel/parser': 7.28.4 + pathe: 2.0.3 + ast-v8-to-istanbul@0.3.5: dependencies: '@jridgewell/trace-mapping': 0.3.31 @@ -2120,6 +2357,8 @@ snapshots: base64-js@1.5.1: {} + birpc@2.6.1: {} + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -2162,6 +2401,10 @@ snapshots: check-error@2.1.1: {} + chokidar@4.0.3: + dependencies: + readdirp: 4.1.2 + chownr@1.1.4: {} chownr@3.0.0: {} @@ -2172,8 +2415,6 @@ snapshots: color-name@1.1.4: {} - commondir@1.0.1: {} - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -2186,18 +2427,24 @@ snapshots: deep-eql@5.0.2: {} - deepmerge@4.3.1: {} + defu@6.1.4: {} detect-libc@2.1.2: {} + diff@8.0.2: {} + dotenv@17.2.3: {} + dts-resolver@2.1.2: {} + eastasianwidth@0.2.0: {} emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} + empathic@2.0.0: {} + encoding@0.1.13: dependencies: iconv-lite: 0.6.3 @@ -2298,8 +2545,6 @@ snapshots: fsevents@2.3.3: optional: true - function-bind@1.1.2: {} - get-tsconfig@4.10.1: dependencies: resolve-pkg-maps: 1.0.0 @@ -2326,9 +2571,7 @@ snapshots: has-flag@4.0.0: {} - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 + hookable@5.5.3: {} html-escaper@2.0.2: {} @@ -2361,18 +2604,8 @@ snapshots: ip-address@10.0.1: {} - is-core-module@2.16.1: - dependencies: - hasown: 2.0.2 - is-fullwidth-code-point@3.0.0: {} - is-module@1.0.0: {} - - is-reference@1.2.1: - dependencies: - '@types/estree': 1.0.8 - isexe@2.0.0: {} isexe@3.1.1: {} @@ -2408,11 +2641,12 @@ snapshots: dependencies: '@isaacs/cliui': 8.0.2 - js-tokens@4.0.0: - optional: true + jiti@2.6.1: {} js-tokens@9.0.1: {} + jsesc@3.1.0: {} + lefthook-darwin-arm64@1.13.6: optional: true @@ -2636,8 +2870,6 @@ snapshots: path-key@3.1.1: {} - path-parse@1.0.7: {} - path-scurry@1.11.1: dependencies: lru-cache: 10.4.3 @@ -2683,19 +2915,17 @@ snapshots: end-of-stream: 1.4.5 once: 1.4.0 + quansync@0.2.11: {} + readable-stream@3.6.2: dependencies: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 - resolve-pkg-maps@1.0.0: {} + readdirp@4.1.2: {} - resolve@1.22.10: - dependencies: - is-core-module: 2.16.1 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 + resolve-pkg-maps@1.0.0: {} retry@0.12.0: {} @@ -2704,25 +2934,46 @@ snapshots: glob: 11.0.1 package-json-from-dist: 1.0.1 - rollup-plugin-dts@6.2.3(rollup@4.52.4)(typescript@5.9.3): - dependencies: - magic-string: 0.30.19 - rollup: 4.52.4 - typescript: 5.9.3 - optionalDependencies: - '@babel/code-frame': 7.27.1 - - rollup-plugin-esbuild@6.2.1(esbuild@0.25.10)(rollup@4.52.4): + rolldown-plugin-dts@0.16.11(@typescript/native-preview@7.0.0-dev.20251014.1)(rolldown@1.0.0-beta.43)(typescript@5.9.3): dependencies: + '@babel/generator': 7.28.3 + '@babel/parser': 7.28.4 + '@babel/types': 7.28.4 + ast-kit: 2.1.3 + birpc: 2.6.1 debug: 4.4.3 - es-module-lexer: 1.7.0 - esbuild: 0.25.10 + dts-resolver: 2.1.2 get-tsconfig: 4.10.1 - rollup: 4.52.4 - unplugin-utils: 0.2.5 + magic-string: 0.30.19 + rolldown: 1.0.0-beta.43 + optionalDependencies: + '@typescript/native-preview': 7.0.0-dev.20251014.1 + typescript: 5.9.3 transitivePeerDependencies: + - oxc-resolver - supports-color + rolldown@1.0.0-beta.43: + dependencies: + '@oxc-project/types': 0.94.0 + '@rolldown/pluginutils': 1.0.0-beta.43 + ansis: 4.2.0 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-beta.43 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.43 + '@rolldown/binding-darwin-x64': 1.0.0-beta.43 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.43 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.43 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.43 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.43 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.43 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.43 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.43 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.43 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.43 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.43 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.43 + rollup@4.52.4: dependencies: '@types/estree': 1.0.8 @@ -2825,8 +3076,6 @@ snapshots: dependencies: has-flag: 4.0.0 - supports-preserve-symlinks-flag@1.0.0: {} - tar-fs@2.1.2: dependencies: chownr: 1.1.4 @@ -2860,6 +3109,8 @@ snapshots: tinyexec@0.3.2: {} + tinyexec@1.0.1: {} + tinyglobby@0.2.15: dependencies: fdir: 6.5.0(picomatch@4.0.3) @@ -2871,6 +3122,33 @@ snapshots: tinyspy@4.0.4: {} + tree-kill@1.2.2: {} + + tsdown@0.15.7(@typescript/native-preview@7.0.0-dev.20251014.1)(typescript@5.9.3): + dependencies: + ansis: 4.2.0 + cac: 6.7.14 + chokidar: 4.0.3 + debug: 4.4.3 + diff: 8.0.2 + empathic: 2.0.0 + hookable: 5.5.3 + rolldown: 1.0.0-beta.43 + rolldown-plugin-dts: 0.16.11(@typescript/native-preview@7.0.0-dev.20251014.1)(rolldown@1.0.0-beta.43)(typescript@5.9.3) + semver: 7.7.3 + tinyexec: 1.0.1 + tinyglobby: 0.2.15 + tree-kill: 1.2.2 + unconfig: 7.3.3 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@ts-macro/tsc' + - '@typescript/native-preview' + - oxc-resolver + - supports-color + - vue-tsc + tslib@2.8.1: {} tsx@4.20.6: @@ -2882,6 +3160,13 @@ snapshots: typescript@5.9.3: {} + unconfig@7.3.3: + dependencies: + '@quansync/fs': 0.1.5 + defu: 6.1.4 + jiti: 2.6.1 + quansync: 0.2.11 + undici-types@7.14.0: {} unique-filename@4.0.0: @@ -2892,20 +3177,15 @@ snapshots: dependencies: imurmurhash: 0.1.4 - unplugin-utils@0.2.5: - dependencies: - pathe: 2.0.3 - picomatch: 4.0.3 - util-deprecate@1.0.2: {} - vite-node@3.2.4(@types/node@24.7.2)(tsx@4.20.6): + vite-node@3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6): dependencies: cac: 6.7.14 debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 6.0.11(@types/node@24.7.2)(tsx@4.20.6) + vite: 6.0.11(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6) transitivePeerDependencies: - '@types/node' - jiti @@ -2920,7 +3200,7 @@ snapshots: - tsx - yaml - vite@6.0.11(@types/node@24.7.2)(tsx@4.20.6): + vite@6.0.11(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6): dependencies: esbuild: 0.24.2 postcss: 8.5.6 @@ -2928,13 +3208,14 @@ snapshots: optionalDependencies: '@types/node': 24.7.2 fsevents: 2.3.3 + jiti: 2.6.1 tsx: 4.20.6 - vitest@3.2.4(@types/node@24.7.2)(tsx@4.20.6): + vitest@3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@6.0.11(@types/node@24.7.2)(tsx@4.20.6)) + '@vitest/mocker': 3.2.4(vite@6.0.11(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -2952,8 +3233,8 @@ snapshots: tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 6.0.11(@types/node@24.7.2)(tsx@4.20.6) - vite-node: 3.2.4(@types/node@24.7.2)(tsx@4.20.6) + vite: 6.0.11(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6) + vite-node: 3.2.4(@types/node@24.7.2)(jiti@2.6.1)(tsx@4.20.6) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 24.7.2 diff --git a/rollup.config.ts b/rollup.config.ts deleted file mode 100644 index 320dd6a7..00000000 --- a/rollup.config.ts +++ /dev/null @@ -1,50 +0,0 @@ -import typescript from '@rollup/plugin-typescript'; -import { defineConfig } from 'rollup'; -import { minify as esbuildMinifyPlugin } from 'rollup-plugin-esbuild'; -import replace from '@rollup/plugin-replace'; -import { readFileSync } from 'node:fs'; -import commonjs from '@rollup/plugin-commonjs'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; - -const { version } = JSON.parse(readFileSync('./package.json', 'utf8')); - -function generateConfig(format: 'es' | 'cjs') { - return { - external: [ - 'msgpackr', - 'ordered-binary' - ], - input: './src/index.ts', - output: { - dir: './dist', - externalLiveBindings: false, - format, - freeze: false, - preserveModules: false, - sourcemap: true, - entryFileNames: format === 'es' ? 'index.js' : 'index.cjs' - }, - plugins: [ - process.env.SKIP_MINIFY ? null : esbuildMinifyPlugin({ - minify: true, - minifySyntax: true - }), - typescript({ - tsconfig: './tsconfig.build.json' - }), - replace({ - preventAssignment: true, - values: { - 'ROCKSDB_JS_VERSION': version - } - }), - nodeResolve(), - commonjs() - ] - }; -} - -export default defineConfig([ - generateConfig('es'), - generateConfig('cjs') -]); diff --git a/rollup.dts.config.ts b/rollup.dts.config.ts deleted file mode 100644 index 425fd77f..00000000 --- a/rollup.dts.config.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { defineConfig } from 'rollup'; -import { dts } from 'rollup-plugin-dts'; - -export default defineConfig([ - { - input: './temp/index.d.ts', - output: { - file: './dist/index.d.ts', - format: 'es' - }, - plugins: [ - dts({ - respectExternal: true - }) - ] - } -]); \ No newline at end of file diff --git a/scripts/init-rocksdb/build-rocksdb-from-source.ts b/scripts/init-rocksdb/build-rocksdb-from-source.ts index ecada9d4..b95413b2 100644 --- a/scripts/init-rocksdb/build-rocksdb-from-source.ts +++ b/scripts/init-rocksdb/build-rocksdb-from-source.ts @@ -2,7 +2,7 @@ import { resolve } from 'node:path'; import { execFileSync } from 'node:child_process'; import { mkdir, rm, symlink } from 'node:fs/promises'; -export async function buildRocksDBFromSource(rocksdbPath: string, dest: string) { +export async function buildRocksDBFromSource(rocksdbPath: string, dest: string): Promise { rocksdbPath = resolve(rocksdbPath); execFileSync( diff --git a/scripts/init-rocksdb/download-rocksdb.ts b/scripts/init-rocksdb/download-rocksdb.ts index 6f79420c..cfb997ad 100644 --- a/scripts/init-rocksdb/download-rocksdb.ts +++ b/scripts/init-rocksdb/download-rocksdb.ts @@ -14,7 +14,7 @@ const platformMap = { const streamPipeline = promisify(pipeline); -export async function downloadRocksDB(prebuild: Prebuild, dest: string) { +export async function downloadRocksDB(prebuild: Prebuild, dest: string): Promise { const filename = `rocksdb-${prebuild.version}-${process.arch}-${platformMap[process.platform] || process.platform}`; const [asset] = prebuild.assets.filter((asset) => asset.name.startsWith(filename)); if (!asset) { diff --git a/scripts/init-rocksdb/get-prebuild.ts b/scripts/init-rocksdb/get-prebuild.ts index 7f43a0f5..a5ea2abc 100644 --- a/scripts/init-rocksdb/get-prebuild.ts +++ b/scripts/init-rocksdb/get-prebuild.ts @@ -18,7 +18,7 @@ export type Prebuild = { }[]; }; -export async function getPrebuild(desiredVersion?: string) { +export async function getPrebuild(desiredVersion?: string): Promise { // download the latest RocksDB prebuild const headers: Record = { Accept: 'application/vnd.github.v3.raw', diff --git a/src/database.ts b/src/database.ts index 17af9d3a..09b3f75c 100644 --- a/src/database.ts +++ b/src/database.ts @@ -5,7 +5,7 @@ import { config, type TransactionOptions, type RocksDatabaseConfig } from './loa import { Encoder as MsgpackEncoder } from 'msgpackr'; import { withResolvers } from './util.js'; import * as orderedBinary from 'ordered-binary'; -import type { EncoderFunction, Key } from './encoding.js'; +import type { Encoder, EncoderFunction, Key } from './encoding.js'; export interface RocksDatabaseOptions extends StoreOptions { /** @@ -100,7 +100,7 @@ export class RocksDatabase extends DBI { * db.close(); * ``` */ - close() { + close(): void { this.store.close(); } @@ -124,11 +124,11 @@ export class RocksDatabase extends DBI { // } - dropSync() { + dropSync(): void { // } - get encoder() { + get encoder(): Encoder | null { return this.store.encoder; } @@ -140,7 +140,7 @@ export class RocksDatabase extends DBI { * * @returns The oldest snapshot timestamp. */ - getOldestSnapshotTimestamp() { + getOldestSnapshotTimestamp(): number { return this.store.db.getOldestSnapshotTimestamp(); } @@ -201,7 +201,7 @@ export class RocksDatabase extends DBI { * * @returns `true` if the database is open, `false` otherwise. */ - isOpen() { + isOpen(): boolean { return this.store.isOpen(); } @@ -343,7 +343,7 @@ export class RocksDatabase extends DBI { return this; } - get path() { + get path(): string { return this.store.path; } @@ -361,7 +361,7 @@ export class RocksDatabase extends DBI { * }); * ``` */ - async transaction(callback: (txn: Transaction) => T | PromiseLike, options?: TransactionOptions) { + async transaction(callback: (txn: Transaction) => T | PromiseLike, options?: TransactionOptions): Promise> { if (typeof callback !== 'function') { throw new TypeError('Callback must be a function'); } @@ -380,7 +380,7 @@ export class RocksDatabase extends DBI { } catch (err) { // if the transaction was already aborted/committed, we can just return if (err instanceof Error && 'code' in err && err.code === 'ERR_ALREADY_ABORTED') { - return; + return undefined as T | PromiseLike; } } // rethrow the user error @@ -392,7 +392,7 @@ export class RocksDatabase extends DBI { return result; } catch (err) { if (err instanceof Error && 'code' in err && err.code === 'ERR_ALREADY_ABORTED') { - return; + return undefined as T; } throw err; } @@ -415,7 +415,7 @@ export class RocksDatabase extends DBI { * }); * ``` */ - transactionSync(callback: (txn: Transaction) => T | PromiseLike, options?: TransactionOptions): T | PromiseLike { + transactionSync(callback: (txn: Transaction) => T | PromiseLike, options?: TransactionOptions): T | PromiseLike | undefined { if (typeof callback !== 'function') { throw new TypeError('Callback must be a function'); } @@ -522,7 +522,7 @@ export class RocksDatabase extends DBI { * }); * ``` */ - withLock(key: Key, callback: () => void | Promise): Promise { + withLock(key: Key, callback: () => void | Promise): Promise | undefined { return this.store.withLock(key, callback); } } diff --git a/src/dbi-iterator.ts b/src/dbi-iterator.ts index 95bfe5a9..403de921 100644 --- a/src/dbi-iterator.ts +++ b/src/dbi-iterator.ts @@ -26,7 +26,7 @@ export class DBIterator implements Iterator> { this.#includeValues = options?.values ?? true; } - [Symbol.iterator]() { + [Symbol.iterator](): Iterator> { return this; } diff --git a/src/dbi.ts b/src/dbi.ts index aea20163..d3634c11 100644 --- a/src/dbi.ts +++ b/src/dbi.ts @@ -201,7 +201,7 @@ export class DBI { * Synchronously retrieves the value for the given key, then returns the * decoded value. */ - getSync(key: Key, options?: GetOptions & T) { + getSync(key: Key, options?: GetOptions & T): any | undefined { if (this.store.decoderCopies) { const bytes = this.getBinaryFastSync(key, options); return bytes === undefined ? undefined : this.store.decodeValue(bytes as Buffer); @@ -345,7 +345,7 @@ export class DBI { /** * Retrieves all keys within a range. */ - getKeys(options?: IteratorOptions & T) { + getKeys(options?: IteratorOptions & T): any | undefined { return this.store.getRange(this.#context, { ...options, values: false @@ -385,7 +385,7 @@ export class DBI { * } * ``` */ - getRange(options?: IteratorOptions & T) { + getRange(options?: IteratorOptions & T): any | undefined { return this.store.getRange(this.#context, options); } @@ -419,7 +419,7 @@ export class DBI { * db.putSync('a', 'b'); * ``` */ - putSync(key: Key, value: any, options?: PutOptions & T) { + putSync(key: Key, value: any, options?: PutOptions & T): void { return this.store.putSync(this.#context, key, value, options); } @@ -463,7 +463,7 @@ export class DBI { * @param event - The event name to add the listener for. * @param callback - The callback to add. */ - addListener(event: string, callback: (...args: any[]) => void) { + addListener(event: string, callback: (...args: any[]) => void): this { this.store.db.addListener(event, callback); return this; } @@ -474,7 +474,7 @@ export class DBI { * @param event - The event name to remove the listener for. * @param callback - The callback to remove. */ - off(event: string, callback: (...args: any[]) => void) { + off(event: string, callback: (...args: any[]) => void): this { this.store.db.removeListener(event, callback); return this; } @@ -485,7 +485,7 @@ export class DBI { * @param event - The event name to add the listener for. * @param callback - The callback to add. */ - on(event: string, callback: (...args: any[]) => void) { + on(event: string, callback: (...args: any[]) => void): this { this.store.db.addListener(event, callback); return this; } @@ -496,7 +496,7 @@ export class DBI { * @param event - The event name to add the listener for. * @param callback - The callback to add. */ - once(event: string, callback: (...args: any[]) => void) { + once(event: string, callback: (...args: any[]) => void): this { const wrapper = (...args: any[]) => { this.removeListener(event, wrapper); callback(...args); diff --git a/src/index.ts b/src/index.ts index fea5cf9c..320b3e4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,10 @@ export { DBIterator } from './dbi-iterator.js'; export { Transaction } from './transaction.js'; export type { Key } from './encoding.js'; -export const versions = { - 'rocksdb': version, +export const versions: { + rocksdb: string; + 'rocksdb-js': string; +} = { + rocksdb: version, 'rocksdb-js': 'ROCKSDB_JS_VERSION', }; diff --git a/src/load-binding.ts b/src/load-binding.ts index 78976745..04fd35a3 100644 --- a/src/load-binding.ts +++ b/src/load-binding.ts @@ -132,4 +132,4 @@ export const config: (options: RocksDatabaseConfig) => void = binding.config; export const NativeDatabase: NativeDatabase = binding.Database; export const NativeIterator: typeof NativeIteratorCls = binding.Iterator; export const NativeTransaction: NativeTransaction = binding.Transaction; -export const version = binding.version; +export const version: string = binding.version; diff --git a/src/store.ts b/src/store.ts index f45ba2f4..edb4f89e 100644 --- a/src/store.ts +++ b/src/store.ts @@ -233,7 +233,7 @@ export class Store { /** * Closes the database. */ - close() { + close(): void { this.db.close(); } @@ -324,7 +324,7 @@ export class Store { resolve: (value: Buffer) => void, reject: (err: unknown) => void, txnId?: number - ) { + ): any | undefined { return context.get( this.encodeKey(key), resolve, @@ -333,7 +333,7 @@ export class Store { ); } - getCount(context: NativeDatabase | NativeTransaction, options?: RangeOptions) { + getCount(context: NativeDatabase | NativeTransaction, options?: RangeOptions): number { options = { ...options }; if (options?.start !== undefined) { @@ -384,7 +384,11 @@ export class Store { ); } - getSync(context: NativeDatabase | NativeTransaction, key: Key, options?: GetOptions & DBITransactional) { + getSync( + context: NativeDatabase | NativeTransaction, + key: Key, + options?: GetOptions & DBITransactional + ): any | undefined { return context.getSync( this.encodeKey(key), this.getTxnId(options) @@ -395,7 +399,7 @@ export class Store { * Checks if the data method options object contains a transaction ID and * returns it. */ - getTxnId(options?: DBITransactional | unknown) { + getTxnId(options?: DBITransactional | unknown): number | undefined { let txnId: number | undefined; if (options && typeof options === 'object' && 'transaction' in options) { txnId = (options.transaction as Transaction)?.id; @@ -463,7 +467,7 @@ export class Store { * * @returns `true` if the database is open, `false` otherwise. */ - isOpen() { + isOpen(): boolean { return this.db.opened; } @@ -471,7 +475,7 @@ export class Store { * Opens the database. This must be called before any database operations * are performed. */ - open() { + open(): boolean { if (this.db.opened) { return true; } @@ -482,9 +486,16 @@ export class Store { parallelismThreads: this.parallelismThreads, mode: this.pessimistic ? 'pessimistic' : 'optimistic', }); + + return false; } - putSync(context: NativeDatabase | NativeTransaction, key: Key, value: any, options?: PutOptions & DBITransactional) { + putSync( + context: NativeDatabase | NativeTransaction, + key: Key, + value: any, + options?: PutOptions & DBITransactional + ): void { if (!this.db.opened) { throw new Error('Database not open'); } @@ -503,7 +514,11 @@ export class Store { ); } - removeSync(context: NativeDatabase | NativeTransaction, key: Key, options?: DBITransactional | undefined) { + removeSync( + context: NativeDatabase | NativeTransaction, + key: Key, + options?: DBITransactional | undefined + ): void { if (!this.db.opened) { throw new Error('Database not open'); } diff --git a/src/transaction.ts b/src/transaction.ts index 8a6bb539..c928809e 100644 --- a/src/transaction.ts +++ b/src/transaction.ts @@ -23,7 +23,7 @@ export class Transaction extends DBI { /** * Abort the transaction. */ - abort() { + abort(): void { this.#txn.abort(); } @@ -61,7 +61,7 @@ export class Transaction extends DBI { /** * Get the transaction id. */ - get id() { + get id(): number { return this.#txn.id; } } diff --git a/src/util.ts b/src/util.ts index 3c9e9d71..cdb404d2 100644 --- a/src/util.ts +++ b/src/util.ts @@ -40,7 +40,11 @@ export function when( * * @returns A tuple of `resolve`, `reject`, and `promise`. */ -export function withResolvers() { +export function withResolvers(): { + resolve: (value: T) => void; + reject: (reason: any) => void; + promise: Promise; +} { let resolve, reject; const promise = new Promise((res, rej) => { resolve = res; diff --git a/test/events.test.ts b/test/events.test.ts index 9df4de93..c182c933 100644 --- a/test/events.test.ts +++ b/test/events.test.ts @@ -14,7 +14,7 @@ describe('Events', () => { expect(db.notify('foo')).toBe(false); // noop let resolvers = [ - withResolvers(), + withResolvers(), ]; db.addListener('foo', value => { @@ -28,8 +28,8 @@ describe('Events', () => { expect(spy).toHaveBeenCalledTimes(1); resolvers = [ - withResolvers(), - withResolvers(), + withResolvers(), + withResolvers(), ]; // add second listener @@ -50,7 +50,7 @@ describe('Events', () => { expect(db.listeners('foo')).toBe(1); resolvers = [ - withResolvers(), + withResolvers(), ]; expect(db.notify('foo', 'bar')).toBe(true); await expect(Promise.all(resolvers.map(r => r.promise))).resolves.toEqual(['bar']); @@ -59,38 +59,38 @@ describe('Events', () => { })); it('should notify with arguments', () => dbRunner(async ({ db }) => { - let resolver = withResolvers(); + let resolver = withResolvers(); db.addListener('foo', (...args) => { resolver.resolve(args); }); db.notify('foo', 'bar'); await expect(resolver.promise).resolves.toEqual(['bar']); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', 1234); await expect(resolver.promise).resolves.toEqual([1234]); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', true); await expect(resolver.promise).resolves.toEqual([true]); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', false); await expect(resolver.promise).resolves.toEqual([false]); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', null); await expect(resolver.promise).resolves.toEqual([null]); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', [1, 2, 3]); await expect(resolver.promise).resolves.toEqual([[1, 2, 3]]); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', { foo: 'bar' }); await expect(resolver.promise).resolves.toEqual([{ foo: 'bar' }]); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('foo', 'bar', 1234, true, false, null, [1, 2, 3], { foo: 'bar' }); await expect(resolver.promise).resolves.toEqual([ 'bar', 1234, true, false, null, [1, 2, 3], { foo: 'bar' } @@ -98,7 +98,7 @@ describe('Events', () => { })); it('should notify once', () => dbRunner(async ({ db }) => { - const { promise, resolve } = withResolvers(); + const { promise, resolve } = withResolvers(); let callCount = 0; db.once('foo', () => { @@ -126,7 +126,7 @@ describe('Events', () => { const spy1 = vi.fn(); const spy2 = vi.fn(); - const { promise, resolve } = withResolvers(); + const { promise, resolve } = withResolvers(); const callback1 = () => { spy1(); @@ -168,9 +168,9 @@ describe('Events', () => { const spy3 = vi.fn(); let resolvers = [ - withResolvers(), - withResolvers(), - withResolvers(), + withResolvers(), + withResolvers(), + withResolvers(), ]; const callback = () => { @@ -203,9 +203,9 @@ describe('Events', () => { expect(spy3).toHaveBeenCalledTimes(0); resolvers = [ - withResolvers(), - withResolvers(), - withResolvers(), + withResolvers(), + withResolvers(), + withResolvers(), ]; db.notify('foo'); await resolvers[0].promise; @@ -219,9 +219,9 @@ describe('Events', () => { expect(spy3).toHaveBeenCalledTimes(0); resolvers = [ - withResolvers(), - withResolvers(), - withResolvers(), + withResolvers(), + withResolvers(), + withResolvers(), ]; db2.notify('foo'); await resolvers[0].promise; @@ -238,9 +238,9 @@ describe('Events', () => { db2.removeListener('foo', callback2); resolvers = [ - withResolvers(), - withResolvers(), - withResolvers(), + withResolvers(), + withResolvers(), + withResolvers(), ]; db2.notify('foo'); db2.notify('foo'); @@ -286,7 +286,7 @@ describe('Events', () => { } ); - let resolver = withResolvers(); + let resolver = withResolvers(); await new Promise((resolve, reject) => { worker.on('error', reject); @@ -304,16 +304,16 @@ describe('Events', () => { worker.on('exit', () => resolver.resolve()); }); - resolver = withResolvers(); + resolver = withResolvers(); db.addListener('worker-event', value => resolver.resolve(value)); worker.postMessage({ notify: true }); await expect(resolver.promise).resolves.toBe('foo'); - resolver = withResolvers(); + resolver = withResolvers(); db.notify('parent-event', 'bar'); await expect(resolver.promise).resolves.toBe('bar'); - resolver = withResolvers(); + resolver = withResolvers(); worker.postMessage({ close: true }); if (process.versions.deno) { diff --git a/test/lib/util.ts b/test/lib/util.ts index d7def297..687afad1 100644 --- a/test/lib/util.ts +++ b/test/lib/util.ts @@ -5,7 +5,7 @@ import { RocksDatabase, type RocksDatabaseOptions } from '../../src/index.js'; import { rimraf } from 'rimraf'; import { setTimeout as delay } from 'node:timers/promises'; -export function generateDBPath() { +export function generateDBPath(): string { return join( tmpdir(), `testdb-${randomBytes(8).toString('hex')}` @@ -57,7 +57,7 @@ type TestFn = (...databases: TestDB[]) => void | Promise; export async function dbRunner( options: TestOptions | TestFn, test?: TestFn -) { +): Promise { let testFn: TestFn; if (typeof options === 'function') { testFn = options; diff --git a/test/lock.test.ts b/test/lock.test.ts index ae91ca68..b8934064 100644 --- a/test/lock.test.ts +++ b/test/lock.test.ts @@ -306,7 +306,7 @@ describe('Lock', () => { expect(workerLocked).toBe(false); }), (async () => { - await delay(100), + await delay(100); await db.withLock('foo', async () => { spy(); expect(db.hasLock('foo')).toBe(true); diff --git a/test/ranges.test.ts b/test/ranges.test.ts index 818b15f4..e94bac41 100644 --- a/test/ranges.test.ts +++ b/test/ranges.test.ts @@ -504,7 +504,6 @@ describe('Ranges', () => { const iter = db.getRange({ start: 'a', end: 'c' }); const iter2 = db.getRange({ start: 'c', end: 'e' }); - // @ts-expect-error ExtendedIterable v1 concat() type definition is missing const concat = iter.concat(iter2); expect(Array.from(concat)).toEqual([ { key: 'a', value: 'value a' }, diff --git a/test/transactions.test.ts b/test/transactions.test.ts index a1575699..673c6ffa 100644 --- a/test/transactions.test.ts +++ b/test/transactions.test.ts @@ -45,10 +45,10 @@ for (const { name, options, txnOptions } of testOptions) { it(`${name} async should set a value`, () => dbRunner({ dbOptions: [ options ] }, async ({ db }) => { - const afterCommit = withResolvers(); - const beforeCommit = withResolvers(); - const beginTransaction = withResolvers(); - const committed = withResolvers(); + const afterCommit = withResolvers(); + const beforeCommit = withResolvers(); + const beginTransaction = withResolvers(); + const committed = withResolvers(); db.on('aftercommit', (result) => afterCommit.resolve(result)); db.on('beforecommit', () => beforeCommit.resolve()); diff --git a/test/user-shared-buffer.test.ts b/test/user-shared-buffer.test.ts index 74542642..684285ef 100644 --- a/test/user-shared-buffer.test.ts +++ b/test/user-shared-buffer.test.ts @@ -131,7 +131,7 @@ describe('User Shared Buffer', () => { } ); - let resolver = withResolvers(); + let resolver = withResolvers(); await new Promise((resolve, reject) => { worker.on('error', reject); @@ -156,7 +156,7 @@ describe('User Shared Buffer', () => { await expect(resolver.promise).resolves.toBe(3n); expect(getNextId()).toBe(4n); - resolver = withResolvers(); + resolver = withResolvers(); worker.postMessage({ close: true }); if (process.versions.deno) { diff --git a/test/util.test.ts b/test/util.test.ts index b34f755a..647cfb63 100644 --- a/test/util.test.ts +++ b/test/util.test.ts @@ -50,15 +50,15 @@ describe('Util', () => { }); }); - describe('withResolvers()', () => { + describe('withResolvers()', () => { it('should resolve with value', async () => { - const { resolve, promise } = withResolvers(); + const { resolve, promise } = withResolvers(); resolve('foo'); await expect(promise).resolves.toBe('foo'); }); it('should reject with error', async () => { - const { reject, promise } = withResolvers(); + const { reject, promise } = withResolvers(); reject(new Error('foo')); await expect(promise).rejects.toThrow('foo'); }); diff --git a/tsconfig.check.json b/tsconfig.check.json index b58a8832..0a5badb6 100644 --- a/tsconfig.check.json +++ b/tsconfig.check.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "declaration": false, "noEmit": true }, "include": ["./dist"], diff --git a/tsconfig.json b/tsconfig.json index 47897e11..dd39dcfd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,13 @@ { "compilerOptions": { - "allowJs": true, "composite": false, - "declaration": false, + "declaration": true, "declarationMap": false, "erasableSyntaxOnly": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "inlineSources": false, + "isolatedDeclarations": true, "isolatedModules": true, "lib": ["esnext"], "module": "esnext", @@ -25,5 +25,5 @@ "typeRoots": ["./node_modules/@types"], "types": ["node"] }, - "include": ["./rollup.config.ts", "./rollup.dts.config.ts", "./src", "./scripts", "./test"] + "include": ["./tsdown.config.ts", "./src", "./scripts", "./test"] } \ No newline at end of file From 5e96359d1b0dea29740a59449c8ebac8a38e78d1 Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Tue, 14 Oct 2025 17:15:09 -0400 Subject: [PATCH 2/4] Add tsdown config --- tsdown.config.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tsdown.config.ts diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 00000000..246c5906 --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,26 @@ +import { defineConfig, type UserConfig } from 'tsdown'; +import replace from '@rollup/plugin-replace'; +import { readFileSync } from 'node:fs'; + +const { version } = JSON.parse(readFileSync('./package.json', 'utf8')); + +const config: UserConfig = defineConfig({ + external: [ + 'msgpackr', + 'ordered-binary' + ], + entry: './src/index.ts', + format: ['es', 'cjs'], + minify: !process.env.SKIP_MINIFY, + platform: 'node', + plugins: [ + replace({ + preventAssignment: true, + values: { + 'ROCKSDB_JS_VERSION': version + } + }) + ], + tsconfig: './tsconfig.build.json' +}); +export default config; From 324f5f3399d18932c967ea218b1c3710ea8ba585 Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Wed, 15 Oct 2025 13:16:26 -0400 Subject: [PATCH 3/4] Clean up scripts --- package.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/package.json b/package.json index f2430fef..f26bfff3 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,7 @@ "bench:deno": "deno run --allow-all --sloppy-imports ./node_modules/vitest/vitest.mjs bench", "build": "pnpm build:bundle && pnpm rebuild", "build:bundle": "rimraf dist && tsdown -c tsdown.config.ts", - "build:bundle2": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript && pnpm build:types", "build:debug": "SKIP_MINIFY=1 pnpm build:bundle", - "build:types": "pnpm build:types:temp && pnpm build:types:roll && pnpm build:types:check", - "build:types:temp": "tsc --declaration --emitDeclarationOnly --outDir temp --project tsconfig.build.json", - "build:types:roll": "rolldown --config rolldown.dts.config.ts && rimraf temp", - "build:types:roll2": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp", - "build:types:check": "tsc --project tsconfig.check.json", "check": "pnpm type-check && pnpm lint", "clean": "node-gyp clean", "coverage": "tsx scripts/coverage/main.ts", From 5205448d884b890e0ff24fd2ec6d49f5ecbc647d Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Wed, 15 Oct 2025 15:46:44 -0400 Subject: [PATCH 4/4] Use Node 20 to build for Node 18 --- .github/workflows/pr.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3d1fd75b..8d176677 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -45,7 +45,7 @@ jobs: - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node == 18 && 20 || matrix.node }} - name: Setup dependencies uses: ./.github/actions/setup-deps @@ -57,6 +57,12 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: pnpm build + - name: Install Node 18 + if: matrix.node == 18 + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Run tests on Node.js ${{ matrix.node }} run: pnpm coverage