@blocklet/pages-kit-block-studio 0.1.1 → 0.1.3
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/lib/cjs/middlewares/init-block-studio-router.js +1 -9
- package/lib/cjs/plugins/vite-plugin-block-studio.js +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/middlewares/init-block-studio-router.js +1 -9
- package/lib/esm/plugins/vite-plugin-block-studio.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -43,11 +43,6 @@ exports.initBlockStudioRouter.get('/', (req, res) => __awaiter(void 0, void 0, v
|
|
|
43
43
|
return fs_1.default.createReadStream(filePath).pipe(res);
|
|
44
44
|
}
|
|
45
45
|
const metadata = (0, helper_1.initializeMetadata)(filePath);
|
|
46
|
-
const code = (0, helper_1.getBlockCode)(filePath);
|
|
47
|
-
if (code) {
|
|
48
|
-
(0, lodash_1.set)(metadata, 'renderer.script', code);
|
|
49
|
-
(0, lodash_1.set)(metadata, 'renderer.type', 'react-component');
|
|
50
|
-
}
|
|
51
46
|
return res.json(metadata);
|
|
52
47
|
}
|
|
53
48
|
catch (error) {
|
|
@@ -87,11 +82,8 @@ exports.initBlockStudioRouter.post('/', (req, res) => __awaiter(void 0, void 0,
|
|
|
87
82
|
});
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
|
-
res.json({ success: true, content: mergedContent, message: 'Updated' });
|
|
91
|
-
// save metadata without renderer after response
|
|
92
|
-
delete mergedContent.renderer;
|
|
93
85
|
fs_1.default.writeFileSync(filePath, JSON.stringify(mergedContent, null, 2));
|
|
94
|
-
return
|
|
86
|
+
return res.json({ success: true, content: mergedContent, message: 'Updated' });
|
|
95
87
|
}
|
|
96
88
|
catch (error) {
|
|
97
89
|
return res.status(500).json({ error: 'Failed to write file' });
|
|
@@ -169,7 +169,7 @@ function initBlockStudioPlugins(options) {
|
|
|
169
169
|
? {
|
|
170
170
|
isHtmlPreview: true,
|
|
171
171
|
dataPath: filePath,
|
|
172
|
-
code: (0, vite_plugin_html_transform_1.generateComponent)((0, vite_plugin_html_transform_1.readHtmlFiles)(dirPath
|
|
172
|
+
code: (0, vite_plugin_html_transform_1.generateComponent)((0, vite_plugin_html_transform_1.readHtmlFiles)(dirPath)),
|
|
173
173
|
blockName,
|
|
174
174
|
dirPath,
|
|
175
175
|
metadataPath,
|