@webmate-studio/builder 0.2.41 → 0.2.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-service.js +3 -25
- package/package.json +1 -1
package/build-service.js
CHANGED
|
@@ -304,29 +304,8 @@ const server = http.createServer(async (req, res) => {
|
|
|
304
304
|
const payload = JSON.parse(body);
|
|
305
305
|
|
|
306
306
|
// Route to appropriate handler
|
|
307
|
-
if (req.url === '/
|
|
308
|
-
//
|
|
309
|
-
const { html } = payload;
|
|
310
|
-
|
|
311
|
-
if (!html) {
|
|
312
|
-
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
313
|
-
res.end(JSON.stringify({ success: false, error: 'Missing html parameter' }));
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const result = await generateComponentCSS(html, {
|
|
318
|
-
designTokens: null,
|
|
319
|
-
minify: true
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
323
|
-
res.end(JSON.stringify({
|
|
324
|
-
success: true,
|
|
325
|
-
css: result.css,
|
|
326
|
-
classes: result.classes
|
|
327
|
-
}));
|
|
328
|
-
} else if (req.url === '/build' || req.url === '/component/build') {
|
|
329
|
-
// NEW: Full component build (islands + CSS)
|
|
307
|
+
if (req.url === '/build' || req.url === '/component/build') {
|
|
308
|
+
// Full component build (islands + CSS)
|
|
330
309
|
const result = await buildComponent(payload);
|
|
331
310
|
|
|
332
311
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
@@ -352,10 +331,9 @@ if (import.meta.url === `file://${process.argv[1]}`) {
|
|
|
352
331
|
server.listen(PORT, () => {
|
|
353
332
|
console.log(`[Build Service] Running on http://localhost:${PORT}`);
|
|
354
333
|
console.log(`[Build Service] Endpoints:`);
|
|
355
|
-
console.log(` POST /css/generate - Generate Tailwind CSS`);
|
|
356
334
|
console.log(` POST /build - Build component (islands + CSS)`);
|
|
357
335
|
});
|
|
358
336
|
}
|
|
359
337
|
|
|
360
338
|
// Export for programmatic usage
|
|
361
|
-
export { buildComponent
|
|
339
|
+
export { buildComponent };
|