oxlint-plugin-vize 0.268.0 → 0.269.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/dist/cli.mjs +15 -9
  2. package/package.json +10 -10
package/dist/cli.mjs CHANGED
@@ -108,18 +108,24 @@ function resolveOxlintCliEntrypoint(cwd) {
108
108
  //#region src/cli/output.ts
109
109
  function rewriteReportedPaths(output, replacements) {
110
110
  let rewritten = output;
111
- const orderedReplacements = [...replacements].sort((left, right) => right[0].length - left[0].length);
111
+ const orderedReplacements = buildReplacementVariants(replacements).sort((left, right) => right[0].length - left[0].length);
112
112
  for (const [from, to] of orderedReplacements) rewritten = rewritten.split(from).join(to);
113
113
  return rewritten;
114
114
  }
115
- if (import.meta.vitest) {
116
- const { describe, expect, it } = import.meta.vitest;
117
- describe("rewriteReportedPaths", () => {
118
- it("rewrites both absolute and relative temporary filenames", () => {
119
- const replacements = new Map([["/repo/node_modules/.vize/oxlint-plugin-vize/100-abcd/0-Example.vue", "/repo/src/Example.vue"], ["node_modules/.vize/oxlint-plugin-vize/100-abcd/0-Example.vue", "/repo/src/Example.vue"]]);
120
- expect(rewriteReportedPaths(["node_modules/.vize/oxlint-plugin-vize/100-abcd/0-Example.vue", "/repo/node_modules/.vize/oxlint-plugin-vize/100-abcd/0-Example.vue"].join("\n"), replacements)).toBe(["/repo/src/Example.vue", "/repo/src/Example.vue"].join("\n"));
121
- });
122
- });
115
+ function buildReplacementVariants(replacements) {
116
+ const variants = /* @__PURE__ */ new Map();
117
+ for (const [from, to] of replacements) {
118
+ registerReplacementVariant(variants, from, to);
119
+ registerReplacementVariant(variants, escapeJsonStringSegment(from), escapeJsonStringSegment(to));
120
+ }
121
+ return [...variants];
122
+ }
123
+ function registerReplacementVariant(variants, from, to) {
124
+ if (!from || !to) return;
125
+ variants.set(from, to);
126
+ }
127
+ function escapeJsonStringSegment(value) {
128
+ return JSON.stringify(value).slice(1, -1);
123
129
  }
124
130
  //#endregion
125
131
  //#region src/cli/workaround-files.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-vize",
3
- "version": "0.268.0",
3
+ "version": "0.269.0",
4
4
  "description": "Oxlint JS plugin bridge for Vize Patina",
5
5
  "keywords": [
6
6
  "lint",
@@ -44,21 +44,21 @@
44
44
  "devDependencies": {
45
45
  "@tsdown/css": "0.22.0",
46
46
  "@types/node": "25.9.2",
47
- "@vizejs/native": "0.268.0",
47
+ "@vizejs/native": "0.269.0",
48
48
  "tsdown": "0.22.0",
49
49
  "typescript": "6.0.3",
50
50
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.21",
51
51
  "vite-plus": "0.1.21"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@vizejs/native-darwin-arm64": "0.268.0",
55
- "@vizejs/native-darwin-x64": "0.268.0",
56
- "@vizejs/native-linux-arm64-gnu": "0.268.0",
57
- "@vizejs/native-linux-arm64-musl": "0.268.0",
58
- "@vizejs/native-linux-x64-gnu": "0.268.0",
59
- "@vizejs/native-linux-x64-musl": "0.268.0",
60
- "@vizejs/native-win32-arm64-msvc": "0.268.0",
61
- "@vizejs/native-win32-x64-msvc": "0.268.0"
54
+ "@vizejs/native-darwin-arm64": "0.269.0",
55
+ "@vizejs/native-darwin-x64": "0.269.0",
56
+ "@vizejs/native-linux-arm64-gnu": "0.269.0",
57
+ "@vizejs/native-linux-arm64-musl": "0.269.0",
58
+ "@vizejs/native-linux-x64-gnu": "0.269.0",
59
+ "@vizejs/native-linux-x64-musl": "0.269.0",
60
+ "@vizejs/native-win32-arm64-msvc": "0.269.0",
61
+ "@vizejs/native-win32-x64-msvc": "0.269.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": "^22 || >= 24"