diff --git a/packages/cli/src/cmd/dev/extractCodes.js b/packages/cli/src/cmd/dev/extractCodes.js index 339f53b..6bce61c 100644 --- a/packages/cli/src/cmd/dev/extractCodes.js +++ b/packages/cli/src/cmd/dev/extractCodes.js @@ -24,11 +24,14 @@ const writeNodeCodes = async (basePath, dsl) => { const nodes = cells.filter((cell) => cell.shape !== 'edge'); for (const { id, - data: { code }, + shape, + data: { label, code }, } of nodes) { fileIds.push(id); const filePath = path.join(basePath, id + '.js'); - await fs.outputFile(filePath, code, { encoding: 'utf8', flag: 'w' }); + const preData = `// ${shape}: ${label}\n`; + const saveData = `${preData}\n${code}`; + await fs.outputFile(filePath, saveData, { encoding: 'utf8', flag: 'w' }); } return fileIds; };