Repository navigation
feat(mosaic): export component entry points #10754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9d36b22
272e1e8
aed2403
c7c0567
3aaff27
efbd6c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/mosaic': patch | ||
| --- | ||
|
|
||
| Export `Avatar`, `Badge`, `Banner`, `Button`, `DataList`, `EmptyState`, `Entity`, `Heading`, `Icon`, `Input`, `Item`, `Skeleton`, `Table` and `Text` from `@clerk/mosaic/components/<name>`, and the `External` glyph from `@clerk/mosaic/icons/glyphs/external`, the import paths Swingset documents. Style them with `@clerk/mosaic/styles.css`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { Avatar } from './avatar'; | ||
| export type { AvatarProps, AvatarImageProps, AvatarFallbackProps, AvatarIconProps } from './avatar'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { Badge } from './badge'; | ||
| export type { BadgeProps } from './badge'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expose compound parts as named client exports. In a Server Component,
|
||
|
|
||
| export { Banner } from './banner'; | ||
| export type { BannerDescriptionProps, BannerLabelProps, BannerRootProps } from './banner'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { DataList } from './data-list'; | ||
| export type { DataListProps } from './data-list'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| 'use client'; | ||
|
|
||
| export { EmptyState } from './empty-state'; | ||
| export type { | ||
| EmptyStateActionsProps, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| 'use client'; | ||
|
|
||
| export { Entity } from './entity'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { Input } from './input'; | ||
| export type { InputProps, InputVariant } from './input'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { Item } from './item'; | ||
| export type { ItemProps } from './item'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { Skeleton } from './skeleton'; | ||
| export type { SkeletonProps, SkeletonShape } from './skeleton'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| 'use client'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Export the table parts as named client references. A Server Component cannot render Export the parts individually as well as through
|
||
|
|
||
| export { Table } from './table'; | ||
| export type { | ||
| TableAlign, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| 'use client'; | ||
|
|
||
| export { Text, TextContext } from './text'; | ||
| export type { TextProps } from './text'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,24 @@ const { default: getTypeScriptExecutablePath } = await import( | |
| ); | ||
|
|
||
| export default defineConfig({ | ||
| entry: ['./src/index.ts'], | ||
| entry: { | ||
| index: './src/index.ts', | ||
| 'components/avatar': './src/components/avatar/index.ts', | ||
| 'components/badge': './src/components/badge/index.ts', | ||
| 'components/banner': './src/components/banner/index.ts', | ||
| 'components/button': './src/components/button/index.ts', | ||
| 'components/data-list': './src/components/data-list/index.ts', | ||
| 'components/empty-state': './src/components/empty-state/index.ts', | ||
| 'components/entity': './src/components/entity/index.ts', | ||
| 'components/heading': './src/components/heading/index.ts', | ||
| 'components/icon': './src/components/icon/index.ts', | ||
| 'components/input': './src/components/input/index.ts', | ||
| 'components/item': './src/components/item/index.ts', | ||
| 'components/skeleton': './src/components/skeleton/index.ts', | ||
| 'components/table': './src/components/table/index.ts', | ||
| 'components/text': './src/components/text/index.ts', | ||
| 'icons/glyphs/external': './src/icons/glyphs/external.tsx', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a client boundary to the External glyph. A Server Component that renders
|
||
| }, | ||
| outDir: './dist', | ||
| format: ['esm'], | ||
| dts: { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the required entries, not only the entries that exist.
If the build omits
components/badge.jsbut emits the other component files,componentEntriesexcludes Badge and this check passes. The published Badge subpath then points to a missing file, so consumer imports fail. Check all four paths declared inpackages/mosaic/package.jsonexplicitly before checking their directives. (raw.githubusercontent.com)