Skip to content
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

Webpack 5 expects package.json in each node_modules subfolder (Managed item <...> isn't a directory or doesn't contain a package.json (see snapshot.managedPaths option)) #7

Open
ghost opened this issue May 19, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented May 19, 2022

I've described the problem here: danmarshall/deckgl-typings#203 (comment)

Either all users of indefinitely-typed must bring their own package.json (= change indefinitely-typed documentation), or indefinitely-typed should generate a package.json (= implement feature in indefinitely-typed).

Another alternative would be to blacklist certain folders for webpack 5 managedPaths (See webpack/webpack#14509).
However, it still breaks assumptions that other tools also might have about node_modules/**/package.json and it's probably not a scalable solution (because the regex probably quickly explodes).

@danmarshall
Copy link
Owner

Do we know what should be contained within this package.json file?

@ghost
Copy link
Author

ghost commented Jun 7, 2022

For webpack, at least everything that is mentioned here: danmarshall/deckgl-typings#203 (comment) (name and version).

https://docs.npmjs.com/cli/v8/configuring-npm/package-json also only mentions name and version as required for published packages (although I'm not sure if it makes sense to have it fully npm compatible as well, even if it required more).

Also, a generated package.json should probably start with a comment, which informs the reader that this is a generated stub for tools like webpack (which could be done in the description field).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant