René's URL Explorer Experiment


Title: Resolving dependency conflicts when importing node package typings · Issue #4665 · microsoft/TypeScript · GitHub

Open Graph Title: Resolving dependency conflicts when importing node package typings · Issue #4665 · microsoft/TypeScript

X Title: Resolving dependency conflicts when importing node package typings · Issue #4665 · microsoft/TypeScript

Description: This issue is explained in details in #2839 Terminology Through out this issue, i will be referring to different ways of declaring external modules, here are what i mean by them. Ambient external module declaration Module declarations of...

Open Graph Description: This issue is explained in details in #2839 Terminology Through out this issue, i will be referring to different ways of declaring external modules, here are what i mean by them. Ambient external m...

X Description: This issue is explained in details in #2839 Terminology Through out this issue, i will be referring to different ways of declaring external modules, here are what i mean by them. Ambient external m...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/4665

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Resolving dependency conflicts when importing node package typings","articleBody":"This issue is explained in details in https://github.com/Microsoft/TypeScript/issues/2839\n## Terminology\n\nThrough out this issue, i will be referring to different ways of declaring external modules, here are what i mean by them.\n#### Ambient external module declaration\n\nModule declarations of the form:\n\n``` ts\ndeclare module \"mod\" {\n    ....\n}\n```\n#### Proper external modules\n\nThe other way of writing a declaration of a module, i.e. a declaration file with a top level `import` or `export`; e.g.:\n\n``` ts\nimport { Contract } from \".\\core\"\nexport var MyContract: Contract;\n```\n#### Script file\n\nA file that is not a module, i.e. does not include a top level `import` or `export`. it could however, include ambient external module declarations as described above.\n## Background\n\nWith module resolution work done in #4154 and #4352, it is possible for node package authors to distribute typings with their packages. For these packages, users do not have to independently acquire the typings from definitely typed, but will just `import` the package, the the compiler will locate the typings in the package directory (either `index.d.ts` or by following `typings` property in `package.json` in the package directory).\n\nAs noted in #2839, for a package author interested in distributing their typings with their package, there are dependencies that they need typings for; the most common would be `node.d.ts`, which is possibly referenced by each package.\n\nThe way they dependency typing are authored today on definitely typed is using _ambient external module declaration_; this indicates that these typings exist in the global scope, and thus are susceptible to conflicts. The classic the diamond dependency issue (courtesy of @poelstra):\n- myprogram\n  - mylib\n    - myutils@1.0\n  - myotherlib\n    - myutils@2.0\n\nNow, if `myUtils.d.ts` uses _ambient external module declaration_, this is guaranteed to result in re-declaration errors.\n## Proposal\n\nWhen resolving an `import` target in a node module, it is an **error** to include files that are **not** either:\n1. **Proper external modules**, or\n2. A **Versioned script file** - see below\n\nFor proper external modules, there are no conflicts expected, as external modules do no polute the global namespace.\n\nFor versioned files, referring to the same library, the compiler will follow a _conflict resolution_ logic picking only the **latest** copy (as described by @basarat in https://github.com/Microsoft/TypeScript/issues/2839#issuecomment-94630741). The files provided on the command line will be allowed to override this conflict resolution policy.\n## Versioned files\n\nThese are files declaring an **identity**, i.e. a name and a version. A versioned file is expected to contain a comment at the top of the form\n\n``` ts\n/// \u003clibrary name=\"myLibraryName\" version=\"1.0.23.2-beta\" />\n```\n\nWhere the `name` field is optional, and if committed, the file name is used instead, and the `version` field follows the version definition in http://semver.org/\n","author":{"url":"https://github.com/mhegazy","@type":"Person","name":"mhegazy"},"datePublished":"2015-09-05T20:22:33Z","url":"https://github.com/microsoft/TypeScript/issues/4665"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1d2de555-0ffa-01bc-0ab8-305bf0280f8b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA15A:21BD98:FFB42:1414B7:6B00F7D7
html-safe-noncefbfcf7df6c233c8d9b7b51e5f3d60d68558c88998eed5ccae2f6f7a76f85bcd9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTVBOjIxQkQ5ODpGRkI0MjoxNDE0Qjc6NkIwMEY3RDciLCJ2aXNpdG9yX2lkIjoiNDE0MTg2MTg2MjcwMDU0NjAwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4f5a9b4b1e667d336ec43c55cba293f61a3685ed9a30cfc9b50cced2d9d33da9
hovercard-subject-tagissue:105047101
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/4665/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fc0f0de635422705090988d72479ba802c49193c4e7d673be93ae4429ce62c7b/microsoft/TypeScript/issues/4665
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fc0f0de635422705090988d72479ba802c49193c4e7d673be93ae4429ce62c7b/microsoft/TypeScript/issues/4665
og:image:altThis issue is explained in details in #2839 Terminology Through out this issue, i will be referring to different ways of declaring external modules, here are what i mean by them. Ambient external m...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemhegazy
hostnamegithub.com
expected-hostnamegithub.com
Nonee208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7dafd017fb7809a839c443dba08622af38e63c09
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/4665#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F4665
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F4665
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/4665
Reloadhttps://github.com/microsoft/TypeScript/issues/4665
Reloadhttps://github.com/microsoft/TypeScript/issues/4665
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/4665
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/4665
Resolving dependency conflicts when importing node package typingshttps://github.com/microsoft/TypeScript/issues/4665#top
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 5, 2015https://github.com/microsoft/TypeScript/issues/4665#issue-105047101
#2839https://github.com/microsoft/TypeScript/issues/2839
#4154https://github.com/microsoft/TypeScript/pull/4154
#4352https://github.com/microsoft/TypeScript/pull/4352
#2839https://github.com/microsoft/TypeScript/issues/2839
Martin Poelstra (@poelstra)https://github.com/poelstra
Basarat Ali Syed (@basarat)https://github.com/basarat
#2839 (comment)https://github.com/microsoft/TypeScript/issues/2839#issuecomment-94630741
http://semver.org/http://semver.org/
Nexthttps://github.com/microsoft/TypeScript/issues/4665?timeline_page=1
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 5, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-137993403
Vladimir Matveev (@vladima)https://github.com/vladima
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Basarat Ali Syed (@basarat)https://github.com/basarat
Martin Poelstra (@poelstra)https://github.com/poelstra
johnnyreillhttps://github.com/johnnyreill
James Brantly (@jbrantly)https://github.com/jbrantly
Zoltu (@Zoltu)https://github.com/Zoltu
Wesley Wigham (@weswigham)https://github.com/weswigham
Matt Frantz (@mhfrantz)https://github.com/mhfrantz
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Sep 5, 2015https://github.com/microsoft/TypeScript/issues/4665#event-401966487
https://github.com/MicahZoltu
Micah Zoltu (MicahZoltu)https://github.com/MicahZoltu
on Sep 5, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138002350
Basarat Ali Syed (@basarat)https://github.com/basarat
#2839https://github.com/microsoft/TypeScript/issues/2839
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 5, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138004402
John Reilly (@johnnyreilly)https://github.com/johnnyreilly
pointed out herehttps://github.com/Microsoft/TypeScript/issues/2839#issuecomment-94699672
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138010529
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138015584
Wesley Wigham (@weswigham)https://github.com/weswigham
#4668https://github.com/microsoft/TypeScript/issues/4668
https://github.com/vvakame
Masahiro Wakame (vvakame)https://github.com/vvakame
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138016259
#2338https://github.com/microsoft/TypeScript/issues/2338
#3232https://github.com/microsoft/TypeScript/pull/3232
https://github.com/poelstra
Martin Poelstra (poelstra)https://github.com/poelstra
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138086541
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
#2839https://github.com/microsoft/TypeScript/issues/2839
#2839https://github.com/microsoft/TypeScript/issues/2839
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
#2338https://github.com/microsoft/TypeScript/issues/2338
https://github.com/poelstra
Martin Poelstra (poelstra)https://github.com/poelstra
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138096891
#4673https://github.com/microsoft/TypeScript/issues/4673
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138132870
#4352https://github.com/microsoft/TypeScript/pull/4352
James Brantly (@jbrantly)https://github.com/jbrantly
Martin Poelstra (@poelstra)https://github.com/poelstra
#4673https://github.com/microsoft/TypeScript/issues/4673
Zoltu (@Zoltu)https://github.com/Zoltu
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/mhfrantz
Matt Frantz (mhfrantz)https://github.com/mhfrantz
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138134615
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 6, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138136589
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Sep 7, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138139179
Zoltu (@Zoltu)https://github.com/Zoltu
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/heycalmdown
Kei Son (heycalmdown)https://github.com/heycalmdown
on Sep 7, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138243125
https://github.com/poelstra
Martin Poelstra (poelstra)https://github.com/poelstra
on Sep 7, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138387741
#4668 (comment)https://github.com/microsoft/TypeScript/issues/4668#issuecomment-138376581
#4665 (comment)https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138370373
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 7, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-138392382
https://github.com/heycalmdown
Kei Son (heycalmdown)https://github.com/heycalmdown
on Sep 14, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-140214471
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 15, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-140246466
#4738https://github.com/microsoft/TypeScript/pull/4738
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 17, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-141145473
Vladimir Matveev (@vladima)https://github.com/vladima
#4738https://github.com/microsoft/TypeScript/pull/4738
#4667https://github.com/microsoft/TypeScript/issues/4667
https://github.com/heycalmdown
Kei Son (heycalmdown)https://github.com/heycalmdown
on Sep 17, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-141280488
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
#2338https://github.com/microsoft/TypeScript/issues/2338
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Sep 18, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-141292543
James Brantly (@jbrantly)https://github.com/jbrantly
Wesley Wigham (@weswigham)https://github.com/weswigham
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 18, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-141293003
#4738https://github.com/microsoft/TypeScript/pull/4738
Vladimir Matveev (@vladima)https://github.com/vladima
https://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packageshttps://github.com/Microsoft/TypeScript/wiki/Typings-for-npm-packages
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 18, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-141482579
Wesley Wigham (@weswigham)https://github.com/weswigham
#4668https://github.com/microsoft/TypeScript/issues/4668
Proposal: Localized typings for definition files #4668https://github.com/microsoft/TypeScript/issues/4668
Proposal: Localized typings for definition files #4668https://github.com/microsoft/TypeScript/issues/4668
#4337https://github.com/microsoft/TypeScript/issues/4337
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
#4337https://github.com/microsoft/TypeScript/issues/4337
#4673https://github.com/microsoft/TypeScript/issues/4673
#4337https://github.com/microsoft/TypeScript/issues/4337
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 18, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-141575750
#4337https://github.com/microsoft/TypeScript/issues/4337
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Sep 21, 2015https://github.com/microsoft/TypeScript/issues/4665#issuecomment-142084432
#4877https://github.com/microsoft/TypeScript/issues/4877
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Jul 21, 2016https://github.com/microsoft/TypeScript/issues/4665#issuecomment-234415784
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 21, 2016https://github.com/microsoft/TypeScript/issues/4665#event-731135372
https://github.com/jamir0
Yurii Beiko (jamir0)https://github.com/jamir0
on Feb 10, 2017https://github.com/microsoft/TypeScript/issues/4665#issuecomment-278900678
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/4665#event-1689614095
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/4665
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/4665
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.