Skip to content

feat(storage): support pathname/contentType extras in file() multi-column mode - #816

Merged
borisno2 merged 1 commit into
mainfrom
claude/funny-sagan-4izde1
Jul 26, 2026
Merged

feat(storage): support pathname/contentType extras in file() multi-column mode#816
borisno2 merged 1 commit into
mainfrom
claude/funny-sagan-4izde1

Conversation

@borisno2

Copy link
Copy Markdown
Member

Summary

  • Extends file()'s db.columns: 'keystone' multi-column mode with two new optional column parts, pathname and contentType, mirroring the parts image()'s multi-column mode already supports (ImageColumnPart's seven-part union).
  • Opt in per-field via db.columns.parts (e.g. parts: FILE_COLUMN_PARTS for all five, or a custom subset). Without it, multi-column file() fields keep emitting exactly the same three columns (filename/filesize/url) with the same default <field>_<part> names as before — no regression for existing configs.
  • Per-part @map overrides continue to work for the new parts via the existing db.columns.map mechanism.
  • pathname/contentType round-trip through FileMetadata.metadata.pathname / FileMetadata.metadata.contentType, the same way image()'s contentDisposition round-trips through ImageMetadata.metadata — neither is a native top-level FileMetadata field.
  • Unexported DEFAULT_FILE_COLUMN_PARTS (the three-part default) and widened FILE_COLUMN_PARTS (all five) are exported from @opensaas/stack-storage/@opensaas/stack-storage/fields for configuring parts.

Test plan

  • Added unit tests in packages/storage/tests/multi-column.test.ts covering: default (3-column, no-regression) behavior, opting into the extras via parts, per-part @map overrides for the extras, assemble/split round-trips with one/both/neither extra present, and null-clearing writes — mirroring the existing image() contentDisposition coverage.
  • pnpm test in packages/storage — 167 passed (8 files)
  • pnpm build in packages/core and packages/storage (typecheck)
  • pnpm lint (repo root) — clean (only pre-existing, unrelated warnings)
  • pnpm format / pnpm manypkg fix (repo root)
  • Changeset added (@opensaas/stack-storage: minor)

Closes #815


Generated by Claude Code

…lumn mode

Extends file()'s db.columns: 'keystone' multi-column mode with two
optional parts, pathname and contentType, mirroring the parts
image()'s multi-column mode already supports. Opt in per-field via
db.columns.parts; existing configs keep their exact three-column
(filename/filesize/url) shape by default. The extras round-trip
through FileMetadata.metadata, the same way image()'s
contentDisposition round-trips through ImageMetadata.metadata.

Closes #815

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KyYAvWo4YpCF9EqSdFTUiC
@changeset-bot

changeset-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d24dbc9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@opensaas/stack-storage Minor
@opensaas/stack-storage-s3 Minor
@opensaas/stack-storage-vercel Minor
@opensaas/stack-auth Minor
@opensaas/stack-cli Minor
@opensaas/stack-core Minor
@opensaas/stack-rag Minor
@opensaas/stack-tiptap Minor
@opensaas/stack-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
stack-docs Building Building Preview Jul 26, 2026 4:49am

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Core Package Coverage (./packages/core)

Status Category Percentage Covered / Total
🟢 Lines 92.63% (🎯 65%) 1145 / 1236
🟢 Statements 91.11% (🎯 65%) 1221 / 1340
🟢 Functions 97.93% (🎯 62%) 190 / 194
🟢 Branches 81.91% (🎯 50%) 820 / 1001
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for UI Package Coverage (./packages/ui)

Status Category Percentage Covered / Total
🔵 Lines 76.72% 244 / 318
🔵 Statements 76.29% 251 / 329
🔵 Functions 69.15% 74 / 107
🔵 Branches 64.25% 160 / 249
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for CLI Package Coverage (./packages/cli)

Status Category Percentage Covered / Total
🔵 Lines 79.4% 1496 / 1884
🔵 Statements 79.1% 1556 / 1967
🔵 Functions 86.19% 206 / 239
🔵 Branches 67.31% 655 / 973
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Auth Package Coverage (./packages/auth)

Status Category Percentage Covered / Total
🔵 Lines 97.45% 115 / 118
🔵 Statements 97.52% 118 / 121
🔵 Functions 100% 38 / 38
🔵 Branches 92.85% 78 / 84
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Storage Package Coverage (./packages/storage)

Status Category Percentage Covered / Total
🔵 Lines 78.57% 220 / 280
🔵 Statements 80.06% 245 / 306
🔵 Functions 86.07% 68 / 79
🔵 Branches 75.88% 214 / 282
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/storage/src/fields/index.ts 73.46% 60.24% 80.64% 70.45% 269-275, 290-298, 334-347, 463-469, 484-492, 541-554
packages/storage/src/utils/multi-column.ts 95.12% 87.15% 100% 95.65% 227, 238-239
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for RAG Package Coverage (./packages/rag)

Status Category Percentage Covered / Total
🔵 Lines 47.97% 355 / 740
🔵 Statements 48.14% 377 / 783
🔵 Functions 54.26% 70 / 129
🔵 Branches 42.55% 180 / 423
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)

Status Category Percentage Covered / Total
🔵 Lines 100% 40 / 40
🔵 Statements 100% 40 / 40
🔵 Functions 100% 9 / 9
🔵 Branches 100% 19 / 19
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)

Status Category Percentage Covered / Total
🔵 Lines 100% 68 / 68
🔵 Statements 100% 71 / 71
🔵 Functions 100% 15 / 15
🔵 Branches 97.87% 46 / 47
File CoverageNo changed files found.
Generated in workflow #1521 for commit d24dbc9 by the Vitest Coverage Report Action

@borisno2
borisno2 merged commit 9113836 into main Jul 26, 2026
6 checks passed
@borisno2
borisno2 deleted the claude/funny-sagan-4izde1 branch July 26, 2026 12:13
@github-actions github-actions Bot mentioned this pull request Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants