@tsrx/oxc 0.12.0 → 0.14.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  `oxc-tsrx` is the complete OXC-shaped TSRX parser, linter, formatter, and
4
4
  language-server host. It uses canonical OXC Rust crates from commit
5
- `8e0ed2ebb96137fb1611cdbd5742d5cb46037d40` of
5
+ `5a6e37e5cf895143a5b34050c50109c46e2ae96a` of
6
6
  <https://github.com/oxc-project/oxc>. OXC is licensed under the MIT License.
7
7
 
8
8
  OXC is consumed as an exact-revision Cargo dependency. Its source is not
package/dist/lint-cli.js CHANGED
@@ -291,6 +291,12 @@ function summaryLines(result, elapsedMilliseconds) {
291
291
  }
292
292
  return lines;
293
293
  }
294
+ function escapeGitHubData(value) {
295
+ return value.replaceAll("%", "%25").replaceAll("\r", "%0D").replaceAll("\n", "%0A");
296
+ }
297
+ function escapeGitHubProperty(value) {
298
+ return escapeGitHubData(value).replaceAll(":", "%3A").replaceAll(",", "%2C");
299
+ }
294
300
  function renderGitHub(result, cwd, elapsedMilliseconds) {
295
301
  const lines = sortedDiagnostics(result).map((diagnostic) => {
296
302
  const span = diagnostic.labels?.[0]?.span;
@@ -301,7 +307,9 @@ function renderGitHub(result, cwd, elapsedMilliseconds) {
301
307
  const filename = relative(cwd, diagnostic.filename) || diagnostic.filename;
302
308
  const severity = diagnostic.severity === "error" ? "error" : "warning";
303
309
  const title = diagnostic.code || diagnostic.rule || "oxlint";
304
- return `::${severity} ${`file=${filename},line=${line},endLine=${endLine},col=${column},endColumn=${endColumn}`},title=${title}::${diagnostic.message}`;
310
+ const message = escapeGitHubData(diagnostic.message);
311
+ if (!filename) return `::${severity} title=${title}::${message}`;
312
+ return `::${severity} ${`file=${escapeGitHubProperty(filename)},line=${line},endLine=${endLine},col=${column},endColumn=${endColumn}`},title=${title}::${escapeGitHubData(filename)}:${line}:${column}: ${message}`;
305
313
  });
306
314
  if (lines.length > 0) lines.push("");
307
315
  lines.push(...summaryLines(result, elapsedMilliseconds));
@@ -479,8 +479,9 @@ function diagnosticNamespace(diagnostic) {
479
479
  * The failures Oxlint's plugin host itself reported, in the user's own terms.
480
480
  *
481
481
  * A rule that throws does not come back as a diagnostic on a file: Oxlint reports
482
- * it with an empty `filename`, no `code`, and no labels, which is exactly the
483
- * shape every other filter in this file drops. Dropping it too would mean a
482
+ * it with no `code` and no labels, which is exactly the shape every other filter
483
+ * in this file drops. Oxlint 1.74 left `filename` empty as well; 1.83 fills it
484
+ * in and opens the message with "Error running JS plugin.", so both shapes count. Dropping it too would mean a
484
485
  * broken rule looks like a rule that found nothing, which is the failure this
485
486
  * whole lane exists to remove. `paths` rewrites the mirror path Oxlint saw back
486
487
  * to the file the developer opened.
@@ -505,9 +506,9 @@ function pluginHostFailures(report, paths = /* @__PURE__ */ new Map()) {
505
506
  const failures = [];
506
507
  for (const diagnostic of report?.diagnostics ?? []) {
507
508
  if (typeof diagnostic?.message !== "string" || diagnostic.message === "") continue;
508
- if (diagnostic.filename !== void 0 && diagnostic.filename !== "") continue;
509
509
  if ((diagnostic.labels ?? []).length > 0) continue;
510
510
  if (typeof diagnostic.code === "string" && diagnostic.code !== "") continue;
511
+ if (!(diagnostic.filename === void 0 || diagnostic.filename === "") && !/^Error running JS plugin\b/u.test(diagnostic.message)) continue;
511
512
  let message = diagnostic.message.split(/\n\s+at /u, 1)[0].trim();
512
513
  const rewrites = [...paths].sort(([left], [right]) => right.length - left.length);
513
514
  for (const [from, to] of rewrites) message = message.split(from).join(to);
package/dist/parser.js CHANGED
@@ -3,18 +3,18 @@ import { isTsrxBinaryProgram, parseTrustedTsrxProgram, parseTsrxProgram } from "
3
3
  import { createRequire } from "node:module";
4
4
  //#region src/parser.ts
5
5
  const require = createRequire(import.meta.url);
6
- const PACKAGE_VERSION = "0.12.0";
6
+ const PACKAGE_VERSION = "0.14.0";
7
7
  const parserManifest = Object.freeze({
8
8
  name: "@tsrx/oxc",
9
9
  version: PACKAGE_VERSION,
10
- dependencies: Object.freeze({ "@oxc-project/types": "0.140.0" }),
10
+ dependencies: Object.freeze({ "@oxc-project/types": "0.150.0" }),
11
11
  optionalDependencies: Object.freeze(Object.fromEntries(NATIVE_TARGETS.map((target) => [nativePackageName(target), PACKAGE_VERSION])))
12
12
  });
13
13
  const API_VERSION = 1;
14
14
  const TRANSPORT_ABI = 1;
15
15
  const NODE_API = 8;
16
16
  const NATIVE_PROTOCOL_VERSION = 2;
17
- const OXC_REVISION = "8e0ed2ebb96137fb1611cdbd5742d5cb46037d40";
17
+ const OXC_REVISION = "5a6e37e5cf895143a5b34050c50109c46e2ae96a";
18
18
  const NODE_ENGINE = "^20.19.0 || >=22.12.0";
19
19
  const ADDON_FILE = "parser.node";
20
20
  const ADDON_ROLE = "canonical-parser";
package/dist/runtime.js CHANGED
@@ -11,7 +11,7 @@ import { existsSync, statSync } from "node:fs";
11
11
  const require = createRequire(import.meta.url);
12
12
  const runtimeManifest = require("../package.json");
13
13
  const NATIVE_PROTOCOL_VERSION = 2;
14
- const OXC_REVISION = "8e0ed2ebb96137fb1611cdbd5742d5cb46037d40";
14
+ const OXC_REVISION = "5a6e37e5cf895143a5b34050c50109c46e2ae96a";
15
15
  const ENVIRONMENTS = {
16
16
  lint: "OXC_TSRX_LINT_BIN",
17
17
  format: "OXC_TSRX_FORMAT_BIN",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsrx/oxc",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "The official OXC integration for TSRX — Rust-native Oxlint and Oxfmt for .tsrx, JavaScript, TypeScript, and JSX",
5
5
  "keywords": [
6
6
  "formatter",
@@ -120,22 +120,22 @@
120
120
  ],
121
121
  "sideEffects": false,
122
122
  "dependencies": {
123
- "@oxc-project/types": "0.140.0",
124
- "oxfmt-current": "npm:oxfmt@0.59.0",
125
- "oxlint-current": "npm:oxlint@1.74.0",
126
- "oxlint-tsgolint": "0.24.0",
123
+ "@oxc-project/types": "0.150.0",
124
+ "oxfmt-current": "npm:oxfmt@0.68.0",
125
+ "oxlint-current": "npm:oxlint@1.83.0",
126
+ "oxlint-tsgolint": "7.0.2002",
127
127
  "pathe": "2.0.3",
128
128
  "tinyglobby": "0.2.17"
129
129
  },
130
130
  "optionalDependencies": {
131
- "@tsrx/oxc-darwin-arm64": "0.12.0",
132
- "@tsrx/oxc-darwin-x64": "0.12.0",
133
- "@tsrx/oxc-linux-arm64-gnu": "0.12.0",
134
- "@tsrx/oxc-linux-arm64-musl": "0.12.0",
135
- "@tsrx/oxc-linux-x64-gnu": "0.12.0",
136
- "@tsrx/oxc-linux-x64-musl": "0.12.0",
137
- "@tsrx/oxc-win32-arm64-msvc": "0.12.0",
138
- "@tsrx/oxc-win32-x64-msvc": "0.12.0"
131
+ "@tsrx/oxc-darwin-arm64": "0.14.0",
132
+ "@tsrx/oxc-darwin-x64": "0.14.0",
133
+ "@tsrx/oxc-linux-arm64-gnu": "0.14.0",
134
+ "@tsrx/oxc-linux-arm64-musl": "0.14.0",
135
+ "@tsrx/oxc-linux-x64-gnu": "0.14.0",
136
+ "@tsrx/oxc-linux-x64-musl": "0.14.0",
137
+ "@tsrx/oxc-win32-arm64-msvc": "0.14.0",
138
+ "@tsrx/oxc-win32-x64-msvc": "0.14.0"
139
139
  },
140
140
  "engines": {
141
141
  "node": "^20.19.0 || >=22.12.0"