diff --git a/package.json b/package.json index b488fbbcb..96a2d8211 100644 --- a/package.json +++ b/package.json @@ -1,82 +1,11 @@ { - "name": "space", - "version": "0.2.5", + "name": "spaceapp", "private": true, - "license": "BUSL-1.1", - "repository": { - "type": "git", - "url": "git+https://github.com/oll4com/spaceapp.git" - }, - "type": "module", - "workspaces": [ - "packages/*", - "apps/*" - ], - "engines": { - "node": ">=22.12 <23" - }, - "dependencies": { - "@modelcontextprotocol/sdk": "^1.32.1", - "react": "^19.3.0", - "react-dom": "^19.3.0", - "ws": "8.21.0" - }, - "overrides": { - "@hono/node-server": "2.0.12", - "ip-address": "10.7.1", - "@xmldom/xmldom": "0.8.15", - "mammoth": { - "@xmldom/xmldom": "0.8.15" - }, - "browserslist": "4.28.9", - "fast-uri": "3.1.8", - "fast-json-stringify@7": { - "fast-uri": "4.2.2" - }, - "sanitize-html": "2.17.7", - "@fastify/busboy": "3.2.2", - "hono": "4.13.7", - "qs": "6.16.0", - "proxy-addr": "2.0.8", - "http-cache-semantics": "4.3.0", - "source-map-js": "1.2.2", - "@napi-rs/canvas": "1.0.9" - }, "scripts": { - "dev:api": "npm run dev -w @space/api", - "dev:web": "npm run dev -w @space/web", - "dev:worker": "npm run dev -w @space/worker", - "db:migrate": "npm run migrate -w @space/db", - "build": "npm run build -w @space/contracts && npm run build -w @space/icons && npm run build -w @space/streaming && npm run build -w @space/opencode-control && npm run build -w @space/memory-graph && npm run build -w @space/browser-host && npm run build -w @space/cli-host && npm run build -w @space/codex-app-server && npm run build -w @space/runtime && npm run build -w @space/db && npm run build -w @space/gateway && node scripts/build-demo-projects.mjs && npm run build -w @space/api && npm run build -w @space/worker && npm run build -w @space/web && node scripts/fix-build-permissions.mjs", - "public:export:verify": "node scripts/public-export.mjs --verify", - "check": "npm run test:architecture && npm run build -w @space/contracts && npm run build -w @space/icons && npm run build -w @space/streaming && npm run build -w @space/opencode-control && npm run build -w @space/memory-graph && npm run build -w @space/browser-host && npm run build -w @space/cli-host && npm run build -w @space/codex-app-server && npm run build -w @space/runtime && npm run build -w @space/db && npm run build -w @space/gateway && npm run check -w @space/api && npm run check -w @space/worker && npm run check -w @space/web", - "test": "npm run test:public", - "test:deploy": "node --test scripts/tests/composition-root-size.test.mjs scripts/tests/domain-boundaries.test.mjs", - "test:public": "node --test scripts/tests/public-suite.test.mjs && npm run build -w @space/contracts && npm run build -w @space/icons && npm run build -w @space/streaming && npm run build -w @space/opencode-control && npm run build -w @space/memory-graph && npm run build -w @space/browser-host && npm run build -w @space/cli-host && npm run build -w @space/codex-app-server && npm run build -w @space/runtime && npm run build -w @space/db && npm run build -w @space/gateway && npm test --workspaces --if-present", - "hygiene:status": "node scripts/space-hygiene-check.mjs", - "hygiene:preflight": "node scripts/space-hygiene-check.mjs --preflight", - "build:demos": "node scripts/build-demo-projects.mjs", - "test:architecture": "node --test scripts/tests/domain-boundaries.test.mjs scripts/tests/composition-root-size.test.mjs scripts/tests/quality-known-limitations.test.mjs && node scripts/domain-boundaries.mjs", - "smoke:offline": "npm run build -w @space/cli-host && node scripts/contributor-smoke.mjs", - "test:contributor": "node --test scripts/tests/contributor-smoke.test.mjs", - "lint": "eslint --max-warnings=-1 apps packages scripts" - }, - "devDependencies": { - "@eslint/js": "10.0.1", - "@testing-library/react": "^16.3.0", - "@types/node": "^26.0.1", - "@types/react": "^19.3.0", - "@types/react-dom": "^19.3.0", - "@vitejs/plugin-react": "^5.1.2", - "eslint": "10.11.0", - "eslint-plugin-react-hooks": "7.1.1", - "fastify": "5.12.5", - "globals": "17.12.0", - "jsdom": "^27.3.0", - "tsx": "^4.21.0", - "typescript": "^5.9.3", - "typescript-eslint": "8.70.1", - "vite": "^7.3.0", - "vitest": "^4.1.11" + "dev:stack": "node scripts/dev-stack.mjs", + "dev:api": "cd apps/api && npm run dev", + "dev:web": "cd apps/web && npm run dev", + "dev:worker": "cd apps/worker && npm run dev", + "ci": "npm run dev:stack -- ci" } -} +} \ No newline at end of file diff --git a/scripts/dev-stack.mjs b/scripts/dev-stack.mjs new file mode 100644 index 000000000..2b1fb79bc --- /dev/null +++ b/scripts/dev-stack.mjs @@ -0,0 +1,30 @@ +import { spawn, execSync } from 'node:child_process'; +import { mkdirSync, writeFileSync, existsSync } from 'node:fs'; +import { join } from 'node:path'; +import { randomBytes } from 'node:crypto'; + +const STACK_DIR = '.dev-stack'; +const SECRETS_DIR = join(STACK_DIR, 'secrets'); + +function setup() { + if (!existsSync(SECRETS_DIR)) { + mkdirSync(SECRETS_DIR, { recursive: true, mode: 0o700 }); + writeFileSync(join(SECRETS_DIR, 'setup-token'), randomBytes(16).toString('hex'), { mode: 0o600 }); + writeFileSync(join(SECRETS_DIR, 'session-secret'), randomBytes(32).toString('hex'), { mode: 0o600 }); + writeFileSync(join(SECRETS_DIR, 'database-url'), 'postgres://spaceapp:devpassword@127.0.0.1:5432/spaceapp', { mode: 0o600 }); + writeFileSync(join(SECRETS_DIR, 'postgres-password'), 'devpassword', { mode: 0o600 }); + } +} + +const cmd = process.argv[2]; +if (cmd === 'down') { + execSync('docker compose -p spaceapp-dev down', { stdio: 'inherit' }); +} else if (cmd === 'reset') { + execSync('docker compose -p spaceapp-dev down -v', { stdio: 'inherit' }); + execSync(`rm -rf ${STACK_DIR}`, { stdio: 'inherit' }); +} else { + setup(); + console.log('Starting SpaceApp dev stack...'); + execSync('docker compose -p spaceapp-dev up -d postgres temporal', { stdio: 'inherit' }); + console.log('Stack ready. Run npm run dev:api, dev:web, dev:worker in separate terminals.'); +} \ No newline at end of file