Upgrade @objectstack packages to v2.0.3 (requires zod v4 migration)#365
Upgrade @objectstack packages to v2.0.3 (requires zod v4 migration)#365
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
There was a problem hiding this comment.
Pull request overview
This PR upgrades the monorepo’s @objectstack/* dependencies to v2.0.3 and migrates the codebase from Zod v3 to Zod v4, updating protocol validation schemas and error-shaping to match the new Zod APIs.
Changes:
- Bumped
@objectstack/{cli,core,plugin-hono-server,studio,spec,objectql,runtime}to2.0.3and updatedzodto^4.3.6across packages (plus lockfile refresh). - Migrated Zod usage for v4:
z.record()now uses explicit key/value schemas;ZodError.errors→ZodError.issues. - Updated hook registration fallback in
plugin-securityto includekernel.use().
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks updated versions for @objectstack/*, zod@4.3.6, and related transitive deps. |
| package.json | Root dependency bumps to @objectstack/*@2.0.3. |
| packages/protocols/graphql/src/validation.ts | Zod v4 migration: error.issues and z.record(z.string(), ...). |
| packages/protocols/json-rpc/src/validation.ts | Zod v4 migration: error.issues and z.record(z.string(), z.any()) for object params. |
| packages/protocols/odata-v4/src/validation.ts | Zod v4 migration: header record signature + error.issues. |
| packages/foundation/plugin-security/src/plugin.ts | Adds kernel.use() as a hook registration fallback. |
| packages/foundation/plugin-multitenancy/src/config.schema.ts | Replaced tenantResolver function schema with z.any() (reduces runtime validation). |
| packages/**/package.json | Propagates @objectstack/*@2.0.3 and zod@^4.3.6 across packages (drivers/plugins/protocols/foundation). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| .args(z.any()) | ||
| .returns(z.union([z.string(), z.promise(z.string())])) | ||
| .optional(), | ||
| tenantResolver: z.any().optional(), |
There was a problem hiding this comment.
tenantResolver is documented as a function but the schema now accepts any value (z.any()), so invalid configs (e.g., string/number) will pass validation and then crash at runtime when TenantResolver calls it. Please keep runtime validation by constraining this field to a function (and ideally validating the return type is a string or Promise).
| tenantResolver: z.any().optional(), | |
| tenantResolver: z | |
| .function() | |
| .args(z.any()) | |
| .returns(z.union([z.string(), z.promise(z.string())])) | |
| .optional(), |
Upgrades @objectstack dependencies from 2.0.1/2.0.2 to 2.0.3. This version requires zod ^4.3.6, necessitating migration from zod v3.
Changes
Dependency updates:
Zod v4 API migrations:
z.record(valueType)→z.record(z.string(), valueType)error.errors→error.issueswith properz.ZodIssuetypingz.function()schema validation withz.any()in plugin-multitenancy (TypeScript types still enforce function signature)Files affected:
Example migration:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
fastdl.mongodb.org/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/objectql/objectql/node_modules/.bin/../vitest/vitest.mjs run sh k/ob�� tsc cut k/objectql/objectql/node_modules/.bin/node om/objectstack-ash grep tnet/tools/sh sh -nod�� tsc /usr/bin/git /.bin/node --untracked-filegit --no-renames nfig/composer/ve--exclude-standard /home/REDACTED/wor--others(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Created from VS Code.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.