Skip to content
Closed
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: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests

Check warning on line 1 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

test.yml:1: overly broad permissions: default permissions used due to no permissions: block

on:
push:
Expand All @@ -7,19 +7,19 @@
branches: [ 'main' ]

jobs:
test:

Check warning on line 10 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

test.yml:10: overly broad permissions: default permissions used due to no permissions: block

runs-on: ubuntu-latest

strategy:
matrix:
# TODO(b/419883265): remove commonjs bundles when dropping node 20 support.
node-version: [20.x, 22.x, 24.x]
node-version: [20.x, 22.x, 24.x, 26.x]

steps:
- uses: actions/checkout@v4

Check failure on line 20 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 20 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

test.yml:20: unpinned action reference: action is not pinned to a hash (required by blanket policy)
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4

Check failure on line 22 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 22 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

test.yml:22: unpinned action reference: action is not pinned to a hash (required by blanket policy)
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -32,8 +32,8 @@
npm install
npm run build

api-consistency:

Check warning on line 35 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

test.yml:35: overly broad permissions: default permissions used due to no permissions: block
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Check failure on line 38 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 38 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

test.yml:38: unpinned action reference: action is not pinned to a hash (required by blanket policy)
- run: scripts/validate_api_consistency.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ We recommend using our Code Generation instructions [`codegen_instructions.md`](

## Prerequisites

1. Node.js version 20 or later
1. Node.js version 22 or later

### The following are required for Gemini Enterprise Agent Platform users (excluding Vertex AI Studio)
1. [Select](https://console.cloud.google.com/project) or [create](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project) a Google Cloud project.
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

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

17 changes: 3 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
"node": {
"types": "./dist/node/node.d.ts",
"import": "./dist/node/index.mjs",
"require": "./dist/node/index.cjs",
"default": "./dist/node/index.mjs"
},
"types": "./dist/genai.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"default": "./dist/index.mjs"
},
"./web": {
Expand All @@ -39,24 +37,20 @@
"node": {
"types": "./dist/tokenizer/node.d.ts",
"import": "./dist/tokenizer/node.mjs",
"require": "./dist/tokenizer/node.cjs",
"default": "./dist/tokenizer/node.mjs"
},
"types": "./dist/tokenizer/node.d.ts",
"import": "./dist/tokenizer/node.mjs",
"require": "./dist/tokenizer/node.cjs",
"default": "./dist/tokenizer/node.mjs"
},
"./tokenizer/node": {
"types": "./dist/tokenizer/node.d.ts",
"import": "./dist/tokenizer/node.mjs",
"require": "./dist/tokenizer/node.cjs",
"default": "./dist/tokenizer/node.mjs"
},
"./vertex_internal": {
"types": "./dist/vertex_internal/index.d.ts",
"import": "./dist/vertex_internal/index.js",
"require": "./dist/vertex_internal/index.cjs"
"import": "./dist/vertex_internal/index.js"
}
},
"scripts": {
Expand Down Expand Up @@ -85,32 +79,27 @@
"generate-proto": "pbjs -t static-module -w es6 -o src/cross/sentencepiece/sentencepiece_model.pb.js src/cross/sentencepiece/sentencepiece_model.proto && pbts -o src/cross/sentencepiece/sentencepiece_model.pb.d.ts src/cross/sentencepiece/sentencepiece_model.pb.js && sed -i.bak 's/import \\* as \\$protobuf from \"protobufjs\\/minimal\"/import \\$protobuf from \"protobufjs\\/minimal.js\"/' src/cross/sentencepiece/sentencepiece_model.pb.js && rm src/cross/sentencepiece/sentencepiece_model.pb.js.bak"
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
},
"overrides": {
"tmp": "^0.2.4"
},
"files": [
"dist/genai.d.ts",
"dist/index.mjs",
"dist/index.cjs",
"dist/index.mjs.map",
"dist/node/index.mjs",
"dist/node/index.cjs",
"dist/node/index.mjs.map",
"dist/node/node.d.ts",
"dist/web/index.mjs",
"dist/web/index.mjs.map",
"dist/web/web.d.ts",
"dist/tokenizer/node.mjs",
"dist/tokenizer/node.cjs",
"dist/tokenizer/node.mjs.map",
"dist/tokenizer/node.d.ts",
"dist/vertex_internal/index.js",
"dist/vertex_internal/index.cjs",
"dist/vertex_internal/index.d.ts",
"dist/vertex_internal/index.js.map",
"dist/vertex_internal/index.cjs.map",
"node/package.json",
"web/package.json"
],
Expand All @@ -121,7 +110,7 @@
"@modelcontextprotocol/sdk": "^1.25.2",
"@rollup/plugin-json": "^6.1.0",
"@types/jasmine": "^5.1.2",
"@types/node": "^20.9.0",
"@types/node": "^22.0.3",
"@types/node-fetch": "^2.6.13",
"@types/unist": "^3.0.3",
"@types/ws": "^8.5.14",
Expand Down
46 changes: 0 additions & 46 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ export default [
external: externalDeps,
},

// Cross CJS module (dist/index.cjs)
{
input: 'src/index.ts',
output: {
file: pkg.exports['.']['require'],
format: 'cjs',
sourcemap: true,
},
plugins: rollupPlugins,
external: externalDeps,
},

// The `node/` ES module (dist/node/index.mjs)
{
input: 'src/node/index.ts',
Expand All @@ -74,18 +62,6 @@ export default [
external: externalDeps,
},

// The `node/` CJS module (dist/node/index.cjs)
{
input: 'src/node/index.ts',
output: {
file: pkg.exports['.']['node']['require'],
format: 'cjs',
sourcemap: true,
},
plugins: rollupPlugins,
external: externalDeps,
},

// The `web/` module, ES module only (dist/web/index.js)
{
input: 'src/web/index.ts',
Expand All @@ -110,18 +86,6 @@ export default [
external: externalDeps,
},

// The `tokenizer/node` CJS module (dist/tokenizer/node.cjs)
{
input: 'src/tokenizer/node.ts',
output: {
file: 'dist/tokenizer/node.cjs',
format: 'cjs',
sourcemap: true,
},
plugins: rollupPlugins,
external: externalDeps,
},

// Internal module, only for use by Vertex SDK
{
input: 'src/vertex_internal/index.ts',
Expand All @@ -133,14 +97,4 @@ export default [
plugins: rollupPlugins,
external: externalDeps,
},
{
input: 'src/vertex_internal/index.ts',
output: {
file: 'dist/vertex_internal/index.cjs',
format: 'cjs',
sourcemap: true,
},
plugins: rollupPlugins,
external: externalDeps,
},
];
Loading