vite-plus 0.1.21-alpha.5 → 0.1.21-alpha.7

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.
@@ -11,7 +11,7 @@ import fs from "node:fs";
11
11
  import { styleText } from "node:util";
12
12
  import process$1, { stdin, stdout } from "node:process";
13
13
  import * as b from "node:readline";
14
- import l from "node:readline";
14
+ import E from "node:readline";
15
15
  import { ReadStream } from "node:tty";
16
16
  import fsPromises from "node:fs/promises";
17
17
  //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
@@ -516,7 +516,7 @@ let p = class {
516
516
  this.state = "cancel", this.close();
517
517
  }, { once: !0 });
518
518
  }
519
- this.rl = l.createInterface({
519
+ this.rl = E.createInterface({
520
520
  input: this.input,
521
521
  tabSize: 2,
522
522
  prompt: "",
@@ -1,5 +1,5 @@
1
1
  import { a as printHeader, r as log } from "../terminal-CxTMfsxZ.js";
2
- import { L as defaultInteractive, _ as hasStagedConfigInViteConfig, h as ensurePreCommitHook, i as updateExistingAgentInstructions, z as promptGitHooks } from "../agent-DfrgUb6p.js";
2
+ import { L as defaultInteractive, _ as hasStagedConfigInViteConfig, h as ensurePreCommitHook, i as updateExistingAgentInstructions, z as promptGitHooks } from "../agent-D2ocSU01.js";
3
3
  import { t as lib_default } from "../lib-BamM40b7.js";
4
4
  import { t as renderCliDoc } from "../help-BtkjXtRM.js";
5
5
  import { join } from "node:path";
@@ -2,10 +2,10 @@ import { r as __toESM, t as __commonJSMin } from "../chunk-q7NCDQ7-.js";
2
2
  import { a as runCommand$1, o as runCommandSilently, s as require_cross_spawn } from "../tsconfig-lBAWm4sf.js";
3
3
  import { a as printHeader, i as muted, o as success, r as log, t as accent } from "../terminal-CxTMfsxZ.js";
4
4
  import { i as resolveViteConfig, n as hasViteConfig, t as findWorkspaceRoot } from "../resolve-vite-config-C1KX9CZU.js";
5
- import { $ as multiselect, A as setPackageManager, B as runViteFmt, D as rewriteMonorepo, E as promptPrettierMigration, G as templatesDir, H as selectPackageManager, K as DependencyType, L as defaultInteractive, O as rewriteMonorepoProject, Q as log$1, R as downloadPackageManager$1, T as promptEslintMigration, V as runViteInstall, W as displayRelative, X as confirm, Y as cancel, Z as intro, a as writeAgentInstructions, at as q, d as detectEslintProject, f as detectFramework, g as hasFrameworkShim, it as require_picocolors, k as rewriteStandaloneProject, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, q as PackageManager, r as selectAgentTargetPaths, rt as text, tt as select, v as injectCreateDefaultTemplate, y as installGitHooks, z as promptGitHooks } from "../agent-DfrgUb6p.js";
5
+ import { $ as multiselect, A as setPackageManager, B as runViteFmt, D as rewriteMonorepo, E as promptPrettierMigration, G as templatesDir, H as selectPackageManager, K as DependencyType, L as defaultInteractive, O as rewriteMonorepoProject, Q as log$1, R as downloadPackageManager$1, T as promptEslintMigration, V as runViteInstall, W as displayRelative, X as confirm, Y as cancel, Z as intro, a as writeAgentInstructions, at as q, d as detectEslintProject, f as detectFramework, g as hasFrameworkShim, it as require_picocolors, k as rewriteStandaloneProject, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, q as PackageManager, r as selectAgentTargetPaths, rt as text, tt as select, v as injectCreateDefaultTemplate, y as installGitHooks, z as promptGitHooks } from "../agent-D2ocSU01.js";
6
6
  import { t as lib_default } from "../lib-BamM40b7.js";
7
7
  import { c as editJsonFile, o as fetchNpmResource, s as getNpmRegistry, t as checkNpmPackageExists, u as readJsonFile } from "../package-CrKanQYM.js";
8
- import { a as detectExistingEditors, c as writeEditorConfigs, n as updatePackageJsonWithDeps, r as updateWorkspaceConfig, s as selectEditors, t as detectWorkspace$1 } from "../workspace-B9iIR57G.js";
8
+ import { a as detectExistingEditors, c as writeEditorConfigs, n as updatePackageJsonWithDeps, r as updateWorkspaceConfig, s as selectEditors, t as detectWorkspace$1 } from "../workspace-QXeJWs3P.js";
9
9
  import { t as renderCliDoc } from "../help-BtkjXtRM.js";
10
10
  import path from "node:path";
11
11
  import { runCommand, vitePlusHeader } from "../../binding/index.js";
@@ -59,6 +59,15 @@ type Task = {
59
59
  * - Negative patterns (e.g. `"!dist/**"`) exclude matched files
60
60
  */
61
61
  input?: Array<string | GlobWithBase | AutoInput>;
62
+ /**
63
+ * Output files to archive after a successful run and restore on cache hit.
64
+ *
65
+ * - Omitted or `[]` (empty): no output archiving (default)
66
+ * - Glob patterns (e.g. `"dist/**"`) select specific output files, relative to the package directory
67
+ * - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory
68
+ * - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files
69
+ */
70
+ output?: Array<string | GlobWithBase>;
62
71
  } | {
63
72
  /**
64
73
  * Whether to cache the task
@@ -97,7 +106,7 @@ type RunConfig = {
97
106
  /**
98
107
  * Task definitions
99
108
  */
100
- tasks?: { [key in string]?: Task };
109
+ tasks?: { [key in string]: Task };
101
110
  /**
102
111
  * Whether to automatically run `preX`/`postX` package.json scripts as
103
112
  * lifecycle hooks when script `X` is executed.
@@ -1,2 +1,2 @@
1
- import { n as lazyPlugins, t as defineConfig } from "./define-config-bKSulJaG.js";
1
+ import { n as lazyPlugins, t as defineConfig } from "./define-config-cWg3Z2bC.js";
2
2
  export { defineConfig, lazyPlugins };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as lazyPlugins, t as defineConfig } from "./define-config-bKSulJaG.js";
1
+ import { n as lazyPlugins, t as defineConfig } from "./define-config-cWg3Z2bC.js";
2
2
  export * from "@voidzero-dev/vite-plus-test/config";
3
3
  export * from "@voidzero-dev/vite-plus-core";
4
4
  export { defineConfig, lazyPlugins };
@@ -1,11 +1,11 @@
1
1
  import { r as __toESM } from "../chunk-q7NCDQ7-.js";
2
2
  import { l as isForceOverrideMode } from "../main-A6UrSTYb.js";
3
3
  import { a as printHeader, i as muted, r as log, t as accent } from "../terminal-CxTMfsxZ.js";
4
- import { C as migratePrettierToOxfmt, D as rewriteMonorepo, E as promptPrettierMigration, H as selectPackageManager, I as cancelAndExit, J as require_semver, L as defaultInteractive, M as warnPackageLevelEslint, N as warnPackageLevelPrettier, Q as log$1, R as downloadPackageManager, S as migrateNodeVersionManagerFile, T as promptEslintMigration, U as upgradeYarn, V as runViteInstall, W as displayRelative, X as confirm, a as writeAgentInstructions, at as q, b as mergeViteConfigFiles, c as checkVitestVersion, d as detectEslintProject, et as outro, f as detectFramework, g as hasFrameworkShim, j as warnLegacyEslintConfig, k as rewriteStandaloneProject, l as confirmEslintMigration, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, p as detectNodeVersionManagerFile, q as PackageManager, r as selectAgentTargetPaths, s as checkViteVersion, t as detectAgentConflicts, tt as select, u as confirmPrettierMigration, w as preflightGitHooksSetup, x as migrateEslintToOxlint, y as installGitHooks, z as promptGitHooks } from "../agent-DfrgUb6p.js";
4
+ import { C as migratePrettierToOxfmt, D as rewriteMonorepo, E as promptPrettierMigration, H as selectPackageManager, I as cancelAndExit, J as require_semver, L as defaultInteractive, M as warnPackageLevelEslint, N as warnPackageLevelPrettier, Q as log$1, R as downloadPackageManager, S as migrateNodeVersionManagerFile, T as promptEslintMigration, U as upgradeYarn, V as runViteInstall, W as displayRelative, X as confirm, a as writeAgentInstructions, at as q, b as mergeViteConfigFiles, c as checkVitestVersion, d as detectEslintProject, et as outro, f as detectFramework, g as hasFrameworkShim, j as warnLegacyEslintConfig, k as rewriteStandaloneProject, l as confirmEslintMigration, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as spinner, o as addFrameworkShim, p as detectNodeVersionManagerFile, q as PackageManager, r as selectAgentTargetPaths, s as checkViteVersion, t as detectAgentConflicts, tt as select, u as confirmPrettierMigration, w as preflightGitHooksSetup, x as migrateEslintToOxlint, y as installGitHooks, z as promptGitHooks } from "../agent-D2ocSU01.js";
5
5
  import { t as lib_default } from "../lib-BamM40b7.js";
6
6
  import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-CrKanQYM.js";
7
7
  import { r as createMigrationReport } from "../report-DbrfjWiP.js";
8
- import { c as writeEditorConfigs, i as detectEditorConflicts, o as selectEditor, t as detectWorkspace } from "../workspace-B9iIR57G.js";
8
+ import { c as writeEditorConfigs, i as detectEditorConflicts, o as selectEditor, t as detectWorkspace } from "../workspace-QXeJWs3P.js";
9
9
  import { t as renderCliDoc } from "../help-BtkjXtRM.js";
10
10
  import path from "node:path";
11
11
  import { styleText } from "node:util";
@@ -9,7 +9,7 @@ import { constants } from "node:fs";
9
9
  import { formatWithOptions, inspect, promisify } from "node:util";
10
10
  import { pathToFileURL } from "node:url";
11
11
  import { cwd } from "node:process";
12
- import l from "node:readline";
12
+ import E from "node:readline";
13
13
  import nodeTty from "node:tty";
14
14
  import { EOL } from "node:os";
15
15
  import fsPromises, { constants as constants$1 } from "node:fs/promises";
@@ -398,7 +398,7 @@ var w = /* @__PURE__ */ u(((e, t) => {
398
398
  var T = /* @__PURE__ */ u(((e, t) => {
399
399
  t.exports = /^#!(.*)/;
400
400
  }));
401
- var E = /* @__PURE__ */ u(((e, t) => {
401
+ var E$1 = /* @__PURE__ */ u(((e, t) => {
402
402
  const n = T();
403
403
  t.exports = (e = "") => {
404
404
  const t = e.match(n);
@@ -411,7 +411,7 @@ var E = /* @__PURE__ */ u(((e, t) => {
411
411
  }));
412
412
  var D = /* @__PURE__ */ u(((e, t) => {
413
413
  const n = d("fs");
414
- const r = E();
414
+ const r = E$1();
415
415
  function i(e) {
416
416
  const t = 150;
417
417
  const i = Buffer.alloc(t);
@@ -630,7 +630,7 @@ var z = class {
630
630
  if (this._streamErr) t.push(this._streamErr);
631
631
  if (this._streamOut) t.push(this._streamOut);
632
632
  const n = _(t);
633
- const r = l.createInterface({ input: n });
633
+ const r = E.createInterface({ input: n });
634
634
  for await (const e of r) yield e.toString();
635
635
  await this._processClosed;
636
636
  e.removeAllListeners();
@@ -1,4 +1,4 @@
1
- import { $ as multiselect, F as readYamlFile, P as editYamlFile, Q as log, at as q, q as PackageManager, tt as select } from "./agent-DfrgUb6p.js";
1
+ import { $ as multiselect, F as readYamlFile, P as editYamlFile, Q as log, at as q, q as PackageManager, tt as select } from "./agent-D2ocSU01.js";
2
2
  import { t as require_dist } from "./dist-DjG9AYbK.js";
3
3
  import { c as editJsonFile, d as writeJsonFile, r as getScopeFromPackageName, u as readJsonFile } from "./package-CrKanQYM.js";
4
4
  import path, { posix, win32 } from "node:path";
@@ -167,7 +167,7 @@ A set of common environment variables are automatically passed through to all ta
167
167
  - **System:** `HOME`, `USER`, `PATH`, `SHELL`, `LANG`, `TZ`
168
168
  - **Node.js:** `NODE_OPTIONS`, `COREPACK_HOME`, `PNPM_HOME`
169
169
  - **CI/CD:** `CI`, `VERCEL_*`, `NEXT_*`
170
- - **Terminal:** `TERM`, `COLORTERM`, `FORCE_COLOR`, `NO_COLOR`
170
+ - **Terminal:** Color variables (`FORCE_COLOR`, `NO_COLOR`, `COLORTERM`, `TERM`, `TERM_PROGRAM`) aren't passed to tasks unless you list them under `env` (the value gets fingerprinted, so changing it invalidates the cache) or `untrackedEnv` (passed without fingerprinting). If `FORCE_COLOR` isn't in either list, the child gets `FORCE_COLOR=1` so cached logs stay colored. Colors get stripped on display when the terminal can't render them.
171
171
 
172
172
  ### `input`
173
173
 
@@ -233,6 +233,36 @@ tasks: {
233
233
  String glob patterns are resolved relative to the package directory by default. Use the object form with `base: "workspace"` to resolve relative to the workspace root.
234
234
  :::
235
235
 
236
+ ### `output`
237
+
238
+ - **Type:** `Array<string | { pattern: string, base: "workspace" | "package" }>`
239
+ - **Default:** `[]` (nothing is archived)
240
+
241
+ Files the task produces. They get archived after a successful run and restored on a cache hit, so you don't have to rebuild them. Leave it empty (or omit it) and nothing is archived.
242
+
243
+ ```ts [vite.config.ts]
244
+ tasks: {
245
+ build: {
246
+ command: 'vp build',
247
+ output: ['dist/**', '!dist/cache/**'],
248
+ },
249
+ }
250
+ ```
251
+
252
+ If a task writes outside its own package, use the object form with `base: "workspace"`:
253
+
254
+ ```ts [vite.config.ts]
255
+ tasks: {
256
+ build: {
257
+ command: 'vp build',
258
+ output: [
259
+ 'dist/**',
260
+ { pattern: 'shared-artifacts/**', base: 'workspace' },
261
+ ],
262
+ },
263
+ }
264
+ ```
265
+
236
266
  ### `cwd`
237
267
 
238
268
  - **Type:** `string`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.1.21-alpha.5",
3
+ "version": "0.1.21-alpha.7",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -325,8 +325,8 @@
325
325
  "oxfmt": "=0.48.0",
326
326
  "oxlint": "=1.63.0",
327
327
  "oxlint-tsgolint": "=0.22.1",
328
- "@voidzero-dev/vite-plus-core": "0.1.21-alpha.5",
329
- "@voidzero-dev/vite-plus-test": "0.1.21-alpha.5"
328
+ "@voidzero-dev/vite-plus-core": "0.1.21-alpha.7",
329
+ "@voidzero-dev/vite-plus-test": "0.1.21-alpha.7"
330
330
  },
331
331
  "devDependencies": {
332
332
  "@napi-rs/cli": "^3.6.1",
@@ -353,7 +353,7 @@
353
353
  "yaml": "^2.8.1",
354
354
  "@voidzero-dev/vite-plus-prompts": "0.0.0",
355
355
  "@voidzero-dev/vite-plus-tools": "0.0.0",
356
- "vite": "npm:@voidzero-dev/vite-plus-core@0.1.21-alpha.5"
356
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.21-alpha.7"
357
357
  },
358
358
  "napi": {
359
359
  "binaryName": "vite-plus",
@@ -373,14 +373,14 @@
373
373
  "node": "^20.19.0 || >=22.12.0"
374
374
  },
375
375
  "optionalDependencies": {
376
- "@voidzero-dev/vite-plus-darwin-arm64": "0.1.21-alpha.5",
377
- "@voidzero-dev/vite-plus-darwin-x64": "0.1.21-alpha.5",
378
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.21-alpha.5",
379
- "@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.21-alpha.5",
380
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.21-alpha.5",
381
- "@voidzero-dev/vite-plus-linux-x64-musl": "0.1.21-alpha.5",
382
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.21-alpha.5",
383
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.21-alpha.5"
376
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.1.21-alpha.7",
377
+ "@voidzero-dev/vite-plus-darwin-x64": "0.1.21-alpha.7",
378
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.21-alpha.7",
379
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.21-alpha.7",
380
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.21-alpha.7",
381
+ "@voidzero-dev/vite-plus-linux-x64-musl": "0.1.21-alpha.7",
382
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.21-alpha.7",
383
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.21-alpha.7"
384
384
  },
385
385
  "scripts": {
386
386
  "build": "oxnode -C dev ./build.ts",