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
2 changes: 2 additions & 0 deletions .changeset/wet-days-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v4 # installs node/pnpm/biome from mise.toml
- uses: jdx/mise-action@v4
- run: pnpm install --frozen-lockfile
- run: mise run lint # biome check (whole repo)
- run: mise run //...:typecheck # tsc --noEmit in every package
- run: mise run //...:test # node --test in every package
- run: mise run //...:build # tsc -> dist in every package
- run: mise //:check
- run: mise //:verify
- run: mise //...:build

changeset:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # `changeset status` diffs the PR against origin/main
- uses: jdx/mise-action@v4 # provides the `changeset` binary (a mise tool)
fetch-depth: 0
- uses: jdx/mise-action@v4
# Fails if a *publishable* package changed without a changeset.
# If the change needs no release (tests, docs, refactor), record that with:
# changeset add --empty
Expand Down
22 changes: 22 additions & 0 deletions hk.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
amends "package://github.com/jdx/hk/releases/download/v1.48.0/hk@1.48.0#/Config.pkl"

hooks {
["pre-commit"] {
fix = true
stash = true
steps {
["check"] {
glob = List("**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.css", "**/*.json")
check = "mise //:check {{ files }}"
fix = "mise //:check --write {{ files }}"
}
}
}
["pre-push"] {
steps {
["verify"] {
check = "mise //:verify"
}
}
}
}
30 changes: 13 additions & 17 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,22 @@ config_roots = ["packages/*"]

[tools]
biome = "2"
hk = "1"
node = "24"
"npm:@changesets/cli" = "2"
pnpm = "11"

[tasks.format]
description = "Format the repository with Biome"
run = "biome format --write ."
[hooks]
postinstall = "hk install"

[tasks.lint]
description = "Lint the repository with Biome"
run = "biome check ."
[tasks.check]
description = "Lint and format with Biome"
usage = '''
flag "--write" help="Apply safe fixes and formatting in place"
arg "<paths>" var=#true default="." help="Files or directories to check (defaults to the whole repo)"
'''
run = "biome check ${usage_write:+--write} --no-errors-on-unmatched $usage_paths"

[tasks.changeset]
description = "Record a changeset describing pending changes (interactive)"
run = "changeset"

[tasks.version]
description = "Apply pending changesets: bump versions + write changelogs"
run = "changeset version"

[tasks.publish]
description = "Build (via prepack) and publish changed packages to the registry"
run = "changeset publish"
[tasks.verify]
description = "Typecheck and test every package"
depends = ["//...:typecheck", "//...:test"]
18 changes: 9 additions & 9 deletions packages/std/src/cn.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { cn } from "./cn.ts";
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { cn } from './cn.ts';

test("joins class names", () => {
assert.equal(cn("a", "b"), "a b");
test('joins class names', () => {
assert.equal(cn('a', 'b'), 'a b');
});

test("resolves conflicting tailwind utilities, last wins", () => {
assert.equal(cn("px-2", "px-4"), "px-4");
test('resolves conflicting tailwind utilities, last wins', () => {
assert.equal(cn('px-2', 'px-4'), 'px-4');
});

test("drops falsy values and supports conditionals", () => {
assert.equal(cn("a", false, null, undefined, "c"), "a c");
test('drops falsy values and supports conditionals', () => {
assert.equal(cn('a', false, null, undefined, 'c'), 'a c');
});
4 changes: 2 additions & 2 deletions packages/std/src/cn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';

/**
* Combine class names with clsx semantics, then resolve conflicting Tailwind
Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type { ClassValue } from "clsx";
export { cn } from "./cn.js";
export type { ClassValue } from 'clsx';
export { cn } from './cn.js';