diff --git a/.changeset/curly-donkeys-relax.md b/.changeset/curly-donkeys-relax.md deleted file mode 100644 index 93fbcf51..00000000 --- a/.changeset/curly-donkeys-relax.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-ui': patch ---- - -List-page relationship cells now render their label via the shared label seam (`getItemLabel`), honouring a related list's `ui.labelField` instead of an inline `name → title → label → id` guess that had drifted from the item form. diff --git a/.changeset/swift-otters-bump.md b/.changeset/swift-otters-bump.md deleted file mode 100644 index d99b4bb1..00000000 --- a/.changeset/swift-otters-bump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-storage-s3': patch ---- - -Bump @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner to ^3.1084.0 together to keep their shared @smithy/types versions aligned and fix the S3Client type error in getSignedUrl diff --git a/.changeset/tame-otters-listen.md b/.changeset/tame-otters-listen.md deleted file mode 100644 index f9cf7aa1..00000000 --- a/.changeset/tame-otters-listen.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@opensaas/stack-core': minor ---- - -Add a label seam for the admin UI: `getLabelFieldName(listConfig)` resolves the field that represents a list's rows as a single label (`ui.labelField` → `name` → `title` → `id`), and `getItemLabel(listConfig, item)` reads that field off a row, falling back to `id` when it's missing. Both are exported from the root entry point. - -```typescript -import { getLabelFieldName, getItemLabel } from '@opensaas/stack-core' - -Post: list({ - fields: { title: text() }, - ui: { labelField: 'title' }, -}) - -getLabelFieldName(listConfig) // 'title' -getItemLabel(listConfig, item) // item.title, or item.id if title is missing -``` diff --git a/.changeset/tame-owls-wander.md b/.changeset/tame-owls-wander.md deleted file mode 100644 index f612b5f1..00000000 --- a/.changeset/tame-owls-wander.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@opensaas/stack-ui': minor ---- - -Wire the edit page onto the relationship-options primitive so relationship dropdowns are fast and live-searchable. The item-form preparation now fetches a bounded, take-limited window via `getRelationshipOptions` instead of an unbounded `findMany({})` per relationship field, always unioning the current value's id(s) so its label renders even outside the window. - -`ComboboxField` (single) and `RelationshipManager` (many) gain debounced live search: typing narrows results against the label field via the `relationshipOptions` serverAction op, without any wiring changes required in host apps — `ItemForm`/`SingletonView` already pass `serverAction` and `listKey` through. - -```typescript -// No config changes needed — AdminUI's edit page picks this up automatically. -// A field's relationship dropdown now: -// 1. Renders a bounded initial window (default 50) with the current value's label always visible -// 2. Debounces typed input and searches server-side via context.serverAction({ action: 'relationshipOptions', ... }) -``` - -Components without a wired `serverAction` (e.g. custom usages of `ComboboxField`/`RelationshipManager`) fall back to client-side filtering over the initial window, unchanged from previous behavior. diff --git a/.changeset/tame-plums-invite.md b/.changeset/tame-plums-invite.md deleted file mode 100644 index 5a2574fe..00000000 --- a/.changeset/tame-plums-invite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-core': patch ---- - -Fix virtual fields named in `include`/`select` throwing a Prisma "Unknown field" error. Virtual field keys are now stripped from the query payload while their value is still computed via `resolveOutput`. diff --git a/.changeset/tidy-plums-argue.md b/.changeset/tidy-plums-argue.md deleted file mode 100644 index 528b718e..00000000 --- a/.changeset/tidy-plums-argue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@opensaas/stack-core': patch ---- - -Fix `calendarDay` writes 500ing on Prisma 7 `@db.Date` columns — a `resolveInput` hook now coerces a `YYYY-MM-DD` string to a UTC-midnight `Date` before validation, and the field's zod schema accepts either shape. diff --git a/.changeset/tiny-hounds-jump.md b/.changeset/tiny-hounds-jump.md deleted file mode 100644 index 036d0e31..00000000 --- a/.changeset/tiny-hounds-jump.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'@opensaas/stack-core': minor -'@opensaas/stack-ui': minor ---- - -Add a relationship-options read primitive: `getRelationshipOptions(context, config, relatedListKey, { search?, take?, selectedIds? })` returns a bounded, projected `{ id, label }[]` for relationship editors. It selects only `id` and the resolved label field (via `getLabelFieldName`), so no depth-5 auto-include ever runs; `search` filters via `contains` when the label field is text; results are ordered by the label field; and currently-selected `selectedIds` are always unioned into the result even when outside the `search`/`take` window. Operation-level `query` access on the related list still applies (denied → `[]`). - -Also adds a `relationshipOptions` op on `context.serverAction` so hosts can resolve options from a client without a bespoke endpoint: - -```typescript -await context.serverAction({ - listKey: 'Post', - action: 'relationshipOptions', - field: 'author', - search: 'ada', - take: 20, - selectedIds: ['user-123'], -}) -// => { success: true, data: [{ id: 'user-123', label: 'Ada Lovelace' }, ...] } -``` - -`getRelationshipOptions` is exported from `@opensaas/stack-core` and re-exported from `@opensaas/stack-ui` for server components that already hold a context. diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index 5a6b8827..5b374fa7 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-auth +## 0.27.0 + ## 0.26.0 ## 0.25.0 diff --git a/packages/auth/package.json b/packages/auth/package.json index e04dfb49..ddc2c7aa 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-auth", - "version": "0.26.0", + "version": "0.27.0", "description": "Better-auth integration for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 386458a9..dfbe305a 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,12 @@ # @opensaas/stack-cli +## 0.27.0 + +### Patch Changes + +- Updated dependencies [[`18c39c8`](https://github.com/OpenSaasAU/stack/commit/18c39c8b8ffc0b0c5c4551385bb67054448e5781), [`9d9c7f8`](https://github.com/OpenSaasAU/stack/commit/9d9c7f8e5afd0b4afb01dc40cb16217f8d675354), [`002e755`](https://github.com/OpenSaasAU/stack/commit/002e755ca405c23127b3c88378955127cc8b3f67), [`a15e566`](https://github.com/OpenSaasAU/stack/commit/a15e5660d736c8ea2d4b804c5ef6891510b2ea3d)]: + - @opensaas/stack-core@0.27.0 + ## 0.26.0 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index a0854c89..a1c461cf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-cli", - "version": "0.26.0", + "version": "0.27.0", "description": "CLI tools for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 94cfbb83..174f0259 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,47 @@ # @opensaas/stack-core +## 0.27.0 + +### Minor Changes + +- [#635](https://github.com/OpenSaasAU/stack/pull/635) [`18c39c8`](https://github.com/OpenSaasAU/stack/commit/18c39c8b8ffc0b0c5c4551385bb67054448e5781) Thanks [@borisno2](https://github.com/borisno2)! - Add a label seam for the admin UI: `getLabelFieldName(listConfig)` resolves the field that represents a list's rows as a single label (`ui.labelField` → `name` → `title` → `id`), and `getItemLabel(listConfig, item)` reads that field off a row, falling back to `id` when it's missing. Both are exported from the root entry point. + + ```typescript + import { getLabelFieldName, getItemLabel } from '@opensaas/stack-core' + + Post: list({ + fields: { title: text() }, + ui: { labelField: 'title' }, + }) + + getLabelFieldName(listConfig) // 'title' + getItemLabel(listConfig, item) // item.title, or item.id if title is missing + ``` + +- [#636](https://github.com/OpenSaasAU/stack/pull/636) [`a15e566`](https://github.com/OpenSaasAU/stack/commit/a15e5660d736c8ea2d4b804c5ef6891510b2ea3d) Thanks [@borisno2](https://github.com/borisno2)! - Add a relationship-options read primitive: `getRelationshipOptions(context, config, relatedListKey, { search?, take?, selectedIds? })` returns a bounded, projected `{ id, label }[]` for relationship editors. It selects only `id` and the resolved label field (via `getLabelFieldName`), so no depth-5 auto-include ever runs; `search` filters via `contains` when the label field is text; results are ordered by the label field; and currently-selected `selectedIds` are always unioned into the result even when outside the `search`/`take` window. Operation-level `query` access on the related list still applies (denied → `[]`). + + Also adds a `relationshipOptions` op on `context.serverAction` so hosts can resolve options from a client without a bespoke endpoint: + + ```typescript + await context.serverAction({ + listKey: 'Post', + action: 'relationshipOptions', + field: 'author', + search: 'ada', + take: 20, + selectedIds: ['user-123'], + }) + // => { success: true, data: [{ id: 'user-123', label: 'Ada Lovelace' }, ...] } + ``` + + `getRelationshipOptions` is exported from `@opensaas/stack-core` and re-exported from `@opensaas/stack-ui` for server components that already hold a context. + +### Patch Changes + +- [#633](https://github.com/OpenSaasAU/stack/pull/633) [`9d9c7f8`](https://github.com/OpenSaasAU/stack/commit/9d9c7f8e5afd0b4afb01dc40cb16217f8d675354) Thanks [@borisno2](https://github.com/borisno2)! - Fix virtual fields named in `include`/`select` throwing a Prisma "Unknown field" error. Virtual field keys are now stripped from the query payload while their value is still computed via `resolveOutput`. + +- [#637](https://github.com/OpenSaasAU/stack/pull/637) [`002e755`](https://github.com/OpenSaasAU/stack/commit/002e755ca405c23127b3c88378955127cc8b3f67) Thanks [@borisno2](https://github.com/borisno2)! - Fix `calendarDay` writes 500ing on Prisma 7 `@db.Date` columns — a `resolveInput` hook now coerces a `YYYY-MM-DD` string to a UTC-midnight `Date` before validation, and the field's zod schema accepts either shape. + ## 0.26.0 ### Minor Changes diff --git a/packages/core/package.json b/packages/core/package.json index 1c57f3ba..feffc179 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-core", - "version": "0.26.0", + "version": "0.27.0", "description": "Core stack for OpenSaas - schema definition, access control, and runtime utilities", "type": "module", "main": "./dist/index.js", diff --git a/packages/rag/CHANGELOG.md b/packages/rag/CHANGELOG.md index 0c95a701..8f5c401d 100644 --- a/packages/rag/CHANGELOG.md +++ b/packages/rag/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-rag +## 0.27.0 + ## 0.26.0 ## 0.25.0 diff --git a/packages/rag/package.json b/packages/rag/package.json index 2116a4b9..05129466 100644 --- a/packages/rag/package.json +++ b/packages/rag/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-rag", - "version": "0.26.0", + "version": "0.27.0", "description": "RAG and AI embeddings integration for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/storage-s3/CHANGELOG.md b/packages/storage-s3/CHANGELOG.md index 8ba20f69..1d13d82d 100644 --- a/packages/storage-s3/CHANGELOG.md +++ b/packages/storage-s3/CHANGELOG.md @@ -1,5 +1,11 @@ # @opensaas/stack-storage-s3 +## 0.27.0 + +### Patch Changes + +- [#646](https://github.com/OpenSaasAU/stack/pull/646) [`198824e`](https://github.com/OpenSaasAU/stack/commit/198824e53c1a9691685f21f8accb45f207bae434) Thanks [@borisno2](https://github.com/borisno2)! - Bump @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner to ^3.1084.0 together to keep their shared @smithy/types versions aligned and fix the S3Client type error in getSignedUrl + ## 0.26.0 ## 0.25.0 diff --git a/packages/storage-s3/package.json b/packages/storage-s3/package.json index 691a98a1..70bff99f 100644 --- a/packages/storage-s3/package.json +++ b/packages/storage-s3/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-storage-s3", - "version": "0.26.0", + "version": "0.27.0", "description": "AWS S3 storage provider for OpenSaas Stack file uploads", "type": "module", "exports": { diff --git a/packages/storage-vercel/CHANGELOG.md b/packages/storage-vercel/CHANGELOG.md index a43931f9..a9eedc63 100644 --- a/packages/storage-vercel/CHANGELOG.md +++ b/packages/storage-vercel/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-storage-vercel +## 0.27.0 + ## 0.26.0 ## 0.25.0 diff --git a/packages/storage-vercel/package.json b/packages/storage-vercel/package.json index 5d504cf5..dcbf5b08 100644 --- a/packages/storage-vercel/package.json +++ b/packages/storage-vercel/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-storage-vercel", - "version": "0.26.0", + "version": "0.27.0", "description": "Vercel Blob storage provider for OpenSaas Stack file uploads", "type": "module", "exports": { diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index c782ac80..f48150e4 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-storage +## 0.27.0 + ## 0.26.0 ### Patch Changes diff --git a/packages/storage/package.json b/packages/storage/package.json index 7dc5e3cd..88752e6d 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-storage", - "version": "0.26.0", + "version": "0.27.0", "description": "File and image upload field types with pluggable storage providers for OpenSaas Stack", "type": "module", "exports": { diff --git a/packages/tiptap/CHANGELOG.md b/packages/tiptap/CHANGELOG.md index 0f9bcb1b..326c6652 100644 --- a/packages/tiptap/CHANGELOG.md +++ b/packages/tiptap/CHANGELOG.md @@ -1,5 +1,7 @@ # @opensaas/stack-tiptap +## 0.27.0 + ## 0.26.0 ## 0.25.0 diff --git a/packages/tiptap/package.json b/packages/tiptap/package.json index 02844f05..9beb75b5 100644 --- a/packages/tiptap/package.json +++ b/packages/tiptap/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-tiptap", - "version": "0.26.0", + "version": "0.27.0", "description": "Tiptap rich text editor integration for OpenSaas Stack", "type": "module", "main": "./dist/index.js", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index dd5835d7..8cf69f3e 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,44 @@ # @opensaas/stack-ui +## 0.27.0 + +### Minor Changes + +- [#638](https://github.com/OpenSaasAU/stack/pull/638) [`95560e4`](https://github.com/OpenSaasAU/stack/commit/95560e4db69ae390131f02c357c7c0e0b82d4304) Thanks [@borisno2](https://github.com/borisno2)! - Wire the edit page onto the relationship-options primitive so relationship dropdowns are fast and live-searchable. The item-form preparation now fetches a bounded, take-limited window via `getRelationshipOptions` instead of an unbounded `findMany({})` per relationship field, always unioning the current value's id(s) so its label renders even outside the window. + + `ComboboxField` (single) and `RelationshipManager` (many) gain debounced live search: typing narrows results against the label field via the `relationshipOptions` serverAction op, without any wiring changes required in host apps — `ItemForm`/`SingletonView` already pass `serverAction` and `listKey` through. + + ```typescript + // No config changes needed — AdminUI's edit page picks this up automatically. + // A field's relationship dropdown now: + // 1. Renders a bounded initial window (default 50) with the current value's label always visible + // 2. Debounces typed input and searches server-side via context.serverAction({ action: 'relationshipOptions', ... }) + ``` + + Components without a wired `serverAction` (e.g. custom usages of `ComboboxField`/`RelationshipManager`) fall back to client-side filtering over the initial window, unchanged from previous behavior. + +- [#636](https://github.com/OpenSaasAU/stack/pull/636) [`a15e566`](https://github.com/OpenSaasAU/stack/commit/a15e5660d736c8ea2d4b804c5ef6891510b2ea3d) Thanks [@borisno2](https://github.com/borisno2)! - Add a relationship-options read primitive: `getRelationshipOptions(context, config, relatedListKey, { search?, take?, selectedIds? })` returns a bounded, projected `{ id, label }[]` for relationship editors. It selects only `id` and the resolved label field (via `getLabelFieldName`), so no depth-5 auto-include ever runs; `search` filters via `contains` when the label field is text; results are ordered by the label field; and currently-selected `selectedIds` are always unioned into the result even when outside the `search`/`take` window. Operation-level `query` access on the related list still applies (denied → `[]`). + + Also adds a `relationshipOptions` op on `context.serverAction` so hosts can resolve options from a client without a bespoke endpoint: + + ```typescript + await context.serverAction({ + listKey: 'Post', + action: 'relationshipOptions', + field: 'author', + search: 'ada', + take: 20, + selectedIds: ['user-123'], + }) + // => { success: true, data: [{ id: 'user-123', label: 'Ada Lovelace' }, ...] } + ``` + + `getRelationshipOptions` is exported from `@opensaas/stack-core` and re-exported from `@opensaas/stack-ui` for server components that already hold a context. + +### Patch Changes + +- [#639](https://github.com/OpenSaasAU/stack/pull/639) [`3b2beb7`](https://github.com/OpenSaasAU/stack/commit/3b2beb7fbe64ce34510a5f59e0403a9b2fdab52d) Thanks [@borisno2](https://github.com/borisno2)! - List-page relationship cells now render their label via the shared label seam (`getItemLabel`), honouring a related list's `ui.labelField` instead of an inline `name → title → label → id` guess that had drifted from the item form. + ## 0.26.0 ## 0.25.0 diff --git a/packages/ui/package.json b/packages/ui/package.json index 8a7ac0d6..a2421628 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@opensaas/stack-ui", - "version": "0.26.0", + "version": "0.27.0", "description": "Composable React UI components for OpenSaas Stack", "type": "module", "main": "./dist/index.js",