From 543388e18b6add315ff80aae03b84f681f14fda8 Mon Sep 17 00:00:00 2001 From: "jason.woltje" Date: Sun, 5 Apr 2026 01:41:46 +0000 Subject: [PATCH] fix(mosaic): resolve framework scripts via import.meta.url (#385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #383 — resolveTool now uses fileURLToPath(import.meta.url). Adds package.json/framework subpath exports. Bumps @mosaic/mosaic to 0.0.18. --- packages/mosaic/package.json | 6 ++++-- packages/mosaic/src/commands/launch.ts | 14 +++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/mosaic/package.json b/packages/mosaic/package.json index 40dd1c5..d4ee0d4 100644 --- a/packages/mosaic/package.json +++ b/packages/mosaic/package.json @@ -1,6 +1,6 @@ { "name": "@mosaic/mosaic", - "version": "0.0.17", + "version": "0.0.18", "repository": { "type": "git", "url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git", @@ -18,7 +18,9 @@ ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" - } + }, + "./package.json": "./package.json", + "./framework/*": "./framework/*" }, "scripts": { "build": "tsc", diff --git a/packages/mosaic/src/commands/launch.ts b/packages/mosaic/src/commands/launch.ts index 1c8a57c..8183a0a 100644 --- a/packages/mosaic/src/commands/launch.ts +++ b/packages/mosaic/src/commands/launch.ts @@ -7,9 +7,9 @@ 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 { fileURLToPath } from 'node:url'; import type { Command } from 'commander'; const MOSAIC_HOME = process.env['MOSAIC_HOME'] ?? join(homedir(), '.config', 'mosaic'); @@ -498,14 +498,10 @@ function delegateToScript(scriptPath: string, args: string[], env?: Record