turbo icon indicating copy to clipboard operation
turbo copied to clipboard

docs(Turborepo): package entry points customization

Open linkb15 opened this issue 2 years ago • 4 comments

Description

When we have so many functions inside the packages. Importing files from a package become too long.

i.e. we have a UI package where we import so many components. it can be more enhanced if it can be more customized.

Customizing package entry points information was really hard for me to find before - spent more than few days to get it around - I wish it can be shown as example somewhere - and TurboRepo documentation is teaching me how to use this internal package - hence it would be nice to have this additional reading as well.

linkb15 avatar Apr 04 '24 12:04 linkb15

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 5:56pm
6 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 5:56pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 5:56pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 5:56pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 5:56pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 5:56pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 5:56pm

vercel[bot] avatar Apr 04 '24 12:04 vercel[bot]

@linkb15 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 04 '24 12:04 vercel[bot]

Can you explain how this is different from the section above on the same page? https://turbo.build/repo/docs/handbook/sharing-code/internal-packages#4-fix-exports

anthonyshew avatar Apr 04 '24 17:04 anthonyshew

@anthonyshew this information is to customize the subpath of the internal package.

// it will make the import in the different subpath
import { Dialog, DialogContent, DialogTrigger } from "@repo/ui/dialog";
import { Button } from "@repo/ui/button";

// instead of this
import { Button, Dialog, DialogContent, DialogTrigger } from "@repo/ui";

This is to customize how we can export it differently.

I believe this will help some clarification on how we can do it, and customize it further.

linkb15 avatar Apr 04 '24 20:04 linkb15

We've done a major docs update since this PR! Check them out!

anthonyshew avatar Jun 15 '24 23:06 anthonyshew