From 78f0288bd82dba437b7e5a97ec4af61ac75b390c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Fri, 26 Mar 2021 20:02:43 +0100 Subject: [PATCH] fix(49492): restore alphabetical sort of packages (#52021) Unwated artefact of #49492 was a change in the order of no longer needed pacakges from alphabetical sort to chronological (desc) This commit restores the alphabetical sort. Thanks! /cc @jablko @andrewbranch --- notNeededPackages.json | 16 ++++++++-------- scripts/not-needed.js | 7 +++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/notNeededPackages.json b/notNeededPackages.json index 977b20da7e..ac13062a34 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1265,10 +1265,6 @@ "libraryName": "handsontable", "asOfVersion": "0.35.0" }, - "hapi-auth-jwt2": { - "libraryName": "hapi-auth-jwt2", - "asOfVersion": "8.6.1" - }, "hapi__accept": { "libraryName": "@hapi/accept", "asOfVersion": "5.0.0" @@ -1305,6 +1301,10 @@ "libraryName": "@hapi/wreck", "asOfVersion": "17.0.0" }, + "hapi-auth-jwt2": { + "libraryName": "hapi-auth-jwt2", + "asOfVersion": "8.6.1" + }, "hard-rejection": { "libraryName": "hard-rejection", "asOfVersion": "2.0.0" @@ -2017,10 +2017,6 @@ "libraryName": "matcher", "asOfVersion": "2.0.0" }, - "material-components-web": { - "libraryName": "material-components-web", - "asOfVersion": "1.0.0" - }, "material__animation": { "libraryName": "@material/animation", "asOfVersion": "1.0.0" @@ -2129,6 +2125,10 @@ "libraryName": "@material/top-app-bar", "asOfVersion": "1.0.0" }, + "material-components-web": { + "libraryName": "material-components-web", + "asOfVersion": "1.0.0" + }, "matrix-appservice-bridge": { "libraryName": "matrix-appservice-bridge", "asOfVersion": "2.0.0" diff --git a/scripts/not-needed.js b/scripts/not-needed.js index adc614fa33..08f8178e1c 100644 --- a/scripts/not-needed.js +++ b/scripts/not-needed.js @@ -1,3 +1,4 @@ +/// // Script to remove a package from DefinitelyTyped and add it to notNeededPackages.json const fs = require("fs"); @@ -13,8 +14,14 @@ if (process.argv.length !== 4 && process.argv.length !== 5) { } rmdirRecursive(path.join("types", typingsPackageName)); + +/** @type {{packages: Record }} */ const notNeededPackages = JSON.parse(fs.readFileSync("notNeededPackages.json", "utf-8")); notNeededPackages.packages[typingsPackageName] = { libraryName, asOfVersion }; +const sortedPackages = Object.entries(notNeededPackages.packages).sort((packageA, packageB) => + packageA[0].localeCompare(packageB[0]), +); +notNeededPackages.packages = Object.fromEntries(sortedPackages); fs.writeFileSync("notNeededPackages.json", JSON.stringify(notNeededPackages, undefined, 4) + "\n", "utf-8"); function rmdirRecursive(dir) {