Skip to content

fix: restore Docker production build (resolves #782)#803

Closed
kseungyong wants to merge 1 commit into
OpenCut-app:mainfrom
kseungyong:fix/docker-build-typescript-errors
Closed

fix: restore Docker production build (resolves #782)#803
kseungyong wants to merge 1 commit into
OpenCut-app:mainfrom
kseungyong:fix/docker-build-typescript-errors

Conversation

@kseungyong
Copy link
Copy Markdown

@kseungyong kseungyong commented May 18, 2026

Summary

Resolves #782. Restores production build by applying the 5 fixes that the issue author documented in detail.

Changes

  1. actions/keybinding.ts — Add isShortcutKey type guard (imported by keybindings/persistence.ts)
  2. actions/definitions.ts — Add isActionWithOptionalArgs runtime guard (imported by keybindings/persistence.ts)
  3. services/storage/migrations/runner.ts — Migrate IndexedDBAdapter constructor + .set() calls to object args
  4. services/storage/migrations/v1-to-v2.ts — Migrate 3 IndexedDBAdapter constructor call sites to object args
  5. stickers/providers/index.ts — Migrate register() call to object args

All five are mechanical fixes from a stale positional-arg refactor; no logic changes.

Verification

  • bunx tsc --noEmit — the 5 errors from Docker build fails on main: 5 TypeScript errors prevent production build #782 are gone (other pre-existing errors unrelated to this PR remain)
  • bun run build — TypeScript compiled successfully (✓ Compiled successfully); build halts at env-var validation (ZodError for DATABASE_URL etc.) which requires secrets not present in a local clone — this is pre-existing and unrelated to our changes
  • bun run lint — 0 errors in the 5 modified files (pre-existing lint errors in other files remain)

Test Plan

  • Reproduced original build failure on main
  • Applied fixes
  • Verified Next.js TypeScript compilation succeeds
  • Lint clean on modified files

Summary by CodeRabbit

  • Bug Fixes

    • Improved validation for keyboard shortcuts to accept only supported modifier combinations.
    • Enhanced action classification to correctly distinguish actions with optional vs required arguments.
  • Improvements

    • Refined storage migration flow for more consistent project persistence during upgrades.
    • Standardized registration of sticker providers for more predictable provider handling.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@kseungyong is attempting to deploy a commit to the OpenCut OSS Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae0fe84d-c600-4640-bb77-cc676d859276

📥 Commits

Reviewing files that changed from the base of the PR and between 98fa5cc and ecc14c0.

📒 Files selected for processing (5)
  • apps/web/src/actions/definitions.ts
  • apps/web/src/actions/keybinding.ts
  • apps/web/src/services/storage/migrations/runner.ts
  • apps/web/src/services/storage/migrations/v1-to-v2.ts
  • apps/web/src/stickers/providers/index.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/web/src/services/storage/migrations/v1-to-v2.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/web/src/stickers/providers/index.ts
  • apps/web/src/services/storage/migrations/runner.ts
  • apps/web/src/actions/definitions.ts

📝 Walkthrough

Walkthrough

This PR fixes five TypeScript errors from issue #782 by adding missing runtime type guards for action and shortcut key validation, and migrating storage adapter and registry call sites to use object-based API signatures instead of positional arguments. All changes are mechanical API compliance updates with no logic modifications.

Changes

API Contract Migrations and Runtime Type Guards

Layer / File(s) Summary
Action type guards
apps/web/src/actions/definitions.ts
ACTION_SET and REQUIRED_ARGS_ACTIONS classify known actions at runtime, while exported isActionWithOptionalArgs type guard distinguishes actions that accept optional arguments from the two asset-removal actions that require them.
Shortcut key validation
apps/web/src/actions/keybinding.ts
MODIFIER_SET defines the allowed modifier prefixes (ctrl, alt, shift, and combinations), and isShortcutKey is updated to parse the last "+" separator and validate both the modifier prefix and key suffix against the allowed set.
Storage adapter API migration
apps/web/src/services/storage/migrations/runner.ts, apps/web/src/services/storage/migrations/v1-to-v2.ts
IndexedDBAdapter initialization calls across both files are migrated from positional constructor arguments to object-based form with { dbName, storeName, version }, and the projectsAdapter.set method call is updated to use { key, value } signature.
Sticker registry API migration
apps/web/src/stickers/providers/index.ts
stickersRegistry.register call is updated to pass an object argument with { key, definition } instead of separate positional parameters.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mazeincoding

Poem

🐰 A hop and a skip through types so true,
Shortcuts and guards with MODIFIER_SET too,
Objects where args once danced in a line,
TypeScript is happy—the errors? Resigned!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: restoring the Docker production build by fixing TypeScript errors referenced in issue #782.
Description check ✅ Passed The PR description thoroughly documents the five mechanical fixes, verification steps, and test plan, meeting the requirements despite the template warning.
Linked Issues check ✅ Passed All five objectives from issue #782 are addressed: isShortcutKey and isActionWithOptionalArgs exports added, and all IndexedDBAdapter and register() call sites migrated to object-argument form.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the five TypeScript errors documented in issue #782; no unrelated modifications or scope creep.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ng positional-to-object API call sites

Resolves OpenCut-app#782.

- Add isShortcutKey type guard to actions/keybinding.ts
- Add isActionWithOptionalArgs runtime guard to actions/definitions.ts
- Migrate IndexedDBAdapter constructor + .set() calls to object args in storage migrations
- Migrate DefinitionRegistry.register() call to object args in stickers/providers
@kseungyong kseungyong force-pushed the fix/docker-build-typescript-errors branch from 98fa5cc to ecc14c0 Compare May 18, 2026 08:37
@kseungyong
Copy link
Copy Markdown
Author

Closing — we're continuing development on a private fork. The branch fix/docker-build-typescript-errors (commit ecc14c07) remains on https://github.com/kseungyong/OpenCut under MIT if maintainers later wish to cherry-pick the fixes for #782. Thanks for OpenCut.

@kseungyong kseungyong closed this May 20, 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

Development

Successfully merging this pull request may close these issues.

Docker build fails on main: 5 TypeScript errors prevent production build

1 participant