Files
stack/packages/storage/package.json
Jarvis 116784fd36
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
feat(gateway,storage): mosaic gateway doctor with tier health JSON (FED-M1-06)
Adds `mosaic gateway doctor [--json] [--config <path>]` for tier-aware
health reporting (postgres, valkey, pgvector). JSON mode emits a single
parseable TierHealthReport for CI consumption; exit 1 on red.

Refactors gateway-internal tier probes into @mosaicstack/storage so the
same probe logic is reused by both the gateway boot path
(detectAndAssertTier — fail-fast on first failure) and the doctor
command (probeServiceHealth — non-throwing, runs all probes, returns
report). Old apps/gateway/src/bootstrap/tier-detector.* files removed.

A local TierConfig interface in tier-detection.ts captures the minimal
structural shape from MosaicConfig without importing @mosaicstack/config
(would create a cycle since config already depends on storage for
StorageConfig).

Tests:
- packages/storage/src/tier-detection.spec.ts — 22 tests (11 ported from
  gateway tier-detector, 11 new for probeServiceHealth + timing + branch
  coverage)
- packages/mosaic/src/commands/gateway-doctor.spec.ts — 12 tests for
  JSON contract, exit codes, output format, --config override

Refs #460
2026-04-19 19:56:28 -05:00

43 lines
964 B
JSON

{
"name": "@mosaicstack/storage",
"version": "0.0.4",
"repository": {
"type": "git",
"url": "https://git.mosaicstack.dev/mosaicstack/stack.git",
"directory": "packages/storage"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"lint": "eslint src",
"typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests"
},
"dependencies": {
"@electric-sql/pglite": "^0.2.17",
"@mosaicstack/db": "workspace:^",
"@mosaicstack/types": "workspace:*",
"commander": "^13.0.0",
"ioredis": "^5.10.0",
"postgres": "^3.4.8"
},
"devDependencies": {
"typescript": "^5.8.0",
"vitest": "^2.0.0"
},
"publishConfig": {
"registry": "https://git.mosaicstack.dev/api/packages/mosaicstack/npm/",
"access": "public"
},
"files": [
"dist"
]
}