packages/core/import-real-files
Split out of import.mjs: existingRealFiles is a deterministic, read-only collision check with no LLM or network dependency of its own, but it used to live in import.mjs alongside the LLM-fill code (callLlm et al.),...
Core engine, next. Source: packages/core/import-real-files.mjs.
Variables#
IMPORT_TODO_MARKER#
constIMPORT_TODO_MARKER:"TODO(import):"='TODO(import):'
Defined in: packages/core/import-real-files.mjs:14
Functions#
existingRealFiles()#
existingRealFiles(
root,name,feature,layers):string[]
Defined in: packages/core/import-real-files.mjs:34
Target files (for layers) that already exist with real content — i.e.
NOT just an earlier, still-unfilled import stub (one that still carries
the TODO(import) breadcrumb, which importVertical is always free to
rewrite). found that re-running construct import for the same
name/feature/layer silently overwrote whatever was already there,
including a file a human had already hand-ported or an earlier --llm
fill had already written — real work destroyed with no warning, purely
because generateVertical's write() has no existence check. Read-only:
never writes, so it's safe to call before anything is scaffolded.
Exported for plan-touches.mjs: the same collision check importVertical
runs before writing anything, reused rather than duplicated so a plan
preview and the real run can never disagree about whether this refuses.
Parameters#
root
string
project root.
name
string
the unit name being imported (e.g. a component/page name).
feature
string
the feature slice name.
layers
string[]
the layers to check.
Returns#
string[]
absolute paths of target files that already exist with real (non-stub) content.