npms-io / npms-analyzer

The analyzer behind https://npms.io
MIT License
317 stars 38 forks source link

README size is wrong #258

Closed L2jLiga closed 2 years ago

L2jLiga commented 3 years ago

I have an package - fastify-decorators with REAME but APIs response says that README size is 0

bennobuilder commented 3 years ago

@agile-ts/core got the same issue.

In AgileTs the issue arises because the readme isn't directly located in the GitHub repository package (packages/core/). Instead, the readme is located at the root of the repository and is added during the publishing process to the core package. We do that to avoid redundant readmes. Because we want to display the same readme on the GitHub repository landing page, which is only possible if it's in the root of the project, and of course in the core package itself. Therefore we have created a simple script that moves the readme from the root of the project into the core package during the build.

  fs.copySync('../../README.md', './README.md');
  fs.copySync('../../LICENSE', './LICENSE');

grafik

Unfortunately, the npms-analyzer checks the readme in the GitHub repository and not from npm itself. But I guess it won't be hard to fix since the npms-analyzer already fetched the readme from somewhere else. Otherwise, the whole readme wouldn't appear in collected.metadata.readme

grafik

A temporary workaround would be to add a dummy readme into the core package to fake the readme.. since we don't want to always copy and paste the readme if a small change got made.

But I guess your problem isn't related to mine. Since your repository doesn't look like a monorepo.

satazor commented 2 years ago

This was fixed in: https://github.com/npms-io/npms-analyzer/commit/bfee077ab3dc7a2a6a5bea20895500e143234a7b If you publish a new version of the package, you should see the readmeSize with the correct size.