fix: use runnable key for file naming in generate-metadata to prevent duplicate scripts in raw apps (#8740)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-04-06 14:08:07 -04:00
committed by GitHub
parent c09a4311fd
commit edfe074e98
2 changed files with 122 additions and 2 deletions

View File

@@ -472,8 +472,11 @@ async function updateRawAppRunnables(
// Skip frontend scripts - they don't need locks
if (language === "frontend") {
// Still need to write the runnable YAML file
// Use runnableId (the dict key) for file naming, consistent with
// extractInlineScriptsForApps in sync.ts which also uses the key.
// Using runnable.name would create duplicate files when name != key.
const [basePathO, ext] = pathAssigner.assignPath(
runnable.name ?? runnableId,
runnableId,
language
);
const basePath = basePathO.replaceAll(SEP, "/");
@@ -509,8 +512,11 @@ async function updateRawAppRunnables(
);
// Determine file extension for this language
// Use runnableId (the dict key) for file naming, consistent with
// extractInlineScriptsForApps in sync.ts which also uses the key.
// Using runnable.name would create duplicate files when name != key.
const [basePathO, ext] = pathAssigner.assignPath(
runnable.name ?? runnableId,
runnableId,
language
);
const basePath = basePathO.replaceAll(SEP, "/");