feat: consume @codaco/fresco-ui (migrate components/ui out of Fresco)#735
Merged
feat: consume @codaco/fresco-ui (migrate components/ui out of Fresco)#735
Conversation
…), useProtocolForm
…used deps Deletes the source files now provided by @codaco/fresco-ui (components/ui, relocated utils/hooks, tailwind plugins, interviewer icons, shared style helpers) and removes the dependencies that no longer have any direct importers in Fresco according to knip: dependencies removed: @radix-ui/react-slot, @tiptap/* (8 packages), comlink, cva, fuse.js, nanoid, react-aria-components, react-best-merge-refs, rehype-raw, rehype-sanitize, remark-gemoji, tailwind-merge. devDependencies removed: @testing-library/user-event. Also drops stale optimizePackageImports entries in next.config.ts and the fuse.js prebundle hint in vitest.config.ts; both pointed at sources that moved into @codaco/fresco-ui.
# Conflicts: # app/dashboard/_components/ProtocolsTable/ActionsDropdown.tsx # lib/form/components/fields/Combobox/Combobox.tsx # lib/form/components/fields/PasswordField.tsx
…t (WebKit map render)" This reverts commit fb6239c.
…stage-8-final.png baseline
|
|
✅ E2E tests — success |
Stages 8, 19, 40, and 50 are Geospatial Interface stages with WebKit support disabled. The stale baselines no longer match the migrated UI.
Migrate all `@codaco/fresco-ui/form/components/X` imports to the flattened `@codaco/fresco-ui/form/X` form. No behavior changes.
Updates 23 imports across the dashboard, interviewer, and shared components to reference the PascalCase subpaths exported by @codaco/fresco-ui (Badge, DropdownMenu, Popover, Skeleton, Table, Tooltip).
|
❌ E2E tests — failure |
Tailwind v4's CSS resolver walks node_modules from the consuming file upward. pnpm doesn't hoist transitive deps, so the @plugin directives in @codaco/fresco-ui/styles.css couldn't resolve from styles/globals.css. Declaring it directly forces the symlink.
|
❌ E2E tests — failure |
…peer @codaco/fresco-ui@0.3.0 moves @codaco/tailwind-config to peerDependencies. public-hoist-pattern in .npmrc forces pnpm to symlink it to top-level node_modules so Tailwind v4's CSS resolver can find the @plugin paths.
|
❌ E2E tests — failure |
Stage 8 was already skipping webkit (unstable WebGL paint pipeline) but stages 19, 40, 50 were marked test.slow(webkit) instead — they ran on webkit with longer timeouts and would always fail because their baseline webkit snapshots were intentionally removed.
|
❌ E2E tests — failure |
fresco-ui 2.0.0 widens the @codaco/tailwind-config peer to ^0.4.0. pnpm peer-dep resolution stuck on the old 0.2.0 across the bump, so declaring tailwind-config as an explicit direct dep forces the right version into the hoisted node_modules tree.
styles/themes/{default,interview}.css were near-duplicates of
@codaco/tailwind-config/fresco/{default-theme,interview-theme}.css
(differing only in the font @import and a header comment). Drop the
local copies and import the canonical files in the relevant entry points.
The Inclusive Sans + Nunito @import is now loaded transitively via
@codaco/fresco-ui/styles.css → @codaco/tailwind-config/fresco/fonts.css.
|
❌ E2E tests — failure |
|
❌ E2E tests — failure |
…ndant entries from globals.css
|
❌ E2E tests — failure |
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
Migrates Fresco's
components/ui/directory (and supporting hooks, utils, styles) out of this repo and into a new published package,@codaco/fresco-ui. Fresco now consumes the package at^0.1.1.Companion PR: complexdatacollective/network-canvas-monorepo#478 (read that for the package design + decisions).
This PR is the consumer-side half: dependency add, CSS wire-up, file relocations, codemod, source deletion, dep cleanup.
Numbers
components/ui/,utils/,hooks/,lib/interviewer/components/icons/,styles/shared/,styles/plugins/~/components/ui/X→@codaco/fresco-ui/X, plus utils/hooks/styles paths)dependencies+ 1devDependencyremoved viapnpm knipcleanup (Tiptap stack, base-ui, Radix Slot, Comlink, cva, fuse.js, nanoid, react-aria-components, react-best-merge-refs, rehype/remark plugins, tailwind-merge, usehooks-ts)What stays in Fresco
Per the package's design:
components/SubmitButton.tsx(relocated fromcomponents/ui/) — depends on Next form-state hookscomponents/Link.tsx(relocated, NativeLink export removed) — wrapsnext/linklib/interviewer/forms/useProtocolForm.{tsx,stories.tsx}(relocated fromcomponents/ui/form/hooks/) — Network-Canvas-protocol-aware bridge that imports the Fresco interviewer Redux selectorCSS / Tailwind
styles/globals.cssnow imports@codaco/fresco-ui/styles.css(which carries the @theme tokens, the three custom Tailwind plugins, and an @source for the package's compiled output). Fresco's themes (styles/themes/{default,interview}.css) stay as before — they're consumer-specific.What's bundled in the merge from
nextThis branch merges
origin/next(19 commits) to pick up the WebKit geospatial test skip + activity-feed and protocol-download fixes. Three commits fromnextmodified files we'd already migrated to the package:3ebe64629) + docs note (7e5b22c96)Omit<..., 'type'>(e6f10e04d)Those are ported into the package and shipped as
@codaco/fresco-ui@0.1.1.Verification
pnpm typecheckcleanpnpm test:unitpasses (170 tests)pnpm test:e2e— 163 passed, 0 failed, 5 skipped (chromium + firefox + webkit; webkit-only Mapbox stages skipped vianext's test.skip)pnpm knipshows no new unused exportsTest plan
pnpm installresolves@codaco/fresco-ui@^0.1.1cleanlyFollow-ups
tests/e2e/visual-snapshots/webkit/stage-8-final.pngwas deleted. Other webkit geospatial baselines may also need a regenerate-or-remove pass since those tests are now skipped on webkit.