소스 검색

refactor(preset): name overlay row fields explicitly

Yichen Jiang 4 주 전
부모
커밋
83747b255f
1개의 변경된 파일과 4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      packages/preset/agent-presets/src/composition-inventory.ts

+ 4 - 4
packages/preset/agent-presets/src/composition-inventory.ts

@@ -192,13 +192,13 @@ function flattenRows(
       moduleName: row.name,
       enabled: disabled === true ? false : disabled === 'conditional' ? 'conditional' : true,
       ...isJsExpr(row.disabled) ? { condition: row.disabled.__jsExpr } : {},
-      ...rowProvenance(id, disabled === true, overlay),
+      ...rowOverlayFields(id, disabled === true, overlay),
     })
   }
 }
 
 /** The `source` and `disabledBy` fields of one row, from the layer's decisions. */
-function rowProvenance(
+function rowOverlayFields(
   id: string | null, disabled: boolean, overlay: OverlayFacts,
 ): Pick<AgentPresetCompositionRow, 'source' | 'disabledBy'> {
   const userRow = id !== null && overlay.inserted.has(id)
@@ -261,9 +261,9 @@ export function mountedCompositionRows(tree: EntryTree, overlay: readonly PatchO
       enabled: !entry.disabled,
       ...isJsExpr(entry.options.disabled) ? { condition: entry.options.disabled.__jsExpr } : {},
       ...entry.fiber === undefined ? {} : { fiberState: entry.fiber.state },
-      // Provenance and user patches address rows by the id the composition
+      // Layer decisions and user patches address rows by the id the composition
       // declares; the tree-wide `entry.id` carries the include's prefix.
-      ...rowProvenance(entry.options.id, entry.disabled, facts),
+      ...rowOverlayFields(entry.options.id, entry.disabled, facts),
     })
   }
   return found