Skip to content

Commit 1574f21

Browse files
committedJun 11, 2023
fix: use the projectPath from @anolilab/package-json-utils
Signed-off-by: prisis <d.bannert@anolilab.de>
1 parent a96329b commit 1574f21

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed
 

‎packages/babel-preset/src/postinstall.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22

3-
import { packageIsTypeModule } from "@anolilab/package-json-utils";
3+
import { packageIsTypeModule, projectPath } from "@anolilab/package-json-utils";
44
import { existsSync, writeFile } from "node:fs";
5-
import { join, resolve } from "node:path";
5+
import { join } from "node:path";
66
import { promisify } from "node:util";
77

88
if (process.env["CI"]) {
@@ -12,10 +12,6 @@ if (process.env["CI"]) {
1212

1313
const writeFileAsync = promisify(writeFile);
1414

15-
// get the path to the host project.
16-
// eslint-disable-next-line no-undef
17-
const projectPath = resolve(process.cwd(), "..", "..", "..");
18-
1915
console.log("Configuring @anolilab/babel-preset", projectPath, "\n");
2016

2117
/**

‎packages/prettier-config/src/postinstall.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22

3-
import { packageIsTypeModule } from "@anolilab/package-json-utils";
3+
import { packageIsTypeModule, projectPath } from "@anolilab/package-json-utils";
44
import { existsSync, writeFile } from "node:fs";
5-
import { join, resolve } from "node:path";
5+
import { join } from "node:path";
66
import { promisify } from "node:util";
77

88
import content from "./index";
@@ -14,10 +14,6 @@ if (process.env["CI"]) {
1414

1515
const writeFileAsync = promisify(writeFile);
1616

17-
// get the path to the host project.
18-
// eslint-disable-next-line no-undef
19-
const projectPath = resolve(process.cwd(), "..", "..", "..");
20-
2117
console.log("Configuring @anolilab/prettier-config", projectPath, "\n");
2218

2319
/**

‎packages/textlint-config/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"postinstall": "node ./skip.js || node ./dist/postinstall.js"
4545
},
4646
"dependencies": {
47+
"@anolilab/package-json-utils": "1.2.0",
4748
"@textlint-rule/textlint-rule-no-invalid-control-character": "^2.0.0",
4849
"@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.9",
4950
"@textlint-rule/textlint-rule-preset-google": "^0.1.2",

‎packages/textlint-config/src/postinstall.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env node
22

3+
import { projectPath } from "@anolilab/package-json-utils";
34
import { existsSync, writeFile } from "node:fs";
4-
import { join, resolve } from "node:path";
5+
import { join } from "node:path";
56
import { promisify } from "node:util";
67

78
if (process.env["CI"]) {
@@ -11,10 +12,6 @@ if (process.env["CI"]) {
1112

1213
const writeFileAsync = promisify(writeFile);
1314

14-
// get the path to the host project.
15-
// eslint-disable-next-line no-undef
16-
const projectPath = resolve(process.cwd(), "..", "..", "..");
17-
1815
console.log("Configuring @anolilab/textlint-config", projectPath, "\n");
1916

2017
/**

‎pnpm-lock.yaml

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.