@vizejs/vite-plugin 0.754.0 → 0.755.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as runTask } from "../runner-D73zNmj7.mjs";
2
+ import { n as runTask } from "../runner-BKbC1d84.mjs";
3
3
  //#region src/internal/vite-plus-task.ts
4
4
  try {
5
5
  process.exitCode = await runTask(process.argv.slice(2));
@@ -1,7 +1,7 @@
1
1
  import { i as resolveConfigExport, r as loadConfig } from "./config-mRmJduOt.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
- import { mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
4
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
5
5
  import { glob } from "tinyglobby";
6
6
  import { createHash, randomUUID } from "node:crypto";
7
7
  import { spawn, spawnSync } from "node:child_process";
@@ -230,9 +230,19 @@ async function runTask(argv) {
230
230
  }
231
231
  return runTools(task, args, metadata, vp, nativeBinary(), execute);
232
232
  }
233
- async function execute(command, args) {
233
+ async function execute(command, args, stdin) {
234
234
  return new Promise((resolve) => {
235
- const child = spawn(command, args, { stdio: "inherit" });
235
+ const child = spawn(command, args, { stdio: stdin === void 0 ? "inherit" : [
236
+ "pipe",
237
+ "inherit",
238
+ "inherit"
239
+ ] });
240
+ if (stdin !== void 0) {
241
+ child.stdin?.on("error", (error) => {
242
+ if (error.code !== "EPIPE") console.error(error.message);
243
+ });
244
+ child.stdin?.end(stdin);
245
+ }
236
246
  const forwardInt = () => child.kill("SIGINT");
237
247
  const forwardTerm = () => child.kill("SIGTERM");
238
248
  process.on("SIGINT", forwardInt);
@@ -256,6 +266,11 @@ function nativeBinary() {
256
266
  const require = createRequire(import.meta.url);
257
267
  return path.resolve(path.dirname(require.resolve("vize")), "../bin/vize");
258
268
  }
269
+ const CONFIG_STDIN_MARKER = "config-stdin-v1";
270
+ /** Preserve compatibility with published CLI packages from before stdin transport. */
271
+ function nativeSupportsConfigStdin(native) {
272
+ return !existsSync(native) || existsSync(path.join(path.dirname(native), CONFIG_STDIN_MARKER));
273
+ }
259
274
  async function runNative(command, argv, metadata, native = nativeBinary(), spawn = execute) {
260
275
  const env = {
261
276
  mode: "production",
@@ -266,13 +281,21 @@ async function runNative(command, argv, metadata, native = nativeBinary(), spawn
266
281
  ...config,
267
282
  ignores: [...metadata.lintIgnorePatterns, ...config.ignores ?? []]
268
283
  } : config;
284
+ const payload = JSON.stringify({ vue: relocateTaskConfig(taskConfig, process.cwd()) });
285
+ const lintOptions = command === "lint" ? [...metadata.lintLocale ? ["--locale", metadata.lintLocale] : [], ...metadata.lintHelpLevel ? ["--help-level", metadata.lintHelpLevel] : []] : [];
286
+ if (nativeSupportsConfigStdin(native)) return spawn(process.execPath, [
287
+ native,
288
+ command,
289
+ "--config-stdin",
290
+ ...lintOptions,
291
+ ...argv
292
+ ], payload);
269
293
  const file = path.join(os.tmpdir(), `.vize-vp-${randomUUID()}.json`);
270
294
  try {
271
- await writeFile(file, JSON.stringify({ vue: relocateTaskConfig(taskConfig, process.cwd()) }), {
295
+ await writeFile(file, payload, {
272
296
  flag: "wx",
273
297
  mode: 384
274
298
  });
275
- const lintOptions = command === "lint" ? [...metadata.lintLocale ? ["--locale", metadata.lintLocale] : [], ...metadata.lintHelpLevel ? ["--help-level", metadata.lintHelpLevel] : []] : [];
276
299
  return await spawn(process.execPath, [
277
300
  native,
278
301
  command,
@@ -1,5 +1,5 @@
1
1
  import { c as projectViteConfigSource, i as resolveConfigExport, l as vueConfigOptions, s as mergeVueConfigOptions } from "./config-mRmJduOt.mjs";
2
- import { a as taskConfigKey, i as sourceConfigKey, r as availableVueRules, t as runNative } from "./runner-D73zNmj7.mjs";
2
+ import { a as taskConfigKey, i as sourceConfigKey, r as availableVueRules, t as runNative } from "./runner-BKbC1d84.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import path from "node:path";
5
5
  import { readFileSync } from "node:fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.754.0",
3
+ "version": "0.755.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -54,13 +54,13 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@vizejs/native": "0.754.0",
58
- "@vizejs/unplugin": "0.754.0",
57
+ "@vizejs/native": "0.755.0",
58
+ "@vizejs/unplugin": "0.755.0",
59
59
  "jsonc-parser": "^3.3.1",
60
60
  "oxc-parser": "0.157.0",
61
61
  "picomatch": "4.0.7",
62
62
  "tinyglobby": "0.2.17",
63
- "vize": "0.754.0"
63
+ "vize": "0.755.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/node": "25.9.2",