Skip to content

Add _nodeModulePaths to node Module class - #24526

Closed
mohsen1 wants to merge 7 commits into
DefinitelyTyped:masterfrom
mohsen1:patch-32
Closed

mohsen1 wants to merge 7 commits into
DefinitelyTyped:masterfrom
mohsen1:patch-32

Conversation

@mohsen1

@mohsen1 mohsen1 commented Mar 26, 2018

Copy link
Copy Markdown
Contributor

Being used here
https://github.com/webpack/webpack/blob/51b0df77e4f366163730ee465f01458bfad81f34/lib/NormalModule.js#L151

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If adding a new definition:

  • The package does not provide its own types, and you can not add them.
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • tslint.json should be present, and tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

If removing a declaration:

  • If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Mar 26, 2018
@typescript-bot

typescript-bot commented Mar 26, 2018 •

Copy link
Copy Markdown
Contributor

@mohsen1 Thank you for submitting this PR!

🔔 @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot

Copy link
Copy Markdown
Contributor

@mohsen1 The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks!

@ajafff ajafff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not documented in Node's docs and the underscore implies that it's private. The fact that it's used by some project doesn't mean it should be publicly available.

@mohsen1

mohsen1 commented Mar 27, 2018

Copy link
Copy Markdown
Contributor Author

@ajafff marked as deprecated. It's a real API and lack of this property is blocking us migrating to TypeScript.

What is the policy here? Are we not adding types for non-documented stuff?

@typescript-bot

Copy link
Copy Markdown
Contributor

🔔 @ajafff - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate?

@mohsen1

mohsen1 commented Mar 29, 2018

Copy link
Copy Markdown
Contributor Author

@Flarna

Flarna commented Mar 29, 2018

Copy link
Copy Markdown
Contributor

I recommend to use a project local .d.ts file to access such internal, non documented APIs.
Maybe the documented require.resolve.path() (see https://nodejs.org/dist/latest/docs/api/modules.html#modules_require_resolve_paths_request) fits your needs also?

@mohsen1 mohsen1 closed this Mar 29, 2018
@mohsen1

mohsen1 commented Mar 29, 2018

Copy link
Copy Markdown
Contributor Author

Maybe we should not add this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants