Skip to content

Commit 57a476e

Browse files
committed
feat(tags): add tags to the schema
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
1 parent 8dd2cda commit 57a476e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ For every single NPM package, we create a record in the Algolia index. The resul
4646
"humanDownloadsLast30Days": "7.7m",
4747
"popular": true,
4848
"version": "6.24.0",
49+
"versions": {
50+
"4.0.1": "2015-02-15T14:15:48.555Z",
51+
"4.0.2": "2015-02-17T02:14:19.635Z",
52+
"4.1.1": "2015-02-17T13:05:27.250Z",
53+
"4.2.0": "2015-02-18T00:32:53.715Z",
54+
[...]
55+
},
56+
"tags": {"latest":"6.25.0","old":"5.8.38","next":"7.0.0-alpha.19"},
4957
"description": "Babel compiler core.",
5058
"dependencies": {
5159
"babel-code-frame": "^6.22.0",

formatPkg.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export default function formatPkg(pkg) {
4242

4343
const versions = getVersions(cleaned);
4444

45+
const tags = pkg['dist-tags'];
46+
4547
const rawPkg = {
4648
objectID: cleaned.name,
4749
name: cleaned.name,
@@ -52,6 +54,7 @@ export default function formatPkg(pkg) {
5254
popular: false,
5355
version,
5456
versions,
57+
tags,
5558
description: cleaned.description ? cleaned.description : null,
5659
dependencies,
5760
devDependencies,

0 commit comments

Comments
 (0)