feat(apollo-vertex): add registry dependency validation script [AGVSOL-2062]#428
feat(apollo-vertex): add registry dependency validation script [AGVSOL-2062]#428
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
Pull request overview
Adds a build-time guardrail in apollo-vertex to prevent shadcn-registry install breakages by ensuring registry component source files don’t import other registry modules that aren’t declared in registry.json (files[] / registryDependencies).
Changes:
- Added
scripts/validate-registry.tsto validate registry import-to-dependency consistency. - Updated
registry.jsonto add missingregistryDependencies: ["button"]for alert-dialog, carousel, pagination, and calendar. - Wired the validator into
pnpm registry:buildso it runs aftershadcn buildand before index generation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/apollo-vertex/scripts/validate-registry.ts | New registry dependency validation script (import scanning + failure reporting). |
| apps/apollo-vertex/registry.json | Adds missing registryDependencies entries for components that import @/components/ui/button. |
| apps/apollo-vertex/package.json | Runs the validation script as part of registry:build. |
b7ca248 to
22e1103
Compare
22e1103 to
83799be
Compare
34bd439 to
a018762
Compare
a018762 to
69e75d3
Compare
69e75d3 to
ffe4453
Compare
ffe4453 to
5b57f31
Compare
Pull request was converted to draft
5b57f31 to
81a184d
Compare
81a184d to
ef9a60b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
apps/apollo-vertex/registry.json:1003
- The
use-data-tableregistry item now only liststypes.ts,constants.ts,useDataTable.tsx, andusePersistedSorting.ts, butuseDataTable.tsximportsuseColumnVisibilityandusePersistedColumnOrder, and those in turn importusePersistedColumns. If these files aren’t included infiles[], consumers installing@uipath/use-data-tablewill get TypeScript/module resolution failures. Re-add the missing hook files (and any other direct/indirect relative imports) to this item’sfiles[].
"name": "use-data-table",
"type": "registry:hook",
"title": "useDataTable",
"description": "A generic data table hook that manages sorting, filtering, pagination, column visibility, and column order with localStorage persistence.",
"dependencies": ["@tanstack/react-table", "@mantine/hooks@^9.0.0"],
"files": [
{
"path": "registry/use-data-table/types.ts",
"type": "registry:hook"
},
{ "path": "lib/constants.ts", "type": "registry:lib" },
{
"path": "registry/use-data-table/useDataTable.tsx",
"type": "registry:hook"
},
{
"path": "registry/use-data-table/usePersistedSorting.ts",
"type": "registry:hook"
}
]
apps/apollo-vertex/registry.json
Outdated
| @@ -589,10 +590,6 @@ | |||
| { | |||
| "path": "registry/data-table/sortable-column-list.tsx", | |||
| "type": "registry:ui" | |||
There was a problem hiding this comment.
The data-table registry item no longer includes registry/use-data-table/useReactTableCompat.ts, but registry/data-table/data-table.tsx imports it via the @/hooks/useReactTableCompat path alias. Installing @uipath/data-table via shadcn will therefore produce an unresolved import unless this file is included (either re-add it to files[] for data-table or add an appropriate registryDependencies entry that guarantees it is installed).
| "type": "registry:ui" | |
| "type": "registry:ui" | |
| }, | |
| { | |
| "path": "registry/use-data-table/useReactTableCompat.ts", | |
| "type": "registry:ui" |
01a0549 to
86d6b9a
Compare
86d6b9a to
ddbfa31
Compare
ddbfa31 to
ef9a60b
Compare
3b27cc1 to
05f28bd
Compare
05f28bd to
8acadf7
Compare
31d6827 to
a284882
Compare
a284882 to
0551ce0
Compare
…mports Replace next build with tsc --noEmit in registry CI to catch unresolved imports. Add --overwrite flag to shadcn add so file conflicts don't skip installation silently. Add explicit target paths for data-table registry files to preserve subdirectory structure. Re-export DataTableColumnHeader from data-table.tsx since shadcn rewrites barrel imports to the main file.
0551ce0 to
bb3ffeb
Compare
Summary
Prevents issues like #413 from happening again by automatically catching missing registry entries at build time.
next buildwithtsc --noEmitin the registry CI check —next buildonly type-checks files in the build graph, silently skipping components not imported by any page--overwritetoshadcn add— without it, shadcn silently skips installation on file conflicts, sotsc --noEmitruns against an empty app and always passestargetpaths for data-table registry files — preserves the subdirectory structure during installation instead of flattening files intocomponents/ui/DataTableColumnHeaderfromdata-table.tsx— works around a known shadcn bug where barrel imports are rewritten to the main fileshadcn barrel import bug
shadcn has a known bug (shadcn-ui/ui#7309) where imports targeting a barrel
index.tsin a multi-file component get rewritten to the main file instead. For example:Since data-table.tsx only exported DataTable and DataTableProps, the import broke. The fix is to re-export DataTableColumnHeader from data-table.tsx so both resolution paths work. This is documented in AGENTS.md for future contributors.