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
16 changes: 4 additions & 12 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Build
run: |
yarn nx run-many --target=build

- name: Lint
run: yarn nx run-many --target=lint

Expand All @@ -37,15 +41,3 @@ jobs:
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Build
run: |
yarn nx run-many --target=build --projects=playground

- name: Deploy Playground to Github Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: chore/gh-pages
target-folder: .
folder: apps/playground/dist
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 12 additions & 1 deletion .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ on:
dry_run:
type: boolean
description: |
Dry run: preview versioning/publish without tagging, publishing, or deploying to S3.
Dry run: preview versioning/publish without tagging, publishing, or deploying.

nx release decides which packages need a bump from conventional commits and runs the steps for the monorepo:
- json-difference: published to npm and browser bundle deployed to S3
- json-difference-cli: published to npm
- playground: versioned/tagged/changelogged (private, not published to npm) and deployed to GitHub Pages
- mcp-json-diff: versioned/tagged/changelogged (private, not published to npm); in-repo json-difference dep kept in sync
default: false
required: false

Expand Down Expand Up @@ -87,3 +89,12 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Deploy Playground to Github Pages 🚀
if: github.event.inputs.dry_run != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: chore/gh-pages
target-folder: .
folder: apps/playground/dist
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Changing a project's tags in `project.json` changes who can import it — update

# Release flow

Each publishable lib (`json-difference`, `json-difference-cli`) versions **independently** via the built-in `nx release` (config in `nx.json` → `release`). Driven by **conventional commits**: `feat` → minor, `fix`/`docs`/`chore`/`refactor` → patch, `BREAKING CHANGE` → major (custom mapping in `release.conventionalCommits.types`). Tag pattern is `{projectName}-{version}` (no leading `v`). `release.version.preVersionCommand` runs `nx run-many -t build` first. `nx release` handles version + CHANGELOG.md + git commit/tag/push + GitHub release + npm publish in one shot.
`json-difference`, `json-difference-cli`, `playground`, and `mcp-json-diff` each version **independently** via the built-in `nx release` (config in `nx.json` → `release`). Driven by **conventional commits**: `feat` → minor, `fix`/`docs`/`chore`/`refactor` → patch, `BREAKING CHANGE` → major (custom mapping in `release.conventionalCommits.types`). Tag pattern is `{projectName}-{version}` (no leading `v`). `release.version.preVersionCommand` runs `nx run-many -t build` first. `nx release` handles version + CHANGELOG.md + git commit/tag/push + GitHub release + npm publish in one shot. Since all projects in `release.projects` participate, nx release also syncs in-repo `json-difference` dependency versions across `json-difference-cli` and `mcp-json-diff`'s `package.json` whenever the library bumps. `playground` and `mcp-json-diff` are marked `"private": true`, so they get versioned/tagged/changelogged but are skipped by `npm publish`.

Run via `yarn release` (= `yarn nx release`); `yarn release:dry-run` previews. Do not hand-edit versions; do not amend published commits. CI workflows live in `.github/workflows/` (`ci.yml`, `cd.yml`, `release-and-publish.yml`).

Expand Down
2 changes: 1 addition & 1 deletion apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"react": "^19.2.5",
"lucide-react": "^1.8.0",
"@chakra-ui/react": "^3.35.0",
"json-difference": "1.16.1",
"json-difference": "1.16.2",
"react-dom": "^19.2.5",
"react-monaco-editor": "^0.59.0"
},
Expand Down
6 changes: 4 additions & 2 deletions libs/json-difference/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist"
"outputPath": "{projectRoot}/dist",
"generatePackageJson": false
}
},
"build-browser": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist.browser",
"configFile": "{projectRoot}/vite.config.browser.mts"
"configFile": "{projectRoot}/vite.config.browser.mts",
"generatePackageJson": false
}
},
"build-to-s3": {
Expand Down
3 changes: 1 addition & 2 deletions libs/json-difference/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
import * as path from 'path'
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'

export default defineConfig({
root: import.meta.dirname,
cacheDir: '../../node_modules/.vite/libs/json-difference',
resolve: { tsconfigPaths: true },
plugins: [
nxViteTsPaths(),
nxCopyAssetsPlugin(['*.md']),
dts({ entryRoot: 'src', tsconfigPath: path.join(import.meta.dirname, 'tsconfig.lib.json'), pathsToAliases: false })
],
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"packageManager": "yarn",
"analytics": false,
"release": {
"projects": ["json-difference", "json-difference-cli"],
"projects": ["json-difference", "json-difference-cli", "playground", "mcp-json-diff"],
"projectsRelationship": "independent",
"releaseTagPattern": "{projectName}-{version}",
"version": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"eslint-plugin-react-refresh": "^0.5.2",
"framer-motion": "^12.38.0",
"jest": "^30.3.0",
"json-difference": "1.16.1",
"json-difference": "1.16.2",
"jsonc-eslint-parser": "^3.1.0",
"lucide-react": "^1.8.0",
"monaco-editor": "^0.55.1",
Expand Down
2 changes: 1 addition & 1 deletion tools/mcp-json-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"json-difference": "1.16.1",
"json-difference": "1.16.2",
"zod": "^3.23.0"
}
}
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10329,10 +10329,10 @@ __metadata:
languageName: node
linkType: hard

"json-difference@npm:1.16.1":
version: 1.16.1
resolution: "json-difference@npm:1.16.1"
checksum: 10/52b2564afdfdae4abc0bbd380c8555426e55c46a1ce362e6d7a4865a6a8575cb6b9b27b7184dfdb991a85fbf513fb2f253de5615ad777b22cf17e5828357f754
"json-difference@npm:1.16.2":
version: 1.16.2
resolution: "json-difference@npm:1.16.2"
checksum: 10/5fbd64efdbfd917cc9120ba8352cd1e5d685471156502df7c909d4848884f321f2b1695542cc57121a84e4e74e6acc4e5714aed35a6b6986ce7e4837139e9a01
languageName: node
linkType: hard

Expand Down Expand Up @@ -12456,7 +12456,7 @@ __metadata:
eslint-plugin-react-refresh: "npm:^0.5.2"
framer-motion: "npm:^12.38.0"
jest: "npm:^30.3.0"
json-difference: "npm:1.16.1"
json-difference: "npm:1.16.2"
jsonc-eslint-parser: "npm:^3.1.0"
lucide-react: "npm:^1.8.0"
monaco-editor: "npm:^0.55.1"
Expand Down
Loading