Conversation
…torage in fixture
Also fix maxUploadSize serialization into the virtual config module — it was missing from serializableConfig in integration/index.ts, so the setting was never visible to route handlers at runtime.
🦋 Changeset detectedLatest commit: 2d060e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
|
Thanks! Could oyu update the reference docs too. |
There was a problem hiding this comment.
Pull request overview
Adds a configurable media upload size limit (maxUploadSize) to EmDash so deployments can adjust the maximum allowed upload size (previously hardcoded to 50 MB), and wires the value through validation and OpenAPI generation.
Changes:
- Introduces
EmDashConfig.maxUploadSize(bytes) with a default of 50 MB. - Enforces the configured limit in both direct multipart uploads and signed-URL upload requests (validation layer).
- Updates OpenAPI generation + caching path and adds unit/integration tests around the new behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/astro/integration/runtime.ts | Adds maxUploadSize to the public integration config type/docs. |
| packages/core/src/astro/integration/index.ts | Serializes maxUploadSize into runtime config for use by routes/spec generation. |
| packages/core/src/api/schemas/media.ts | Replaces hardcoded upload limit with DEFAULT_MAX_UPLOAD_SIZE + mediaUploadUrlBody(maxSize) factory. |
| packages/core/src/astro/routes/api/media.ts | Applies maxUploadSize to multipart upload enforcement and messaging. |
| packages/core/src/astro/routes/api/media/upload-url.ts | Applies maxUploadSize to signed-URL request body validation. |
| packages/core/src/api/openapi/document.ts | Makes OpenAPI document generation depend on configured maxUploadSize. |
| packages/core/src/astro/routes/api/openapi.json.ts | Passes runtime config into OpenAPI generation and handles invalid config failures. |
| packages/core/tests/unit/api/schemas.test.ts | Adds unit coverage for the schema factory + boundary/error-message behavior. |
| packages/core/tests/integration/server.ts | Adds per-server uploads dir + env passthrough support. |
| packages/core/tests/integration/fixture/astro.config.mjs | Wires fixture storage + maxUploadSize via env for server-based tests. |
| packages/core/tests/integration/media/upload-limit.test.ts | Adds a server-level test validating enforcement on both upload paths. |
| .changeset/better-rockets-listen.md | Publishes the new config option as a patch change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ascorbic Done |
What does this PR do?
Makes file upload size limit configurable via
EmDashConfig. Previously, it was hardcoded as 50 MB.Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runpnpm locale:extracthas been run (if applicable)AI-generated code disclosure
Screenshots / test output