Skip to content

Commit

Permalink
fix: fix pinst running in wrong directory
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed May 18, 2024
1 parent 8b32bbf commit bdbb210
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
7 changes: 4 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {resolve} from "node:path";
import * as pinst from "pinst";

export async function prepare(
pluginConfig: unknown,
context: {readonly cwd: string}
{pkgRoot}: {readonly pkgRoot?: string},
{cwd}: {readonly cwd: string}
): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
pinst.disableAndSave(context.cwd);
pinst.disableAndSave(pkgRoot == null ? cwd : resolve(cwd, pkgRoot));
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@softwareventures/prettier-config": "4.0.0",
"@softwareventures/semantic-release-config": "4.1.0",
"@softwareventures/tsconfig": "8.0.0",
"@types/node": "17.0.45",
"@types/node": "20.12.12",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"ava": "6.1.3",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "@softwareventures/tsconfig",
"compilerOptions": {
"types": ["./types/pinst"]
"types": ["node", "./types/pinst"]
},
"exclude": ["**/*.test.ts", "**/test.ts"]
}
11 changes: 2 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:*":
"@types/node@npm:*, @types/node@npm:20.12.12":
version: 20.12.12
resolution: "@types/node@npm:20.12.12"
dependencies:
Expand All @@ -1185,13 +1185,6 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:17.0.45":
version: 17.0.45
resolution: "@types/node@npm:17.0.45"
checksum: 10c0/0db377133d709b33a47892581a21a41cd7958f22723a3cc6c71d55ac018121382de42fbfc7970d5ae3e7819dbe5f40e1c6a5174aedf7e7964e9cb8fa72b580b0
languageName: node
linkType: hard

"@types/normalize-package-data@npm:^2.4.3":
version: 2.4.4
resolution: "@types/normalize-package-data@npm:2.4.4"
Expand Down Expand Up @@ -6774,7 +6767,7 @@ __metadata:
"@softwareventures/prettier-config": "npm:4.0.0"
"@softwareventures/semantic-release-config": "npm:4.1.0"
"@softwareventures/tsconfig": "npm:8.0.0"
"@types/node": "npm:17.0.45"
"@types/node": "npm:20.12.12"
"@typescript-eslint/eslint-plugin": "npm:7.9.0"
"@typescript-eslint/parser": "npm:7.9.0"
ava: "npm:6.1.3"
Expand Down

0 comments on commit bdbb210

Please sign in to comment.