Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1153124
fix: show the git branch loaded for each project
versnic Nov 10, 2026
80ca49c
feat: search nested folders for projects
versnic Nov 10, 2026
c65e76e
feat: list the packages of monorepos
versnic Nov 10, 2026
7588dec
feat: save several named workspaces
versnic Nov 10, 2026
8fa6f72
docs: label bigger workspaces as released in 0.10.0
versnic Nov 10, 2026
09b4f25
fix: keep the packages of a recent monorepo
versnic Nov 11, 2026
c3c63f2
feat: open monorepos into their root and packages, and ask for requir…
versnic Nov 11, 2026
f3ea217
feat: show packages by folder name in a tree, with their own branch
versnic Nov 11, 2026
fe6ea2c
docs: say how deep a ** workspace pattern is followed
versnic Nov 12, 2026
9c58c44
Merge remote-tracking branch 'origin/main' into feat/bigger-workspaces
versnic Nov 12, 2026
a441b83
fix: find a monorepo by a prefix of its name again
versnic Nov 12, 2026
2f9a5f8
fix: read pnpm workspace packages listed without indentation
versnic Nov 12, 2026
67437ff
fix: drop the comment after a quoted pnpm workspace package
versnic Nov 12, 2026
b7eac4f
fix: read a pnpm workspace packages list spread over several lines
versnic Nov 12, 2026
efaf333
docs: put the frame() comment back above frame()
versnic Nov 12, 2026
29b1ce8
fix: read the packages of a monorepo again after opening it
versnic Nov 12, 2026
976ef84
fix: leave out the folder itself with a trailing /** exclusion
versnic Nov 12, 2026
3c5bd08
docs: label bigger workspaces as released in 0.11.0
versnic Nov 12, 2026
5df98f1
Merge remote-tracking branch 'origin/main' into feat/bigger-workspaces
versnic Nov 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Every colour comes from the theme in `ui.js`: `color()` for plain output, `style

Each file in `lib/` starts with two comment lines: what the file is for, and which files use it. Update them only if your change makes them wrong, for example a new file that imports it. Explain how something works in a comment next to the code instead, where it is easier to keep right.

Modules receive their side effects (file system, prompts, process spawning) as parameters with real defaults, so tests can replace them with fakes. Tests live in `test/`, one file per module.
Modules receive their side effects (file system, prompts, process spawning) as parameters with real defaults, so tests can replace them with fakes. Tests live in `test/`, one file per module. `test/benchmark.test.js` is the exception: it checks the time budget of the "Bigger workspaces" milestone, a 200-project workspace searched two levels deep in under 500 ms, on real folders in a temporary directory.

## Workflow

Expand Down
74 changes: 54 additions & 20 deletions README.md

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ These apply to every milestone:
| Fast navigation | Released in 0.6.0 | Fuzzy search, recent items, direct mode, script arguments |
| A polished interface | Released in 0.9.0 | Mouse support, framed header, buttons, themes, project details, first run |
| Terminal compatibility | Planned | Mouse and screens checked in macOS Terminal, iTerm2 and Linux terminals |
| Bigger workspaces | Planned | Monorepos, nested projects, multiple named workspaces |
| Bigger workspaces | Released in 0.11.0 | Monorepos, nested projects, multiple named workspaces |
| Configuration and scripts | Planned | Versioned config schema, `config` command, JSON output, project commands |
| Hardening and release candidate | Planned | Linting, type checks, end-to-end tests, interface freeze, feedback period |
| Stable | Planned: 1.0.0 | Semver guarantees for flags, config and exit codes |
Expand Down Expand Up @@ -179,14 +179,16 @@ Every screen checked in the terminals people use, on their own schedule: they ne

**Done when:** screenshots of the main screens look correct in Windows Terminal, PowerShell, macOS Terminal, iTerm2 and a Linux terminal, at 80 and 120 columns, with and without `NO_COLOR`, and resizing the window while a menu is open never leaves broken lines or duplicate headers in any of them.

## Bigger workspaces
## Bigger workspaces _(released in 0.11.0)_

- [ ] **Monorepos:** detect npm, Yarn and pnpm workspaces. A monorepo appears as one project with expandable packages; scripts run in the selected package.
- [ ] **Nested discovery:** optional search depth (default 1, maximum 3) for workspaces organised in folders such as `clients/acme/web`. It must stop at any folder with a `package.json` and never enter `node_modules`.
- [ ] **Multiple named workspaces:** save several workspaces (for example `work` and `personal`), switch between them from the menu, and choose one with `--workspace <name>`.
- [x] **Monorepos:** detect npm, Yarn and pnpm workspaces. A monorepo appears as one project with expandable packages; scripts run in the selected package. Opening it shows a **root** entry for its own scripts and its packages, search looks through all of them, and each package runs with its monorepo's package manager [#36](https://github.com/modulane/dev-workspace-cli/issues/36).
- [x] **Nested discovery:** optional search depth (default 1, maximum 3) for workspaces organised in folders such as `clients/acme/web`, saved with `--set-depth`. It must stop at any folder with a `package.json` and never enter `node_modules`. Projects found deeper are named by their path, and direct mode also finds them by their last part (`dws web`) [#37](https://github.com/modulane/dev-workspace-cli/issues/37).
- [x] **Multiple named workspaces:** save several workspaces (for example `work` and `personal`), switch between them from the menu, and choose one with `--workspace <name>`. Each workspace is saved under a name (its folder name, or one typed when it is added from the menu), and `--list-workspaces` and `--remove-workspace` manage them [#38](https://github.com/modulane/dev-workspace-cli/issues/38).

**Done when:** a 200-project workspace with depth 2 lists in under 500 ms on a typical SSD, measured in a benchmark test.

Met: `test/benchmark.test.js` lists 20 folders of 10 projects each, two levels deep, and fails above 500 ms. It runs with the other tests in CI on every operating system.

## Configuration and scripts

- [ ] **Versioned config schema:** add a `"version"` field and migrate older files automatically, with a backup (`config.json.bak`) before any migration.
Expand Down
23 changes: 21 additions & 2 deletions lib/args.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Reading the command-line options, and the `--help` text.
// Used by cli.js and prompts.js.
// Used by cli.js, prompts.js and script-arguments.js.

import { parseArgs } from 'node:util'

Expand All @@ -24,13 +24,20 @@ export function formatHelp(color = value => String(value)) {
${color('dws web dev -- --port 4000', 'accent')}

${color('Options:', 'bold')}
${color('-w, --workspace', 'accent')} ${color('<path>', 'dim')} Use <path> as the workspace and save it
${color('-w, --workspace', 'accent')} ${color('<name|path>', 'dim')}
Use a saved workspace, or <path> (saved too)
${color('--list-workspaces', 'accent')} List the saved workspaces
${color('--remove-workspace', 'accent')} ${color('<name>', 'dim')}
Forget a saved workspace
${color('--no-mouse', 'accent')} Use only the keyboard in menus, this time
${color('--set-mouse', 'accent')} ${color('<on|off>', 'dim')}
Save whether menus use the mouse
${color('--set-color', 'accent')} ${color('<name>', 'dim')} Save the accent colour: cyan, blue, purple,
magenta, pink, orange, teal, sky, lavender,
coral, gold, bold
${color('--set-depth', 'accent')} ${color('<1-3>', 'dim')} Save how many folder levels to search for
projects (1, the default, lists only the
workspace's own subfolders)
${color('--config-path', 'accent')} Print the configuration file location
${color('--clear-history', 'accent')} Forget recently used projects and scripts
${color('--add-alias', 'accent')} ${color('<name>', 'dim')} Create another command that starts the CLI
Expand Down Expand Up @@ -64,9 +71,12 @@ export function parseCliArgs(args) {
args: own,
options: {
workspace: { type: 'string', short: 'w' },
'list-workspaces': { type: 'boolean' },
'remove-workspace': { type: 'string' },
'no-mouse': { type: 'boolean' },
'set-mouse': { type: 'string' },
'set-color': { type: 'string' },
'set-depth': { type: 'string' },
'config-path': { type: 'boolean' },
'clear-history': { type: 'boolean' },
'add-alias': { type: 'string' },
Expand Down Expand Up @@ -112,6 +122,15 @@ export function parseCliArgs(args) {
)
}

if (
values['set-depth'] !== undefined &&
!['1', '2', '3'].includes(values['set-depth'])
) {
throw new Error(
`Use --set-depth with 1, 2 or 3, not "${values['set-depth']}".${SEE_HELP}`,
)
}

if (separator !== -1 && script === undefined) {
throw new Error(
`Arguments after -- need a project and a script, for example: dws web dev -- --port 4000${SEE_HELP}`,
Expand Down
Loading
Loading