Compare commits

..

2 Commits

Author SHA1 Message Date
Jarvis
9f73d3f5db fix: unify Commander to v13 across all packages (prdy, mosaic)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Stale commander@12 in @mosaic/prdy and @mosaic/mosaic caused type
mismatch with @mosaic/cli and @mosaic/quality-rails (both on v13).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 13:37:23 -05:00
Jarvis
6954e43bbb feat: local tier gateway with PGlite + Gitea-only publishing + repo linking
- Add PGlite (embedded Postgres) for local tier — gateway runs without
  external PG server. Same schema, same Drizzle API, zero module refactor.
- Install wizard now offers tier selection (local vs team).
  Local skips DATABASE_URL/VALKEY_URL, writes mosaic.config.json.
- Comment out npmjs publish step in CI (preserved for future use).
- Revert gateway publishConfig to Gitea registry, include in Gitea publish.
- Add repository field to all 23 publishable package.json files for
  Gitea package-to-repo linking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 13:32:02 -05:00
4 changed files with 21 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@mosaic/cli", "name": "@mosaic/cli",
"version": "0.0.12", "version": "0.0.10",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git", "url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",

View File

@@ -91,14 +91,24 @@ export function resolveGatewayEntry(): string {
return meta.entryPoint; return meta.entryPoint;
} }
// Try to resolve from globally installed @mosaic/gateway // Try to resolve from globally installed @mosaicstack/gateway
try {
const req = createRequire(import.meta.url);
const pkgPath = req.resolve('@mosaicstack/gateway/package.json');
const mainEntry = join(resolve(pkgPath, '..'), 'dist', 'main.js');
if (existsSync(mainEntry)) return mainEntry;
} catch {
// Not installed globally via @mosaicstack
}
// Try @mosaic/gateway (workspace / dev)
try { try {
const req = createRequire(import.meta.url); const req = createRequire(import.meta.url);
const pkgPath = req.resolve('@mosaic/gateway/package.json'); const pkgPath = req.resolve('@mosaic/gateway/package.json');
const mainEntry = join(resolve(pkgPath, '..'), 'dist', 'main.js'); const mainEntry = join(resolve(pkgPath, '..'), 'dist', 'main.js');
if (existsSync(mainEntry)) return mainEntry; if (existsSync(mainEntry)) return mainEntry;
} catch { } catch {
// Not installed globally // Not available
} }
throw new Error('Cannot find gateway entry point. Run `mosaic gateway install` first.'); throw new Error('Cannot find gateway entry point. Run `mosaic gateway install` first.');
@@ -207,11 +217,9 @@ function sleep(ms: number): Promise<void> {
// ─── npm install helper ───────────────────────────────────────────────────── // ─── npm install helper ─────────────────────────────────────────────────────
const GITEA_REGISTRY = 'https://git.mosaicstack.dev/api/packages/mosaic/npm/';
export function installGatewayPackage(): void { export function installGatewayPackage(): void {
console.log('Installing @mosaic/gateway from Gitea registry...'); console.log('Installing @mosaicstack/gateway...');
execSync(`npm install -g @mosaic/gateway@latest --registry=${GITEA_REGISTRY}`, { execSync('npm install -g @mosaicstack/gateway@latest', {
stdio: 'inherit', stdio: 'inherit',
timeout: 120_000, timeout: 120_000,
}); });
@@ -219,7 +227,7 @@ export function installGatewayPackage(): void {
export function uninstallGatewayPackage(): void { export function uninstallGatewayPackage(): void {
try { try {
execSync('npm uninstall -g @mosaic/gateway', { execSync('npm uninstall -g @mosaicstack/gateway', {
stdio: 'inherit', stdio: 'inherit',
timeout: 60_000, timeout: 60_000,
}); });
@@ -230,15 +238,15 @@ export function uninstallGatewayPackage(): void {
export function getInstalledGatewayVersion(): string | null { export function getInstalledGatewayVersion(): string | null {
try { try {
const output = execSync('npm ls -g @mosaic/gateway --json --depth=0', { const output = execSync('npm ls -g @mosaicstack/gateway --json --depth=0', {
encoding: 'utf-8', encoding: 'utf-8',
timeout: 15_000, timeout: 15_000,
stdio: ['pipe', 'pipe', 'pipe'], stdio: ['pipe', 'pipe', 'pipe'],
}); });
const data = JSON.parse(output) as { const data = JSON.parse(output) as {
dependencies?: { '@mosaic/gateway'?: { version?: string } }; dependencies?: { '@mosaicstack/gateway'?: { version?: string } };
}; };
return data.dependencies?.['@mosaic/gateway']?.version ?? null; return data.dependencies?.['@mosaicstack/gateway']?.version ?? null;
} catch { } catch {
return null; return null;
} }

View File

@@ -142,7 +142,7 @@ async function doInstall(rl: ReturnType<typeof createInterface>, opts: InstallOp
entryPoint = resolveGatewayEntry(); entryPoint = resolveGatewayEntry();
} catch { } catch {
console.error('Error: Gateway package not found after install.'); console.error('Error: Gateway package not found after install.');
console.error('Check that @mosaic/gateway installed correctly.'); console.error('Check that @mosaicstack/gateway installed correctly.');
return; return;
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@mosaic/mosaic", "name": "@mosaic/mosaic",
"version": "0.0.12", "version": "0.0.10",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git", "url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",