@pob/root 28.7.0 → 28.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/oxlint.js +29 -2
  2. package/package.json +6 -6
package/bin/oxlint.js CHANGED
@@ -1,21 +1,48 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import fs from "node:fs";
3
4
  import { createRequire } from "node:module";
5
+ import path from "node:path";
4
6
  import pkg from "oxlint/package.json" with { type: "json" };
5
7
 
8
+ /**
9
+ * tsrs-lint of the project's tsrs (0.21+), the same compiler as its "tsc"
10
+ * script: a Rust port of tsgolint, using less memory.
11
+ */
12
+ const resolveTsrsLint = () => {
13
+ try {
14
+ const tsrsPackageJsonPath = createRequire(
15
+ path.resolve("package.json"),
16
+ ).resolve("tsrs/package.json");
17
+ const tsrsLintBin = JSON.parse(fs.readFileSync(tsrsPackageJsonPath, "utf8"))
18
+ .bin?.["tsrs-lint"];
19
+ return tsrsLintBin
20
+ ? path.resolve(path.dirname(tsrsPackageJsonPath), tsrsLintBin)
21
+ : undefined;
22
+ } catch {
23
+ return undefined;
24
+ }
25
+ };
26
+
6
27
  // oxlint looks for tsgolint (type-aware rules) in the project's
7
28
  // node_modules/.bin, which does not contain the bins of @pob/root dependencies
8
- if (!process.env.OXLINT_TSGOLINT_PATH) {
29
+ const resolveTsgolint = () => {
9
30
  const require = createRequire(
10
31
  import.meta.resolve("oxlint-tsgolint/package.json"),
11
32
  );
12
33
  try {
13
- process.env.OXLINT_TSGOLINT_PATH = require.resolve(
34
+ return require.resolve(
14
35
  `@oxlint-tsgolint/${process.platform}-${process.arch}/tsgolint${process.platform === "win32" ? ".exe" : ""}`,
15
36
  );
16
37
  } catch {
17
38
  // unsupported platform: oxlint reports the missing tsgolint when needed
39
+ return undefined;
18
40
  }
41
+ };
42
+
43
+ if (!process.env.OXLINT_TSGOLINT_PATH) {
44
+ const tsgolintPath = resolveTsrsLint() || resolveTsgolint();
45
+ if (tsgolintPath) process.env.OXLINT_TSGOLINT_PATH = tsgolintPath;
19
46
  }
20
47
 
21
48
  await import(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/root",
3
- "version": "28.7.0",
3
+ "version": "28.8.0",
4
4
  "description": "root package",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/christophehurpeau/pob",
@@ -66,17 +66,17 @@
66
66
  "@commitlint/format": "21.2.3",
67
67
  "@commitlint/lint": "21.2.4",
68
68
  "@commitlint/types": "21.2.3",
69
- "@pob/version": "8.5.0",
69
+ "@pob/version": "8.6.0",
70
70
  "conventional-changelog-conventionalcommits": "^10.0.0",
71
71
  "conventional-changelog-writer": "^9.0.0",
72
72
  "conventional-commits-parser": "^7.0.0",
73
73
  "json5": "^2.2.3",
74
74
  "lint-staged": "17.6.0",
75
- "oxfmt": "0.75.0",
76
- "oxlint": "1.90.0",
77
- "oxlint-tsgolint": "7.0.2005",
75
+ "oxfmt": "0.78.0",
76
+ "oxlint": "1.93.0",
77
+ "oxlint-tsgolint": "7.0.2006",
78
78
  "picomatch": "^4.0.7",
79
- "pob-dependencies": "28.7.0",
79
+ "pob-dependencies": "28.8.0",
80
80
  "semver": "^7.7.3"
81
81
  },
82
82
  "engines": {