Skip to content

feat: Graduate Upload Capability to Unified Project.upload() & Version 0.3.0#352

Merged
davideast merged 1 commit into
mainfrom
feat/unified-upload-0.3.0
May 6, 2026
Merged

feat: Graduate Upload Capability to Unified Project.upload() & Version 0.3.0#352
davideast merged 1 commit into
mainfrom
feat/unified-upload-0.3.0

Conversation

@davideast
Copy link
Copy Markdown
Collaborator

@davideast davideast commented May 6, 2026

This PR refactors the screen upload capability into a clean, unhyphenated, factually accurate public API method Project.upload(), completely removes the legacy uploadImage() misnomer, integrates full native HTML code document uploading, hardens Zod-based schema validation, and bumps the codebase to a stable mainline 0.3.0 release.


What Changed

1. Unified Project.upload() API Surface

  • Purged the old uploadImage() method, which acted as an artificial client-side constraint.
  • Replaced it with a permissive, generic Project.upload(filePath, options) method capability on the extended domain class surface. It handles both design images (.png, .jpg, .jpeg, .webp) and full layout HTML text code documents (.html, .htm) first-class.

2. Dynamic Payload Transcoding (upload-handler.ts)

  • Enforced core asset extension support for HTML files inside SUPPORTED_MIME_TYPES.
  • Rewrote buildBatchCreateScreensBody() to dynamically branch on incoming asset MIME type signatures:
    • HTML documents (text/html): Inferred automatically as screenType: 'DOCUMENT', wrapping contents inside the htmlCode payload property object map.
    • Static design screenshots: Inferred as screenType: 'IMAGE', wrapping contents inside the screenshot payload property object map.

3. Side-Effect Membrane Compliance

  • Fully updated generated/domain-map.json to declare the new Project.upload() method as a formal side-effect contract, satisfying all monorepo validation guardrails perfectly.
  • Recompiled and verified all 171 unit and integration contract test cases pass with 0 failures.

4. Mainline 0.3.0 Stable Graduation

  • Elevated package metadata to the stable 0.3.0 mainline release track.
  • Automatically re-injected the version string constant into src/version.ts at compile time.

Files Changed

Spec Contract & Handler Infrastructure

  • packages/sdk/src/spec/upload.ts — Purged old UploadImage definitions; established clean generic UploadSpec, UploadInput, and UploadResult schemas
  • packages/sdk/src/upload-handler.ts — Rewrote handler execution loops into a standalone UploadHandler class with dynamic HTML body transcoding support
  • packages/sdk/src/project-ext.ts — Removed uploadImage() public surface method; exposed new permissive upload() extension method

Monorepo Manifest Layout

  • packages/sdk/generated/domain-map.json — Mapped upload method under side-effects manifest
  • packages/sdk/package.json — Bumped stable package version to 0.3.0
  • packages/sdk/src/version.ts — Auto-generated compilation string updated
  • packages/sdk/src/index.ts — Barrel re-exports updated to map clean upload types

Test Validation Suites

  • packages/sdk/test/unit/upload.test.ts — Lifted imports block, cleaned syntax layouts, and added comprehensive generic integration tests
  • packages/sdk/test/unit/extension-resolution.test.ts — Updated extended subclass runtime capability check
  • packages/sdk/test/unit/sdk.test.ts — Rebuilt base assertions

@davideast davideast force-pushed the feat/unified-upload-0.3.0 branch from 994cf2c to 168c750 Compare May 6, 2026 01:25
@davideast davideast changed the title feat: Graduate Upload Capability to Unified Project.upload() & Version 0.3.0 Stable feat: Graduate Upload Capability to Unified Project.upload() & Version 0.3.0 May 6, 2026
@davideast davideast merged commit edeb1f1 into main May 6, 2026
6 checks passed
@davideast davideast deleted the feat/unified-upload-0.3.0 branch May 6, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant