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

Create a release note with `pnpm changeset`. The five public `@primitree/*`
packages use a fixed version group, so an approved changeset updates all five
to the same version. Apply pending release notes with
`pnpm version-packages`.
Create a release note with `pnpm changeset`. The five scoped packages and the
unscoped `primitree` launcher use a fixed version group, so an approved
changeset updates all six to the same version. Run `pnpm version-packages` to
apply pending notes.

Maintainers do not version or publish private workspaces through Changesets.
9 changes: 8 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"changelog": ["@changesets/cli/changelog", null],
"commit": false,
"fixed": [
["@primitree/core", "@primitree/dtcg", "@primitree/cli", "@primitree/hooks", "@primitree/mcp"]
[
"@primitree/core",
"@primitree/dtcg",
"@primitree/cli",
"@primitree/hooks",
"@primitree/mcp",
"primitree"
]
],
"linked": [],
"access": "public",
Expand Down
13 changes: 13 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@primitree/core": "0.0.0",
"@primitree/dtcg": "0.0.0",
"@primitree/cli": "0.0.0",
"@primitree/hooks": "0.0.0",
"@primitree/mcp": "0.0.0",
"primitree": "0.0.0"
},
"changesets": ["primitree-one"]
Comment thread
marklearst marked this conversation as resolved.
}
21 changes: 21 additions & 0 deletions .changeset/primitree-one.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@primitree/core': major
'@primitree/dtcg': major
'@primitree/cli': major
'@primitree/hooks': major
'@primitree/mcp': major
'primitree': major
---

Launch the Primitree 1.0 package family.

- `@primitree/core` normalizes Figma variables, resolves aliases, compares
revisions, and evaluates token policy.
- `@primitree/dtcg` reads DTCG 2025.10 tokens and builds DTCG, Resolver, CSS,
Tailwind CSS, and TypeScript output.
- `@primitree/cli` checks, inspects, compares, and builds configured token
projects.
- `@primitree/hooks` reads generated token output in React applications.
- `@primitree/mcp` exposes loaded token graphs to MCP clients.
- `primitree` provides the unscoped `primitree` command through
`@primitree/cli`.
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ jobs:
- name: Run browser tests
run: pnpm run test:e2e

- name: Validate stable release tag
- name: Validate release tag
if: github.ref_type == 'tag'
shell: bash
run: |
set -euo pipefail
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Release tags must use vMAJOR.MINOR.PATCH" >&2
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-next\.[0-9]+)?$ ]]; then
echo "Release tags must use vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-next.N" >&2
exit 1
fi
pnpm run check:release-metadata
Expand All @@ -93,12 +93,7 @@ jobs:
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
use_oidc: true
files: >-
./packages/core/coverage/lcov.info,
./packages/dtcg/coverage/lcov.info,
./packages/cli/coverage/lcov.info,
./packages/hooks/coverage/lcov.info,
./packages/mcp/coverage/lcov.info
files: ./packages/core/coverage/lcov.info,./packages/dtcg/coverage/lcov.info,./packages/cli/coverage/lcov.info,./packages/hooks/coverage/lcov.info,./packages/mcp/coverage/lcov.info
disable_search: true
fail_ci_if_error: true

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Check a local DTCG source against project rules and build files for apps.
</div>

```sh
npx @primitree/cli check
npx @primitree/cli build
npx primitree@next check
npx primitree@next build
```

Configured builds can write this file set:
Expand All @@ -36,7 +36,7 @@ config example.
The older Figma form remains available:

```sh
npx @primitree/cli build variables.json
npx primitree@next build variables.json
```

Its token output follows DTCG 2025.10 plus a documented boolean extension.
Expand All @@ -53,6 +53,7 @@ REST API.

| Package | Purpose |
| ---------------------------------------- | ------------------------------------------------------------------------------------ |
| [`primitree`](packages/primitree) | Run the CLI through the short, unscoped package name |
| [`@primitree/core`](packages/core) | Normalize exports, resolve aliases, compare revisions, and call the API |
| [`@primitree/dtcg`](packages/dtcg) | Convert exports to token files and emit CSS, Tailwind, and TypeScript |
| [`@primitree/cli`](packages/cli) | Check and inspect local DTCG sources; convert Figma exports; scaffold token projects |
Expand Down Expand Up @@ -165,6 +166,7 @@ apps/
├── figma-plugin/ Figma export plugin
└── playground/ Standalone browser playground
packages/
├── primitree/ Unscoped CLI launcher
├── core/ Shared normalization, diff, API, and types
├── dtcg/ Token conversion and emitters
├── cli/ Command-line package
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/cli/check.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ forms and references, and owners. Paths start from the config file directory.
Install the CLI in the project before importing its config helper:

```sh
npm install -D @primitree/cli
npm install -D @primitree/cli@next
```

```ts
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/cli/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Check local DTCG sources, build output files, compare changes, and
The CLI requires Node.js 24 or newer. Add it as a development dependency:

```bash
pnpm add -D @primitree/cli
pnpm add -D @primitree/cli@next
```

Binary name: `primitree`.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/getting-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You need Node.js 24 or newer. Contributors working in this monorepo need pnpm
## 1. Install the CLI

```bash
pnpm add -D @primitree/cli
pnpm add -D @primitree/cli@next
```

## 2. Add a DTCG token file
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/hooks/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Typed React hooks for built design tokens or live Figma Variables A
---

```bash
npm install @primitree/hooks react@^19.0.0 swr@^2.3.7
npm install @primitree/hooks@next react@^19.0.0 swr@^2.3.7
```

`@primitree/hooks` requires Node.js 24 or newer and React `^19.0.0`.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/hooks/local-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Use built DTCG artifacts in React without the Figma API.
Build the token files:

```bash
npx @primitree/cli build variables.json
npx primitree@next build variables.json
```

## Setup
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/hooks/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Primitree 1.0 moves the hooks package from `@figma-vars/hooks` to `@primitree/ho

```bash
npm uninstall @figma-vars/hooks
npm install @primitree/hooks
npm install @primitree/hooks@next
```

| Before | Primitree 1.0 |
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ files for an app to use.
Install the CLI. Add a local DTCG file and `primitree.config.ts`. Run:

```bash
pnpm add -D @primitree/cli
pnpm add -D @primitree/cli@next
pnpm exec primitree check --source brand
pnpm exec primitree inspect semantic.motion.control --source brand
cp tokens.json before.tokens.json
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/mcp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The `--tokens` option selects the source for `get_token`, `resolve_context`, and
## Start the server

```bash
npx @primitree/mcp --tokens ./variables.json
npx @primitree/mcp@next --tokens ./variables.json
```

The command connects over stdio and logs its source path to standard error.
Expand Down
12 changes: 6 additions & 6 deletions docs/launch/announcement.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Primitree 1.0 launch copy

Draft copy for the 1.0.0 release.
Draft copy for the 1.0 prerelease.

## Show HN

Expand All @@ -15,7 +15,7 @@ Hi HN. I built Primitree to turn an exported `variables.json` file into token
files that live in a repository.

```sh
npx @primitree/cli build variables.json
npx primitree@next build variables.json
git add design-tokens
```

Expand Down Expand Up @@ -56,7 +56,7 @@ Docs: https://primitree.com
Build commit-ready token files from a Figma `variables.json` export.

```sh
npx @primitree/cli build variables.json
npx primitree@next build variables.json
```

Primitree writes DTCG 2025.10 tokens plus a documented boolean extension,
Expand Down Expand Up @@ -119,13 +119,13 @@ Set Width 1200
Set Height 640
Set Theme "Catppuccin Mocha"

Type "npx @primitree/cli build variables.json" Enter
Type "npx primitree@next build variables.json" Enter
Sleep 4s
Type "find design-tokens -maxdepth 2 -type f | sort" Enter
Sleep 4s
Type "git add design-tokens && git status --short" Enter
Sleep 4s
Type "npx @primitree/cli diff backup/variables.json variables.json" Enter
Type "npx primitree@next diff backup/variables.json variables.json" Enter
Sleep 5s
```

Expand All @@ -135,7 +135,7 @@ switch one Resolver context, and download the zip.
## Launch checklist

- [ ] Finish the [release runbook](../releasing.md).
- [ ] Publish the five `@primitree` packages in dependency order.
- [ ] Publish the five scoped packages and the unscoped `primitree` launcher in dependency order.
- [ ] Verify the documentation site at https://primitree.com.
- [ ] Verify the migration guide at
https://primitree.com/docs/hooks/migration.
Expand Down
47 changes: 47 additions & 0 deletions docs/launch/v1.0.0-next.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Primitree 1.0.0-next.0

Status: Unreleased.

Primitree checks a local DTCG source against project layer and owner rules. The
first public prerelease also reserves the unscoped `primitree` package name, so
the complete CLI is available through one short command:

```sh
npx primitree@next check
```

The launcher forwards to `@primitree/cli`. It does not contain a second command
implementation or a separate configuration format.

## Release highlights

- `primitree check` evaluates a configured DTCG source and reports stable policy
findings.
- `primitree inspect` traces one token through its alias chain, owners, and
direct dependents.
- `primitree diff` reports token changes, affected aliases, and policy changes.
- `primitree build` writes DTCG, Resolver, CSS, Tailwind CSS, and TypeScript
files. Its check mode reports drift without writing.
- `@primitree/hooks` reads generated token output in React applications.
- `@primitree/mcp` exposes loaded token graphs to MCP clients.
- `primitree`, `@primitree/core`, `@primitree/dtcg`, `@primitree/cli`,
`@primitree/hooks`, and `@primitree/mcp` share version `1.0.0-next.0`.

## Prerelease channel

Install this version through npm's `next` tag. The release workflow verifies
that `latest` does not point to the prerelease. Stable `1.0.0` will move the
package family to `latest` after prerelease testing and a separate review.

## Requirements

- Node.js 24 or newer
- React `^19.0.0` and SWR `^2.3.7` for `@primitree/hooks`

## Migration

The React package moved from `@figma-vars/hooks` to `@primitree/hooks`. The
legacy npm package ends at version 4.0.0.

Read the [migration guide](https://primitree.com/docs/hooks/migration) and the
[README](https://github.com/marklearst/primitree/blob/v1.0.0-next.0/README.md).
Loading