mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
<!-- ONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> <!-- RECURSEML_SUMMARY:START --> ## High-level PR Summary This PR changes the default development ports for several background services to avoid conflicts. PostgreSQL moves from port `5432` to `8128`, Inbucket SMTP from `2500` to `8129`, Inbucket POP3 from `1100` to `8130`, and the OpenTelemetry collector from `4318` to `8131`. All references across configuration files, Docker Compose setups, environment files, CI/CD workflows, test files, and documentation have been updated to reflect these new port assignments. A knowledge base document has been added to document the new port mappings. ⏱️ Estimated Review Time: 15-30 minutes <details> <summary>💡 Review Order Suggestion</summary> | Order | File Path | | --- | --- | | 1 | `claude/CLAUDE-KNOWLEDGE.md` | | 2 | `apps/dev-launchpad/public/index.html` | | 3 | `docker/dependencies/docker.compose.yaml` | | 4 | `docker/emulator/docker.compose.yaml` | | 5 | `apps/backend/.env` | | 6 | `apps/backend/.env.development` | | 7 | `docker/server/.env.example` | | 8 | `package.json` | | 9 | `.devcontainer/devcontainer.json` | | 10 | `apps/e2e/.env.development` | | 11 | `.github/workflows/check-prisma-migrations.yaml` | | 12 | `.github/workflows/docker-server-test.yaml` | | 13 | `.github/workflows/e2e-api-tests.yaml` | | 14 | `.github/workflows/e2e-source-of-truth-api-tests.yaml` | | 15 | `.github/workflows/restart-dev-and-test.yaml` | | 16 | `apps/e2e/tests/backend/endpoints/api/v1/internal/email-drafts.test.ts` | | 17 | `apps/e2e/tests/backend/endpoints/api/v1/internal/email.test.ts` | | 18 | `apps/e2e/tests/backend/endpoints/api/v1/send-email.test.ts` | | 19 | `apps/e2e/tests/backend/endpoints/api/v1/unsubscribe-link.test.ts` | | 20 | `apps/e2e/tests/backend/workflows.test.ts` | | 21 | `docs/templates/others/self-host.mdx` | </details> [](https://discord.gg/n3SsVDAW6U) [ <!-- RECURSEML_SUMMARY:END --> <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > This PR introduces customizable development ports using `NEXT_PUBLIC_STACK_PORT_PREFIX`, updating configurations, documentation, and tests accordingly. > > - **Behavior**: > - Default development ports for services are now customizable via `NEXT_PUBLIC_STACK_PORT_PREFIX`. > - PostgreSQL port changed from `5432` to `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}28`. > - Inbucket SMTP port changed from `2500` to `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}29`. > - Inbucket POP3 port changed from `1100` to `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}30`. > - OpenTelemetry collector port changed from `4318` to `${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}31`. > - **Configuration**: > - Updated `docker.compose.yaml` to use new port variables for services like PostgreSQL, Inbucket, and OpenTelemetry. > - Environment files in `apps/backend`, `apps/dashboard`, and `apps/e2e` updated to use `NEXT_PUBLIC_STACK_PORT_PREFIX`. > - `package.json` scripts updated to reflect new port configurations. > - **Documentation**: > - Added `CLAUDE-KNOWLEDGE.md` to document new port mappings. > - Updated `self-host.mdx` to reflect new port configurations. > - **Testing**: > - Updated test files in `apps/e2e/tests` to use new port configurations. > - Added `helpers/ports.ts` for port-related utilities in tests. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup> for76ef55f58f. You can [customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> ---- <!-- ELLIPSIS_HIDDEN --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enable configurable development ports via a NEXT_PUBLIC_STACK_PORT_PREFIX, allowing parallel local environments with custom port prefixes. - **Bug Fixes** - Updated local service port mappings and CI/workflow settings so tooling and tests use the new prefixed ports consistently. - **Documentation** - Added docs and contributor guidance for running multiple parallel workspaces with custom port prefixes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: N2D4 <N2D4@users.noreply.github.com>
115 lines
8.0 KiB
JSON
115 lines
8.0 KiB
JSON
{
|
|
"name": "@stackframe/monorepo",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"repository": "",
|
|
"scripts": {
|
|
"pre-no-codegen": "npx -y only-allow pnpm",
|
|
"pre-preinstall": "npx -y only-allow pnpm && node -e \"if(process.env.STACK_SKIP_TEMPLATE_GENERATION !== 'true') require('child_process').execSync('npx --package=tsx tsx ./scripts/generate-sdks.ts', {stdio: 'inherit'})\"",
|
|
"pre": "pnpm pre-preinstall",
|
|
"preinstall": "pnpm pre-preinstall",
|
|
"typecheck": "pnpm pre && turbo typecheck --",
|
|
"build:dev": "pnpm pre && NODE_ENV=development pnpm run build",
|
|
"build": "pnpm pre && turbo build",
|
|
"build:backend": "pnpm pre && turbo run build --filter=@stackframe/stack-backend...",
|
|
"build:dashboard": "pnpm pre && turbo run build --filter=@stackframe/stack-dashboard...",
|
|
"build:demo": "pnpm pre && turbo run build --filter=demo-app...",
|
|
"build:docs": "pnpm run build:packages && pnpm run build:backend && turbo run generate-openapi-fumadocs && pnpm run --filter=@stackframe/stack-docs generate-openapi-docs && turbo run build --filter=@stackframe/stack-docs",
|
|
"build:packages": "pnpm pre && turbo run build --filter=./packages/*",
|
|
"claude-code": "pnpm pre && npx -y @anthropic-ai/claude-code@latest",
|
|
"cmux": "pnpm pre && npx -y cmux@latest",
|
|
"codebuff": "pnpm pre && npx codebuff",
|
|
"restart-dev-in-background": "pnpm pre && pnpm run kill-dev:named && (pnpm run dev:named > dev-server.log.untracked.txt 2>&1 &) && echo 'Starting dev server in background... (Logs are in dev-server.log.untracked.txt)' && npx wait-on http://localhost:${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02 -t 120000 && echo 'Dev server running.'",
|
|
"restart-dev-environment": "pnpm pre && concurrently \"pnpm run build:packages && pnpm run codegen\" \"pnpm run restart-deps\" && pnpm run restart-dev-in-background",
|
|
"stop-dev-environment": "pnpm pre && pnpm run kill-dev:named && pnpm run stop-deps",
|
|
"clean": "pnpm pre-no-codegen && turbo run clean && rimraf --glob **/.next && rimraf --glob **/.turbo && rimraf .turbo && rimraf --glob **/node_modules",
|
|
"codegen": "pnpm pre && turbo run codegen && pnpm run generate-sdks && pnpm run generate-openapi-fumadocs",
|
|
"deps-compose": "docker compose -p stack-dependencies-${NEXT_PUBLIC_STACK_PORT_PREFIX:-81} -f docker/dependencies/docker.compose.yaml",
|
|
"stop-deps": "POSTGRES_DELAY_MS=0 pnpm run deps-compose kill && POSTGRES_DELAY_MS=0 pnpm run deps-compose down -v",
|
|
"wait-until-postgres-is-ready:pg_isready": "until pg_isready -h localhost -p ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}28; do sleep 1; done",
|
|
"wait-until-postgres-is-ready": "command -v pg_isready >/dev/null 2>&1 && pnpm run wait-until-postgres-is-ready:pg_isready || sleep 10 # not everyone has pg_isready installed, so we fallback to sleeping",
|
|
"start-deps:no-delay": "pnpm pre && pnpm run deps-compose up --detach --build && pnpm run wait-until-postgres-is-ready && pnpm run db:init && echo \"\\nDependencies started in the background as Docker containers. 'pnpm run stop-deps' to stop them\"n",
|
|
"start-deps": "POSTGRES_DELAY_MS=${POSTGRES_DELAY_MS:-20} pnpm run start-deps:no-delay",
|
|
"restart-deps": "pnpm pre && pnpm run stop-deps && pnpm run start-deps",
|
|
"restart-deps:no-delay": "pnpm pre && pnpm run stop-deps && pnpm run start-deps:no-delay",
|
|
"psql": "pnpm pre && pnpm run --filter=@stackframe/stack-backend psql",
|
|
"explain-query": "pnpm pre && echo 'Paste your query (end with Ctrl-D):' && query=$(cat) && echo 'Connecting to Postgres...' && printf \"EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)\n$query\" | pnpm run --silent psql -qAt | sed -n '/\\[/,$p' > explained-query.untracked.json && echo 'Explained query saved to explained-query.untracked.json. To analyze it, open it in the query analyzer at https://tatiyants.com/pev/#/plans/new'",
|
|
"db:migration-gen": "pnpm pre && pnpm run --filter=@stackframe/stack-backend db:migration-gen",
|
|
"db:reset": "pnpm pre && pnpm run --filter=@stackframe/stack-backend db:reset",
|
|
"db:seed": "pnpm pre && pnpm run --filter=@stackframe/stack-backend db:seed",
|
|
"db:init": "pnpm pre && pnpm run --filter=@stackframe/stack-backend db:init",
|
|
"db:migrate": "pnpm pre && pnpm run --filter=@stackframe/stack-backend db:migrate",
|
|
"fern": "pnpm pre && pnpm run --filter=@stackframe/docs fern",
|
|
"dev:full": "pnpm pre && concurrently -k \"pnpm run generate-sdks:watch\" \"turbo run dev --concurrency 99999\"",
|
|
"dev": "pnpm pre && concurrently -k \"pnpm run generate-sdks:watch\" \"pnpm run generate-openapi-docs:watch\" \"turbo run dev --concurrency 99999 --filter=./apps/* --filter=@stackframe/stack-docs --filter=./packages/* --filter=./examples/demo \"",
|
|
"dev:basic": "pnpm pre && concurrently -k \"pnpm run generate-sdks:watch\" \"turbo run dev --concurrency 99999 --filter=@stackframe/stack-backend --filter=@stackframe/stack-dashboard --filter=@stackframe/mock-oauth-server\"",
|
|
"dev:docs": "pnpm pre && concurrently -k \"pnpm run generate-openapi-docs:watch\" \"turbo run dev --concurrency 99999 --filter=@stackframe/stack-docs\"",
|
|
"dev:named": "pnpm pre && concurrently -k \"pnpm run dev\" \"node -e \\\"process.title='node (stack-named-dev-server)'; process.stdin.resume();\\\"\"",
|
|
"kill-dev:named": "(pgrep -f 'stack-named-dev-server' | xargs -r -n1 pkill -P); echo 'Killed named dev server (if found). Sleeping to give some time for it to shut down...' && sleep 10",
|
|
"start": "pnpm pre && turbo run start --concurrency 99999",
|
|
"start:backend": "pnpm pre && turbo run start --concurrency 99999 --filter=@stackframe/stack-backend",
|
|
"start:dashboard": "pnpm pre && turbo run start --concurrency 99999 --filter=@stackframe/stack-dashboard",
|
|
"start:mock-oauth-server": "pnpm pre && turbo run start --concurrency 99999 --filter=@stackframe/mock-oauth-server",
|
|
"lint": "pnpm pre && turbo run lint --continue -- --max-warnings=0",
|
|
"release": "pnpm pre && release",
|
|
"peek": "pnpm pre && pnpm release --peek",
|
|
"changeset": "pnpm pre && changeset",
|
|
"test": "pnpm pre && vitest",
|
|
"test:e2e": "pnpm pre && vitest e2e/tests",
|
|
"test:unit": "pnpm pre && vitest src",
|
|
"verify-data-integrity": "pnpm pre && pnpm -C apps/backend run verify-data-integrity",
|
|
"generate-openapi-fumadocs": "turbo run generate-openapi-fumadocs",
|
|
"generate-keys": "pnpm pre && turbo run generate-keys",
|
|
"generate-sdks": "npx --package=tsx tsx ./scripts/generate-sdks.ts",
|
|
"generate-sdks:watch": "chokidar --silent -c 'pnpm run generate-sdks' './packages/template' --ignore './packages/template/package.json' --ignore '**/node_modules/**' --ignore '**/dist/**' --ignore '**/.turbo/**' --throttle 2000",
|
|
"generate-openapi-docs:watch": "chokidar --silent -c 'pnpm run --filter=@stackframe/stack-docs generate-openapi-docs' './docs/public/openapi/{admin,client,server,webhooks}.json' --throttle 2000"
|
|
},
|
|
"devDependencies": {
|
|
"@changesets/cli": "^2.27.9",
|
|
"@testing-library/react": "^15.0.7",
|
|
"@types/node": "20.17.6",
|
|
"@types/supertest": "^6.0.2",
|
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
"@typescript-eslint/parser": "^6.21.0",
|
|
"@vitejs/plugin-react": "^4.3.3",
|
|
"chokidar-cli": "^3.0.0",
|
|
"codebuff": "^1.0.261",
|
|
"concurrently": "^8.2.2",
|
|
"esbuild": "^0.24.0",
|
|
"eslint": "8.30.0",
|
|
"eslint-config-next": "^14.2.17",
|
|
"eslint-plugin-import": "^2.31.0",
|
|
"eslint-plugin-node": "^11.1.0",
|
|
"eslint-plugin-promise": "^6.6.0",
|
|
"eslint-plugin-react": "^7.37.2",
|
|
"jsdom": "^24.1.3",
|
|
"only-allow": "^1.2.1",
|
|
"rimraf": "^5.0.10",
|
|
"tsup": "^8.3.5",
|
|
"turbo": "^2.2.3",
|
|
"typescript": "5.3.3",
|
|
"vite-tsconfig-paths": "^4.3.2",
|
|
"vitest": "^1.6.0",
|
|
"wait-on": "^8.0.1"
|
|
},
|
|
"pnpm": {
|
|
"overrides": {
|
|
"@types/react": "^18.2.0",
|
|
"@types/react-dom": "^18.2.0"
|
|
},
|
|
"patchedDependencies": {
|
|
"openid-client@5.6.4": "patches/openid-client@5.6.4.patch"
|
|
}
|
|
},
|
|
"engines": {
|
|
"npm": ">=10.0.0",
|
|
"node": ">=20.0.0"
|
|
},
|
|
"packageManager": "pnpm@9.1.2",
|
|
"dependencies": {
|
|
"commander": "^13.1.0",
|
|
"tsx": "^4.19.3",
|
|
"yaml": "^2.4.5"
|
|
}
|
|
}
|