Skip to content

Allow "typings": null #10303

New issue

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

Merged
1 commit merged into from
Aug 12, 2016
Merged

Allow "typings": null #10303

1 commit merged into from
Aug 12, 2016

Conversation

ghost
Copy link

@ghost ghost commented Aug 12, 2016

Fixes #10291.
Also fixes #10295.

This solution may not be ideal because it results in us generally parsing the package.json files 2 times; once when we read to determine whether to include the typings, and if so, again later on when we actually resolve the typings.

if (host.directoryExists && host.getDirectories) {
const typeRoots = getEffectiveTypeRoots(options, host);
if (typeRoots) {
for (const root of typeRoots) {
if (host.directoryExists(root)) {
for (const typeDirectivePath of host.getDirectories(root)) {
// Return just the type directive names
result = result.concat(getBaseFileName(normalizePath(typeDirectivePath)));
const normalized = normalizePath(typeDirectivePath)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we normalize here since getDirectories should produce a list of plain directory names, not full paths.

@ghost ghost force-pushed the not_needed_types branch from d0a7d19 to a55b9cc Compare August 12, 2016 14:59
…pings": null` to disclude it from automatically included typings.
@ghost ghost force-pushed the not_needed_types branch from a55b9cc to df739fd Compare August 12, 2016 15:13
@RyanCavanaugh
Copy link
Member

👍

@ghost ghost merged commit b988bc9 into master Aug 12, 2016
@ghost ghost deleted the not_needed_types branch August 12, 2016 15:55
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

library-reference-1.ts fails with runtests-browser Handle empty @types folders properly
2 participants