You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5d18683
Browse filesBrowse the repository at this point in the historyBrowse files
typescript-public-api: entry points use the nearest tsconfig, so paths apply (#350)
* typescript-public-api: entry points use the nearest tsconfig, so paths apply
With inputs.entrypoints and no inputs.tsconfig, the program used generic
default options, so tsconfig paths aliases (`@/commands/config`) didn't
resolve. Each entry point now takes the nearest tsconfig.json above it, as
an editor does. typesVersions ranges also read caret, tilde and hyphen
forms, so the table the compiler would apply is the one used.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Name the changelog fragment after #350
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Check each entry point under its own nearest tsconfig only
An entry point belongs to the nearest tsconfig.json above it: another
selected tsconfig that also includes it (a root one without the package's
paths) no longer checks it, and an entry point without one gets the
default options rather than the first package's.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Suggest entry points whenever a program without them fails
A package tsconfig that includes tests or scripts (with a lib or rootDir
they don't fit) failed every extraction, and only unresolved modules got
the advice to set inputs.entrypoints. Any analysis failure without entry
points now suggests them.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
---------
Co-authored-by: agorischek <6295280+agorischek@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
-**`typescript-public-api` applies `paths` when only entry points are set** (#350). When `inputs.entrypoints` was set without `inputs.tsconfig`, the extractor used a default program and aliases like `@/commands/config` didn't resolve. It now uses the nearest `tsconfig.json` above each entry point. `typesVersions` ranges written with `^`, `~` or a hyphen (`^5.0`, `~5.9`, `5.0 - 5.9`) are now read as the compiler reads them, so the table that applies is the one used. When the program has errors and no entry points are set, the failure now suggests setting `inputs.entrypoints` to the package's source entry points, which keeps a tsconfig's tests and scripts out of the program.
? "Public API collection requires resolved dependencies and valid types. Some modules didn't resolve: install the repository's dependencies, or set `inputs.entrypoints` so the program holds only what the public API reaches."
179
-
: 'Public API collection requires resolved dependencies and valid types.'
200
+
// Without entry points the program is everything the tsconfig includes, so its tests and scripts fail it too.
201
+
constguidance=[
202
+
'Public API collection requires resolved dependencies and valid types.',
'If the errors are in files the public API doesn\'t import, such as tests or scripts, set `inputs.entrypoints` to its source entry points (for example `{".": "src/index.ts"}`), so the program holds only what they import.',
208
+
]),
209
+
].join(' ')
180
210
thrownewError(
181
211
`TypeScript analysis failed. Fix the project or select \`inputs.tsconfig\` or \`inputs.entrypoints\`. ${guidance}\n${diagnosticText(files.root,errors)}`,
0 commit comments