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
24 changes: 11 additions & 13 deletions .github/workflows/release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,24 @@ jobs:
- name: Yarn Install
run: yarn install --immutable

- name: Derive appropriate SHAs for base and head for `nx affected` commands
id: setSHAs
uses: nrwl/nx-set-shas@v5
with:
main-branch-name: 'master'

- name: Set npmrc
run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc

- run: ls -a
- run: |
echo "BASE: ${{ steps.setSHAs.outputs.base }}"
echo "HEAD: ${{ steps.setSHAs.outputs.head }}"

- name: Check npm credentials
run: npm whoami

- name: Version And Publishment
- name: Release & Publish
shell: bash
run: yarn ${{ github.event.inputs.dry_run == 'true' && 'release:dry-run' || 'release' }} ${{ github.event.inputs.name == 'all' && '--all' || '--projects=' }}${{ github.event.inputs.name == 'all' && ' ' || github.event.inputs.name }}
run: |
PROJECTS_FLAG=""
if [ "${{ github.event.inputs.name }}" != "all" ]; then
PROJECTS_FLAG="--projects=${{ github.event.inputs.name }}"
fi
DRY_RUN_FLAG=""
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
DRY_RUN_FLAG="--dry-run"
fi
yarn nx release --yes $PROJECTS_FLAG $DRY_RUN_FLAG

- name: Tag last-release
if: github.event.inputs.dry_run != 'true'
Expand Down
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ yarn nx run mcp-json-diff:test-browser # open @modelcontextprotocol/inspec
yarn nx run json-difference-cli:install-local # build CLI and `npm install -g` it

yarn graph # full dep graph; yarn graph:affected for subset
yarn release[:dry-run] # per-project semver (do not run casually)
yarn release[:dry-run] # nx release: version + changelog + publish (do not run casually)
```

The `claude` script (`yarn claude`) builds the MCP server then launches Claude Code with it available — `.mcp.json` points at `tools/mcp-json-diff/bin/src/index.js`, so the MCP server must be built before it will respond.
Expand Down Expand Up @@ -104,7 +104,9 @@ Changing a project's tags in `project.json` changes who can import it — update

# Release flow

Each publishable lib versions independently via `@jscutlery/semver` → `ngx-deploy-npm` → GitHub release, driven by **conventional commits**. `nx.json`'s `release.version.preVersionCommand` runs `nx run-many -t build` first. Do not hand-edit versions; do not amend published commits. CI workflows live in `.github/workflows/` (`ci.yml`, `cd.yml`, `release-and-publish.yml`).
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.

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`).

# Conventions

Expand Down
22 changes: 0 additions & 22 deletions libs/json-difference-cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@
"tsConfig": "{projectRoot}/tsconfig.lib.json"
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"postTargets": ["json-difference-cli:github", "json-difference-cli:npm"],
"baseBranch": "master",
"syncVersions": false,
"push": true
}
},
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "${tag}",
"notes": "${notes}"
}
},
"npm": {
"executor": "ngx-deploy-npm:deploy",
"access": "public",
"distFolderPath": "{projectRoot}",
"buildTarget": "json-difference-cli:build"
},
"install-local": {
"executor": "nx:run-commands",
"options": {
Expand Down
26 changes: 0 additions & 26 deletions libs/json-difference/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@
},
"dependsOn": ["build-browser"]
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"preset": "conventional",
"postTargets": ["json-difference:github", "json-difference:npm"],
"baseBranch": "master",
"syncVersions": false,
"push": true,
"skipCommitTypes": []
}
},
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "${tag}",
"notes": "${notes}"
}
},
"npm": {
"executor": "ngx-deploy-npm:deploy",
"options": {
"access": "public",
"distFolderPath": "libs/json-difference",
"buildTarget": "json-difference:build"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
Expand Down
55 changes: 54 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,61 @@
"packageManager": "yarn",
"analytics": false,
"release": {
"projects": ["json-difference", "json-difference-cli"],
"projectsRelationship": "independent",
"releaseTagPattern": "{projectName}-{version}",
"version": {
"preVersionCommand": "yarn dlx nx run-many -t build"
"preVersionCommand": "yarn dlx nx run-many -t build",
"conventionalCommits": true,
"fallbackCurrentVersionResolver": "disk",
"updateDependents": "never"
},
"changelog": {
"workspaceChangelog": false,
"projectChangelogs": {
"createRelease": "github",
"file": "{projectRoot}/CHANGELOG.md"
}
},
"git": {
"commit": true,
"tag": true,
"push": true,
"commitMessage": "chore({projectName}): release version {version} [skip ci]"
},
"conventionalCommits": {
"types": {
"feat": {
"semverBump": "minor",
"changelog": {
"title": "Features"
}
},
"fix": {
"semverBump": "patch",
"changelog": {
"title": "Bug Fixes"
}
},
"docs": {
"semverBump": "patch",
"changelog": {
"title": "Documentation"
}
},
"chore": {
"semverBump": "patch",
"changelog": {
"title": "Chores"
}
},
"refactor": {
"semverBump": "patch",
"changelog": {
"title": "Refactors"
}
}
}
}
}
}
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"show": "yarn nx show project json-difference --web",
"graph": "yarn nx graph",
"graph:affected": "yarn nx graph --affected",
"release": "yarn nx run-many --target=version --parallel=1 ${0}",
"release:dry-run": "yarn nx run-many --target=version --parallel=1 ${0} --dry-run",
"release": "yarn nx release ${0}",
"release:dry-run": "yarn nx release ${0} --dry-run",
"upgrade": "yarn npm-check-updates --interactive",
"claude": "yarn nx run mcp-json-diff:build --no-tui && claude"
},
Expand All @@ -17,7 +17,6 @@
"@chakra-ui/react": "^3.35.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@jscutlery/semver": "^6.1.2",
"@modelcontextprotocol/sdk": "^1.29.0",
"@nx/devkit": "22.6.5",
"@nx/eslint": "22.6.5",
Expand All @@ -34,7 +33,6 @@
"@typescript-eslint/parser": "8.59.0",
"@vitejs/plugin-react": "^6.0.1",
"@yarnpkg/plugin-version": "^4.2.0",
"conventional-changelog-conventionalcommits": "^9.3.1",
"copyfiles": "^2.4.1",
"eslint": "^10.2.1",
"eslint-config-standard-with-typescript": "^43.0.1",
Expand All @@ -52,7 +50,6 @@
"jsonc-eslint-parser": "^3.1.0",
"lucide-react": "^1.8.0",
"monaco-editor": "^0.55.1",
"ngx-deploy-npm": "^9.0.0",
"npm-check-updates": "^21.0.3",
"nx": "22.6.5",
"prettier": "^3.8.3",
Expand Down
Loading
Loading