From e27f4b52641b5b96ced481e5694bbe9831aa7944 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Fri, 3 Jan 2025 15:22:53 -0700 Subject: [PATCH 1/4] docs: Add note about packaging patterns. --- .../structuring-a-repository.mdx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx b/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx index 6558cd1a96d11..9913f740db57b 100644 --- a/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx +++ b/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx @@ -280,13 +280,15 @@ For example, if you had a `@repo/math` package, you might have the following `ex ```json title="./packages/math/package.json" { "exports": { - ".": "./dist/constants.ts", - "./add": "./dist/add.ts", - "./subtract": "./dist/subtract.ts" + ".": "./src/constants.ts", + "./add": "./src/add.ts", + "./subtract": "./src/subtract.ts" } } ``` +Note that this example uses the [Just-in-Time Package](/repo/docs/core-concepts/internal-packages#just-in-time-packages) pattern for simplicity. It exports TypeScript directly, but you might choose to the [Compiled Packages](/repo/docs/core-concepts/internal-packages#compiled-packages) pattern. + The `exports` field in this example requires modern versions of Node.js and TypeScript. @@ -307,9 +309,9 @@ Using exports this way provides three major benefits: - **IDE autocompletion**: By specifying the entrypoints for your package using `exports`, you can ensure that your code editor can provide auto-completion for the package's exports. - You may also specify `exports` using a wildcard. However, you will lose IDE - autocompletion due to performance tradeoffs with the TypeScript compiler. For - more information, visit [the TypeScript + You may also specify `exports` using a wildcard. However, you will some lose + IDE autocompletion due to performance tradeoffs with the TypeScript compiler. + For more information, visit [the TypeScript guide](/repo/docs/guides/tools/typescript#package-entrypoint-wildcards). From afec9914690cef3e488a727deac83444566197dd Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Fri, 3 Jan 2025 15:28:08 -0700 Subject: [PATCH 2/4] Update docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx --- .../crafting-your-repository/structuring-a-repository.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx b/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx index 9913f740db57b..29c2042fe0eeb 100644 --- a/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx +++ b/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx @@ -287,7 +287,7 @@ For example, if you had a `@repo/math` package, you might have the following `ex } ``` -Note that this example uses the [Just-in-Time Package](/repo/docs/core-concepts/internal-packages#just-in-time-packages) pattern for simplicity. It exports TypeScript directly, but you might choose to the [Compiled Packages](/repo/docs/core-concepts/internal-packages#compiled-packages) pattern. +Note that this example uses the [Just-in-Time Package](/repo/docs/core-concepts/internal-packages#just-in-time-packages) pattern for simplicity. It exports TypeScript directly, but you might choose to use the [Compiled Package](/repo/docs/core-concepts/internal-packages#compiled-packages) pattern instead. The `exports` field in this example requires modern versions of Node.js and From 60dd1fa3e13c00f6b38d3ddd3bd291c0cdfe9d77 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Fri, 3 Jan 2025 15:50:36 -0700 Subject: [PATCH 3/4] WIP --- .../crafting-your-repository/creating-an-internal-package.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/crafting-your-repository/creating-an-internal-package.mdx b/docs/repo-docs/crafting-your-repository/creating-an-internal-package.mdx index 160f1e54aca72..b98dea95e31a8 100644 --- a/docs/repo-docs/crafting-your-repository/creating-an-internal-package.mdx +++ b/docs/repo-docs/crafting-your-repository/creating-an-internal-package.mdx @@ -12,7 +12,7 @@ import { Files, File, Folder } from '#/components/files'; ![Visual representation of a Package Graph in a Turborepo.](/images/docs/package-graph.png) -Let's create your first Internal Package to share math utilities in your repo using the guidance in the [Anatomy of a package](/repo/docs/crafting-your-repository/structuring-a-repository#anatomy-of-a-package) section. In the steps below, we assume you've [created a new repository using `create-turbo`](/repo/docs/getting-started/installation) or are using a similarly structured repository. +Let's create your first Internal Package to share math utilities in your repo using the guidance in the [Anatomy of a package](/repo/docs/crafting-your-repository/structuring-a-repository#anatomy-of-a-package) section and the [Compiled Packages](/repo/docs/core-concepts/internal-packages#compiled-packages) pattern. In the steps below, we assume you've [created a new repository using `create-turbo`](/repo/docs/getting-started/installation) or are using a similarly structured repository. From 51f6335d4e75304436b82fa4d0c0800f00108c3d Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Mon, 6 Jan 2025 14:52:53 -0700 Subject: [PATCH 4/4] Update docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx Co-authored-by: Thomas Knickman --- .../crafting-your-repository/structuring-a-repository.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx b/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx index 29c2042fe0eeb..3c0b49084f901 100644 --- a/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx +++ b/docs/repo-docs/crafting-your-repository/structuring-a-repository.mdx @@ -309,7 +309,7 @@ Using exports this way provides three major benefits: - **IDE autocompletion**: By specifying the entrypoints for your package using `exports`, you can ensure that your code editor can provide auto-completion for the package's exports. - You may also specify `exports` using a wildcard. However, you will some lose + You may also specify `exports` using a wildcard. However, you will lose some IDE autocompletion due to performance tradeoffs with the TypeScript compiler. For more information, visit [the TypeScript guide](/repo/docs/guides/tools/typescript#package-entrypoint-wildcards).