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: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,19 @@ npx @google/design.md diff DESIGN.md DESIGN-v2.md

Exit code `1` if regressions are detected (more errors or warnings in the "after" file).

### `tailwind`
### `export`

Generate a Tailwind CSS `theme.extend` configuration from a DESIGN.md file.
Export DESIGN.md tokens to other formats (tailwind, dtcg).

```bash
npx @google/design.md tailwind DESIGN.md > tailwind.theme.json
npx @google/design.md export --format tailwind DESIGN.md > tailwind.theme.json
npx @google/design.md export --format dtcg DESIGN.md > tokens.json
```

| Option | Type | Default | Description |
|:-------|:-----|:--------|:------------|
| `file` | positional | required | Path to DESIGN.md |

Outputs a JSON object with `theme.extend` containing `colors`, `fontFamily`, `fontSize`, `borderRadius`, and `spacing` mapped from the design tokens.
| `file` | positional | required | Path to DESIGN.md (or `-` for stdin) |
| `--format` | `tailwind` \| `dtcg` | required | Output format |

### `spec`

Expand Down
2 changes: 2 additions & 0 deletions packages/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
LICENSE
README.md
smoke-test/
*.tgz
58 changes: 28 additions & 30 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
{
"name": "@google/design.md",
"version": "0.1.0",
"description": "A design.md CLI tool by Google Stitch.",
"version": "0.1.1",
"description": "Bridging design systems and code: a linter and exporter for the DESIGN.md format",
"keywords": [
"design.md"
],
"repository": {
"type": "git",
"url": "git+https://github.com/google-labs-code/design.md.git",
"directory": "packages/cli"
"url": "git+https://github.com/google-labs-code/design.md.git"
},
"bugs": {
"url": "https://github.com/google-labs-code/design.md/issues"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"README.md",
"LICENSE"
"dist"
],
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"private": false,
"type": "module",
"engines": {
"node": ">=22.0.0"
},
"bin": {
"design.md": "./dist/index.js",
"designmd": "./dist/index.js"
"design.md": "./dist/index.js"
},
"exports": {
".": {
Expand All @@ -40,34 +30,42 @@
"./linter": {
"import": "./dist/linter/index.js",
"types": "./dist/linter/index.d.ts"
},
"./package.json": "./package.json"
}
},
"publishConfig": {
"registry": "https://wombat-dressing-room.appspot.com",
"access": "public"
},
"scripts": {
"prepublishOnly": "bun run build",
"build": "bun build src/index.ts src/linter/index.ts --outdir dist --target node && npx tsc --project tsconfig.build.json --emitDeclarationOnly --skipLibCheck && cp src/linter/spec-config.yaml dist/linter/ && cp src/linter/spec-config.yaml dist/ && cp ../../docs/spec.md dist/linter/ && cp ../../docs/spec.md dist/ && cp ../../README.md . && cp ../../LICENSE .",
"build": "bun build src/index.ts src/linter/index.ts --outdir dist --target node && npx tsc --project tsconfig.build.json --emitDeclarationOnly --skipLibCheck && cp src/linter/spec-config.yaml dist/linter/ && cp src/linter/spec-config.yaml dist/ && cp ../../docs/spec.md dist/linter/",
"dev": "bun run src/index.ts",
"test": "bun test",
"spec:gen": "bun run src/linter/spec-gen/generate.ts",
"check-package": "bun run scripts/check-package.ts"
},
"dependencies": {
"zod": "^3.24.0"
},
"devDependencies": {
"@types/bun": "latest",
"@types/mdast": "^4.0.4",
"@types/node": "^20.11.24",
"bun-types": "^1.3.12",
"@json-render/core": "^0.16.0",
"@json-render/ink": "^0.16.0",
"citty": "^0.1.6",
"ink": "^7.0.0",
"mdast": "^3.0.0",
"react": "^19.2.5",
"remark-frontmatter": "^5.0.0",
"remark-mdx": "^3.1.1",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"tailwindcss": "3",
"typescript": "^5.7.3",
"unified": "^11.0.5",
"unist-util-visit": "^5.1.0",
"yaml": "^2.7.1"
"yaml": "^2.7.1",
"zod": "^3.24.0"
},
"devDependencies": {
"@types/bun": "latest",
"@types/mdast": "^4.0.4",
"@types/node": "^20.11.24",
"@types/react": "^19.2.14",
"bun-types": "^1.3.12",
"tailwindcss": "3",
"typescript": "^5.7.3"
}
}
2 changes: 1 addition & 1 deletion packages/cli/src/linter/spec-gen/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { compileMdx } from './compiler.js';
import { SPEC_CONFIG } from '../spec-config.js';
import * as renderers from './renderers.js';

const ROOT = resolve(import.meta.dir, '../../../../');
const ROOT = resolve(import.meta.dir, '../../../../../');
const MDX_PATH = resolve(import.meta.dir, 'spec.mdx');
const OUTPUT_PATH = resolve(ROOT, 'docs/spec.md');

Expand Down
Loading