We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using dtsRollup feature, I found that it is unable to bundle types from importing from a index file but not write the full path.
dtsRollup
https://github.com/Timeless0911/api-extractor-issue-index-path
pnpm install
pnpm build
Expected result:
see https://github.com/Timeless0911/api-extractor-issue-index-path/blob/main/dist-expected/index.d.ts
Actual result:
see https://github.com/Timeless0911/api-extractor-issue-index-path/blob/main/dist-actual/index.d.ts
type-fest is a npm package which has a collection of essential TypeScript types that has below file structure:
. ├── index.d.ts ├── package.json └── source ├── ... ├── delimiter-case.d.ts ├── internal │ ├── ... │ └── index.d.ts └── ...
This repro demo import KebabCase from type-fest
KebabCase
type-fest
// src/index.ts import type { KebabCase } from "type-fest"; export function kebabCase<T extends string>(str: T): KebabCase<T> { return str as KebabCase<T>; }
The KebabCase type is from source/kebab-case.d.ts which have an import from ./delimiter-case
source/kebab-case.d.ts
./delimiter-case
// source/kebab-case.d.ts import type {DelimiterCase} from './delimiter-case'; // .... export type KebabCase<Value> = DelimiterCase<Value, '-'>;
In source/delimiter-case.d.ts file, it import some types from ./internal which should be resolved to ./internal/index.d.ts
source/delimiter-case.d.ts
./internal
./internal/index.d.ts
// source/delimiter-case.d.ts import type {UpperCaseCharacters, WordSeparators} from './internal';
The actual result keeps these import from ./internal
import type { UpperCaseCharacters } from './internal'; import type { WordSeparators } from './internal';
I modify the source/delimiter-case.d.ts file to write full path of the importer like below, it works as expected.
- import type {UpperCaseCharacters, WordSeparators} from './internal'; + import type {UpperCaseCharacters, WordSeparators} from './internal/index';
Since both Node.js and Typescript support index file resolution, I think ./internal should be resolved correctly when rolluping DTS.
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
node -v
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
When using
dtsRollup
feature, I found that it is unable to bundle types from importing from a index file but not write the full path.Repro steps
https://github.com/Timeless0911/api-extractor-issue-index-path
pnpm install
pnpm build
Expected result:
see https://github.com/Timeless0911/api-extractor-issue-index-path/blob/main/dist-expected/index.d.ts
Actual result:
see https://github.com/Timeless0911/api-extractor-issue-index-path/blob/main/dist-actual/index.d.ts
Details
type-fest is a npm package which has a collection of essential TypeScript types that has below file structure:
This repro demo import
KebabCase
fromtype-fest
The
KebabCase
type is fromsource/kebab-case.d.ts
which have an import from./delimiter-case
In
source/delimiter-case.d.ts
file, it import some types from./internal
which should be resolved to./internal/index.d.ts
The actual result keeps these import from
./internal
I modify the
source/delimiter-case.d.ts
file to write full path of the importer like below, it works as expected.Since both Node.js and Typescript support index file resolution, I think
./internal
should be resolved correctly when rolluping DTS.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
version?node -v
)?The text was updated successfully, but these errors were encountered: