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
12 changes: 12 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changesets

This folder is managed by `@changesets/cli`. Use it to record release notes,
version `madrigal`, and publish the package to npm.

Common workflow:

```bash
pnpm changeset
pnpm version-packages
pnpm release
```
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "block/madrigal" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release:
name: Version or publish
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: pnpm
registry-url: https://registry.npmjs.org

- run: pnpm install --frozen-lockfile

- run: npm ci --prefix src/dev/ui

- run: pnpm build

- name: Create Release PR or publish
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
with:
publish: npm publish --access public --provenance
version: pnpm changeset version
commit: "chore: version packages"
title: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.MADRIGAL_NPM_PUBLISH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.MADRIGAL_NPM_PUBLISH_TOKEN }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# madrigal

## 0.1.0

Initial source version. Future releases are versioned and published by
Changesets.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,29 @@ mkdir -p ~/.claude/skills/{skill-name}/
ln -sf "$(pwd)/skills/{skill-name}/SKILL.md" ~/.claude/skills/{skill-name}/SKILL.md
```

## Release Workflow

Madrigal uses [Changesets](https://github.com/changesets/changesets) for
versioning and npm publishing.

For a release-bearing change, run:

```bash
pnpm changeset
```

After the change lands on `main`, the `Release` GitHub Actions workflow creates
a version PR when changesets are pending. When that version PR lands, the same
workflow builds Madrigal and publishes it to npm with provenance. The workflow
expects the npm automation token in `MADRIGAL_NPM_PUBLISH_TOKEN`.

Manual release commands are also available:

```bash
pnpm version-packages
pnpm release
```

## Project Resources

| Resource | Description |
Expand Down
32 changes: 29 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
"name": "madrigal",
"version": "0.1.0",
"description": "A config-driven, pluggable knowledge compiler inspired by Style Dictionary",
"license": "Apache-2.0",
"author": "Block, Inc.",
"repository": {
"type": "git",
"url": "git+https://github.com/block/madrigal.git"
},
"homepage": "https://github.com/block/madrigal#readme",
"bugs": {
"url": "https://github.com/block/madrigal/issues"
},
"keywords": [
"knowledge-compiler",
"knowledge-base",
"ai-agents",
"style-dictionary",
"rules",
"cli"
],
"type": "module",
"packageManager": "pnpm@10.12.4",
"main": "dist/index.js",
Expand All @@ -16,9 +34,12 @@
}
},
"files": [
"dist",
"src"
"dist"
],
"publishConfig": {
"access": "public",
"provenance": true
},
"scripts": {
"build": "tsc -p tsconfig.build.json && cd src/dev/ui && npm run build",
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput & cd src/dev/ui && npm run dev",
Expand All @@ -29,12 +50,15 @@
"format": "biome format --write .",
"test": "vitest run",
"clean": "rm -rf dist",
"changeset": "changeset",
"version-packages": "changeset version",
"release": "pnpm build && changeset publish",
"prepublishOnly": "pnpm build",
"prepare": "lefthook install"
},
"engines": {
"node": ">=18"
},
"license": "Apache-2.0",
"peerDependencies": {
"@anthropic-ai/sdk": ">=0.27.0",
"@modelcontextprotocol/sdk": ">=1.0.0",
Expand All @@ -61,6 +85,8 @@
"devDependencies": {
"@anthropic-ai/sdk": "^0.90.0",
"@biomejs/biome": "^2.4.10",
"@changesets/changelog-github": "^0.6.0",
"@changesets/cli": "^2.31.0",
"@modelcontextprotocol/sdk": "^1.28.0",
"@types/node": "^20.11.0",
"lefthook": "^2.1.4",
Expand Down
Loading
Loading