From 23991932e16941bfba16faeee2d4abc54dbcd940 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Thu, 23 Apr 2026 16:49:49 +0900 Subject: [PATCH] fix(workspace): restore bun/turbo contract and remove ink dep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit addresses several workspace reliability issues to restore the root build, test, and lint contract. - Sets the root to in , which is required by Turborepo to correctly orchestrate workspace tasks. - Removes the unused , , and dependencies from , which resolves the warning during bun install v1.2.10 (db2e7d7f) Checked 180 installs across 183 packages (no changes) [133.00ms]. - Updates to remove stale JSX-related configuration ( and includes) that was left over after CLI rendering was simplified. - Adds a dedicated script to to ensure type checking is performed as part of the linting process. - Updates the CI workflow to use the root • Packages in scope: @google/design.md • Running build in 1 packages • Remote caching disabled, using shared worktree cache @google/design.md:build: cache miss, executing 73e2511429bb965a @google/design.md:build: $ bun build src/index.ts src/linter/index.ts --outdir dist --target node && bun x 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/ && cp ../../docs/spec.md dist/linter/ @google/design.md:build: Bundled 224 modules in 53ms @google/design.md:build: @google/design.md:build: index.js 0.77 MB (entry point) @google/design.md:build: linter/index.js 0.64 MB (entry point) @google/design.md:build: Tasks: 1 successful, 1 total Cached: 0 cached, 1 total Time: 3.027s , • Packages in scope: @google/design.md • Running test in 1 packages • Remote caching disabled, using shared worktree cache @google/design.md:build: cache hit, replaying logs 73e2511429bb965a @google/design.md:build: $ bun build src/index.ts src/linter/index.ts --outdir dist --target node && bun x 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/ && cp ../../docs/spec.md dist/linter/ @google/design.md:build: Bundled 224 modules in 53ms @google/design.md:build: @google/design.md:build: index.js 0.77 MB (entry point) @google/design.md:build: linter/index.js 0.64 MB (entry point) @google/design.md:build: @google/design.md:test: cache miss, executing ab11503af37b7447 @google/design.md:test: $ bun test @google/design.md:test: bun test v1.2.10 (db2e7d7f) @google/design.md:test: @google/design.md:test: src/version.test.ts: @google/design.md:test: (pass) VERSION > matches package.json version exactly [1.90ms] @google/design.md:test: (pass) VERSION > is a valid semver string [0.81ms] @google/design.md:test: (pass) VERSION > is not the fallback value [0.01ms] @google/design.md:test: @google/design.md:test: src/linter/spec-config.test.ts: @google/design.md:test: (pass) spec-config loader > throws when file does not exist [5.63ms] @google/design.md:test: (pass) spec-config loader > throws when YAML is malformed [2.37ms] @google/design.md:test: (pass) spec-config loader > throws when required fields are missing [3.95ms] @google/design.md:test: (pass) spec-config loader > throws when sections array is empty [2.41ms] @google/design.md:test: (pass) spec-config loader > does not write to stdout or stderr [7.46ms] @google/design.md:test: (pass) spec-config lazy loading > getSpecConfig returns a valid config object [0.65ms] @google/design.md:test: (pass) spec-config lazy loading > getSpecConfig returns the same cached instance on subsequent calls [0.02ms] @google/design.md:test: (pass) spec-config structural invariants > sections are non-empty @google/design.md:test: (pass) spec-config structural invariants > section canonical names are unique [0.05ms] @google/design.md:test: (pass) spec-config structural invariants > no alias collides with a canonical name [0.09ms] @google/design.md:test: (pass) spec-config structural invariants > aliases are unique across all sections [0.02ms] @google/design.md:test: (pass) spec-config structural invariants > typography property names are unique [0.08ms] @google/design.md:test: (pass) spec-config structural invariants > component sub-token names are unique @google/design.md:test: (pass) spec-config structural invariants > color roles are unique @google/design.md:test: (pass) spec-config structural invariants > units are non-empty and unique @google/design.md:test: (pass) spec-config structural invariants > recommended token categories are non-empty @google/design.md:test: (pass) spec-config structural invariants > examples covers colors, typography, and components [0.53ms] @google/design.md:test: (pass) spec-config derived constants > CANONICAL_ORDER length matches SECTIONS length [0.04ms] @google/design.md:test: (pass) spec-config derived constants > resolveAlias returns canonical for known alias @google/design.md:test: (pass) spec-config derived constants > resolveAlias returns input for unknown heading [0.12ms] @google/design.md:test: (pass) spec-config derived constants > VALID_TYPOGRAPHY_PROPS length matches TYPOGRAPHY_PROPERTIES @google/design.md:test: (pass) spec-config derived constants > VALID_COMPONENT_SUB_TOKENS length matches COMPONENT_SUB_TOKENS @google/design.md:test: (pass) spec-config derived constants > SECTION_ALIASES maps every alias to a canonical name [0.40ms] @google/design.md:test: @google/design.md:test: src/linter/index.test.ts: @google/design.md:test: (pass) Integration: full pipeline > processes a frontmatter DESIGN.md through the complete pipeline [28.48ms] @google/design.md:test: (pass) Integration: full pipeline > processes a code-block DESIGN.md with components [12.25ms] @google/design.md:test: (pass) Integration: full pipeline > correctly detects errors in a broken DESIGN.md [3.09ms] @google/design.md:test: @google/design.md:test: src/linter/fixture.test.ts: @google/design.md:test: (pass) Fixture Test > processes DESIGN-test.md [30.38ms] @google/design.md:test: @google/design.md:test: src/commands/spec.test.ts: @google/design.md:test: (pass) spec command > outputs spec markdown by default [0.63ms] @google/design.md:test: (pass) spec command > outputs spec and rules table when --rules is passed [0.32ms] @google/design.md:test: (pass) spec command > outputs only rules table when --rules-only is passed [0.06ms] @google/design.md:test: (pass) spec command > outputs JSON when --format json is passed [0.16ms] @google/design.md:test: (pass) spec command > outputs JSON with rules when --format json and --rules are passed [1.05ms] @google/design.md:test: (pass) spec command > outputs the spec from the built CLI bundle [3752.62ms] @google/design.md:test: @google/design.md:test: src/linter/dtcg/conformance.test.ts: @google/design.md:test: (pass) DTCG Conformance > Terrazzo can parse our DTCG output and generate CSS [11803.30ms] @google/design.md:test: @google/design.md:test: src/linter/dtcg/handler.test.ts: @google/design.md:test: (pass) DtcgEmitterHandler > empty state produces valid DTCG file with $schema [0.26ms] @google/design.md:test: (pass) DtcgEmitterHandler > name and description → top-level $description [0.04ms] @google/design.md:test: (pass) DtcgEmitterHandler > name without description → $description uses name [0.01ms] @google/design.md:test: (pass) DtcgEmitterHandler > colors → DTCG color tokens with sRGB components in 0–1 range [0.88ms] @google/design.md:test: (pass) DtcgEmitterHandler > spacing → DTCG dimension tokens with { value, unit } [0.21ms] @google/design.md:test: (pass) DtcgEmitterHandler > rounded → DTCG dimension tokens under "rounded" group [0.04ms] @google/design.md:test: (pass) DtcgEmitterHandler > typography → DTCG typography composite tokens [0.16ms] @google/design.md:test: (pass) DtcgEmitterHandler > typography with missing fields omits them from $value [0.04ms] @google/design.md:test: @google/design.md:test: src/linter/fixer/handler.test.ts: @google/design.md:test: (pass) FixerHandler > should reorder sections to canonical order [0.34ms] @google/design.md:test: (pass) FixerHandler > should preserve prelude at the top [0.10ms] @google/design.md:test: (pass) FixerHandler > should append unknown sections at the end [0.07ms] @google/design.md:test: (pass) FixerHandler > should recognize "Brand & Style" as a known section via alias [0.14ms] @google/design.md:test: (pass) FixerHandler > should recognize "Layout & Spacing" as a known section via alias [0.25ms] @google/design.md:test: (pass) FixerHandler > should handle a full real-world section order with aliases [1.72ms] @google/design.md:test: @google/design.md:test: src/linter/linter/runner.test.ts: @google/design.md:test: (pass) runLinter > runs default rules when none specified [0.31ms] @google/design.md:test: (pass) runLinter > runs only the specified subset of rules [0.13ms] @google/design.md:test: (pass) runLinter > returns empty findings for empty rules array [0.07ms] @google/design.md:test: (pass) preEvaluate > groups findings into fixes, improvements, and suggestions [0.12ms] @google/design.md:test: (pass) preEvaluate > accepts custom rules [0.17ms] @google/design.md:test: @google/design.md:test: src/linter/linter/handler.test.ts: @google/design.md:test: (pass) LinterHandler > E3: broken token reference > emits error when a component references a non-existent token [0.53ms] @google/design.md:test: (pass) LinterHandler > E4: circular reference > emits error when circular references are detected [0.24ms] @google/design.md:test: (pass) LinterHandler > W1: missing primary color > emits warning when no primary color is defined [0.18ms] @google/design.md:test: (pass) LinterHandler > W1: missing primary color > does NOT emit warning when primary color IS defined [0.12ms] @google/design.md:test: (pass) LinterHandler > W2: WCAG contrast failure > emits warning for low contrast backgroundColor/textColor pair [0.21ms] @google/design.md:test: (pass) LinterHandler > W2: WCAG contrast failure > does NOT emit warning for high contrast pair [0.52ms] @google/design.md:test: (pass) LinterHandler > I1: token count summary > emits an info diagnostic summarizing the token counts [0.37ms] @google/design.md:test: (pass) LinterHandler > clean document > produces zero errors for a valid design system [0.17ms] @google/design.md:test: (pass) LinterHandler > preEvaluate graded menu > groups findings into fixes, improvements, and suggestions [0.16ms] @google/design.md:test: (pass) LinterHandler > summary counts > correctly counts errors, warnings, and infos [0.09ms] @google/design.md:test: @google/design.md:test: src/linter/parser/handler.test.ts: @google/design.md:test: (pass) ParserHandler > frontmatter extraction > extracts YAML from frontmatter delimiters [2.32ms] @google/design.md:test: (pass) ParserHandler > code block extraction > extracts YAML from fenced yaml code blocks [1.05ms] @google/design.md:test: (pass) ParserHandler > code block extraction > extracts YAML code blocks with attributes [1.86ms] @google/design.md:test: (pass) ParserHandler > merging multiple code blocks > merges separate YAML blocks into one tree [0.82ms] @google/design.md:test: (pass) ParserHandler > duplicate section detection > returns DUPLICATE_SECTION when same top-level key appears in multiple blocks [0.72ms] @google/design.md:test: (pass) ParserHandler > malformed YAML > returns YAML_PARSE_ERROR on invalid YAML syntax [1.19ms] @google/design.md:test: (pass) ParserHandler > malformed YAML > returns NO_YAML_FOUND when no YAML content exists [0.97ms] @google/design.md:test: @google/design.md:test: src/linter/parser/spec.test.ts: @google/design.md:test: (pass) ParserInputSchema > rejects empty content [0.37ms] @google/design.md:test: (pass) ParserInputSchema > accepts non-empty content [0.09ms] @google/design.md:test: (pass) ParserInputSchema > rejects missing content field [0.11ms] @google/design.md:test: @google/design.md:test: src/linter/tailwind/handler.test.ts: @google/design.md:test: (pass) TailwindEmitterHandler > colors mapping > maps resolved colors to theme.extend.colors [0.18ms] @google/design.md:test: (pass) TailwindEmitterHandler > typography mapping > maps typography scales to fontFamily and fontSize [0.12ms] @google/design.md:test: (pass) TailwindEmitterHandler > dimensions mapping > maps rounded to borderRadius and spacing to spacing [0.07ms] @google/design.md:test: (pass) TailwindEmitterHandler > empty state > produces a valid config with empty extend sections [0.02ms] @google/design.md:test: @google/design.md:test: src/linter/model/handler.test.ts: @google/design.md:test: (pass) ModelHandler > symbol table from colors > resolves valid hex colors into the symbol table [0.11ms] @google/design.md:test: (pass) ModelHandler > symbol table from colors > emits diagnostic for invalid color format [0.03ms] @google/design.md:test: (pass) ModelHandler > symbol table from colors > normalizes #RGB shorthand to #RRGGBB [0.01ms] @google/design.md:test: (pass) ModelHandler > symbol table from colors > normalizes #RGBA shorthand to #RRGGBBAA and extracts alpha @google/design.md:test: (pass) ModelHandler > symbol table from colors > accepts 8-digit hex colors and extracts alpha @google/design.md:test: (pass) ModelHandler > single-level token reference resolution > resolves a direct {section.token} reference in components [0.02ms] @google/design.md:test: (pass) ModelHandler > chained token reference resolution > resolves chained refs: {a} → {b} → #value @google/design.md:test: (pass) ModelHandler > circular reference detection > detects circular refs and records them as unresolved [0.07ms] @google/design.md:test: (pass) ModelHandler > circular reference detection > detects long circular reference chains [0.05ms] @google/design.md:test: (pass) ModelHandler > non-standard dimension units > emits diagnostic for non-standard dimension units in typography [0.05ms] @google/design.md:test: (pass) ModelHandler > typography validation > emits diagnostic when fontFamily is a hex color [0.02ms] @google/design.md:test: (pass) ModelHandler > typography validation > emits diagnostic when fontWeight is not a number or valid number string [0.02ms] @google/design.md:test: (pass) ModelHandler > typography validation > accepts string representations of numbers for fontWeight [0.02ms] @google/design.md:test: (pass) ModelHandler > rounded validation > emits diagnostic for non-standard units in rounded [0.02ms] @google/design.md:test: (pass) ModelHandler > WCAG contrast ratio > computes correct contrast ratio for black on white (21:1) [0.03ms] @google/design.md:test: (pass) ModelHandler > WCAG contrast ratio > computes correct contrast for identical colors (1:1) [0.03ms] @google/design.md:test: (pass) ModelHandler > return signature > returns findings array @google/design.md:test: (pass) ModelHandler > rounded token reference resolution > resolves a direct token reference in rounded [0.02ms] @google/design.md:test: (pass) ModelHandler > rounded token reference resolution > resolves a chained token reference in rounded [0.03ms] @google/design.md:test: (pass) ModelHandler > rounded token reference resolution > resolved rounded reference appears in symbol table [0.02ms] @google/design.md:test: (pass) ModelHandler > spacing token reference resolution > resolves a direct token reference in spacing [0.04ms] @google/design.md:test: (pass) ModelHandler > spacing token reference resolution > resolves a chained token reference in spacing [0.02ms] @google/design.md:test: (pass) ModelHandler > spacing token reference resolution > resolved spacing reference appears in symbol table [0.03ms] @google/design.md:test: (pass) ModelHandler > spacing token reference resolution > resolved spacing reference propagates correctly to component resolution [0.06ms] @google/design.md:test: @google/design.md:test: src/linter/model/spec.test.ts: @google/design.md:test: (pass) isValidColor > accepts valid hex color: #ff0000 @google/design.md:test: (pass) isValidColor > accepts valid hex color: #FF0000 @google/design.md:test: (pass) isValidColor > accepts valid hex color: #abc @google/design.md:test: (pass) isValidColor > accepts valid hex color: #ABC @google/design.md:test: (pass) isValidColor > accepts valid hex color: #647D66 @google/design.md:test: (pass) isValidColor > accepts valid hex color: #000 @google/design.md:test: (pass) isValidColor > accepts valid hex color: #fff @google/design.md:test: (pass) isValidColor > rejects invalid color: red @google/design.md:test: (pass) isValidColor > rejects invalid color: blue @google/design.md:test: (pass) isValidColor > rejects invalid color: #gg0000 [0.03ms] @google/design.md:test: (pass) isValidColor > rejects invalid color: #12345 @google/design.md:test: (pass) isValidColor > rejects invalid color: 647D66 @google/design.md:test: (pass) isValidColor > rejects invalid color: #1234567 @google/design.md:test: (pass) isValidColor > rejects invalid color: @google/design.md:test: (pass) isValidColor > rejects invalid color: # @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 12px [0.53ms] @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 1.5rem [0.01ms] @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 0px @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 42px @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 0.75rem @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 100px @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: 12em @google/design.md:test: (pass) isStandardDimension > accepts standard dimension: -0.02em @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: 42 [0.02ms] @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: px @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: rem @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: 12vh @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: 12 px @google/design.md:test: (pass) isStandardDimension > rejects non-standard dimension: 12vw @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 12px [0.02ms] @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 1.5rem @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: -0.02em @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 100vh @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 50% @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 0.75rem @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 1em @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 12vw @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 10cqi @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 20lvh @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 30dvw @google/design.md:test: (pass) isParseableDimension > accepts parseable dimension: 5cqmin @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: 42 @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: px @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: rem @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: 12 px @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: auto @google/design.md:test: (pass) isParseableDimension > rejects unparseable dimension: inherit @google/design.md:test: (pass) parseDimensionParts > parses standard dimensions [0.02ms] @google/design.md:test: (pass) parseDimensionParts > parses leading-zero-free decimals (.5rem) @google/design.md:test: (pass) parseDimensionParts > returns null for bare numbers without a unit [0.13ms] @google/design.md:test: (pass) parseDimensionParts > returns null for CSS keywords [0.01ms] @google/design.md:test: (pass) isTokenReference > recognizes curly-brace token references @google/design.md:test: (pass) isTokenReference > rejects non-references [0.01ms] @google/design.md:test: @google/design.md:test: src/linter/spec-gen/compiler.test.ts: @google/design.md:test: (pass) compileMdx > passes plain markdown through unchanged [2.48ms] @google/design.md:test: (pass) compileMdx > evaluates inline expressions [3.47ms] @google/design.md:test: (pass) compileMdx > evaluates expressions with scope variables [3.42ms] @google/design.md:test: (pass) compileMdx > evaluates block expressions that produce multi-line content [4.65ms] @google/design.md:test: (pass) compileMdx > strips import statements from output [1.53ms] @google/design.md:test: (pass) compileMdx > preserves expressions inside fenced code blocks [2.16ms] @google/design.md:test: (pass) compileMdx > compiles the full spec.mdx with spec-config scope [23.55ms] @google/design.md:test: @google/design.md:test: src/linter/spec-gen/spec-helpers.test.ts: @google/design.md:test: (pass) getRulesTable > returns a markdown table with rule details [1.16ms] @google/design.md:test: (pass) getSpecContent > returns spec content with expected heading [0.40ms] @google/design.md:test: (pass) getSpecContent > returns consistent content on repeated calls [0.21ms] @google/design.md:test: (pass) getSpecContent > content has substantial length (not a stub) [0.10ms] @google/design.md:test: (pass) getSpecContent > accepts an explicit specPath override [0.06ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/contrast-ratio.test.ts: @google/design.md:test: (pass) contrastCheck > emits warning for low contrast pair [0.18ms] @google/design.md:test: (pass) contrastCheck > returns empty for high contrast pair [0.03ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/types.test.ts: @google/design.md:test: (pass) LintRule type > accepts a function that takes state and returns findings [0.42ms] @google/design.md:test: (pass) LintRule type > accepts a RuleDescriptor object [0.01ms] @google/design.md:test: (pass) LintRule type > has all rules in DEFAULT_RULE_DESCRIPTORS [0.03ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/missing-primary.test.ts: @google/design.md:test: (pass) missingPrimary > emits warning when colors exist but no primary [0.06ms] @google/design.md:test: (pass) missingPrimary > returns empty when primary IS defined [0.03ms] @google/design.md:test: (pass) missingPrimary > returns empty when no colors defined [0.06ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/missing-typography.test.ts: @google/design.md:test: (pass) missingTypography > emits warning when colors exist but no typography defined [0.13ms] @google/design.md:test: (pass) missingTypography > returns empty when typography IS defined [0.06ms] @google/design.md:test: (pass) missingTypography > returns empty when no colors defined (nothing to compare against) [0.02ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/missing-sections.test.ts: @google/design.md:test: (pass) missingSections > emits info when spacing is missing but colors exist [0.10ms] @google/design.md:test: (pass) missingSections > returns empty when all sections present [0.05ms] @google/design.md:test: (pass) missingSections > returns empty when no colors exist (nothing to compare against) [0.01ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/token-summary.test.ts: @google/design.md:test: (pass) tokenSummary > emits info diagnostic with token counts [0.11ms] @google/design.md:test: (pass) tokenSummary > returns empty for completely empty state [0.03ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/orphaned-tokens.test.ts: @google/design.md:test: (pass) orphanedTokens > emits warning for color not referenced by any component [0.12ms] @google/design.md:test: (pass) orphanedTokens > returns empty when no components exist [0.02ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/section-order.test.ts: @google/design.md:test: (pass) sectionOrder > should warn when sections are out of order [0.07ms] @google/design.md:test: (pass) sectionOrder > should not warn when sections are in order [0.02ms] @google/design.md:test: (pass) sectionOrder > should ignore unknown sections [0.02ms] @google/design.md:test: (pass) sectionOrder > should resolve "Brand & Style" as "Overview" [0.01ms] @google/design.md:test: (pass) sectionOrder > should resolve "Layout & Spacing" as "Layout" @google/design.md:test: (pass) sectionOrder > should resolve "Elevation" as "Elevation & Depth" [0.02ms] @google/design.md:test: (pass) sectionOrder > should detect out-of-order aliased sections [0.02ms] @google/design.md:test: (pass) sectionOrder > should handle mixed aliases and canonical names @google/design.md:test: (pass) resolveAlias > should resolve known aliases [0.04ms] @google/design.md:test: (pass) resolveAlias > should pass through canonical names unchanged @google/design.md:test: (pass) resolveAlias > should pass through unknown names unchanged [0.02ms] @google/design.md:test: @google/design.md:test: src/linter/linter/rules/broken-ref.test.ts: @google/design.md:test: (pass) brokenRef > emits error for unresolved token reference [0.36ms] @google/design.md:test: (pass) brokenRef > returns empty when all references resolve [0.01ms] @google/design.md:test: (pass) brokenRef > emits warning (not error) for unknown component sub-tokens @google/design.md:test: (pass) brokenRef > has a valid rule descriptor @google/design.md:test: @google/design.md:test: 204 pass @google/design.md:test: 0 fail @google/design.md:test: 428 expect() calls @google/design.md:test: Ran 204 tests across 26 files. [16.09s] Tasks: 2 successful, 2 total Cached: 1 cached, 2 total Time: 16.157s , and • Packages in scope: @google/design.md • Running lint in 1 packages • Remote caching disabled, using shared worktree cache @google/design.md:lint: cache miss, executing 52b9e4ae10fcfb6f @google/design.md:lint: $ bun x tsc --project tsconfig.json --noEmit --skipLibCheck Tasks: 1 successful, 1 total Cached: 0 cached, 1 total Time: 2.558s commands, ensuring the CI environment accurately reflects the local development contract. The Bun version is also now derived from the field. These changes collectively fix the broken CI build, eliminate dependency warnings, and ensure that the workspace is in a healthy, verifiable state. Refs #30 --- .agents/skills/quality-remediation/SKILL.md | 54 ++++ .github/workflows/test.yml | 18 +- README.md | 2 +- bun.lock | 30 ++- ...2026-04-23-workspace-reliability-design.md | 175 ++++++++++++ .../plans/2026-04-23-workspace-reliability.md | 253 ++++++++++++++++++ package.json | 1 + packages/cli/package.json | 8 +- packages/cli/src/commands/spec.test.ts | 29 ++ packages/cli/tsconfig.json | 5 +- 10 files changed, 544 insertions(+), 31 deletions(-) create mode 100644 .agents/skills/quality-remediation/SKILL.md create mode 100644 docs/plans/2026-04-23-workspace-reliability-design.md create mode 100644 docs/plans/2026-04-23-workspace-reliability.md diff --git a/.agents/skills/quality-remediation/SKILL.md b/.agents/skills/quality-remediation/SKILL.md new file mode 100644 index 0000000..b900ce4 --- /dev/null +++ b/.agents/skills/quality-remediation/SKILL.md @@ -0,0 +1,54 @@ +--- +name: quality-remediation +description: > + Use when workspace reliability defects appear as missing root packageManager + metadata, dead dependency peer warnings, fake lint coverage, or CI commands + that bypass the root workspace contract. +--- + +# Quality Remediation + +Fix reliability defects at the contract boundary instead of suppressing symptoms. + +## When to use this skill + +- Root workspace commands fail because package-manager metadata is missing. +- Install logs show peer warnings for libraries with no active imports. +- A package exposes a `lint` target but the workspace contract does not execute + a real static check. +- CI runs package-local commands that hide a broken root workspace path. +- Warning, lint, or security findings need removal by root cause. + +## Workflow + +1. Reproduce the failure or warning from the repo root. +2. Trace the contract boundary causing it: root manifest, package manifest, + compiler config, or workflow. +3. Confirm active imports before removing any dependency chain. +4. Remove dead config with the dead dependency, such as JSX settings after + `.tsx` sources disappear. +5. Make package lint commands execute a real static check. +6. Update CI to use the root workspace contract and derive tool versions from + canonical metadata. +7. Re-run install, lint, test, and build, then keep smoke paths that prove + packaged artifacts still work. + +## Quick checks + +- `bun run build` fails with missing `packageManager` -> add root + `packageManager` using the installed Bun version. +- `bun install` warns about Ink or React peers without imports -> remove the + unused dependency chain and refresh the lockfile. +- `bun run lint` is hollow -> add a package `lint` script that typechecks or + lints real sources. +- Workflow runs `cd packages/... && bun run build` while root build is broken + -> switch CI back to root `bun run` commands and keep smoke steps after + build. + +## Common mistakes + +- Pinning CI to `latest` instead of the root `packageManager` contract. +- Keeping dead dependencies because they were once planned for future + features. +- Leaving stale TS JSX config after the last `.tsx` file is gone. +- Treating warnings as acceptable background noise. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fca41f0..4bbd1c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,19 +25,22 @@ jobs: steps: - uses: actions/checkout@v4 - + - uses: oven-sh/setup-bun@v2 with: - bun-version: latest - + bun-version-file: package.json + - name: Install dependencies run: bun install + + - name: Run lint + run: bun run lint - - name: Run tests - run: bun test + - name: Run workspace tests + run: bun run test - - name: Build CLI - run: cd packages/cli && bun run build + - name: Run workspace build + run: bun run build - name: Node.js Smoke Test run: node packages/cli/dist/index.js lint examples/atmospheric-glass/DESIGN.md @@ -51,4 +54,3 @@ jobs: echo -e '---\ncolors:\n primary: "#0000ff"\n---' > DESIGN.md npx design.md lint DESIGN.md node -e "import('@google/design.md/linter').then(m => console.log('OK:', Object.keys(m).length, 'exports'))" - diff --git a/README.md b/README.md index c7d9f0b..2ddfda9 100644 --- a/README.md +++ b/README.md @@ -293,4 +293,4 @@ The DESIGN.md format is at version `alpha`. The spec, token schema, and CLI are ## Disclaimer This project is not eligible for the [Google Open Source Software Vulnerability -Rewards Program](https://bughunters.google.com/open-source-security). \ No newline at end of file +Rewards Program](https://bughunters.google.com/open-source-security). diff --git a/bun.lock b/bun.lock index 81516a9..167ca87 100644 --- a/bun.lock +++ b/bun.lock @@ -1,6 +1,5 @@ { "lockfileVersion": 1, - "configVersion": 1, "workspaces": { "": { "name": "design-monorepo", @@ -13,30 +12,29 @@ }, "packages/cli": { "name": "@google/design.md", - "version": "0.1.0", + "version": "0.1.1", "bin": { "design.md": "./dist/index.js", - "designmd": "./dist/index.js", }, "dependencies": { - "zod": "^3.24.0", - }, - "devDependencies": { - "@types/bun": "latest", - "@types/mdast": "^4.0.4", - "@types/node": "^20.11.24", - "bun-types": "^1.3.12", "citty": "^0.1.6", "mdast": "^3.0.0", "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", + "zod": "^3.24.0", + }, + "devDependencies": { + "@types/bun": "latest", + "@types/mdast": "^4.0.4", + "@types/node": "^20.11.24", + "bun-types": "^1.3.12", + "tailwindcss": "3", + "typescript": "^5.7.3", }, }, }, @@ -71,7 +69,7 @@ "@turbo/windows-arm64": ["@turbo/windows-arm64@2.9.6", "", { "os": "win32", "cpu": "arm64" }, "sha512-1XUUyWW0W6FTSqGEhU8RHVqb2wP1SPkr7hIvBlMEwH9jr+sJQK5kqeosLJ/QaUv4ecSAd1ZhIrLoW7qslAzT4A=="], - "@types/bun": ["@types/bun@1.3.12", "", { "dependencies": { "bun-types": "1.3.12" } }, "sha512-DBv81elK+/VSwXHDlnH3Qduw+KxkTIWi7TXkAeh24zpi5l0B2kUg9Ga3tb4nJaPcOFswflgi/yAvMVBPrxMB+A=="], + "@types/bun": ["@types/bun@1.3.13", "", { "dependencies": { "bun-types": "1.3.13" } }, "sha512-9fqXWk5YIHGGnUau9TEi+qdlTYDAnOj+xLCmSTwXfAIqXr2x4tytJb43E9uCvt09zJURKXwAtkoH4nLQfzeTXw=="], "@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="], @@ -393,8 +391,12 @@ "@google/design.md/@types/node": ["@types/node@20.19.39", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-orrrD74MBUyK8jOAD/r0+lfa1I2MO6I+vAkmAWzMYbCcgrN4lCrmK52gRFQq/JRxfYPfonkr4b0jcY7Olqdqbw=="], + "@google/design.md/bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="], + "@google/design.md/typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "@types/bun/bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="], + "chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], @@ -404,5 +406,7 @@ "tinyglobby/picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="], "@google/design.md/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + + "@google/design.md/bun-types/@types/node": ["@types/node@25.6.0", "", { "dependencies": { "undici-types": "~7.19.0" } }, "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ=="], } } diff --git a/docs/plans/2026-04-23-workspace-reliability-design.md b/docs/plans/2026-04-23-workspace-reliability-design.md new file mode 100644 index 0000000..8c994d7 --- /dev/null +++ b/docs/plans/2026-04-23-workspace-reliability-design.md @@ -0,0 +1,175 @@ +# Workspace Reliability and Interoperability Program Design + +## Goal + +Restore a trustworthy repository baseline for `design.md` so the active export +and interoperability roadmap can run without hidden build breakage, stale +dependency warnings, or CI-only workarounds. + +## Context + +This design captures the baseline `origin/main` failure state observed at the +start of this run and the first delivery slice needed to unblock the broader +interoperability roadmap. + +- At the start of this run, `bun run build` at the repo root failed because + Turbo could not resolve workspaces without a root `packageManager` field. +- At the start of this run, `bun run test` failed through the same missing root + contract. +- At the start of this run, `bun install` emitted + `warn: incorrect peer dependency "ink@7.0.1"` because the CLI package still + declared an Ink / React dependency chain that was not imported by the current + source tree. +- At the start of this run, `.github/workflows/test.yml` validated `bun test` + and `cd packages/cli && bun run build`, which masked the broken root build + contract instead of enforcing it. +- GitHub already has a canonical roadmap issue (#29) and a concrete blocker + issue (#30), but milestone and formal sub-issue metadata may still require + refresh or fallback documentation. + +## Constraints + +- Work from a fresh worktree created from the current default branch reference. +- Keep repo-facing artifacts in English. +- Do not wait for human review by default. +- Do not proactively summon a robot reviewer when the repository does not + appear to use one. +- Treat warnings, deprecations, lint findings, and security findings as + remediation targets rather than suppressing them. +- Consider Kubernetes and deployment surfaces explicitly, even if the result is + that none are present in the current repository. +- Keep the first slice small enough to merge autonomously from `origin/main`. + +## Candidate Approaches + +### Approach A — Baseline-first cleanup, then continue the roadmap (recommended) + +1. Refresh the issue program around the existing roadmap and blocker issues. +2. Fix the root build/test contract, remove the stale dependency warning, and + align CI with the repo-level contract. +3. Merge that blocker slice. +4. Re-scan the roadmap and continue with the next executable issue. + +#### Approach A pros + +- Smallest mergeable diff with direct operational value. +- Removes warning noise before feature work. +- Creates a reliable baseline for #15, #19, #27, and #28. + +#### Approach A cons + +- Delays direct feature delivery by one PR. + +### Approach B — Combine baseline cleanup with Tailwind v4 export work + +Implement the workspace cleanup and one export feature in the same branch. + +#### Approach B pros + +- Fewer PRs overall. +- Immediate user-facing feature delivery. + +#### Approach B cons + +- Larger diff, harder review, mixed responsibility. +- Harder to separate blocker remediation from feature regressions. + +### Approach C — Issue-program refresh only + +Refresh GitHub issues and milestone metadata without changing code. + +#### Approach C pros + +- Fastest GitHub housekeeping path. + +#### Approach C cons + +- Leaves the broken repo baseline and warning unresolved. +- Does not satisfy the requirement to fix warnings by root cause. + +## Recommendation + +Use **Approach A**. + +The strongest current-code concern is the broken root workspace contract. The +roadmap already has an explicit blocker issue (#30), and every downstream +interoperability change depends on being able to trust the repository baseline. + +## Proposed Issue Program Topology + +- **Milestone intent:** `Interop & Workspace Reliability` +- **Canonical meta issue:** #29 `Token interoperability roadmap` +- **Concrete blocker issue:** #30 `Restore root Bun/Turbo build contract and + remove stale Ink peer mismatch` +- **Related execution issues:** + - #15 CSS custom properties export + - #19 Tailwind v4 export support + - #28 DTCG `tokens.json` -> `DESIGN.md` +- **Cross-cutting issue:** + - #27 OKLCH color support + +Relationship intent: + +- #30 remains the first executable blocker under #29. +- #15, #19, and #28 remain direct roadmap children or explicitly linked + follow-up issues. +- #27 remains a cross-cutting spec/fidelity dependency rather than a hard + blocker for the baseline cleanup. +- If milestone or formal sub-issue wiring is unavailable from the current + account, the fallback is to record the same hierarchy in issue bodies and + comments. + +## Implementation Shape + +### Code changes + +- Add `packageManager` to the root `package.json` using the currently installed + Bun version. +- Remove unused CLI dependencies that trigger the Ink peer mismatch if the + source tree has no imports of them. +- Remove stale TS React / JSX compiler settings if no JSX sources remain. +- Add a package-level lint script so `bun run lint` becomes a meaningful static + check instead of a no-op workspace placeholder. +- Update CI so the workflow: + - reads Bun from the root `packageManager` contract, + - runs root workspace `test` and `build`, and + - preserves package smoke coverage. + +### Documentation changes + +- Record the investigation and execution plan under `docs/plans/`. +- Add a repo-local remediation skill for warning, lint, and security-class + defects observed during this run. + +### GitHub changes + +- Re-check milestone creation and issue-linking capabilities. +- Refresh #29 and #30 if the latest evidence or hierarchy wording changed. +- Create comments or issue-body relationship sections when first-class metadata + edges are unavailable. + +## Verification Strategy + +- `bun install` should complete without the Ink peer warning. +- `bun run lint` should execute a real package-level static check and pass. +- `bun run test` should pass from the repo root. +- `bun run build` should pass from the repo root. +- Built CLI smoke and tarball smoke should continue to pass. +- PR checks should validate the same root contract used locally. + +## Deployment / Runtime / Kubernetes Notes + +- No Kubernetes manifests, Helm charts, Dockerfiles, or runtime deployment + manifests are present in the current repository tree. +- Kubernetes is therefore considered explicitly and found to be out of direct + runtime scope for this slice. +- The relevant deployment surface here is CI, package build, tarball smoke, and + default-branch health after merge. + +## Decisions + +- Fix the workspace baseline before continuing feature delivery. +- Treat the peer warning as a dead-dependency / config drift problem unless code + inspection proves active runtime use. +- Keep the first PR scoped to repository reliability plus issue-program + maintenance. diff --git a/docs/plans/2026-04-23-workspace-reliability.md b/docs/plans/2026-04-23-workspace-reliability.md new file mode 100644 index 0000000..cf1c955 --- /dev/null +++ b/docs/plans/2026-04-23-workspace-reliability.md @@ -0,0 +1,253 @@ +# Workspace Reliability and Interoperability Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to +> implement this plan task-by-task. + +**Goal:** Restore the root Bun/Turbo build contract, remove the stale Ink peer +warning, refresh the interoperability issue program, and deliver the change +through PR and merge. + +**Architecture:** Keep the diff focused on repository reliability. Use the +existing roadmap issue (#29) and blocker issue (#30) as the canonical GitHub +anchors, and keep feature delivery for #15 / #19 / #28 as follow-up work after +the baseline is repaired. + +**Tech Stack:** Bun, Turbo, TypeScript, GitHub Issues/PRs, GitHub Actions, +markdown docs. + +**Baseline note:** Any step that expects a failure or warning refers to the +`origin/main` snapshot captured before remediation in this worktree. + +--- + +## Task 1: Capture baseline evidence and current issue topology + +**Files:** + +- Create: `docs/plans/2026-04-23-workspace-reliability-design.md` +- Create: `docs/plans/2026-04-23-workspace-reliability.md` +- Read: `package.json` +- Read: `packages/cli/package.json` +- Read: `.github/workflows/test.yml` + +### Step 1: Reproduce the root build failure + +Run: `bun run build` + +Expected on the baseline snapshot: Turbo fails with `Missing packageManager` +field in `package.json`. + +### Step 2: Reproduce the root test failure + +Run: `bun run test` + +Expected on the baseline snapshot: Turbo fails through the same missing-root +contract path. + +### Step 3: Reproduce the install warning + +Run: `bun install` + +Expected on the baseline snapshot: Bun prints +`warn: incorrect peer dependency "ink@7.0.1"`. + +### Step 4: Confirm dependency use is absent + +Run repo search for `@json-render/ink`, `@json-render/core`, `ink`, and +`react` imports under `packages/cli/src`. + +Expected: No active runtime imports. + +### Step 5: Re-check the issue program + +Inspect #29, #30, #15, #19, #27, and #28 plus open PRs #20 and #21. + +Expected: #29 remains the canonical roadmap issue and #30 remains the first +executable blocker. + +## Task 2: Refresh GitHub milestone and hierarchy metadata + +**Files:** + +- Modify remotely via GitHub CLI only + +### Step 1: Attempt milestone creation + +Create milestone: `Interop & Workspace Reliability`. + +### Step 2: Re-check issue hierarchy support + +Attempt formal sub-issue or dependency wiring from #29 to #30, #15, #19, and +issue #28. + +### Step 3: Apply fallback documentation if metadata APIs fail + +Update issue bodies or add comments so the roadmap, blocker, related issues, +follow-ups, and blockers remain explicit. + +### Step 4: Verify the resulting issue program + +Run GitHub reads for the affected issues. + +Expected: hierarchy and sequencing are current, even if stored as text rather +than first-class metadata. + +## Task 3: Restore the root workspace contract + +**Files:** + +- Modify: `package.json` +- Modify: `.github/workflows/test.yml` + +### Step 1: Use the captured failing root build as the red state + +Run: `bun run build` + +Expected on the baseline snapshot: failure before the root manifest is fixed. + +### Step 2: Add the minimal root metadata + +Add the root `packageManager` field using the current Bun version. + +### Step 3: Re-run the root build + +Run: `bun run build` + +Expected: build succeeds. + +### Step 4: Update CI to use the same root contract + +Replace the package-local build invocation with root workspace `test` and +`build`, preserve smoke steps, and pin the workflow Bun version from the root +`packageManager` contract. + +## Task 4: Eliminate the stale Ink peer warning by root cause + +**Files:** + +- Modify: `packages/cli/package.json` +- Modify: `packages/cli/tsconfig.json` +- Modify: `bun.lock` + +### Step 1: Keep the captured warning as red evidence + +Run: `bun install` + +Expected on the baseline snapshot: incorrect peer dependency warning for Ink. + +### Step 2: Remove dead dependencies and stale TS config + +- Remove `@json-render/core`, `@json-render/ink`, `ink`, `react`, and + `@types/react` if unused. +- Remove `jsx: "react-jsx"` if no JSX files remain. + +### Step 3: Refresh the lockfile + +Run: `bun install` + +Expected: lockfile updates with no Ink peer warning. + +## Task 5: Make lint verification real and add the remediation skill + +**Files:** + +- Modify: `packages/cli/package.json` +- Create: `.agents/skills/quality-remediation/SKILL.md` + +### Step 1: Add a real package-level lint command + +Add the smallest static-check script that makes `bun run lint` meaningful for +the current TypeScript-only package. + +### Step 2: Write the remediation skill from the observed failures + +Cover: + +- missing `packageManager` causing Turbo workspace failure +- dead dependency / peer mismatch diagnosis +- CI workaround detection and correction +- warning, lint, and security remediation expectations + +### Step 3: Verify the lint contract + +Run: `bun run lint` + +Expected: the workspace lint step executes a real static check and passes. + +## Task 6: Full verification and smoke checks + +**Files:** + +- No new files unless verification reveals required fixes + +### Step 1: Run install, lint, test, and build + +Run: + +- `bun install` +- `bun run lint` +- `bun run test` +- `bun run build` + +Expected: all four commands pass from the repo root with no peer warning. + +### Step 2: Run built CLI smoke + +Run: `node packages/cli/dist/index.js lint examples/atmospheric-glass/DESIGN.md` + +Expected: no errors, and only repository-baseline warnings if the sample file +itself contains them. + +### Step 3: Run tarball smoke + +Run the equivalent of the workflow tarball path: + +- `cd packages/cli && npm pack` +- install the tarball in a temp directory +- run `npx design.md lint DESIGN.md` +- import `@google/design.md/linter` + +Expected: the tarball installs and both CLI and library smoke paths work. + +### Step 4: Check deployment and Kubernetes surfaces + +Expected: no Kubernetes or runtime deployment assets exist; package and CI +verification remain the only relevant deployment surfaces. + +## Task 7: Commit, push, PR, merge, and rescan + +**Files:** + +- All modified files above + +### Step 1: Review git status, diff, and recent log + +Gather commit context and draft a concise message explaining why the repository +baseline cleanup is needed. + +### Step 2: Commit and push + +Push branch `continuous-delivery-20260423` to origin. + +### Step 3: Create a draft PR + +The PR should summarize: + +- root build and test contract restored +- stale Ink peer warning removed +- CI now validates the root build path and Bun contract +- roadmap / blocker issue program refreshed + +### Step 4: Advance the PR to merge + +- Refresh the branch if GitHub reports it as behind. +- Wait for required checks. +- Do not proactively request human or robot review in a repo that does not + appear to use one. +- Merge when checks and repository gates allow. + +### Step 5: Rescan and continue + +After merge, verify default-branch health, update linked issues, and begin the +next executable follow-up issue from #29 if a clean, non-conflicting slice +remains. diff --git a/package.json b/package.json index bd7f76a..37b071d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "design-monorepo", "private": true, + "packageManager": "bun@1.2.10", "workspaces": [ "packages/*" ], diff --git a/packages/cli/package.json b/packages/cli/package.json index 5f66e7c..0d0c3d3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -37,19 +37,16 @@ "access": "public" }, "scripts": { - "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/", + "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/ && cp ../../docs/spec.md dist/linter/", "dev": "bun run src/index.ts", + "lint": "bun x tsc --project tsconfig.json --noEmit --skipLibCheck", "test": "bun test", "spec:gen": "bun run src/linter/spec-gen/generate.ts", "check-package": "bun run scripts/check-package.ts" }, "dependencies": { - "@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", @@ -63,7 +60,6 @@ "@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" diff --git a/packages/cli/src/commands/spec.test.ts b/packages/cli/src/commands/spec.test.ts index 29f4ada..b7ecc35 100644 --- a/packages/cli/src/commands/spec.test.ts +++ b/packages/cli/src/commands/spec.test.ts @@ -13,8 +13,17 @@ // limitations under the License. import { describe, it, expect, beforeEach, afterEach, spyOn } from 'bun:test'; +import { execFileSync } from 'node:child_process'; +import { existsSync, rmSync } from 'node:fs'; +import { resolve, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import specCommand from './spec.js'; +const currentDir = dirname(fileURLToPath(import.meta.url)); +const packageRoot = resolve(currentDir, '../..'); +const distDir = resolve(packageRoot, 'dist'); +const bundledCliPath = resolve(distDir, 'index.js'); + describe('spec command', () => { let logSpy: any; @@ -91,4 +100,24 @@ describe('spec command', () => { expect(output.rules).toBeDefined(); expect(output.rules.length).toBe(8); }); + + it('outputs the spec from the built CLI bundle', () => { + if (existsSync(distDir)) { + rmSync(distDir, { recursive: true, force: true }); + } + + execFileSync('bun', ['run', 'build'], { + cwd: packageRoot, + encoding: 'utf-8', + stdio: ['ignore', 'pipe', 'pipe'], + }); + + const output = execFileSync('node', [bundledCliPath, 'spec'], { + cwd: packageRoot, + encoding: 'utf-8', + stdio: ['ignore', 'pipe', 'pipe'], + }); + + expect(output).toContain('# DESIGN.md Format'); + }); }); diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 40298d8..5739aa4 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -8,8 +8,7 @@ "outDir": "./dist", "rootDir": "./src", "declaration": true, - "types": ["bun"], - "jsx": "react-jsx" + "types": ["bun"] }, - "include": ["src/**/*.ts", "src/**/*.tsx"] + "include": ["src/**/*.ts"] }