Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/cross-language-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: '24.x'

- name: Setup Go
uses: actions/setup-go@v5
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: ['24.x']
include:
# The exact lower bound of engines.node in core/dev/integrations
# package.json. Pinned to the patch so a Node API added later in the
# 20.x line cannot pass CI while breaking a consumer who is still
# inside the declared range. Keep the two in sync.
- os: ubuntu-latest
node: '20.19.0'

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}

- name: Setup Python
uses: actions/setup-python@v5
Expand Down
3 changes: 3 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"type": "git",
"url": "https://github.com/google/adk-js"
},
"engines": {
"node": ">=20.19.0"
},
"files": [
"package.json",
"README.md",
Expand Down
3 changes: 3 additions & 0 deletions dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"type": "git",
"url": "https://github.com/google/adk-js"
},
"engines": {
"node": ">=20.19.0"
},
"files": [
"package.json",
"README.md",
Expand Down
3 changes: 3 additions & 0 deletions integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"type": "git",
"url": "https://github.com/google/adk-js"
},
"engines": {
"node": ">=20.19.0"
},
"files": [
"package.json",
"README.md",
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions tests/integration/package_manifests/engines_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @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 published to npm. The root manifest is the workspace
* container, is never published, and deliberately declares no engines: npm
* already validates a workspace package's engines during a root install.
*/
const PUBLISHED_WORKSPACES = ['core', 'dev', 'integrations'];

interface Manifest {
engines?: {node?: string};
}

async function readEnginesNode(workspace: string): Promise<string | undefined> {
const manifestPath = path.join(process.cwd(), workspace, 'package.json');
const manifest = JSON.parse(await readFile(manifestPath, 'utf8')) as Manifest;
return manifest.engines?.node;
}

describe('published package manifests', () => {
it('declare one agreed engines.node range', async () => {
const entries = await Promise.all(
PUBLISHED_WORKSPACES.map(
async (workspace) =>
[workspace, await readEnginesNode(workspace)] as const,
),
);
const declared = Object.fromEntries(entries);
const [reference] = Object.values(declared);

expect(reference).toBeDefined();
expect(declared).toEqual(
Object.fromEntries(
PUBLISHED_WORKSPACES.map((workspace) => [workspace, reference]),
),
);
});
});
Loading