mrmd-server 0.1.11 → 0.1.12
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/package.json +1 -1
- package/src/api/project.js +7 -17
package/package.json
CHANGED
package/src/api/project.js
CHANGED
|
@@ -145,6 +145,11 @@ export function createProjectRoutes(ctx) {
|
|
|
145
145
|
* POST /api/project
|
|
146
146
|
* Create a new mrmd project
|
|
147
147
|
* Mirrors: electronAPI.project.create(targetPath)
|
|
148
|
+
*
|
|
149
|
+
* Uses ProjectService.createProject() which:
|
|
150
|
+
* 1. Creates scaffold files (mrmd.md, index files)
|
|
151
|
+
* 2. Creates venv
|
|
152
|
+
* 3. Installs mrmd-python
|
|
148
153
|
*/
|
|
149
154
|
router.post('/', async (req, res) => {
|
|
150
155
|
try {
|
|
@@ -155,23 +160,8 @@ export function createProjectRoutes(ctx) {
|
|
|
155
160
|
|
|
156
161
|
const resolvedPath = path.resolve(ctx.projectDir, targetPath);
|
|
157
162
|
|
|
158
|
-
//
|
|
159
|
-
await
|
|
160
|
-
|
|
161
|
-
// Create mrmd.md config file
|
|
162
|
-
const mrmdPath = path.join(resolvedPath, 'mrmd.md');
|
|
163
|
-
const mrmdContent = `# ${path.basename(resolvedPath)}
|
|
164
|
-
|
|
165
|
-
A new mrmd project.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
venv: .venv
|
|
169
|
-
---
|
|
170
|
-
`;
|
|
171
|
-
await fs.writeFile(mrmdPath, mrmdContent);
|
|
172
|
-
|
|
173
|
-
// Get and return project info
|
|
174
|
-
const projectInfo = await getProjectInfo(mrmdPath, ctx.projectDir);
|
|
163
|
+
// Use ProjectService to create full project (same as Electron)
|
|
164
|
+
const projectInfo = await projectService.createProject(resolvedPath);
|
|
175
165
|
res.json(projectInfo);
|
|
176
166
|
} catch (err) {
|
|
177
167
|
console.error('[project:create]', err);
|