Arseniy Klempner 0df18b2a75
feat: create @waku/run package for local dev env (#2678)
* feat: create @waku/run package for local dev env

* chore: add @waku/run to release please config

* feat: test @waku/run with playwright

* fix: don't run waku/run tests in CI

* fix: cache images so docker-compose can work offline

* feat: set nodekey and staticnode flags for each nwaku node

* fix: use constants for node ids

* chore: set directories for running via npx

* fix: remove .env, support env vars for nwaku ports

* fix: use separate db (same instance) for each node

* feat: add command to test dev env

* chore: use package version in container name

* fix: replace hardcoded WS/REST ports with constants/env vars

* chore: clean up README

* fix: refactor config printing into own function

* fix: add run package to release please manifest

* fix: defer to root folder gitignore/cspell

* fix: update node version and remove tsx

* fix: remove browser tests and express dep

* fix: replace magic values with constants

* fix: move to root .gitignore

* fix: move cspell to root
2025-10-22 21:38:28 -07:00

27 lines
800 B
JavaScript

#!/usr/bin/env node
import { execSync } from "child_process";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
import { getProjectName } from "../src/utils.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const packageRoot = __dirname.includes("dist")
? join(__dirname, "..", "..")
: join(__dirname, "..");
try {
const projectName = getProjectName(packageRoot);
execSync(`docker compose --project-name ${projectName} logs -f`, {
cwd: packageRoot,
stdio: "inherit",
env: { ...process.env, COMPOSE_PROJECT_NAME: projectName }
});
} catch (error: unknown) {
const err = error as { message?: string };
process.stderr.write(`Error viewing logs: ${err.message || String(error)}\n`);
process.exit(1);
}