-
Notifications
You must be signed in to change notification settings - Fork 220
Include nested package.json files in generated DefinitelyTyped packages #1195
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: andrewbranch <[email protected]>
Co-authored-by: andrewbranch <[email protected]>
Co-authored-by: andrewbranch <[email protected]>
@copilot see my review above |
Co-authored-by: andrewbranch <[email protected]>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot you commited a package-lock.json when we use pnpm |
Co-authored-by: andrewbranch <[email protected]>
Fixed in commit 0a8f4c4. Removed the incorrectly committed package-lock.json file since this repository uses pnpm, not npm. |
addFileIfDeclaration
toaddFileIfIncluded
to better reflect its purposeChanges Made
Problem Addressed
Some DefinitelyTyped packages need nested
package.json
files to control module type per subfolder (e.g.,src
as ESM andlib
as CJS). The file enumeration logic needed to be updated to include these nested configuration files while excluding the root package.json which is handled specially.Solution
Modified the
getFiles()
function inpackages/definitions-parser/src/lib/definition-parser.ts
:addFileIfDeclaration
toaddFileIfIncluded
for claritypath.endsWith('/package.json')
Testing
This enables DefinitelyTyped packages to properly support mixed module systems within a single package.
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.