Repository navigation
refac: Extract shared script utilities into dev-tools - #792
Merged
Merged
Conversation
simonrelet
force-pushed
the
refactor-shared-style-uti
branch
from
May 25, 2026 11:44
120462b to
1b206e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@animeaux/dev-tools: all three apps copiedgetLengthValuePx,getBreakpoints,getSpacing,safelyReadFile, andrelativeToCwdverbatim across theirscripts/directories.oneAtTheTimefrom show's localscripts/shared.tsso it is available to any app.Context
Each app's
generate-theme.tsscript and sprite generators duplicated the same helper functions with no meaningful variation. Centralising them indev-toolsis a natural fit: every app already depends on it, anddev-toolswas always intended to host runtime utilities alongside its config exports.The shared utilities are pure functions with no brand or app-specific logic — only the
getColors/getFontsblocks remain app-specific, as intended.Changes
libs/dev-tools/src/with one file per utility:format-breakpoints.ts,format-spacing.ts,get-length-value-px.ts,one-at-the-time.ts,relative-to-cwd.ts,safely-read-file.ts, and a barrelindex.ts."."export so callers useimport { … } from "@animeaux/dev-tools".getBreakpointsCode/getSpacingCodetoformatBreakpoints/formatSpacingfor consistency with theformat*convention.dev-tools: TypeScript compilation,tsc-aliasfor#i/*path aliases,build:src/build:pathsscripts, andpostbuild: pnpm sync-workspace.scripts/shared.tsfrom admin, show, and website (now empty or superseded); update all script imports to@animeaux/dev-tools.Risks and mitigations
src/generated/theme.tsoutput in each app is identical before and after.Checklist