algolia / npm-search

πŸ—Ώ npm ↔️ Algolia replication tool :skier: :snail: :artificial_satellite:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ghost versions in Prismjs

SaraVieira opened this issue Β· comments

πŸ‘‹

We use this at CodeSandbox to get the available versions of packages and weirdly enough prismjs is returning two ghost version

9000.0.1: "2015-05-12T23:54:40.643Z"
9000.0.2: "2015-05-12T23:56:14.033Z"

These versions don't seem to exist in the npm registry http://registry.npmjs.org/prismjs or in npm itself

Some service may be returning weird versions

Relevant codesandbox issue: codesandbox/codesandbox-client#3876

Thank you

I've looked into it, and the version indeed doesn't exist in the versions key on https://registry.npmjs.org/prismjs, but it does exist in the time key.

What we'll need to change in the versions calculation is checking if a key in time is available in versions

{
  "_id": "prismjs",
  "versions": {
    "0.0.1": {}, // ...
    // does not include 9000.x
  },
  "time": {
    "modified": "2020-04-04T01:04:57.069Z",
    "created": "2015-05-12T23:54:40.643Z",
    "9000.0.1": "2015-05-12T23:54:40.643Z",
    "9000.0.2": "2015-05-12T23:56:14.033Z",
    "0.0.1": "2015-05-13T00:37:38.541Z",
    "1.1.0": "2015-10-06T00:03:04.995Z",
    // ...
  },
  //  ...
}

temporarily removed those two versions from the production index now :)