diff --git a/core/package.json b/core/package.json index 678f8c0c9..248ea44ab 100644 --- a/core/package.json +++ b/core/package.json @@ -8,6 +8,9 @@ "type": "git", "url": "https://github.com/google/adk-js" }, + "engines": { + "node": ">=22.12.0" + }, "files": [ "package.json", "README.md", diff --git a/dev/package.json b/dev/package.json index 6117df13a..4ecf91085 100644 --- a/dev/package.json +++ b/dev/package.json @@ -8,6 +8,9 @@ "type": "git", "url": "https://github.com/google/adk-js" }, + "engines": { + "node": ">=22.12.0" + }, "files": [ "package.json", "README.md", diff --git a/integrations/package.json b/integrations/package.json index b7c467b4c..3dbc99cb0 100644 --- a/integrations/package.json +++ b/integrations/package.json @@ -8,6 +8,9 @@ "type": "git", "url": "https://github.com/google/adk-js" }, + "engines": { + "node": ">=22.12.0" + }, "files": [ "package.json", "README.md", diff --git a/package-lock.json b/package-lock.json index e29a4a190..658a5a822 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,6 +81,9 @@ "@types/lodash-es": "^4.17.12", "openapi-types": "^12.1.3" }, + "engines": { + "node": ">=22.12.0" + }, "peerDependencies": { "@mikro-orm/mariadb": "^6.6.6", "@mikro-orm/mssql": "^6.6.6", @@ -130,6 +133,9 @@ "tslib": "^2.6.2", "typescript": "^5.9.2", "vitest": "^3.2.4" + }, + "engines": { + "node": ">=22.12.0" } }, "dev/node_modules/@eslint/js": { @@ -335,6 +341,9 @@ "license": "Apache-2.0", "dependencies": { "@google/adk": "^1.5.0" + }, + "engines": { + "node": ">=22.12.0" } }, "node_modules/@a2a-js/sdk": { diff --git a/tests/integration/package_manifests/engines_test.ts b/tests/integration/package_manifests/engines_test.ts new file mode 100644 index 000000000..d503744f0 --- /dev/null +++ b/tests/integration/package_manifests/engines_test.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2026 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import {readFile} from 'node:fs/promises'; +import path from 'node:path'; +import {describe, expect, it} from 'vitest'; + +/** + * Workspace directories whose package.json is published to npm. The root + * manifest is excluded: it is the workspace container, not a deliverable. + */ +const PUBLISHED_WORKSPACES = ['core', 'dev', 'integrations']; + +/** + * Consumer-facing Node.js floor. 22.12.0 is the lowest release on a supported + * LTS line that satisfies every engine constraint in the production dependency + * closure. All three published manifests must agree on it. + */ +const EXPECTED_NODE_RANGE = '>=22.12.0'; + +interface Manifest { + name?: string; + engines?: {node?: string}; +} + +async function readManifest(workspace: string): Promise { + const manifestPath = path.join(process.cwd(), workspace, 'package.json'); + return JSON.parse(await readFile(manifestPath, 'utf8')) as Manifest; +} + +describe('published package manifests', () => { + it.each(PUBLISHED_WORKSPACES)( + '%s declares the shared engines.node range', + async (workspace) => { + const manifest = await readManifest(workspace); + expect(manifest.engines?.node).toBe(EXPECTED_NODE_RANGE); + }, + ); +});