Repository navigation
feat: add dev:stack command to run SpaceApp from source #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | The
A CI job that calls Implement a
|
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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 }); | ||||||||||||||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | Replace the hardcoded database password with a generated secret. Line 15 writes the fixed string Anyone who can reach the PostgreSQL port can log in if the compose file publishes it on a non-loopback interface. The port is also fixed at Generate the password with Proposed fix
The compose file must use the same password and port. See the next comment. 📝 Committable suggestion
|
||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| const cmd = process.argv[2]; | ||||||||||||||
| if (cmd === 'down') { | ||||||||||||||
| execSync('docker compose -p spaceapp-dev down', { stdio: 'inherit' }); | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔎 Supported by static analysis
Wire the dev stack to its state directory.
The script also reports readiness immediately after
|
||||||||||||||
| } 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.'); | ||||||||||||||
| } | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration |
Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: oll4com/spaceapp
Length of output: 7825
Restore the root workspace and install configuration.
package.jsonremovesworkspaces, dependencies, development dependencies, overrides, and existing build, check, and test scripts. The lockfile still declares the oldspaceroot and its workspace graph. A rootnpm citherefore no longer has the manifest configuration required to installapps/*andpackages/*. The CI workflows also invoke the removedtest:public,check, andbuildscripts.Restore the removed fields and scripts, then retain the new
dev:stackandciscripts. If the removal is intentional, updatepackage-lock.jsonand every affected workflow.