• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

scriptype / writ-cms / 21048924467

15 Jan 2026 10:42PM UTC coverage: 38.215% (-0.6%) from 38.816%
21048924467

push

github

scriptype
Primitively implement main cms flow

If the cms is started with ssgOptions, then proceed to initing the
editor with the rootDirectory (started from $ writ start)

Otherwise ($ writ create or desktop app), try to find the most recent
project in a workspace directory (writ projects). If found, init the
editor with the project's path. Else, proceed to onboarding.

Onboarding makes sure the workspace + a new project now exist.

While at it:
- Keep watched directory in state so when ssg.watch() is called, we can
check if a specific directory is watched or not. And if a different
directory was being watched when ssg.watch() is called, stop the watcher
and start watching the new one.
- Pass the api object itself to its members, so they can sphagettify

621 of 3681 branches covered (16.87%)

Branch coverage included in aggregate %.

0 of 109 new or added lines in 7 files covered. (0.0%)

7 existing lines in 2 files now uncovered.

2171 of 3625 relevant lines covered (59.89%)

1727.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/cms/server/router/api/workspace.js
NEW
1
const express = require('express')
×
2

NEW
3
module.exports = express.Router()
×
4
  .get('/', async (req, res, next) => {
NEW
5
    try {
×
NEW
6
      res.status(200).json(
×
7
        await req.api.workspace.get()
8
      )
9
    } catch (e) {
NEW
10
      console.log('Error running workspace.get', e)
×
NEW
11
      res.status(500).send(e)
×
12
    }
13
  })
14
  .post('/', async (req, res, next) => {
NEW
15
    try {
×
NEW
16
      res.status(200).json(
×
17
        await req.api.workspace.create()
18
      )
19
    } catch (e) {
NEW
20
      console.log('Error running workspace.create', e)
×
NEW
21
      res.status(500).send(e)
×
22
    }
23
  })
24
  .post('/project', async (req, res, next) => {
NEW
25
    try {
×
NEW
26
      res.status(200).json(
×
27
        await req.api.workspace.createProject(req.body)
28
      )
29
    } catch (e) {
NEW
30
      console.log('Error running workspace.createProject', e)
×
NEW
31
      res.status(500).send(e)
×
32
    }
33
  })
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc