mirror of
https://github.com/lancedb/lancedb.git
synced 2026-08-18 20:18:37 +00:00
dbc3687c7b
## Summary - require Node.js 18-compatible type declarations when TypeScript consumers install them - keep the type peer optional for JavaScript-only consumers - add a regression test tying the Node type peer range to the supported runtime ## Root cause LanceDB requires Node.js 18 or newer, and its public types expose Apache Arrow declarations that import built-ins through the node: scheme. The package did not declare a matching @types/node peer requirement, so npm accepted projects pinned to Node 12 declarations and TypeScript then reported that node:stream and node:fs/promises did not exist. ## Validation - pnpm lint - pnpm build - pnpm run docs - pnpm test --runInBand (678 passed, 5 skipped) - packed-package consumer probe rejects @types/node 12.20.55 and installs with @types/node 18.19.130 Fixes #1713 <!-- lance-gatekeeper-fix:v1 agent=7a2b68f3daad20bed9e46cb8892d6e6c generation=1 --> Co-authored-by: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com>
15 lines
495 B
TypeScript
15 lines
495 B
TypeScript
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: Copyright The LanceDB Authors
|
|
|
|
import packageJson = require("../package.json");
|
|
|
|
describe("package metadata", () => {
|
|
it("requires Node.js type declarations compatible with the runtime", () => {
|
|
expect(packageJson.engines.node).toBe(">= 18");
|
|
expect(packageJson.peerDependencies["@types/node"]).toBe(">=18");
|
|
expect(packageJson.peerDependenciesMeta["@types/node"]).toEqual({
|
|
optional: true,
|
|
});
|
|
});
|
|
});
|