[CustomCatalog] Surface sanitizeCatalogImageUrl in the bundled d.ts#1697
Open
claude[bot] wants to merge 1 commit into
Open
[CustomCatalog] Surface sanitizeCatalogImageUrl in the bundled d.ts#1697claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
sanitizeCatalogImageUrl ships at runtime but reaches the package entry only through 'export * from ./custom' nested barrels, so rollup-plugin-dts (the tsup declaration bundler) drops its type from the published dist/index.d.ts. Consumers importing it type-fail with TS2305 even though the runtime export exists — the same nested-barrel quirk already documented for FeedbackButton, TableActions, DangerConfirmationModal and UniversalFilter. Extract the function into a dependency-free leaf module (custom/CustomCatalog/sanitizeCatalogImageUrl.ts) and add an explicit re-export from src/index.tsx. The leaf placement mirrors the TableActions-vs- ResponsiveDataTable rationale: re-exporting directly from Helper.ts would drag its untyped js-yaml import into the declaration graph and crash the dts build. Helper.ts re-exports from the leaf so the existing 'from ./Helper' import path is preserved. Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
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.
Notes for Reviewers
sanitizeCatalogImageUrl(added for the catalog snapshot-URL sanitization work) ships at runtime but reaches the package entry only throughexport * from './custom'nested barrels.rollup-plugin-dts— the tsup declaration bundler — drops such symbols from the publisheddist/index.d.ts, so consumers importing it type-fail withTS2305: Module '@sistent/sistent' has no exported member 'sanitizeCatalogImageUrl'even though the runtime export exists. This is the same nested-barrel quirk already documented insrc/index.tsxforFeedbackButton,TableActions,DangerConfirmationModalandUniversalFilter.This PR:
sanitizeCatalogImageUrlinto a dependency-free leaf module (src/custom/CustomCatalog/sanitizeCatalogImageUrl.ts). Re-exporting it directly fromHelper.tswould drag that module's untypedjs-yamlimport into the declaration graph and crash the dts build — the same rationale that keepsgetCopyDeepLinkAction/TableActionin the leafTableActionsmodule rather thanResponsiveDataTable.export { sanitizeCatalogImageUrl } from './custom/CustomCatalog/sanitizeCatalogImageUrl'tosrc/index.tsx, forcing the declaration into the bundleddist/index.d.ts.Helper.tsre-exports from the leaf so the existingfrom './Helper'import path keeps working for internal consumers (CatalogCardDesignLogo,CustomCatalog/index).Verification:
NODE_ENV=production tsupbuilds clean anddist/index.d.tsnow declaressanitizeCatalogImageUrl: (rawUrl?: string) => string | undefinedand lists it in the export barrel; thesanitizeCatalogImageUrlJest suite passes. Once released, downstream consumers can drop their local.d.tsshim for this symbol and import it type-safely.Signed commits
Generated by Claude Code