@vizejs/nuxt 0.504.0 → 0.506.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.
@@ -163,16 +163,22 @@ function spawnOxlint(node, entrypoint, args, cwd) {
163
163
  });
164
164
  child.on("close", (status) => {
165
165
  const output = Buffer.concat(stdout).toString("utf8");
166
+ const details = Buffer.concat(stderr).toString("utf8");
166
167
  if (output.trim()) {
167
- resolve(output);
168
+ resolve({
169
+ stderr: details,
170
+ stdout: output
171
+ });
168
172
  return;
169
173
  }
170
- const details = Buffer.concat(stderr).toString("utf8").trim();
171
174
  if (status === 0) {
172
- resolve("{\"diagnostics\":[]}\n");
175
+ resolve({
176
+ stderr: details,
177
+ stdout: "{\"diagnostics\":[]}\n"
178
+ });
173
179
  return;
174
180
  }
175
- reject(/* @__PURE__ */ new Error(`oxlint exited with ${String(status)} without JSON output${details ? `: ${details}` : ""}`));
181
+ reject(/* @__PURE__ */ new Error(`oxlint exited with ${String(status)} without JSON output${details.trim() ? `: ${details.trim()}` : ""}`));
176
182
  });
177
183
  });
178
184
  }
@@ -206,7 +212,7 @@ function formatNuxtLintCheckerDiagnostics(diagnostics, formatter) {
206
212
  });
207
213
  return lines.length > 0 ? `${lines.join("\n")}\n` : "";
208
214
  }
209
- function resultFromPayload(payload, task) {
215
+ function resultFromPayload(payload, task, stderr) {
210
216
  const diagnostics = payload.diagnostics.filter((diagnostic) => {
211
217
  const kind = diagnosticKind(diagnostic);
212
218
  return kind === "error" && task.emitError || kind === "warning" && task.emitWarning;
@@ -217,11 +223,13 @@ function resultFromPayload(payload, task) {
217
223
  ...payload,
218
224
  diagnostics
219
225
  })}\n` : "" : formatNuxtLintCheckerDiagnostics(diagnostics, task.formatter);
226
+ const notice = stderr.trim();
220
227
  return {
221
228
  diagnostics,
222
229
  diagnosticCount: diagnostics.length,
223
230
  hasErrors,
224
231
  hasWarnings,
232
+ notices: notice ? [notice] : [],
225
233
  output
226
234
  };
227
235
  }
@@ -232,17 +240,18 @@ async function runNuxtLintCheckerTask(task) {
232
240
  diagnosticCount: 0,
233
241
  hasErrors: false,
234
242
  hasWarnings: false,
243
+ notices: [],
235
244
  output: ""
236
245
  };
237
- const stdout = await executeOxlint(task.oxlintEntrypoint ?? resolveOxlintEntrypoint(), await checkerArgs(task), task.cwd);
246
+ const execution = await executeOxlint(task.oxlintEntrypoint ?? resolveOxlintEntrypoint(), await checkerArgs(task), task.cwd);
238
247
  let payload;
239
248
  try {
240
- payload = JSON.parse(stdout);
249
+ payload = JSON.parse(execution.stdout);
241
250
  } catch (error) {
242
- throw new Error(`oxlint returned invalid JSON: ${stdout.slice(0, 240)}`, { cause: error });
251
+ throw new Error(`oxlint returned invalid JSON: ${execution.stdout.slice(0, 240)}`, { cause: error });
243
252
  }
244
253
  if (!Array.isArray(payload.diagnostics)) throw new Error("oxlint JSON has no diagnostics array");
245
- return resultFromPayload(payload, task);
254
+ return resultFromPayload(payload, task, execution.stderr);
246
255
  }
247
256
  function serializeError(error) {
248
257
  if (error instanceof Error) return {
@@ -408,6 +417,7 @@ var NuxtLintChangeCollector = class {
408
417
  return path.resolve(this.config.rootDir, file);
409
418
  }
410
419
  report(result, targets, full) {
420
+ for (const notice of result.notices) this.server.config.logger.warn(notice);
411
421
  if (result.output) {
412
422
  if (result.hasErrors) this.server.config.logger.error(result.output);
413
423
  else if (result.hasWarnings) this.server.config.logger.warn(result.output);
@@ -467,6 +477,7 @@ function checkerError(message) {
467
477
  return error;
468
478
  }
469
479
  function reportResult(compilation, result) {
480
+ for (const notice of result.notices) compilation.warnings.push(checkerError(notice));
470
481
  if (result.hasErrors) compilation.errors.push(checkerError(result.output));
471
482
  else if (result.hasWarnings) compilation.warnings.push(checkerError(result.output));
472
483
  }
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as setupLintInspector, l as setupNuxtLintChecker, m as hasNuxtViteCompilerSupport, n as setupNuxtLintConfigGeneration, p as getDetectedNuxtMajor } from "./generation-CQelZUTy.mjs";
1
+ import { i as setupLintInspector, l as setupNuxtLintChecker, m as hasNuxtViteCompilerSupport, n as setupNuxtLintConfigGeneration, p as getDetectedNuxtMajor } from "./generation-DJxmPezT.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import fs from "node:fs";
4
4
  import path, { dirname, join, resolve } from "node:path";
@@ -66,6 +66,7 @@ interface NuxtLintCheckerResult {
66
66
  diagnosticCount: number;
67
67
  hasErrors: boolean;
68
68
  hasWarnings: boolean;
69
+ notices: string[];
69
70
  output: string;
70
71
  }
71
72
  interface NuxtLintCheckerDiagnostic {
@@ -1,3 +1,3 @@
1
- import { a as toNuxtLintProjectState, c as setupNuxtLintConfigAddons, d as createNuxtLintCheckerVitePlugin, f as resolveNuxtLintCheckerOptions, l as setupNuxtLintChecker, n as setupNuxtLintConfigGeneration, o as renderNuxtOxlintConfig, r as writeFileIfChanged, s as VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, t as ROOT_OXLINT_CONFIG_NAMES, u as createNuxtLintCheckerWebpackPlugin } from "../generation-CQelZUTy.mjs";
1
+ import { a as toNuxtLintProjectState, c as setupNuxtLintConfigAddons, d as createNuxtLintCheckerVitePlugin, f as resolveNuxtLintCheckerOptions, l as setupNuxtLintChecker, n as setupNuxtLintConfigGeneration, o as renderNuxtOxlintConfig, r as writeFileIfChanged, s as VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, t as ROOT_OXLINT_CONFIG_NAMES, u as createNuxtLintCheckerWebpackPlugin } from "../generation-DJxmPezT.mjs";
2
2
  export * from "@vizejs/nuxt-lint-config";
3
3
  export { ROOT_OXLINT_CONFIG_NAMES, VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, createNuxtLintCheckerVitePlugin, createNuxtLintCheckerWebpackPlugin, renderNuxtOxlintConfig, resolveNuxtLintCheckerOptions, setupNuxtLintChecker, setupNuxtLintConfigAddons, setupNuxtLintConfigGeneration, toNuxtLintProjectState, writeFileIfChanged };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/nuxt",
3
- "version": "0.504.0",
3
+ "version": "0.506.0",
4
4
  "description": "Nuxt module for Vize - compiler, musea gallery, linter, and type checker",
5
5
  "keywords": [
6
6
  "compiler",
@@ -49,12 +49,12 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@nuxt/kit": "3.11.2",
52
- "@vizejs/native": "0.504.0",
53
- "@vizejs/nuxt-lint-config": "0.504.0",
54
- "@vizejs/vite-plugin": "0.504.0",
55
- "@vizejs/vite-plugin-musea": "0.504.0",
56
- "oxlint-plugin-vize": "0.504.0",
57
- "vize": "0.504.0"
52
+ "@vizejs/native": "0.474.0",
53
+ "@vizejs/nuxt-lint-config": "0.506.0",
54
+ "@vizejs/vite-plugin": "0.506.0",
55
+ "@vizejs/vite-plugin-musea": "0.506.0",
56
+ "oxlint-plugin-vize": "0.506.0",
57
+ "vize": "0.506.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "jiti-nuxt2": "npm:jiti@1.21.7",