Skip to content

Commit

Permalink
feat(tags): add tags to the schema
Browse files Browse the repository at this point in the history
This is useful for when you have multiple tags (latest, beta, next, RC).

I want to show this on the Yarn website, so it needs to be in the index
  • Loading branch information
Haroenv committed Aug 16, 2017
1 parent 8dd2cda commit 57a476e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ For every single NPM package, we create a record in the Algolia index. The resul
"humanDownloadsLast30Days": "7.7m",
"popular": true,
"version": "6.24.0",
"versions": {
"4.0.1": "2015-02-15T14:15:48.555Z",
"4.0.2": "2015-02-17T02:14:19.635Z",
"4.1.1": "2015-02-17T13:05:27.250Z",
"4.2.0": "2015-02-18T00:32:53.715Z",
[...]
},
"tags": {"latest":"6.25.0","old":"5.8.38","next":"7.0.0-alpha.19"},
"description": "Babel compiler core.",
"dependencies": {
"babel-code-frame": "^6.22.0",
Expand Down
3 changes: 3 additions & 0 deletions formatPkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export default function formatPkg(pkg) {

const versions = getVersions(cleaned);

const tags = pkg['dist-tags'];

const rawPkg = {
objectID: cleaned.name,
name: cleaned.name,
Expand All @@ -52,6 +54,7 @@ export default function formatPkg(pkg) {
popular: false,
version,
versions,
tags,
description: cleaned.description ? cleaned.description : null,
dependencies,
devDependencies,
Expand Down

0 comments on commit 57a476e

Please sign in to comment.