| 
						
						
							
								
							
						
						
					 | 
					@ -15,7 +15,7 @@ const writeEntryFile = async (basePath, fileIds) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    `export default nodeFns;` | 
					 | 
					 | 
					    `export default nodeFns;` | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  ].join('\n'); | 
					 | 
					 | 
					  ].join('\n'); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  const entryFilePath = path.join(basePath, 'index.js'); | 
					 | 
					 | 
					  const entryFilePath = path.join(basePath, 'index.js'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  await fs.writeFile(entryFilePath, fileContent, {encoding: 'utf8', flag:'w'}); | 
					 | 
					 | 
					  await fs.outputFile(entryFilePath, fileContent, {encoding: 'utf8', flag:'w'}); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					}; | 
					 | 
					 | 
					}; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					const writeNodeCodes = async (basePath, dsl) => { | 
					 | 
					 | 
					const writeNodeCodes = async (basePath, dsl) => { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -25,14 +25,14 @@ const writeNodeCodes = async (basePath, dsl) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  for(const {id, data: {code}} of nodes) { | 
					 | 
					 | 
					  for(const {id, data: {code}} of nodes) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    fileIds.push(id); | 
					 | 
					 | 
					    fileIds.push(id); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    const filePath = path.join(basePath, id + '.js'); | 
					 | 
					 | 
					    const filePath = path.join(basePath, id + '.js'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    await fs.writeFile(filePath, code, {encoding: 'utf8', flag:'w'}); | 
					 | 
					 | 
					    await fs.outputFile(filePath, code, {encoding: 'utf8', flag:'w'}); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  return fileIds; | 
					 | 
					 | 
					  return fileIds; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					}; | 
					 | 
					 | 
					}; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					const setup = async (dsl, logicBasePath) => { | 
					 | 
					 | 
					const setup = async (dsl, logicBasePath) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  const nodeCodesPath = path.join(logicBasePath, 'nodeFns'); | 
					 | 
					 | 
					  const nodeCodesPath = path.join(logicBasePath, 'nodeFns'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  await fs.ensureDir(nodeCodesPath); | 
					 | 
					 | 
					  await fs.remove(nodeCodesPath); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  const fileIds = await writeNodeCodes(nodeCodesPath, dsl); | 
					 | 
					 | 
					  const fileIds = await writeNodeCodes(nodeCodesPath, dsl); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  await writeEntryFile(nodeCodesPath, fileIds); | 
					 | 
					 | 
					  await writeEntryFile(nodeCodesPath, fileIds); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					}; | 
					 | 
					 | 
					}; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |