open-index/open-npm huggingface dataset:
npm package: @prismforge/token-build
Description: Deterministic token artifact builders for PrismForge.
Latest version: 0.1.1

# Token Build

`buildArtifacts` generates deterministic outputs for:

- `css` (`tokens.css`)
- `js` (`tokens.js`)
- `android` (`tokens.xml`)
- `ios` (`Tokens.swift`)

Example:

```js
import { buildArtifacts } from "@prismforge/token-build";

const result = buildArtifacts({
  brand: "acme",
  mode: "light",
  target: "all",
  outDir: "./artifacts/acme-light"
});
```
npm package: @prismforge/token-cli
Description: CLI for validating, building, and exporting PrismForge tokens.
Latest version: 0.8.0

# PrismForge CLI

Commands:

- `prismforge init [--mode <standalone|embedded>] [--layout <workspace|app-first>] [--embedded-path <path>] [--tokens-path <path>] [--studio-name <name>] [--dir <path>] [--provider <github|gitlab|bitbucket|generic>] [--repository <id-or-url>] [--base-branch <name>] [--targets <css,js,android,ios|all>] [--studio <true|false>] [--package-manager <pnpm|npm>] [--prompt] [--yes] [--install]`
- `prismforge brand add --brand <id> [--modes <light,dark>] [--from <brand>] [--tokens-root <path>] [--force]`
- `prismforge validate`
- `prismforge build --brand <id> --mode <id> --target <css|js|android|ios|all>`
- `prismforge diff --from <snapshot> --to <snapshot>`
- `prismforge release --channel <stable|next|alpha|beta|rc|canary|custom> [--dist-tag <tag>]`
- `prismforge figma export --brand <id> --mode <id>`

## Scaffold a self-hosted Token Studio

Interactive wizard:

```bash
npx @prismforge/token-cli init
```

Non-interactive:

```bash
npx @prismforge/token-cli init \
  --dir prismforge-studio \
  --studio-name "Acme Token Studio" \
  --provider github \
  --repository your-org/your-token-repo \
  --base-branch main \
  --targets css,js,ios \
  --studio true
```

Notes:

- If run inside an existing git repo, `init` auto-detects provider/repository from `origin`.
- `--repository` is optional. Leave it empty for new workspaces and set it later in `.env.local`.
- Package manager is auto-detected (`npm` or `pnpm`) and can be forced with `--package-manager`.
- `--studio-name` customizes the Token Studio header/title (default: `PrismForge Token Studio`).

## Embedded mode (inside existing repo)

```bash
npx @prismforge/token-cli init \
  --mode embedded \
  --layout app-first \
  --embedded-path tools/prismforge \
  --tokens-path design-tokens \
  --package-manager npm
```

This keeps PrismForge inside your current project and adds helper scripts to your root `package.json`:

- `prismforge:install`
- `prismforge:dev`
- `prismforge:build`
- `prismforge:test`

Layout notes:

- `app-first` (default for embedded): token source lives at project root (`design-tokens/` by default).
- `--tokens-path` lets you move token source anywhere in your host repo (for example `tokens/design`).
- `workspace`: token source stays in `tools/prismforge/packages/token-source`.

Then run:

```bash
# from host project root
npm run prismforge:install
# copy tools/prismforge/apps/token-studio/.env.example to .env.local (inside tools/prismforge/apps/token-studio)
npm run prismforge:dev
```

## Tokens-only scaffold (no Studio UI)

```bash
npx @prismforge/token-cli init \
  --dir prismforge-tokens \
  --targets ios \
  --studio false
```

## Add your own brand

```bash
npx @prismforge/token-cli brand add \
  --brand acme-enterprise \
  --modes light,dark \
  --from acme
```

This creates semantic/component files for your brand in the detected token source root (`design-tokens/src/tokens` or `packages/token-source/src/tokens`).
npm package: @prismforge/token-mappings
Description: Component token mapping contracts for PrismForge.
Latest version: 0.1.1

# Token Mapping Contract

Each mapping record defines how a component state/slot/property consumes a token:

- `component`: UI component name (for example `button`).
- `variant`: variant key (for example `primary`).
- `slot`: element slot (for example `root`, `label`).
- `state`: interaction state (`default`, `hover`, `active`, `disabled`, `focus`).
- `platformProperty`: concrete styling property (`background-color`, `color`, `box-shadow`).
- `tokenRef`: preferred component token id.
- `fallbackRef`: semantic fallback token id.

Validation rules:

- all required fields must exist.
- every `tokenRef` must resolve in current token set.
- required states must be present per `component + variant` group.
npm package: @prismforge/token-schema
Description: Schema, types, and validation utilities for PrismForge tokens.
Latest version: 0.1.1

# Token Schema and Validation

This package provides:

- token JSON schema files
- runtime validation (`validateTokens`)
- alias resolution with cycle/unresolved checks (`resolveAliases`)

Validation enforces:

- required metadata fields
- naming convention `namespace.category.intent.variant.state`
- token type/value compatibility
- semver `since` field