From 9a92bdf540c024bc9f7363348e237a5c91781ecf Mon Sep 17 00:00:00 2001 From: Eric Kwoka <43540491+ekwoka@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:20:40 +0400 Subject: [PATCH 1/2] :memo: Updates documentation regarding Declaration Maps --- docs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 46449dd86..cfd27f010 100644 --- a/docs/README.md +++ b/docs/README.md @@ -211,11 +211,11 @@ The `--dts-only` flag is the equivalent of the `emitDeclarationOnly` option in ` #### Generate TypeScript declaration maps (.d.ts.map) -TypeScript declaration maps are mainly used to quickly jump to type definitions in the context of a monorepo (see [source issue](https://github.com/Microsoft/TypeScript/issues/14479) and [official documentation](https://www.typescriptlang.org/tsconfig/#declarationMap)). +TypeScript declaration maps are mainly used to quickly jump to the source code associate with imported objects. Without declaration maps, `Go to Definition` in IDEs will go to the type defition and not the relevant source code. `Go to Type Definition` will always go to the type definition. -They should not be included in a published NPM package and should not be confused with sourcemaps. +Declaration maps and source TS files should be included in all published TypeScript packages. -[Tsup is not able to generate those files](https://github.com/egoist/tsup/issues/564). Instead, you should use the TypeScript compiler directly, by running the following command after the build is done: `tsc --emitDeclarationOnly --declaration`. +Unfortunately, [Tsup is not able to generate those files](https://github.com/egoist/tsup/issues/564). Instead, you should use the TypeScript compiler directly, by running the following command after the build is done: `tsc --emitDeclarationOnly --declaration`. You can combine this command with Tsup [`onSuccess`](https://tsup.egoist.dev/#onsuccess) callback. From dd027f82b3f0a56b04a06dd8674f7b7c0e8f02dd Mon Sep 17 00:00:00 2001 From: Eric Kwoka <43540491+ekwoka@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:52:04 +0400 Subject: [PATCH 2/2] :construction: Removes published qualifier Co-authored-by: Eli <88557639+lishaduck@users.noreply.github.com> --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index cfd27f010..948c2c8ef 100644 --- a/docs/README.md +++ b/docs/README.md @@ -213,7 +213,7 @@ The `--dts-only` flag is the equivalent of the `emitDeclarationOnly` option in ` TypeScript declaration maps are mainly used to quickly jump to the source code associate with imported objects. Without declaration maps, `Go to Definition` in IDEs will go to the type defition and not the relevant source code. `Go to Type Definition` will always go to the type definition. -Declaration maps and source TS files should be included in all published TypeScript packages. +Declaration maps and source TS files should be included in all TypeScript packages. Unfortunately, [Tsup is not able to generate those files](https://github.com/egoist/tsup/issues/564). Instead, you should use the TypeScript compiler directly, by running the following command after the build is done: `tsc --emitDeclarationOnly --declaration`.