From caa8dbce5b6bca061835e496778b29b00aa158f9 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Sat, 24 Sep 2022 18:48:05 +0200 Subject: [PATCH] docs: use `prepack` and `postpack` instead of `prepublishOnly` and `postpublish` --- docs/ts/with-addons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ts/with-addons.md b/docs/ts/with-addons.md index 029193789..0ca46b574 100644 --- a/docs/ts/with-addons.md +++ b/docs/ts/with-addons.md @@ -15,7 +15,7 @@ When you publish an addon written in TypeScript, the `.ts` files will be consume Even though you publish the source `.ts` files, though, by default you consumers who also use TypeScript won't be able to benefit from those types, because the TS compiler isn't aware of how `ember-cli` resolves import paths for addon files. For instance, if you write `import { foo } from 'my-addon/bar';`, the typechecker has no way to know that the actual file on disk for that import path is at `my-addon/addon/bar.ts`. -In order for your addon's users to benefit from type information from your addon, you need to put `.d.ts` _declaration files_ at the location on disk where the compiler expects to find them. This addon provides two commands to help with that: `ember ts:precompile` and `ember ts:clean`. The default `ember-cli-typescript` blueprint will configure your `package.json` to run these commands in the `prepublishOnly` and `postpublish` phases respectively, but you can also run them by hand to verify that the output looks as you expect. +In order for your addon's users to benefit from type information from your addon, you need to put `.d.ts` _declaration files_ at the location on disk where the compiler expects to find them. This addon provides two commands to help with that: `ember ts:precompile` and `ember ts:clean`. The default `ember-cli-typescript` blueprint will configure your `package.json` to run these commands in the `prepack` and `postpack` phases respectively, but you can also run them by hand to verify that the output looks as you expect. The `ts:precompile` command will populate the overall structure of your package with `.d.ts` files laid out to match their import paths. For example, `addon/index.ts` would produce an `index.d.ts` file in the root of your package.