Skip to content

Upgrade @objectstack to v2.0.4, add plugin-auth for server-side authentication#434

Merged
hotlong merged 4 commits intomainfrom
copilot/upgrade-objectstack-client
Feb 10, 2026
Merged

Upgrade @objectstack to v2.0.4, add plugin-auth for server-side authentication#434
hotlong merged 4 commits intomainfrom
copilot/upgrade-objectstack-client

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

  • Upgrade all @objectstack dependencies from ^2.0.1 to ^2.0.4 across all 13 package.json files
  • Add @objectstack/plugin-auth ^2.0.3 to CRM example (examples/crm/package.json)
  • Update CRM server.ts to integrate AuthPlugin into the ObjectKernel plugin chain
  • Update OBJECTSTACK_CLIENT_EVALUATION.md with latest versions and server-side auth docs
  • Fix Vite builds for @objectstack/core@2.0.4 crypto import (apps/console, examples/msw-todo)
  • Run pnpm install to update lock file
  • All 42 build tasks pass
  • All 137 test files pass (2768 tests, 0 failures)
Original prompt

On OBJECTSTACK_CLIENT_EVALUATION.md, @objectstack 升级到最新版,服务端引入 @objectstack/plugin-auth 进行身份验证


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 10, 2026 4:47pm
objectui-console Ready Ready Preview, Comment Feb 10, 2026 4:47pm
objectui-storybook Error Error Feb 10, 2026 4:47pm

Request Review

Copilot AI and others added 2 commits February 10, 2026 16:01
…ide auth

- Upgrade all @objectstack packages from ^2.0.1 to ^2.0.4 across 13 package.json files
- Add @objectstack/plugin-auth ^2.0.3 to CRM example for server-side authentication
- Update CRM server.ts to integrate AuthPlugin into the ObjectKernel
- Update OBJECTSTACK_CLIENT_EVALUATION.md with latest versions and plugin-auth documentation

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update objectstack client to latest version and add authentication Upgrade @objectstack to v2.0.4, add plugin-auth for server-side authentication Feb 10, 2026
Copilot AI requested a review from hotlong February 10, 2026 16:09
@hotlong hotlong marked this pull request as ready for review February 10, 2026 16:22
Copilot AI review requested due to automatic review settings February 10, 2026 16:22
@hotlong
Copy link
Contributor

hotlong commented Feb 10, 2026

@copilot fix all build and test

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the monorepo to newer @objectstack/* versions and wires @objectstack/plugin-auth into the CRM example to demonstrate server-side authentication, along with corresponding documentation updates.

Changes:

  • Bump @objectstack/* dependencies from ^2.0.1^2.0.4 across the workspace and refresh pnpm-lock.yaml.
  • Add @objectstack/plugin-auth@^2.0.3 and register AuthPlugin in examples/crm/server.ts.
  • Update OBJECTSTACK_CLIENT_EVALUATION.md to reflect the new versions and document server-side auth setup.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pnpm-lock.yaml Lockfile refresh for @objectstack/* upgrades + new plugin-auth transitive deps
package.json Root devDependency bumps to @objectstack/*@^2.0.4 + hono server plugin bump
packages/core/package.json Bump @objectstack/spec to ^2.0.4
packages/react/package.json Bump @objectstack/spec to ^2.0.4
packages/types/package.json Bump @objectstack/spec to ^2.0.4
packages/data-objectstack/package.json Bump @objectstack/client to ^2.0.4
packages/plugin-gantt/package.json Bump @objectstack/spec to ^2.0.4
packages/plugin-map/package.json Bump @objectstack/spec to ^2.0.4
packages/plugin-timeline/package.json Bump @objectstack/spec to ^2.0.4
apps/console/package.json Bump console’s @objectstack/* dependencies to ^2.0.4
examples/todo/package.json Bump todo example deps to @objectstack/*@^2.0.4
examples/msw-todo/package.json Bump msw-todo example deps to @objectstack/*@^2.0.4
examples/kitchen-sink/package.json Bump kitchen-sink example deps to @objectstack/*@^2.0.4
examples/crm/package.json Bump CRM example deps to @objectstack/*@^2.0.4 and add @objectstack/plugin-auth
examples/crm/server.ts Register AuthPlugin in the CRM server kernel plugin chain
OBJECTSTACK_CLIENT_EVALUATION.md Update version headers and add server-side auth documentation/diagram
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +332 to +334
// Provides /api/v1/auth/* endpoints (sign-in, sign-up, session, OAuth, 2FA, etc.)
await kernel.use(new AuthPlugin({
secret: process.env.AUTH_SECRET || 'dev-secret',
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server-side setup example uses secret: process.env.AUTH_SECRET || 'dev-secret'. Similar to the CRM server code, a hard-coded fallback secret is unsafe and can be copied into production accidentally. Prefer failing fast when AUTH_SECRET is missing (or gating any fallback behind an explicit dev-only check) and mention required env vars in the example text.

Suggested change
// Provides /api/v1/auth/* endpoints (sign-in, sign-up, session, OAuth, 2FA, etc.)
await kernel.use(new AuthPlugin({
secret: process.env.AUTH_SECRET || 'dev-secret',
// Requires AUTH_SECRET to be set in the environment for signing tokens.
// Provides /api/v1/auth/* endpoints (sign-in, sign-up, session, OAuth, 2FA, etc.)
const authSecret = process.env.AUTH_SECRET;
if (!authSecret) {
throw new Error('AUTH_SECRET environment variable must be set for @objectstack/plugin-auth');
}
await kernel.use(new AuthPlugin({
secret: authSecret,

Copilot uses AI. Check for mistakes.
Comment on lines 3936 to 3951
@@ -3917,6 +3945,10 @@ packages:
resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==}
engines: {node: ^14.21.3 || >=16}

'@noble/hashes@2.0.1':
resolution: {integrity: sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==}
engines: {node: '>= 20.19.0'}

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lockfile now pulls in @noble/ciphers@2.1.1 and @noble/hashes@2.0.1 which both declare engines.node: >= 20.19.0. The repo root package.json currently allows Node >=20, so installs on Node 20.0–20.18 will violate dependency engine constraints. Consider tightening the repo engine requirement to >=20.19.0 (and aligning CI/dev docs), or pinning transitive deps to versions that support the currently-declared Node range.

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +51
// NOTE: In production, always set AUTH_SECRET env var. The fallback is for local development only.
const authPlugin = new AuthPlugin({
secret: process.env.AUTH_SECRET || 'objectui-dev-secret',
baseUrl: 'http://localhost:3000',
});
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using a hard-coded default secret for authentication (even in an example). This makes it easy to accidentally run the server with a known secret. Prefer requiring AUTH_SECRET (fail fast) unless NODE_ENV === 'development', or generating a random dev secret at startup and logging a warning. Also consider sourcing baseUrl from an env var (or deriving it from the configured port) so the example works behind proxies / non-localhost environments.

Copilot uses AI. Check for mistakes.

return (
<AuthProvider authUrl="/api/auth">
<AuthProvider authUrl="/api/v1/auth">
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document switches the AuthProvider URL to /api/v1/auth, but the rest of the repo (e.g., @object-ui/auth docs/tests and apps/console) consistently uses /api/auth. Unless the server-side AuthPlugin is explicitly mounted at /api/v1/auth, this is likely to mislead readers. Either keep /api/auth here or add a short note explaining the exact route prefix used by @objectstack/plugin-auth and how to configure it to match.

Suggested change
<AuthProvider authUrl="/api/v1/auth">
<AuthProvider authUrl="/api/auth">

Copilot uses AI. Check for mistakes.
…@2.0.4

@objectstack/core@2.0.4 statically imports Node.js crypto module for plugin
hashing. The code has a browser fallback, so we mark crypto as external in
both the console and msw-todo Vite configs to fix browser bundle builds.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 10, 2026

@copilot fix all build and test

Fixed in 771fd19. The @objectstack/core@2.0.4 upgrade introduced a static import { createHash } from "crypto" which broke Vite browser builds for apps/console and examples/msw-todo. Added crypto to rollupOptions.external in both Vite configs since the library already has a browser fallback path. All 42 build tasks and 137 test files (2768 tests) now pass.

@github-actions
Copy link
Contributor

📦 Bundle Size Report

Package Size Gzipped
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 5.93KB 1.44KB
auth (ForgotPasswordForm.js) 4.00KB 1.44KB
auth (LoginForm.js) 4.20KB 1.45KB
auth (RegisterForm.js) 5.66KB 1.59KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (createAuthClient.js) 2.78KB 0.98KB
auth (createAuthenticatedFetch.js) 1.24KB 0.60KB
auth (index.js) 1.14KB 0.50KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 1.50KB 0.55KB
components (index.js) 1811.76KB 425.83KB
core (index.js) 0.70KB 0.30KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 23.44KB 5.74KB
fields (index.js) 87.61KB 17.17KB
i18n (i18n.js) 2.03KB 0.77KB
i18n (index.js) 1.65KB 0.66KB
i18n (provider.js) 2.88KB 0.99KB
layout (index.js) 14.64KB 4.53KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (index.js) 1.03KB 0.50KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 4.42KB 1.27KB
mobile (usePullToRefresh.js) 2.41KB 0.80KB
mobile (useResponsive.js) 0.71KB 0.42KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.11KB 0.87KB
permissions (evaluator.js) 4.00KB 1.23KB
permissions (index.js) 0.85KB 0.40KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 0.99KB 0.49KB
plugin-aggrid (AddressField-Bntpynvd.js) 3.05KB 0.76KB
plugin-aggrid (AgGridImpl-3Mmf2qrR.js) 7.04KB 2.33KB
plugin-aggrid (AutoNumberField-C1kBJaxh.js) 0.28KB 0.27KB
plugin-aggrid (FileField-BDwbJvor.js) 3.50KB 1.34KB
plugin-aggrid (FormulaField-BXNiyGoh.js) 0.52KB 0.38KB
plugin-aggrid (GeolocationField-Df3yYcM9.js) 4.46KB 1.50KB
plugin-aggrid (GridField-CcjQp4WM.js) 1.71KB 0.67KB
plugin-aggrid (LocationField-BIfN5QIq.js) 0.93KB 0.54KB
plugin-aggrid (MasterDetailField-CAEmxbIT.js) 3.86KB 1.17KB
plugin-aggrid (ObjectAgGridImpl-EjifM4aY.js) 919.77KB 203.53KB
plugin-aggrid (ObjectField-BpkQpIF-.js) 1.61KB 0.77KB
plugin-aggrid (QRCodeField-VCBewTDG.js) 3.38KB 1.23KB
plugin-aggrid (RichTextField-CyQwSi2C.js) 1.16KB 0.59KB
plugin-aggrid (SignatureField-Cr4tsEbj.js) 3.32KB 1.28KB
plugin-aggrid (SummaryField-CnEJ_GZI.js) 0.48KB 0.37KB
plugin-aggrid (UserField-DJjaVyrV.js) 2.44KB 0.93KB
plugin-aggrid (VectorField-cPYmcKnV.js) 0.79KB 0.44KB
plugin-aggrid (index-B87wd1E0.js) 19.95KB 5.03KB
plugin-aggrid (index.js) 0.22KB 0.16KB
plugin-ai (index.js) 25.35KB 6.39KB
plugin-calendar (index.js) 31.63KB 8.05KB
plugin-charts (AdvancedChartImpl-DFmeUY4Q.js) 124.69KB 25.93KB
plugin-charts (BarChart-C_I0OFbj.js) 542.77KB 135.30KB
plugin-charts (ChartImpl-B5LY4On3.js) 3.17KB 1.10KB
plugin-charts (index-DSBO2Kdy.js) 15.18KB 4.46KB
plugin-charts (index.js) 0.19KB 0.16KB
plugin-chatbot (index.js) 1140.69KB 333.05KB
plugin-dashboard (index.js) 138.23KB 36.00KB
plugin-designer (index.js) 43.02KB 9.48KB
plugin-detail (index.js) 1720.15KB 405.48KB
plugin-editor (MonacoImpl-hfdmoz6k.js) 18.15KB 5.59KB
plugin-editor (index-CuYbY6xb.js) 10.10KB 3.32KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-form (index.js) 52.17KB 10.49KB
plugin-gantt (index.js) 186.00KB 44.84KB
plugin-grid (index.js) 45.16KB 12.17KB
plugin-kanban (KanbanEnhanced-DjadKL5D.js) 31.43KB 9.03KB
plugin-kanban (KanbanImpl-BHAT_ney.js) 5.28KB 1.91KB
plugin-kanban (index-BhdljdIe.js) 17.29KB 5.01KB
plugin-kanban (index.js) 0.27KB 0.17KB
plugin-kanban (sortable.esm-ZHwgFQIO.js) 71.42KB 18.98KB
plugin-list (index.js) 1733.87KB 408.91KB
plugin-map (index.js) 126.76KB 30.66KB
plugin-map (maplibre-gl-CNsW26De.js) 1418.32KB 302.53KB
plugin-markdown (MarkdownImpl-DufQ-eRU.js) 256.68KB 64.45KB
plugin-markdown (index-CrmE78vF.js) 9.63KB 3.17KB
plugin-markdown (index.js) 0.19KB 0.15KB
plugin-report (index.js) 63.42KB 12.83KB
plugin-timeline (index.js) 105.30KB 24.14KB
plugin-view (index.js) 47.44KB 12.12KB
plugin-workflow (index.js) 30.88KB 7.14KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 3.28KB 1.30KB
react (index.js) 0.39KB 0.25KB
react (index.test.js) 0.34KB 0.26KB
tenant (TenantContext.js) 0.31KB 0.25KB
tenant (TenantGuard.js) 1.04KB 0.43KB
tenant (TenantProvider.js) 2.76KB 0.98KB
tenant (TenantScopedQuery.js) 0.77KB 0.44KB
tenant (index.js) 0.75KB 0.38KB
tenant (resolver.js) 2.64KB 0.76KB
tenant (useTenant.js) 0.50KB 0.32KB
tenant (useTenantBranding.js) 0.62KB 0.39KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 0.20KB 0.18KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 0.20KB 0.18KB
types (disclosure.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (index.js) 1.12KB 0.49KB
types (layout.js) 0.20KB 0.18KB
types (mobile.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (tenant.js) 0.20KB 0.18KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 0.20KB 0.18KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB
types (workflow.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants