Skip to content

Commit

Permalink
Updated package-json dependency (#181)
Browse files Browse the repository at this point in the history
* Bump cli-dep: package-json to 8.1.0

This doesn't update yarn.lock as I'm not sure your procedure for that, and I'm using the web-editor currently.

* Switch to dynamic-import for package-json

It went ESM-only

* Update yarn.lock

* regenerate lockfile

* use `keepDynamicImportAsDynamicImportInCommonJS`

* add changeset

* remove redundant await

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
fbartho and Andarist committed Nov 29, 2023
1 parent 916f647 commit 1e31ced
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 114 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-cherries-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@manypkg/cli": patch
---

Updated `package-json` dependency.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
"preconstruct": {
"packages": [
"packages/!(gatsby)*"
]
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"keepDynamicImportAsDynamicImportInCommonJS": true
}
}
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"fs-extra": "^8.1.0",
"normalize-path": "^3.0.0",
"p-limit": "^2.2.1",
"package-json": "^6.5.0",
"package-json": "^8.1.0",
"parse-github-url": "^1.0.2",
"sembear": "^0.5.0",
"semver": "^6.3.0",
Expand Down
9 changes: 4 additions & 5 deletions packages/cli/src/upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getPackages, Packages } from "@manypkg/get-packages";
import { getPackages } from "@manypkg/get-packages";
import semver from "semver";
import { DEPENDENCY_TYPES, versionRangeToRangeType } from "./checks/utils";
import getPackageJson from "package-json";
import pLimit from "p-limit";

import { writePackage, install } from "./utils";
Expand Down Expand Up @@ -99,10 +98,10 @@ const npmRequestLimit = pLimit(40);

export function getPackageInfo(pkgName: string) {
return npmRequestLimit(async () => {
let result = await getPackageJson(pkgName, {
const getPackageJson = (await import("package-json")).default;

return getPackageJson(pkgName, {
allVersions: true,
});

return result;
});
}

0 comments on commit 1e31ced

Please sign in to comment.