Skip to content

release: @focus-mcp/cli v2.3.1 — sync develop → main#132

Merged
samuelds merged 8 commits into
mainfrom
develop
May 8, 2026
Merged

release: @focus-mcp/cli v2.3.1 — sync develop → main#132
samuelds merged 8 commits into
mainfrom
develop

Conversation

@samuelds
Copy link
Copy Markdown
Contributor

@samuelds samuelds commented May 8, 2026

Summary

Release cli@2.3.1 — fix 2 bugs Windows (spawn npm ENOENT + path normalization).

Contenu

Test plan

  • Tests cross-platform Vitest (321/321 passants)
  • CI passe (7 checks required du ruleset main)
  • OIDC publish s'exécute après merge (workflow Stable Publish)
  • Tag v2.3.1 créé par changesets/action

Bug report user

Failed to install "cache": spawn npm ENOENT
Failed to load "cache": Resolved path "C:\Users\samuelds\.focus\bricks\node_modules\@focus-mcp\brick-cache\mcp-brick.json" escapes bricksDir "C:\Users\samuelds\.focus\bricks"

🤖 Generated with Claude Code

claude and others added 8 commits May 6, 2026 23:27
chore: back-merge main into develop (post-readme-sync 2026-05-06)
"(out of 68+ total)" was ambiguous (total what?) and inconsistent with
the bullet below which says "68+ official bricks". Now reads
"(out of 68+ official bricks)" for consistency.

Closes Copilot review threads on PRs #126 and #127.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2026-05-07

docs(cli): clarify tagline noun per Copilot feedback (#126, #127)
- spawn npm now uses shell: true on win32 to resolve npm.cmd
- assertWithinBricksDir uses path.relative() for cross-platform separator handling

Fixes ENOENT and "escapes bricksDir" errors on Windows nvm4w + Codex MCP.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…malization

fix(cli): support Windows for bricks:install and brick load
Apply changeset bump for Windows spawn + path normalization fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore(release): apply version bump cli 2.3.1
Copilot AI review requested due to automatic review settings May 8, 2026 23:03
@samuelds samuelds enabled auto-merge May 8, 2026 23:03
@samuelds samuelds merged commit eda491a into main May 8, 2026
22 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Release sync from develop to main for @focus-mcp/cli v2.3.1, primarily addressing Windows-specific issues in brick installation (npm spawn) and brick path validation.

Changes:

  • Update brick path containment checks to use path.relative() for cross-platform separator handling.
  • Adjust npm invocation to use shell: true on Windows to resolve npm.cmd.
  • Apply release metadata updates (version bump + changelog + README wording tweak).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/source/filesystem-source.ts Switches assertWithinBricksDir() from string prefix checks to path.relative()-based containment detection.
src/source/filesystem-source.test.ts Adds additional tests around assertWithinBricksDir() behavior.
src/adapters/npm-installer-adapter.ts Changes npm spawn options to enable shell on Windows.
src/adapters/npm-installer-adapter.test.ts Adds tests asserting platform-specific shell behavior for npm spawn.
README.md Minor wording tweak (“official bricks”).
package.json Bumps package version to 2.3.1.
CHANGELOG.md Adds 2.3.1 release notes for the Windows fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to 44
const rel = relative(realBricksDir, resolvedPath);
if (rel !== '' && (rel.startsWith('..') || isAbsolute(rel))) {
throw new Error(`Resolved path "${resolvedPath}" escapes bricksDir "${realBricksDir}"`);
Comment on lines 60 to 66
const child = spawn('npm', args, {
stdio: ['ignore', 'pipe', 'pipe'],
shell: false,
// On Windows, `npm` resolves to `npm.cmd` (a batch script) which
// requires a shell to execute. On POSIX `npm` is a direct binary,
// so we keep `shell: false` to avoid shell-spawn overhead.
shell: process.platform === 'win32',
});
Comment on lines +271 to +305
describe('runNpm cross-platform shell behaviour', () => {
it('uses shell: true on Windows (resolves npm.cmd batch script)', async () => {
const platformSpy = vi.spyOn(process, 'platform', 'get').mockReturnValue('win32');
vi.mocked(mkdir).mockResolvedValue(undefined);
vi.mocked(spawn).mockReturnValue(
makeChildProcess(0) as unknown as ReturnType<typeof spawn>,
);

await adapter.npmInstall('@focus-mcp/brick-echo', '1.0.0');

expect(spawn).toHaveBeenCalledWith(
'npm',
expect.any(Array),
expect.objectContaining({ shell: true }),
);
platformSpy.mockRestore();
});

it('uses shell: false on Linux (direct binary, no shell overhead)', async () => {
const platformSpy = vi.spyOn(process, 'platform', 'get').mockReturnValue('linux');
vi.mocked(mkdir).mockResolvedValue(undefined);
vi.mocked(spawn).mockReturnValue(
makeChildProcess(0) as unknown as ReturnType<typeof spawn>,
);

await adapter.npmInstall('@focus-mcp/brick-echo', '1.0.0');

expect(spawn).toHaveBeenCalledWith(
'npm',
expect.any(Array),
expect.objectContaining({ shell: false }),
);
platformSpy.mockRestore();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants