diff --git a/package.json b/package.json index 1dc028ca72b8..3424d11b4df1 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "jasmine-core": "^3.5.0", "jest": "^26.1.0", "jmespath": "^0.15.0", + "json5": "^2.2.0", "karma": "^5.1.0", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.1.0", diff --git a/tests/versions/tslib.ts b/tests/versions/tslib.ts index b40072c6da50..b74b69736035 100644 --- a/tests/versions/tslib.ts +++ b/tests/versions/tslib.ts @@ -3,8 +3,8 @@ */ import { execSync } from "child_process"; import { readFileSync } from "fs"; - -import * as expectedVersions from "./versions.json"; +import JSON from "json5"; +import { join } from "path"; type PackageInfo = { name: string; @@ -14,6 +14,7 @@ type PackageInfo = { }; console.log("Validating the tslib and tsc version is consistent within workspace."); +const expectedVersions: { [name: string]: string } = JSON.parse(readFileSync(join(__dirname, "versions.json"), "utf8")); const packagesInfo: PackageInfo[] = JSON.parse(execSync("./node_modules/.bin/lerna list -l --json").toString()); for (const { name, location } of packagesInfo) { const manifest = readFileSync(`${location}/package.json`, "utf8"); diff --git a/tests/versions/versions.json b/tests/versions/versions.json index ea06a12e5b96..2c7e93e2bf2e 100644 --- a/tests/versions/versions.json +++ b/tests/versions/versions.json @@ -1,4 +1,5 @@ { + // You need to make sure "tslib" version is compatible with typescript version. "tslib": "^2.3.0", "typescript": "~4.3.2" } diff --git a/yarn.lock b/yarn.lock index 5828b4b6cd8a..c5e0014786d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7205,7 +7205,7 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@2.x, json5@^2.1.2: +json5@2.x, json5@^2.1.2, json5@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==