-
Notifications
You must be signed in to change notification settings - Fork 513
fix: wait for stack/stack-shared builds before generate-openapi-docs:watch #1416
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
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 |
|---|---|---|
|
|
@@ -77,7 +77,7 @@ | |
| "generate-sdks": "pnpm exec tsx ./scripts/generate-sdks.ts", | ||
| "generate-setup-prompt-docs": "pnpm exec tsx ./scripts/generate-setup-prompt-docs.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": "pnpm run --filter=@stackframe/backend codegen-docs && chokidar --silent -c 'pnpm run --filter=@stackframe/backend codegen-docs' './apps/backend/src/app/api/latest/**/route.{js,jsx,ts,tsx}' './apps/backend/src/lib/openapi.ts' './packages/stack-shared/src/interface/webhooks.ts' --throttle 2000", | ||
| "generate-openapi-docs:watch": "wait-on packages/stack/dist/esm/index.js packages/stack-shared/dist/esm/index.js && pnpm run --filter=@stackframe/backend codegen-docs && chokidar --silent -c 'pnpm run --filter=@stackframe/backend codegen-docs' './apps/backend/src/app/api/latest/**/route.{js,jsx,ts,tsx}' './apps/backend/src/lib/openapi.ts' './packages/stack-shared/src/interface/webhooks.ts' --throttle 2000", | ||
|
Contributor
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.
Prompt To Fix With AIThis is a comment left during a code review.
Path: package.json
Line: 80
Comment:
**Infinite hang on build failure**
`wait-on`'s default timeout is `Infinity`, so if either dist file is never produced (e.g. a TypeScript error in `packages/stack` or `packages/stack-shared` prevents the build), this script will block forever with no feedback. The existing `wait-until-clickhouse-is-ready` script has the same pattern (and that service is expected to always start), but a package build can legitimately fail. Consider adding `--timeout 300000` (5 min) so the script exits with a clear error instead of hanging silently in a long-running dev session.
How can I resolve this? If you propose a fix, please make it concise. |
||
| "generate-setup-prompt-docs:watch": "pnpm run generate-setup-prompt-docs && chokidar --silent -c 'pnpm run generate-setup-prompt-docs' './packages/stack-shared/src/ai/prompts.ts' './scripts/generate-setup-prompt-docs.ts' --throttle 2000" | ||
| }, | ||
| "devDependencies": { | ||
|
|
||
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.
wait-until-clickhouse-is-readyscript (line 38) invokeswait-onviapnpm exec wait-on, which ensures the exact local version fromnode_modules/.binis used. This new call dropspnpm exec, which works in practice because pnpm scripts addnode_modules/.bintoPATH, but it is inconsistent with the codebase pattern and could pick up a globally-installedwait-onof a different version if one exists in the shell.Prompt To Fix With AI