Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ksjogo
Copy link
Contributor

@ksjogo ksjogo commented Aug 28, 2025

What does this PR do?

This PR changes the watcher from the worker's dev task from nodemon to tsx.
This allows for automated reloads in the dev environment when packages/shared changes:

Screen.Recording.2025-08-28.at.22.58.03.mov

It would have been possible to configure nodemon to also listen on the dist dir, but nodemon is generally a bit outdated and tsx well supported. Additionally nodemon on mac not only listens on actualy content changes but also saves without changes, which can lead to issues when spinning up @langfuse/shared#dev and @langfuse/worker#dev at the some time, due to tsc in shared dev doing a lot of writes. To help this situation shared#build is now a depdency of worker#dev, so the content is updated before tsx starts listening.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Important

Replaces nodemon with tsx for worker dev script, updates task dependencies in turbo.json, and removes nodemon from dependencies.

  • Behavior:
    • Replaces nodemon with tsx in worker/package.json for dev script to improve reloads when packages/shared changes.
    • Adds @langfuse/shared#build as a dependency for worker#dev in turbo.json to ensure content is updated before tsx starts.
  • Dependencies:
    • Removes nodemon from devDependencies in packages/shared/package.json and worker/package.json.
    • Adds tsx to devDependencies in worker/package.json.
  • Misc:
    • Updates task dependencies in turbo.json for dev:worker and worker#dev to include @langfuse/shared tasks.

This description was created by Ellipsis for 80282ed. You can customize this summary. It will automatically update as commits are pushed.

"start": "dotenv -e ../.env -- node dist/index.js",
"build": "tsc",
"dev": "dotenv -e ../.env -- nodemon src/index.ts",
"dev": "dotenv -e ../.env -- tsx watch --clear-screen=false --include '../packages/shared/dist/*' src/index.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear screen disabled to not remove other packages output when running the composed dev.

'@emotion/[email protected]':
resolution: {integrity: sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==}

'@esbuild/[email protected]':
Copy link
Contributor Author

@ksjogo ksjogo Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem wrong, not sure what pnpm is doing
Will re-run

"eslint-config-standard": "^17.1.0",
"eslint-plugin-prettier": "^5.1.3",
"kysely-codegen": "^0.16.8",
"nodemon": "^3.1.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't used in shared, so we can remove

@ksjogo ksjogo marked this pull request as ready for review August 28, 2025 21:10
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 28, 2025
turbo.json Outdated
"cache": false,
"persistent": true,
"dependsOn": [
"@langfuse/shared#build"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had this dependency also in the web container and this was hghly resource intensive. I think we can remove this and hit "pnpm run dev" on initial startup in this repo twice to account for the concurrency.

@dosubot dosubot bot added the auto-merge This PR is set to be merged label Sep 10, 2025
@dosubot dosubot bot removed the auto-merge This PR is set to be merged label Sep 10, 2025
@maxdeichmann maxdeichmann merged commit 36dc608 into langfuse:main Sep 10, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants