chore: migrate `@rocket.chat/fuselage` from Fuselage
Merged
TA
6d ago+67292+67292+01234567890123456789012345678901234567890123456789-1439-1439-0123456789012345678901234567890123456789
Proposed changes (including videos or screenshots)
Moves @rocket.chat/fuselage from the Fuselage repo into packages/fuselage, continuing from the 0.96.0 release (Fuselage main at RocketChat/fuselage@84dbbbe). It still builds with Vite into the same dist/ layout: index.js picks fuselage.development.js or fuselage.production.js, and fuselage.css references fonts/InterVariable.woff2. Deep imports like @rocket.chat/fuselage/dist/fuselage.css keep working.
Compared with the published 0.96.0 tarball:
- The font is byte-identical.
- The
.d.tsfiles describe the same types; the differences are formatting and import order. - The JS bundles differ only in module order, whitespace inside CSS template literals, and lint autofixes (
?.(), dot notation, a duplicatedRefAttributesremoved from a type). - The production CSS differs only in how cssnano 9.0.5 (vs 9.0.4) merges rules.
tsdoc-metadata.jsonis gone, like the API report.
The package follows the earlier migrations:
- Sources are reformatted to this repo's style. API Extractor, the README,
lint-allandtesting-utilsare dropped; the one mock the specs need lives inmocks/. - Jest uses
@rocket.chat/jest-presets/client, with a small local setup fortoHaveCssInJsClassand the "no console errors" check. @rocket.chat/css-in-js,@rocket.chat/fuselage-tokens,@rocket.chat/memo,@rocket.chat/fuselage-hooks,@rocket.chat/iconsand@rocket.chat/storybook-dark-modenow resolve to the workspace.- All 19 workspaces that consumed
^0.95.0now useworkspace:~. Peer ranges (*) are unchanged. - A patch changeset records the move.
Specific to this package:
- It keeps its own
.storybook.@rocket.chat/storybook-configdev-depends on@rocket.chat/fuselage, so depending on it would create a turbo build cycle. vitestays on~8.2.2. With the repo's Vite 8.0.16, the 352 KB font gets inlined into the stylesheet as base64.postcssis pinned to8.5.26, the version the root resolutions force on Vite. With a different copy, the Vite config's PostCSS plugin types don't match and it fails to typecheck.tsconfig.jsonsetstarget: es2024andstripInternal, as Fuselage's base config did. That keeps class fields with define semantics and keeps the internal SCSS import out ofindex.d.ts.- The Meteor app now declares
invariant, one of fuselage's runtime dependencies. The Meteor bundler resolves client modules only from the app's ownnode_modules. The npm copy of fuselage broughtinvariantalong there; the workspace link doesn't. - The Vite dev client (
dev:next) reads@rocket.chat/fuselagefromdist, like@rocket.chat/fuselage-tokens. Compiling it from source would need fuselage's Sass, PostCSS and font handling. - The
NavBarspec importsSSRProviderfrom@react-aria/ssr. This repo'sreact-ariapatch drops it from the barrel; no runtime import is affected. - A scoped FIXME block in
eslint.config.mjsturns 7 rules into warnings forpackages/fuselage/src. They cover idioms Fuselage uses on purpose:Tag/Anchorcomponent props, multi-component helper files, empty callbacks in stories. - Reformatting the
csstemplate literals changes the css-in-js class hashes. About 110 consumer snapshot files are regenerated. Every diff was checked: onlyrcx-css-*class names and ReactuseIdvalues change, never markup.
Separate commits on top:
fuselage.shand theyarn fuselagescript are removed. With fuselage here, the Fuselage repo publishes nothing this repo consumes.- A
Test Visual RegressionCI job replaces Fuselage's visual regression step. Fuselage relied on a persisted turbo cache to skip unchanged runs. Here a small job asksturbo ls --affectedwhether@rocket.chat/fuselageis affected: its own files, its workspace dependencies, or its locked external dependencies. Only then does a second job build Storybook and run Playwright in Docker. If the comparison base can't be resolved, turbo treats everything as affected and the tests run. It runs on an ARM runner, andโ Tests Donerequires it; a skipped run counts as passing. - The visual regression baselines are regenerated with this repo's Playwright 1.52.0 image. Fuselage's were taken with 1.58.2, and five stories failed on text anti-aliasing. The Docker runner in
@rocket.chat/visual-regressionnow always uses thelinux/arm64image, so snapshots come out the same on Apple Silicon machines and on CI's ARM runners. All 523 images were regenerated, and the 2 orphans whose stories no longer exist were dropped. 354 are pixel-identical to Fuselage's; the rest differ only in faint text and gradient shading.
Issue(s)
Steps to test or reproduce
yarn turbo run build --filter=@rocket.chat/fuselageyarn workspace @rocket.chat/fuselage lintyarn workspace @rocket.chat/fuselage typecheckyarn workspace @rocket.chat/fuselage testunityarn workspace @rocket.chat/fuselage build-storybookyarn workspace @rocket.chat/fuselage visual-regression(needs Docker)yarn turbo run typecheck --filter='...^@rocket.chat/fuselage'
Further comments
Not in this PR:
- The package still has to be removed from the Fuselage repo.
- An org owner still has to repoint the npm trusted publisher for
@rocket.chat/fuselagefromRocketChat/fuselageto this repo, in the npm UI. docs/bundle-optimization-react-aria.mdstill describes Fuselage as a dependency "you don't control". Fuselage can now import react-aria sub-packages directly, which would let the barrel patches go.
๐ค Generated with Claude Code