Skip to content

Commit f7cea41

Browse files
committed
chore: adopt the rubric package conventions
1 parent 779c7c9 commit f7cea41

40 files changed

Lines changed: 5712 additions & 5709 deletions

‎.github/workflows/publish.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
id-token: write
12+
13+
jobs:
14+
release:
15+
uses: rubriclab/package/.github/workflows/release-package.yml@main
16+
secrets: inherit

‎.github/workflows/release.yml‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎.release-please-manifest.json‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [2026-07-15] [chore: adopt the rubric package conventions](https://github.com/RubricLab/tokenmaxx/commit/465dfeb5879bd4bbdf6e7e455e13c81b2f5d3715)
2+
# Changelog
3+

‎assets/assets.config.ts‎

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,83 +4,83 @@
44
// backdrop). Edit this list — never the images — and re-run `bun run
55
// assets:screens`.
66

7-
export type ThemeName = "dark" | "light";
8-
export const THEMES: readonly ThemeName[] = ["dark", "light"];
7+
export type ThemeName = 'dark' | 'light'
8+
export const THEMES: readonly ThemeName[] = ['dark', 'light']
99

1010
// Rendering constants shared by every frame. JetBrainsMono Nerd Font is required
1111
// (brew install --cask font-jetbrains-mono-nerd-font) — it carries the braille,
1212
// block, and symbol glyphs the TUI draws. LetterSpacing 0 keeps text tight.
13-
export const FONT = "JetBrainsMono Nerd Font";
14-
export const FONT_SIZE = 15;
15-
export const WIDTH = 1200;
13+
export const FONT = 'JetBrainsMono Nerd Font'
14+
export const FONT_SIZE = 15
15+
export const WIDTH = 1200
1616

1717
// The desktop the framed window sits on: near-black for dark, soft grey for
1818
// light, so the window edge always reads.
1919
export const MARGIN_FILL: Record<ThemeName, string> = {
20-
dark: "#0b0d10",
21-
light: "#e6ebf2",
22-
};
20+
dark: '#0b0d10',
21+
light: '#e6ebf2'
22+
}
2323

2424
// Pins the header clock. FIXTURE_NOW (see src/tui/fixtures.ts) reads as a clean
2525
// 9:42 AM in Pacific, so every frame shows the same time.
26-
export const FIXTURE_TZ = "America/Los_Angeles";
26+
export const FIXTURE_TZ = 'America/Los_Angeles'
2727

2828
export interface Shot {
29-
// Output basename: generated/<name>-<theme>.png
30-
name: string;
31-
// Fixture scenario from src/tui/fixtures.ts.
32-
scenario: string;
33-
// Canvas height in pixels (width is fixed). Tune per view so the content fills
34-
// the frame without a tall empty gap.
35-
height: number;
36-
// Keys sent after first paint to reach a view (e.g. ["Right"] → Analytics,
37-
// ["Space"] → expand the selected account). Each key waits for a repaint.
38-
keys?: string[];
39-
// false shows the "native routing is off" banner (onboarding).
40-
installed?: boolean;
41-
// One-line caption for the docs manifest; not rendered into the frame.
42-
caption: string;
29+
// Output basename: generated/<name>-<theme>.png
30+
name: string
31+
// Fixture scenario from src/tui/fixtures.ts.
32+
scenario: string
33+
// Canvas height in pixels (width is fixed). Tune per view so the content fills
34+
// the frame without a tall empty gap.
35+
height: number
36+
// Keys sent after first paint to reach a view (e.g. ["Right"] → Analytics,
37+
// ["Space"] → expand the selected account). Each key waits for a repaint.
38+
keys?: string[]
39+
// false shows the "native routing is off" banner (onboarding).
40+
installed?: boolean
41+
// One-line caption for the docs manifest; not rendered into the frame.
42+
caption: string
4343
}
4444

4545
export const SHOTS: readonly Shot[] = [
46-
{
47-
name: "accounts",
48-
scenario: "cruising",
49-
height: 560,
50-
caption: "Every account and its live rate-limit windows, at a glance.",
51-
},
52-
{
53-
name: "hot",
54-
scenario: "oneHot",
55-
height: 560,
56-
caption: "The active Codex account is nearly out — auto-rotate is about to fire.",
57-
},
58-
{
59-
name: "expanded",
60-
scenario: "cruising",
61-
height: 720,
62-
keys: ["Space"],
63-
caption: "Press space: plan tier, per-window reset countdowns, account id.",
64-
},
65-
{
66-
name: "analytics",
67-
scenario: "cruising",
68-
height: 720,
69-
keys: ["Tab"],
70-
caption: "Combined token throughput across all accounts and both providers.",
71-
},
72-
{
73-
name: "analytics-week",
74-
scenario: "oneHot",
75-
height: 720,
76-
keys: ["Tab", "Right"],
77-
caption: "Total tokens and ≈ API value over the timeframe.",
78-
},
79-
{
80-
name: "onboarding",
81-
scenario: "onboarding",
82-
height: 470,
83-
installed: false,
84-
caption: "A fresh install: sign in, then route native codex & claude.",
85-
},
86-
];
46+
{
47+
caption: 'Every account and its live rate-limit windows, at a glance.',
48+
height: 560,
49+
name: 'accounts',
50+
scenario: 'cruising'
51+
},
52+
{
53+
caption: 'The active Codex account is nearly out — auto-rotate is about to fire.',
54+
height: 560,
55+
name: 'hot',
56+
scenario: 'oneHot'
57+
},
58+
{
59+
caption: 'Press space: plan tier, per-window reset countdowns, account id.',
60+
height: 720,
61+
keys: ['Space'],
62+
name: 'expanded',
63+
scenario: 'cruising'
64+
},
65+
{
66+
caption: 'Combined token throughput across all accounts and both providers.',
67+
height: 720,
68+
keys: ['Tab'],
69+
name: 'analytics',
70+
scenario: 'cruising'
71+
},
72+
{
73+
caption: 'Total tokens and ≈ API value over the timeframe.',
74+
height: 720,
75+
keys: ['Tab', 'Right'],
76+
name: 'analytics-week',
77+
scenario: 'oneHot'
78+
},
79+
{
80+
caption: 'A fresh install: sign in, then route native codex & claude.',
81+
height: 470,
82+
installed: false,
83+
name: 'onboarding',
84+
scenario: 'onboarding'
85+
}
86+
]

‎assets/flagship.ts‎

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6,84 +6,84 @@
66
//
77
// bun run assets/flagship.ts
88

9-
import { spawnSync } from "node:child_process";
10-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
11-
import { join } from "node:path";
12-
import { FIXTURE_NOW } from "../src/tui/fixtures.ts";
13-
import { FONT, FONT_SIZE, MARGIN_FILL, THEMES, type ThemeName } from "./assets.config.ts";
9+
import { spawnSync } from 'node:child_process'
10+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs'
11+
import { join } from 'node:path'
12+
import { FIXTURE_NOW } from '../src/tui/fixtures.ts'
13+
import { FONT, FONT_SIZE, MARGIN_FILL, THEMES, type ThemeName } from './assets.config.ts'
1414

15-
const assetsDir = import.meta.dir;
16-
const outDir = join(assetsDir, "generated");
17-
const tapeDir = join(assetsDir, "tapes");
18-
const tmpDir = join(assetsDir, ".tmp");
15+
const assetsDir = import.meta.dir
16+
const outDir = join(assetsDir, 'generated')
17+
const tapeDir = join(assetsDir, 'tapes')
18+
const tmpDir = join(assetsDir, '.tmp')
1919
for (const dir of [outDir, tapeDir, tmpDir]) {
20-
mkdirSync(dir, { recursive: true });
20+
mkdirSync(dir, { recursive: true })
2121
}
2222

23-
const vhs = existsSync("/opt/homebrew/bin/vhs") ? "/opt/homebrew/bin/vhs" : "vhs";
24-
const buildScript = join(assetsDir, "flagship", "build.sh");
23+
const vhs = existsSync('/opt/homebrew/bin/vhs') ? '/opt/homebrew/bin/vhs' : 'vhs'
24+
const buildScript = join(assetsDir, 'flagship', 'build.sh')
2525

2626
// The whole terminal background must match the tokenmaxx theme, otherwise the mock
2727
// panes (which don't paint their own background) show VHS's default and their
2828
// theme-coloured text vanishes. Single-pane shots don't need this — tokenmaxx fills
2929
// the frame — but the flagship's mock panes do.
30-
const TERM_BG: Record<ThemeName, string> = { dark: "#0b0d10", light: "#fbfcfe" };
31-
const TERM_FG: Record<ThemeName, string> = { dark: "#e6e6e6", light: "#1c2430" };
30+
const TERM_BG: Record<ThemeName, string> = { dark: '#0b0d10', light: '#fbfcfe' }
31+
const TERM_FG: Record<ThemeName, string> = { dark: '#e6e6e6', light: '#1c2430' }
3232

3333
function tape(theme: ThemeName, png: string, gif: string): string {
34-
return [
35-
`Output "${gif}"`,
36-
`Set Theme '{ "background": "${TERM_BG[theme]}", "foreground": "${TERM_FG[theme]}" }'`,
37-
`Set FontFamily "${FONT}"`,
38-
`Set FontSize ${FONT_SIZE - 1}`,
39-
"Set LetterSpacing 0",
40-
"Set Width 1560",
41-
"Set Height 860",
42-
"Set Padding 22",
43-
"Set Margin 46",
44-
`Set MarginFill "${MARGIN_FILL[theme]}"`,
45-
"Set WindowBar Colorful",
46-
"Set WindowBarSize 40",
47-
"Set BorderRadius 12",
48-
"Set TypingSpeed 1ms",
49-
`Env TOKENMAXX_NOW "${FIXTURE_NOW}"`,
50-
`Type "THEME=${theme} bash ${buildScript}"`,
51-
"Enter",
52-
"Sleep 9s",
53-
`Screenshot "${png}"`,
54-
"",
55-
].join("\n");
34+
return [
35+
`Output "${gif}"`,
36+
`Set Theme '{ "background": "${TERM_BG[theme]}", "foreground": "${TERM_FG[theme]}" }'`,
37+
`Set FontFamily "${FONT}"`,
38+
`Set FontSize ${FONT_SIZE - 1}`,
39+
'Set LetterSpacing 0',
40+
'Set Width 1560',
41+
'Set Height 860',
42+
'Set Padding 22',
43+
'Set Margin 46',
44+
`Set MarginFill "${MARGIN_FILL[theme]}"`,
45+
'Set WindowBar Colorful',
46+
'Set WindowBarSize 40',
47+
'Set BorderRadius 12',
48+
'Set TypingSpeed 1ms',
49+
`Env TOKENMAXX_NOW "${FIXTURE_NOW}"`,
50+
`Type "THEME=${theme} bash ${buildScript}"`,
51+
'Enter',
52+
'Sleep 9s',
53+
`Screenshot "${png}"`,
54+
''
55+
].join('\n')
5656
}
5757

58-
let ok = 0;
59-
const failed: string[] = [];
58+
let ok = 0
59+
const failed: string[] = []
6060
for (const theme of THEMES) {
61-
const base = `flagship-${theme}`;
62-
const png = join(outDir, `${base}.png`);
63-
const gif = join(tmpDir, `${base}.gif`);
64-
const tapePath = join(tapeDir, `${base}.tape`);
65-
writeFileSync(tapePath, tape(theme, png, gif));
66-
spawnSync("rm", ["-f", png]);
67-
let landed = false;
68-
for (let attempt = 1; attempt <= 4 && !landed; attempt += 1) {
69-
spawnSync(vhs, [tapePath], { stdio: "ignore" });
70-
// build.sh runs tmux inside VHS's own shell, but kill any stray session too.
71-
spawnSync("tmux", ["kill-session", "-t", "fs"], { stdio: "ignore" });
72-
landed = existsSync(png);
73-
if (!landed) {
74-
Bun.sleepSync(1500);
75-
}
76-
}
77-
if (landed) {
78-
ok += 1;
79-
console.log(` ok ${base}.png`);
80-
} else {
81-
failed.push(base);
82-
console.log(` FAIL ${base}.png`);
83-
}
61+
const base = `flagship-${theme}`
62+
const png = join(outDir, `${base}.png`)
63+
const gif = join(tmpDir, `${base}.gif`)
64+
const tapePath = join(tapeDir, `${base}.tape`)
65+
writeFileSync(tapePath, tape(theme, png, gif))
66+
spawnSync('rm', ['-f', png])
67+
let landed = false
68+
for (let attempt = 1; attempt <= 4 && !landed; attempt += 1) {
69+
spawnSync(vhs, [tapePath], { stdio: 'ignore' })
70+
// build.sh runs tmux inside VHS's own shell, but kill any stray session too.
71+
spawnSync('tmux', ['kill-session', '-t', 'fs'], { stdio: 'ignore' })
72+
landed = existsSync(png)
73+
if (!landed) {
74+
Bun.sleepSync(1500)
75+
}
76+
}
77+
if (landed) {
78+
ok += 1
79+
console.log(` ok ${base}.png`)
80+
} else {
81+
failed.push(base)
82+
console.log(` FAIL ${base}.png`)
83+
}
8484
}
8585

8686
console.log(
87-
`\n${ok} rendered, ${failed.length} failed${failed.length ? `: ${failed.join(", ")}` : ""}`,
88-
);
89-
process.exitCode = failed.length > 0 ? 1 : 0;
87+
`\n${ok} rendered, ${failed.length} failed${failed.length ? `: ${failed.join(', ')}` : ''}`
88+
)
89+
process.exitCode = failed.length > 0 ? 1 : 0

0 commit comments

Comments
 (0)