-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Invalid package.json in @material-ui/core/*/package.json #15715
Comments
@bhldev Could you link us an example where the name is missing? You can use unpkg for that. |
These are not standalone packages. The package.json is just there to assist bundlers in finding the module builds. Is there a documentation for required name fields on npm? Otherwise this sounds like the api-extractor tool should just ignore those packages. |
For everybody else: https://unpkg.com/@material-ui/[email protected]/Backdrop/package.json. |
Hi! Yes https://docs.npmjs.com/creating-a-package-json-file
Thank you! |
@bhldev You you create a minimal repository that fails with the API extractor? I'm a bit hesitant to add the name fields because it's not actually meant to be consumed by anything other than bundlers. Just want to verify that adding a name doesn't trigger other errors. I would prefer if setting private: true would hide it from other tools.
I mean the spec is nice and all but it also requires a version that follows semantic versioning. There are plenty of packages that don't follow that. But it seems like in your particular case omitting the version field would be fine. |
Hello, I created minimal example at https://github.com/bhldev/mui-org-issue15715 It is not every package.json adding one line to @material-ui\core\styles\package.json seems to fix the issue both in our codebase and in the minimal example
I am not sure why, perhaps the @material-ui\core\styles\package.json is treated differently? Run Thanks! |
Looks like a plain create-react-app without any dependency on material-ui packages. Did you forget to push? |
Apologies, pushed, thanks |
Hi @eps1lon, any chance at a look? I could also file an issue with api-explorer. Thanks! |
Won't have time in the next days and it isn't that big of a priority for me since I'm not really sure why this package has to be used on 3rd party libraries. I will fix this at some point but we need to be careful that people don't assume that these are actual packages downloadable from some registry. |
Closing, this sounds like an edge case that doesn't have a high impact. |
Invalid package.json files in @material-ui/core/*/package.json
Package.json must have a name field
Lack of name field causes rollup bundlers such as api-extractor to fail due to requirement for name field
For example, see this issue microsoft/rushstack#1200 in api-extractor
Expected Behavior 🤔
Name field should be present in all package.json files
Version field should be present in all package.json files
Current Behavior 😯
Name field missing
Version field missing
Steps to Reproduce 🕹
Unfortunately, build tools like api-explorer are not browser based and I don't know how to execute command line scripts in sandbox.io
If helpful I will produce a GitHub repository that can be forked
Context 🔦
Trying to bundle up .d.ts files with standard api-extractor bundler
Your Environment 🌎
The text was updated successfully, but these errors were encountered: