feat(vue): add @denvelop/vue adapter package#2
Merged
Conversation
Remove placeholder packages (utils and website) that came from Vite+ scaffold and are not part of the Denvelop project scope. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Sets up the real @denvelop/core package with directory structure, package.json, vite.config.ts (with inline pack config per Vite+ docs), and tsconfig.json. Uses @dnd-kit/dom ^0.4.0 (^0.1.0 not available) and drops tsdown.config.ts per Vite+ pack guidance.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Implements builder.ts with createBuilder/createIsolatedBuilder, wires state/history/events/UI together, adds SSR fallback, and adds 10 integration tests (jsdom) covering mount, import/export, undo/redo, sections, accessibility, and destroy. Also fixes mountEditor to append a child .dnv-editor element (rather than mutating the host el) and widens tsconfig rootDir to include tests/. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Pure recursive helpers for BlockNode[] tree manipulation: findBlock, updateBlockInTree, deleteFromTree, addToCol, moveInTree, makeColNode, makeColsFromLayout. All 21 tests pass, no TypeScript errors. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…tions Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Implements text and heading block types with Zod schema validation, MJML rendering, and editor UI controls for Phase 2 block system. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Implements four simple block types with full schema validation and MJML rendering support. Avatar supports image display with sizing and linking. Divider allows customizable separators. Spacer provides vertical spacing control. HTML block enables raw markup embedding. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Implement video.ts, video.test.ts, social.ts, and social.test.ts with full schema validation, MJML rendering, and editor controls. All 218 tests passing including new video and social block tests. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Implements menu and product blocks with full test coverage. Menu block supports up to 4 configurable links with customizable color and font size. Product block includes image, title, description, price, and button with full MJML rendering. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace raw string literals ("1col", "2col-50-50", etc.) with computed
ColumnsLayout const keys in LAYOUT_WIDTHS and fallback expressions.
Change type-only imports to value imports where needed.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…tate.ts Replace hardcoded string literals with const-object constants from types.ts for all editor action types and preview device settings. This improves type safety and maintainability while preserving identical behavior. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… sanitize, toolbar Replace all hardcoded string literals for action types, event names, export formats, severity levels, and control types with their corresponding const-object constants (EditorActionType, EditorEvent, ExportFormat, IssueSeverity, ControlType) imported as values from types.ts. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…s definitions Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace all 7 string case literals with ControlType enum-like constants in the renderControl function's switch statement. This completes the const-object refactoring pattern for all constant objects across the core package. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds applyMergeTags() with {{key}} interpolation, HTML escaping, immutability, recursive children support, and metadata (subject/previewText) substitution. Also fixes @denvelop/core package.json exports to use correct nested .d.mts/.d.cts conditions for moduleResolution: nodenext compatibility.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…rgeTags Replaces truthy checks with explicit !== undefined checks for metadata.subject and metadata.previewText to preserve empty string values. Adds test to verify empty string metadata is preserved through merge tag substitution. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Add render.ts with full RenderResult (html/mjml/plaintext/json/warnings), exportAs() dispatcher, and wire index.ts exports. Add zod devDependency required by tests. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…er.ts to renderer + types Also fixed renderer package.json exports to match built .mjs/.d.mts artifacts. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…e mjml dep Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… and wrong test runner - Remove peerDependency of @denvelop/renderer on @denvelop/core (kept devDependency only); peerDependency caused vp run -r test to abort with cycle detection error - Replace runtime ExportFormat import from @denvelop/core in render.test.ts with string literals, eliminating the value import that required core at runtime in renderer tests - Update root package.json: replace vp run -r test with pnpm -r test in the ready script, and add a test script; vp run -r does not support circular devDependencies while pnpm -r test correctly runs each package from its own directory with its own vite.config.ts All 278 tests now pass: core 252, renderer 26. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
….Json constant - Wrap the public render() export to sanitize template blocks before rendering, preventing block props like <script> from bypassing sanitization - Replace string literal "json" with ExportFormat.Json constant in exportTemplate - Add ExportFormat as a value import from types.js Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace manual `type XxxProps = {...}` + `as BlockDefinition<P>` pattern
with the `defineBlock()` identity helper across all 14 block files.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
TDD implementation: 8 tests cover raw HTMLElement and Ref<HTMLElement> inputs, reactive template/canUndo/canRedo updates via change events, imperative importTemplate/exportTemplate delegation, and builder.destroy on unmount. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…r, store unsubscribe, add tests Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
TDD: wrote failing tests first, implemented the component wiring useDenvelop composable to Vue emits and defineExpose. Adds vue.d.ts shim for .vue module resolution. 17/17 tests pass (10 composable + 7 component). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… emit tests Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replaces the index.ts stub with Denvelop + useDenvelop + UseDenvelopReturn exports; adds vue-tsc and @vitejs/plugin-vue to the pack config so that vp pack can compile the SFC and generate .d.mts/.d.cts declarations. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… Change invariant, add redo test Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/vue(@denvelop/vue) — a thin Vue 3 adapter over@denvelop/coreuseDenvelop(el: MaybeRef<HTMLElement | null>, options?)composable: creates builder inonMounted, tears down inonUnmounted, exposes reactivetemplate/canUndo/canRedoand imperative delegates (importTemplate,exportTemplate,undo,redo,checkAccessibility)<Denvelop />SFC component: single<div>root, allBuilderOptionsfields as props, 5 emits (change,blockAdd,blockDelete,export,ready),defineExposefor builder methodsTest Plan
cd packages/vue && vp test— 21/21 passcd packages/vue && vp check— no TypeScript errorscd packages/vue && vp pack— producesdist/index.mjs,dist/index.cjs,dist/index.d.mts,dist/index.d.ctsindex.d.mtscorrectly types props, emits, and exposed methods🤖 Generated with Claude Code