Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/config.json

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:

- run: pnpm install --frozen-lockfile

- name: Check version sync
run: node scripts/check-version-sync.mjs

- run: pnpm lint

- run: pnpm type-check
Expand Down
134 changes: 134 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write

jobs:
check-release:
name: Check for new version
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
version: ${{ steps.check.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compare version to registry
id: check
run: |
LOCAL_VERSION=$(node -p "require('./packages/@visual-json/core/package.json').version")
echo "Local version: $LOCAL_VERSION"

NPM_VERSION=$(npm view @visual-json/core version 2>/dev/null || echo "0.0.0")
echo "Registry version: $NPM_VERSION"

if [ "$LOCAL_VERSION" != "$NPM_VERSION" ]; then
echo "Version changed: $NPM_VERSION -> $LOCAL_VERSION"
echo "should_release=true" >> "$GITHUB_OUTPUT"
else
echo "Version unchanged, skipping release"
echo "should_release=false" >> "$GITHUB_OUTPUT"
fi
echo "version=$LOCAL_VERSION" >> "$GITHUB_OUTPUT"

publish:
name: Publish
needs: check-release
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Publish @visual-json/core
run: pnpm publish --no-git-checks
working-directory: packages/@visual-json/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @visual-json/react
run: pnpm publish --no-git-checks
working-directory: packages/@visual-json/react
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @visual-json/vue
run: pnpm publish --no-git-checks
working-directory: packages/@visual-json/vue
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @visual-json/svelte
run: pnpm publish --no-git-checks
working-directory: packages/@visual-json/svelte
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @visual-json/yaml
run: pnpm publish --no-git-checks
working-directory: packages/@visual-json/yaml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

github-release:
name: Create GitHub Release
needs: [check-release, publish]
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract changelog entry
run: |
VERSION="${{ needs.check-release.outputs.version }}"

awk '/<!-- release:start -->/{found=1; next} /<!-- release:end -->/{found=0} found{print}' CHANGELOG.md > /tmp/release-notes.md

LINES=$(wc -l < /tmp/release-notes.md | tr -d ' ')
if [ "$LINES" -lt 2 ]; then
echo "Error: No release notes found between <!-- release:start --> and <!-- release:end --> markers in CHANGELOG.md"
exit 1
fi
echo "Extracted release notes for $VERSION ($LINES lines)"

- name: Create GitHub Release
run: |
VERSION="${{ needs.check-release.outputs.version }}"
TAG="v$VERSION"

if gh release view "$TAG" &>/dev/null; then
echo "Release $TAG already exists, skipping"
else
echo "Creating release $TAG..."
gh release create "$TAG" \
--title "$TAG" \
--notes-file /tmp/release-notes.md
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ When adding a new example that runs a dev server, wrap its `dev` script with `po

Do **not** add `--port` flags -- portless handles port assignment automatically. Do **not** add portless as a project dependency; it must be installed globally.

## Releasing

Releases are manual, single-PR affairs. There is no changesets automation. The maintainer controls the changelog voice and format.

To prepare a release:

1. Create a branch (e.g. `prepare-v0.5.0`)
2. Bump `version` in `packages/@visual-json/core/package.json`
3. Run `pnpm version:sync` to update all other `@visual-json/*` packages
4. Write the changelog entry in `CHANGELOG.md` at the top, under a new `## <version>` heading, wrapped in `<!-- release:start -->` and `<!-- release:end -->` markers. Remove the markers from the previous release entry so only the new release has markers.
5. Add a matching entry to `apps/web/src/app/docs/changelog/page.mdx` at the top (below the `# Changelog` heading)
6. Open a PR and merge to `main`

When the PR merges, CI compares `packages/@visual-json/core/package.json` version to what's on npm. If it differs, it builds, publishes all `@visual-json/*` packages, and creates the GitHub release automatically. The GitHub release body is extracted from the content between the `<!-- release:start -->` and `<!-- release:end -->` markers in `CHANGELOG.md`.

## Documentation

Use HTML `<table>` elements for tables in all documentation files (README.md, MDX docs). Do not use markdown pipe tables.
Expand Down
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Changelog

## 0.4.0

<!-- release:start -->
### New Features

- **YAML support** — New `@visual-json/yaml` package for parsing, serializing, and round-tripping YAML through the visual-json tree model. The VS Code extension now opens `.yaml` and `.yml` files with the same tree and form views used for JSON (#29)
- **YAML schema detection** — `resolveSchema` in `@visual-json/core` now recognizes well-known YAML filenames (`docker-compose.yml`, `.gitlab-ci.yml`, `pnpm-workspace.yaml`, etc.) and glob patterns (`.github/workflows/*.yml`, `.github/actions/*/action.yml`) for automatic schema-aware editing (#29)
- **Svelte support** — New `@visual-json/svelte` package with Svelte 5 components mirroring the React and Vue packages (#24)

### Improvements

- **Smoother sidebar resize** — Sidebar resizing is now more responsive and fluid (#30)

### Bug Fixes

- Fixed **React and Vue README links** not pointing to the default variable list (#27)

### Contributors

- @ctate
- @lucianfialho
- @MatanBobi
- @wobsoriano
<!-- release:end -->

## 0.3.1

### Bug Fixes

- Fixed published packages containing unresolved `workspace:*` dependencies

## 0.3.0

### New Features

- **Vue support** — New `@visual-json/vue` package with `VisualJson`, `JsonEditor`, `TreeView`, `FormView`, `DiffView`, `SearchBar`, `Breadcrumbs`, and `ContextMenu` components for Vue 3.

### Internal

- Refactored monorepo package structure: packages moved under `packages/@visual-json/` namespace.
- Shared UI utilities (diff, drag-and-drop, form, tree helpers, theme) extracted to `@internal/ui` for cross-framework reuse.

## 0.2.0

### New Features

- **Multi-select** — Shift-click range selection, cmd/ctrl-click toggle, and bulk drag-and-drop reordering in TreeView.
- **Enum dropdowns** — Schema-aware enum dropdowns in FormView, including boolean enums.
- **VS Code extension** — Breadcrumbs, form view, and search bar adapted for the VS Code webview.

### Bug Fixes

- Prevent dropping a node into its own descendants.
- Sync tree mode edits to raw mode.
- Fix mobile focus issues in breadcrumbs, form view, and search bar.

### Internal

- `isDescendant` utility moved to `@visual-json/core` with unit tests.
- New operations: `insertProperty`, `insertNode`, `reorderChildrenMulti`, `buildSubtree`, `reparentSubtree`.

## 0.1.1

### Bug Fixes

- Fix published package configuration.

## 0.1.0

Initial release.

### `@visual-json/core`

- JSON-to-tree model (`fromJson` / `toJson`) with stable node IDs.
- Full mutation API: `setValue`, `setKey`, `addProperty`, `removeNode`, `moveNode`, `reorderChildren`, `changeType`, `duplicateNode`.
- Undo / redo via `History` class.
- Tree search with `searchNodes`.
- JSON Schema resolution and per-node validation (`resolveSchema`, `validateNode`).

### `@visual-json/react`

- `VisualJson` context provider with state management, history, and search.
- `JsonEditor` wrapper component for quick integration.
- `TreeView` — collapsible tree editor with keyboard navigation and drag-and-drop.
- `FormView` — inline schema-aware form editor.
- `SearchBar` — search with match navigation, expand/collapse controls.
- `Breadcrumbs` — path-based breadcrumb navigation.
- `ContextMenu` — right-click context menu for node operations.
9 changes: 9 additions & 0 deletions apps/web/src/app/docs/changelog/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ export { metadata } from "./metadata";

- **YAML support** — new `@visual-json/yaml` package for parsing, serializing, and round-tripping YAML through the visual-json tree model. The VS Code extension now opens `.yaml` and `.yml` files with the same tree and form views used for JSON.
- **YAML schema detection** — `resolveSchema` in `@visual-json/core` now recognizes well-known YAML filenames (`docker-compose.yml`, `.gitlab-ci.yml`, `pnpm-workspace.yaml`, etc.) and glob patterns (`.github/workflows/*.yml`, `.github/actions/*/action.yml`) for automatic schema-aware editing.
- **Svelte support** — new `@visual-json/svelte` package with Svelte 5 components mirroring the React and Vue packages.

### Improvements

- **Smoother sidebar resize** — sidebar resizing is now more responsive and fluid.

### Fixes

- Fixed React and Vue README links not pointing to the default variable list.

---

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
"test": "vitest run",
"test:watch": "vitest",
"prepare": "husky",
"changeset": "changeset",
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
"ci:publish": "pnpm run build && changeset publish"
"version:sync": "node scripts/sync-version.mjs"
},
"devDependencies": {
"@changesets/cli": "2.29.8",
"@eslint/js": "^10.0.1",
"eslint": "^10.0.1",
"eslint-plugin-svelte": "^3.15.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/@visual-json/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @visual-json/core

## 0.4.0

### Minor Changes

- YAML schema detection — `resolveSchema` now recognizes well-known YAML filenames and glob patterns for automatic schema-aware editing.
- Smoother sidebar resize handling.

## 0.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@visual-json/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visual-json/core",
"version": "0.3.1",
"version": "0.4.0",
"license": "Apache-2.0",
"description": "Headless core for visual-json — the visual JSON editor. Schema-aware, embeddable, extensible.",
"keywords": [
Expand Down
7 changes: 7 additions & 0 deletions packages/@visual-json/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @visual-json/react

## 0.4.0

### Patch Changes

- Updated dependencies
- @visual-json/core@0.4.0

## 0.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@visual-json/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visual-json/react",
"version": "0.3.1",
"version": "0.4.0",
"license": "Apache-2.0",
"description": "React components for visual-json — the visual JSON editor. Schema-aware, embeddable, extensible.",
"keywords": [
Expand Down
14 changes: 14 additions & 0 deletions packages/@visual-json/svelte/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# @visual-json/svelte

## 0.4.0

### Minor Changes

- Initial release of `@visual-json/svelte` — Svelte 5 components for visual-json.
- `VisualJson` context provider with state management, history, and search.
- `JsonEditor` wrapper component for quick integration.
- `TreeView` — collapsible tree editor with keyboard navigation and drag-and-drop.
- `FormView` — inline schema-aware form editor.
- `SearchBar` — search with match navigation, expand/collapse controls.
- `Breadcrumbs` — path-based breadcrumb navigation.
- `ContextMenu` — right-click context menu for node operations.
5 changes: 4 additions & 1 deletion packages/@visual-json/svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@visual-json/svelte",
"version": "0.0.0",
"version": "0.4.0",
"license": "Apache-2.0",
"description": "Svelte components for visual-json — the visual JSON editor. Schema-aware, embeddable, extensible.",
"publishConfig": {
"access": "public"
},
"scripts": {
"prepack": "node ../../../scripts/resolve-workspace-deps.mjs",
"postpack": "node ../../../scripts/restore-package-json.mjs",
Expand Down
7 changes: 7 additions & 0 deletions packages/@visual-json/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @visual-json/vue

## 0.4.0

### Patch Changes

- Updated dependencies
- @visual-json/core@0.4.0

## 0.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@visual-json/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visual-json/vue",
"version": "0.3.1",
"version": "0.4.0",
"license": "Apache-2.0",
"description": "Vue 3 components for visual-json — the visual JSON editor. Schema-aware, embeddable, extensible.",
"keywords": [
Expand Down
Loading
Loading