Skip to content

feat(marketplace): render paid previews as compiled artifacts#109

Merged
jal-co merged 3 commits into
mainfrom
feat/paid-preview-obfuscation
Jul 16, 2026
Merged

feat(marketplace): render paid previews as compiled artifacts#109
jal-co merged 3 commits into
mainfrom
feat/paid-preview-obfuscation

Conversation

@jal-co

@jal-co jal-co commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What

  • paid/locked listings and paid-collection members now keep their live preview visible
  • external paid submissions persist only a compiled preview artifact; readable uploaded source is discarded before database insertion
  • unentitled Modulora-priced listings receive the same compiled artifact even while direct checkout is disabled
  • source tabs and registry/install access remain gated
  • any transform failure fails closed (no files shipped or persisted)

Why

The preview is the point of a listing: purchase should gate usable source and installation, not the ability to see the component working. Checkout feature flags must never disable source protection.

How

preview-obfuscate.ts compiles TS/JSX with Sucrase, strips comments/types, and minifies/mangles modules with Terser. The output preserves imports/exports needed by Sandpack but is a lossy executable artifact, not readable creator source. This is intentionally not keyed encryption: a browser must receive executable code, so any client-side key would also be extractable.

For creator-site paid listings, compilation happens before persistence and only the artifact is stored. For hosted marketplace pricing, active prices always enforce entitlement in catalog and registry paths regardless of VITE_DIRECT_MARKETPLACE_ENABLED; that flag controls checkout UI only.

Testing

  • pnpm --filter web typecheck
  • pnpm --filter web test — 87 passed; paid external, unpaid hosted, free controls, transform failure, and idempotence covered
  • pnpm --filter web build
  • git diff --check
  • authorized real submission: @maker/paid-preview-test v0.1.1
    • 5 stored preview files; all scripts carry the compiled marker
    • readable TypeScript marker absent from persisted files and page payload
    • real sandbox renders working counter controls
    • Code tab remains locked and purchase link points to shieldcn.dev
    • pending human curator review; automation did not approve it

Signed-off-by: Justin Levine <20596508+jal-co@users.noreply.github.com>
@jal-co
jal-co requested a review from a team as a code owner July 16, 2026 02:38
jal-co added 2 commits July 15, 2026 22:46
Signed-off-by: Justin Levine <20596508+jal-co@users.noreply.github.com>
Signed-off-by: Justin Levine <20596508+jal-co@users.noreply.github.com>
@jal-co
jal-co merged commit 2aea01f into main Jul 16, 2026
2 checks passed
@jal-co
jal-co deleted the feat/paid-preview-obfuscation branch July 16, 2026 02:56
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