@vzn/vx-migrate 0.0.639 → 0.0.640

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.
@@ -382,7 +382,7 @@ export async function mapViteTaskWorkspace(
382
382
  ([e, n]) =>
383
383
  `env ${JSON.stringify(e)}: the configs list the names the files of each task's package and its ` +
384
384
  `workspace dependencies spell (${n} task${n === 1 ? '' : 's'}) — add any other a task reads to ` +
385
- 'cache.inputs.env and exec.env.passThrough',
385
+ 'inputs.env and exec.env.passThrough',
386
386
  )
387
387
  return { projects, notes }
388
388
  }
@@ -392,7 +392,7 @@ function autoTodo(what: string, known?: Record<string, unknown>): string {
392
392
  const have = known === undefined ? '' : ` (declared so far: \`${JSON.stringify(known)}\`)`
393
393
  return (
394
394
  `cache: Vite Task traced this task's ${what} and vx infers none — add ` +
395
- `\`cache: { inputs: { files: [...] }, outputs: { files: [...] } }\` with the real ones${have}; ` +
395
+ `\`inputs: { files: [...] }, cache: { outputs: { files: [...] } }\` with the real ones${have}; ` +
396
396
  'without it the task always runs'
397
397
  )
398
398
  }
@@ -460,6 +460,10 @@ function mapTask(name: string, def: TaskDef, ctx: TaskCtx): GeneratedTask {
460
460
  todos.push(autoTodo(what, Object.keys(known).length > 0 ? known : undefined))
461
461
  return { name, todos, task }
462
462
  }
463
+ // Declared inputs key the task cached or not: a dependant folds them.
464
+ const inputLists: Record<string, unknown> = { ...inputs.lists }
465
+ if (env.length > 0) inputLists['env'] = env
466
+ task['inputs'] = inputLists
463
467
  if (outputs.uncached) return { name, todos, task }
464
468
 
465
469
  const outFiles = outputs.lists['files'] as string[]
@@ -473,9 +477,7 @@ function mapTask(name: string, def: TaskDef, ctx: TaskCtx): GeneratedTask {
473
477
  todos.push(ownFileTodo(ownFile))
474
478
  return { name, todos, task }
475
479
  }
476
- const inputLists: Record<string, unknown> = { ...inputs.lists }
477
- if (env.length > 0) inputLists['env'] = env
478
- task['cache'] = { inputs: inputLists, outputs: outputs.lists }
480
+ task['cache'] = { outputs: outputs.lists }
479
481
  return { name, todos, task }
480
482
  }
481
483
 
@@ -510,7 +512,7 @@ function envNames(
510
512
  }
511
513
  if (/[*?[\]{}=\0]/.test(e) || e === '') {
512
514
  todos.push(
513
- `${field} ${JSON.stringify(e)}: vx takes exact env names — list the ones the task reads in exec.env.passThrough${field === 'cache.env' ? ' and cache.inputs.env' : ''}`,
515
+ `${field} ${JSON.stringify(e)}: vx takes exact env names — list the ones the task reads in exec.env.passThrough${field === 'cache.env' ? ' and inputs.env' : ''}`,
514
516
  )
515
517
  continue
516
518
  }