From 7e7d326dc63705959c80b5072fa0b1e447aa665e Mon Sep 17 00:00:00 2001 From: Jarvis Date: Thu, 2 Apr 2026 21:20:49 -0500 Subject: [PATCH] fix: fwScript prefers npm-bundled scripts over stale deployed copies fwScript() now resolves framework scripts from the @mosaic/mosaic npm package first, falling back to ~/.config/mosaic/ only if the bundled copy isn't found. This means `npm i -g @mosaic/cli@latest` immediately takes effect without needing `mosaic init` to re-deploy scripts. Bump @mosaic/mosaic and @mosaic/cli to 0.0.7. Co-Authored-By: Claude Opus 4.6 --- packages/cli/package.json | 2 +- packages/cli/src/commands/launch.ts | 14 ++++++++++++++ packages/mosaic/package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 8d26280..ceb5e2a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@mosaic/cli", - "version": "0.0.6", + "version": "0.0.7", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/cli/src/commands/launch.ts b/packages/cli/src/commands/launch.ts index 4105009..bb48d81 100644 --- a/packages/cli/src/commands/launch.ts +++ b/packages/cli/src/commands/launch.ts @@ -7,6 +7,7 @@ import { execFileSync, execSync, spawnSync } from 'node:child_process'; import { existsSync, mkdirSync, readFileSync, writeFileSync, readdirSync, rmSync } from 'node:fs'; +import { createRequire } from 'node:module'; import { homedir } from 'node:os'; import { join, dirname } from 'node:path'; import type { Command } from 'commander'; @@ -491,7 +492,20 @@ function delegateToScript(scriptPath: string, args: string[], env?: Record