beta/code-blocks (#1)
Reviewed-on: #1 Co-authored-by: obvTiger <obvtiger@epilogue.team> Co-committed-by: obvTiger <obvtiger@epilogue.team>
This commit is contained in:
parent
362b7aa15e
commit
d125640fe7
26 changed files with 1816 additions and 102 deletions
|
@ -46,6 +46,20 @@ class BlueprintBuilder {
|
|||
if (result.success) {
|
||||
this.fileHandler.writeCompiledFiles(outputDir, baseName, result.html, result.css);
|
||||
|
||||
if (result.hasServerCode && result.serverCode) {
|
||||
const serverDir = path.join(outputDir, 'server');
|
||||
if (!fs.existsSync(serverDir)) {
|
||||
fs.mkdirSync(serverDir, { recursive: true });
|
||||
}
|
||||
|
||||
const serverFilePath = path.join(serverDir, `${baseName}-server.js`);
|
||||
fs.writeFileSync(serverFilePath, result.serverCode, 'utf8');
|
||||
|
||||
if (this.options.debug) {
|
||||
console.log(`[DEBUG] Server code written to ${serverFilePath}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.debug) {
|
||||
console.log("[DEBUG] Build completed successfully");
|
||||
}
|
||||
|
@ -54,6 +68,7 @@ class BlueprintBuilder {
|
|||
return {
|
||||
success: result.success,
|
||||
errors: result.errors,
|
||||
hasServerCode: result.hasServerCode
|
||||
};
|
||||
} catch (error) {
|
||||
if (this.options.debug) {
|
||||
|
@ -61,6 +76,7 @@ class BlueprintBuilder {
|
|||
}
|
||||
return {
|
||||
success: false,
|
||||
hasServerCode: false,
|
||||
errors: [
|
||||
{
|
||||
message: error.message,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue