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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api/project.js +7 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mrmd-server",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "HTTP server for mrmd - run mrmd in any browser, access from anywhere",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -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
- // Create directory if it doesn't exist
159
- await fs.mkdir(resolvedPath, { recursive: true });
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);