Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: terrazzoapp/terrazzo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @cobalt-ui/plugin-js@1.2.2
Choose a base ref
...
head repository: terrazzoapp/terrazzo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jul 14, 2023

  1. Update deps, tighten linting

    drwpow committed Jul 14, 2023
    Copy the full SHA
    3e1830c View commit details
  2. Improve Sass plugin docs

    drwpow committed Jul 14, 2023
    Copy the full SHA
    59d61ef View commit details
  3. Plugin README cleanup

    drwpow committed Jul 14, 2023
    Copy the full SHA
    c651d86 View commit details
  4. Fix minor type errors

    drwpow committed Jul 14, 2023
    Copy the full SHA
    d3ce86d View commit details
  5. Add Cloudflare analytics

    drwpow committed Jul 14, 2023
    Copy the full SHA
    413ca8b View commit details
  6. Add global color options (#47)

    * Add global color options
    
    * Update CI
    
    * Update tests
    drwpow authored Jul 14, 2023
    Copy the full SHA
    432029f View commit details
  7. [ci] release

    drwpow committed Jul 14, 2023
    Copy the full SHA
    6203548 View commit details
  8. Copy the full SHA
    dbd82fc View commit details
  9. [ci] release (#50)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Jul 14, 2023
    Copy the full SHA
    9773fe5 View commit details
  10. Add support for multiple schemas, YAML support (#51)

    * Add support for multiple schemas, YAML support
    
    * Update example deps
    
    * Remove undici dep
    
    * Require Node v18 or greater
    
    * Add URL test
    drwpow authored Jul 14, 2023
    Copy the full SHA
    e1e18c1 View commit details
  11. Don’t auto-bump deps (#53)

    drwpow authored Jul 14, 2023
    Copy the full SHA
    07a0294 View commit details
  12. Copy the full SHA
    d27ae0f View commit details
  13. @cobalt-ui/cli@1.3.0

    drwpow committed Jul 14, 2023
    Copy the full SHA
    476c0d9 View commit details

Commits on Jul 19, 2023

  1. Sass plugin docs addition

    drwpow committed Jul 19, 2023
    Copy the full SHA
    7827957 View commit details

Commits on Jul 26, 2023

  1. Add YAML to docs (#57)

    drwpow authored Jul 26, 2023
    Copy the full SHA
    5d7ac96 View commit details
  2. Update Getting Started (#58)

    drwpow authored Jul 26, 2023
    Copy the full SHA
    0799c10 View commit details

Commits on Jul 27, 2023

  1. Add gradient animation (#60)

    drwpow authored Jul 27, 2023
    Copy the full SHA
    b6b2806 View commit details

Commits on Jul 28, 2023

  1. Copy the full SHA
    949481f View commit details
  2. [ci] release (#62)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Jul 28, 2023
    Copy the full SHA
    803d23b View commit details
  3. Add co bundle command (#63)

    drwpow authored Jul 28, 2023
    Copy the full SHA
    f20f589 View commit details
  4. @cobalt-ui/cli@1.4.0

    drwpow committed Jul 28, 2023
    Copy the full SHA
    2030b06 View commit details
  5. Copy the full SHA
    7c9b016 View commit details
  6. Add attempt at JSON Schema, update Adobe example (#67)

    * Add JSON Schema
    
    * Update Adobe example
    drwpow authored Jul 28, 2023
    Copy the full SHA
    bf45d6f View commit details

Commits on Aug 6, 2023

  1. Copy the full SHA
    9a669e2 View commit details
  2. Improve mode examples

    drwpow committed Aug 6, 2023
    Copy the full SHA
    518f895 View commit details

Commits on Aug 10, 2023

  1. fix: broken links (#68)

    agnelnieves authored Aug 10, 2023
    Copy the full SHA
    1efad00 View commit details

Commits on Aug 15, 2023

  1. Add PR template (#70)

    drwpow authored Aug 15, 2023
    Copy the full SHA
    b2cae61 View commit details
  2. Fix pnpm run dev (#71)

    drwpow authored Aug 15, 2023
    Copy the full SHA
    fb7aa47 View commit details
  3. Copy the full SHA
    b3dd1c4 View commit details

Commits on Aug 17, 2023

  1. Copy the full SHA
    27365f3 View commit details
  2. [ci] release (#75)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 17, 2023
    Copy the full SHA
    63dba31 View commit details
  3. Copy the full SHA
    ebc9a01 View commit details
  4. Update deps (#78)

    * Update deps
    
    * Add util tests
    drwpow authored Aug 17, 2023
    Copy the full SHA
    0bd0e58 View commit details
  5. [ci] release (#77)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 17, 2023
    Copy the full SHA
    ff52fc4 View commit details

Commits on Aug 18, 2023

  1. Allow JS plugin to nest token output (#79)

    * wip: support nested js output
    
    * wip: fix js output
    
    * feat: optionally nest TS output as well
    
    * fix: add changeset
    mike-engel authored Aug 18, 2023
    Copy the full SHA
    2963b21 View commit details
  2. [ci] release (#80)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 18, 2023
    Copy the full SHA
    2c8adb3 View commit details

Commits on Aug 25, 2023

  1. Copy the full SHA
    3b96d87 View commit details
  2. [ci] release (#82)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 25, 2023
    Copy the full SHA
    22e54bf View commit details

Commits on Aug 27, 2023

  1. Fix typo in modes guide (#85)

    * Fix typo in modes guide
    
    * Clarify modeSelectors docs
    drwpow authored Aug 27, 2023
    Copy the full SHA
    00fd067 View commit details
  2. Add Windows tests (#86)

    * Add Windows tests
    
    * Fix build command in Windows
    
    * Normalize snapshot line endings
    drwpow authored Aug 27, 2023
    Copy the full SHA
    d83f825 View commit details
  3. [ci] release (#87)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 27, 2023
    Copy the full SHA
    54b451c View commit details
  4. Copy the full SHA
    29a05e1 View commit details

Commits on Aug 31, 2023

  1. Fix plugin-js object keys, sort tokens (#92)

    * Fix plugin-js object keys
    
    * Sort tokens alphabetically
    
    * Update examples
    drwpow authored Aug 31, 2023
    Copy the full SHA
    e859bef View commit details
  2. [ci] release (#93)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 31, 2023
    Copy the full SHA
    88879ea View commit details
  3. Update deps (#94)

    drwpow authored Aug 31, 2023
    Copy the full SHA
    01d1d31 View commit details
  4. [ci] release (#95)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 31, 2023
    Copy the full SHA
    82159f4 View commit details
  5. Copy the full SHA
    92884e6 View commit details
  6. [ci] release (#97)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Aug 31, 2023
    Copy the full SHA
    bcbfc8b View commit details

Commits on Sep 1, 2023

  1. Copy the full SHA
    adfe228 View commit details
  2. Copy the full SHA
    e660687 View commit details
Showing 3,128 changed files with 64,342 additions and 118,183 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
13 changes: 8 additions & 5 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": ["@changesets/changelog-github", {"repo": "drwpow/cobalt-ui"}],
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "terrazzoapp/terrazzo"
}
],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch"
"baseBranch": "main"
}
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Prettier format
4b07a803ce92376ba2dff577454cf619eb53ed5e
c15567f94a557cbfed32bb3bb51c7e7b98f75d49
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Changes

_What does this PR change? Link to any related issue(s)._

## How to Review

_How can a reviewer review your changes? What should be kept in mind for this review?_
56 changes: 45 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -6,25 +6,59 @@ on:
- main
pull_request:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v3
- run: pnpm i
version: 9.15.4
run_install: true
- run: pnpm run lint
test:
strategy:
matrix:
node-version: [20.x, 22.x, 23.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v4
with:
version: 9.15.4
run_install: true
- run: pnpm test
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v3
- run: pnpm i
- run: pnpm run build
version: 9.15.4
run_install: true
- run: pnpm test
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: pnpm/action-setup@v4
with:
version: 9.15.4
run_install: true
- run: pnpm -r build && pnpm -r test
17 changes: 8 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -9,22 +9,21 @@ jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
version: latest
- name: Setup Node
uses: actions/setup-node@v3
node-version: 22
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: 20
- run: pnpm i
version: 9.15.4
run_install: true
- run: pnpm run build
- uses: changesets/action@v1
with:
version: pnpm run version
publish: pnpm exec changeset publish
commit: '[ci] release'
title: '[ci] release'
commit: "[ci] release"
title: "[ci] release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
dist
node_modules
package-lock.json
.dccache
.pnpm-debug*
.env
.turbo
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.x
10 changes: 4 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/packages/utils/src/ansi.ts
/docs/tokens.json
want.json
want.js
want.d.ts
examples/*/tokens/*
*.css
*.ts
*.tsx
*.js
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
26 changes: 26 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"[css]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[astro]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
46 changes: 39 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -9,31 +9,63 @@ contributing here.

## Setup

This repo requires [pnpm]. Once installed, run:
This repo requires [pnpm](https://pnpm.io/). Once installed, run:

```
```sh
pnpm i
```

## Developing

To build TypeScript as you work, run:

```
```sh
pnpm run dev
```

This project uses [Biome](https://biomejs.dev/), a modern JS toolchain, for linting and formatting.

### `.ts` vs. `.js` + `.d.ts`

Some packages (such as `parser`) are written in raw `.js` and `.d.ts`. The reason is the types are written strictly for the benefit of the user, however, the runtime needs to handle invalid and unexpected input that TypeScript may think is impossible or unnecessary, and it usually gets confused. One way to solve this is typing almost everything as `unknown`, however, that’s essentially the same as just writing `.js` anyway. Another way to look at it is for these packages, `.d.ts` are what’s _expected_ from the user, but often reality won’t match that.

Packages that are wrtitten in `.ts` follow more expected TypeScript conventions.

## Testing

Tests are written in [Vitest](https://vitest.dev), a modern replacement for Jest. To run tests:

```
```sh
pnpm run build
pnpm test
```

## Opening a PR
⚠️ **Be sure to build first!** Many tests test the _actual_ built files, not the source `.ts` files.

## Opening a Pull Request

All PRs are welcome! But to save your time, here are some common PRs received and the best course of action to take:

_**Tip**: check out the [good first issue](https://github.com/terrazzoapp/terrazzo/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and [help wanted](https://github.com/terrazzoapp/terrazzo/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) tags for open issues that need a PR!_

### 🐛 Bugfixes

1. **Open the PR directly.** Always accepted, with or without an accompanying issue, as long as you also add tests. Thank you for fixing it!

### 📖 Documentation Changes

1. **Open an issue.** If this is a larger restructuring, or making huge content changes, we’re open to that! But it may need discussion first. However, if this is a **translation** (always accepted) or **fixing a typo** no issue is needed; just open the PR.
2. **Open the PR.** This will be accepted 🙂.

### ✨ New Feature

1. **Open an issue to discuss.** Before opening a PR, the feature may need some discussion, and a clarifying design! Opening an issue makes sure no work is wasted when it’s time for a PR.
2. **Open the PR.** With a clear goal for the PR, it’ll be easier to write and review, and will chip more quickly!

### 💥 Breaking Change

All PRs are welcome! When opening a PR, be sure to complete the checklist within the template to make it easier on me 🙂.
1. **Open an issue to discuss.** Sure, we never plan _directly_ on breaking the API, but usually it’s part of a larger desired change. Let’s discuss it **in an issue** before opening a PR!
2. **Open a NON-BREAKING PR against `main`** Usually we can do some halfway workaround that somewhat solves the problem without breaking the existing API. But afterward, …
3. **Open a BREAKING PR in the future when pinged**. Cobalt doesn’t have a defined release cycle yet, but at certain times, there will be a branch that contains breaking changes for a future major release. The core maintainers will coordinate with you on how to get the breaking changes in, if they’re accepted.

[pnpm]: https://pnpm.io/
For all PRs, **adding tests** are required, as is **filling out the description template** and adding a 🦋 **Changeset** if a new version needs to be released (Changeset instructions automatically appear as a PR comment).
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Cobalt
# ⛋ Terrazzo Monorepo

Design token tooling compatible with the [W3C Design Tokens specification](https://design-tokens.github.io/community-group/format/). Cobalt can:
This repo serves as the home for:

- Parse and validate any valid `tokens.json` file
- Generate Sass, CSS, TypeScript, and more from `tokens.json`
- Keep `tokens.json` in sync from one or multiple Figma files
- Provide a common interface for you to write your own plugins and code generators for your design tokens
- [Terrazzo CLI](https://terrazzo.app/docs/cli): generate code from [DTCG tokens](https://tr.designtokens.org/format/) (formerly known as “Cobalt UI”)
- [CSS](https://terrazzo.app/docs/cli/integrations/css)
- [Sass](https://terrazzo.app/docs/cli/integrations/sass)
- [JS/TS](https://terrazzo.app/docs/cli/integrations/js)
- [Swift](https://terrazzo.app/docs/cli/integrations/swift)
- [Tailwind](https://terrazzo.app/docs/cli/integrations/tailwind)
- [Terrazzo Color Picker](https://terrazzo.app/docs/components/color-picker), a futuristic colorpicker that can handle wide gamut and high bit-depth colors in stunning color reproduction
- [Terrazzo Tiles DS](./packages/tiles/): a design system for _documenting_ design systems
- Token Lab (coming soon): generate design systems from scratch, or start from an existing OSS design system

**[👉 Read Documentation](https://cobalt-ui.pages.dev)**
### 🔹 Cobalt UI

Cobalt UI 2.0 was renamed to Terrazzo (same project, same people). To see the code for Cobalt 1.0, see the [1.x branch](https://github.com/terrazzoapp/terrazzo/tree/1.x).
62 changes: 62 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["**/dist/**", "**/package.json", "*.css.d.ts"]
},
"formatter": {
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 120
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "single"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"useArrowFunction": "off"
},
"correctness": {
"useImportExtensions": "error",
"useExhaustiveDependencies": "off"
},
"style": {
"noNonNullAssertion": "off",
"noUselessElse": "off",
"useBlockStatements": "error"
},
"performance": {
"noDelete": "off"
},
"suspicious": {
"noConsoleLog": "error",
"noFallthroughSwitchClause": "error",
"noExplicitAny": "warn",
"noShadowRestrictedNames": "error"
},
"nursery": {
"useGuardForIn": "error"
}
}
},
"overrides": [
{
"include": ["**/*.test.*"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}
1 change: 0 additions & 1 deletion docs/.env.example

This file was deleted.

5 changes: 0 additions & 5 deletions docs/astro.config.js

This file was deleted.

Loading