Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented May 9, 2025

Description

This allows us to carve our code up into separate packages for easy re-use across a variety of applications (VSCode extension, JetBrains extension, cli, evals, etc).

(Taken from MONOREPO.md):

Roo Code has transitioned to a monorepo powered by PNPM workspaces and Turborepo.

When you first pull down the monorepo changes from git you'll need to re-install all packages using pnpm. You can install pnpm using these instructions. If you're on MacOS the easiest option is to use Homebrew:

brew install pnpm

Once pnpm is installed you should wipe out your existing node_modules directories for a fresh start:

# This is optional, but recommended.
find . -name node_modules | xargs rm -rvf

And then install your packages:

pnpm install

If things are in good working order then you should be able to build a vsix and install it in VSCode:

pnpm build --out ../bin/roo-code-main.vsix && \
  code --install-extension bin/roo-code-main.vsix

Important

Transition to a PNPM and Turbo monorepo setup, updating workflows, build scripts, and configurations across the project.

  • Monorepo Setup:
    • Transition to a monorepo using PNPM workspaces and Turborepo.
    • Update MONOREPO.md with setup instructions.
  • CI/CD Workflows:
    • Replace npm with pnpm in workflows like changeset-release.yml, code-qa.yml, marketplace-publish.yml, and update-contributors.yml.
    • Add pnpm/action-setup@v4 to install pnpm in workflows.
  • Build and Scripts:
    • Update esbuild.js to include asset copying logic.
    • Modify package.json scripts to use pnpm and turbo for tasks like lint, test, and build.
    • Add turbo.json for task management.
  • Configuration Changes:
    • Add .eslintrc.json for e2e tests.
    • Update jest.config.js and vite.config.ts for compatibility with the new setup.
  • Miscellaneous:
    • Remove .vscodeignore and update .gitignore to reflect new asset paths.
    • Adjust ClineProvider.ts to use new asset paths for icons and images.

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


Important

Transition to a PNPM and Turbo monorepo setup, updating workflows, build scripts, and configurations across the project.

  • Monorepo Setup:
    • Transition to a monorepo using PNPM workspaces and Turborepo.
    • Update MONOREPO.md with setup instructions.
  • CI/CD Workflows:
    • Replace npm with pnpm in workflows like changeset-release.yml, code-qa.yml, marketplace-publish.yml, and update-contributors.yml.
    • Add pnpm/action-setup@v4 to install pnpm in workflows.
  • Build and Scripts:
    • Update esbuild.js to include asset copying logic.
    • Modify package.json scripts to use pnpm and turbo for tasks like lint, test, and build.
    • Add turbo.json for task management.
  • Configuration Changes:
    • Add .eslintrc.json for e2e tests.
    • Update jest.config.js and vite.config.ts for compatibility with the new setup.
  • Miscellaneous:
    • Remove .vscodeignore and update .gitignore to reflect new asset paths.
    • Adjust ClineProvider.ts to use new asset paths for icons and images.

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

@changeset-bot
Copy link

changeset-bot bot commented May 9, 2025

⚠️ No Changeset found

Latest commit: 4921102234d4326f3224ff74ff358014ae655b0a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label May 9, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented May 9, 2025

Thank you for your work on this major migration to a pnpm + Turbo monorepo! This is a very large pull request, with 62 files changed and tens of thousands of lines added/removed. Per our workflow guidelines, I'm reviewing whether it could be split into smaller, more focused PRs.

After reviewing the changes, most of the updates appear to be tightly coupled as part of the monorepo migration (switching to pnpm, updating scripts, moving/renaming files, updating workspace configs, and synchronizing build/test/lint processes). These changes generally need to happen together to keep the repository in a working state during the migration.

However, there are a few areas that could potentially be split out to make the review process easier:

  • Documentation updates (README.md, CONTRIBUTING.md): These could be submitted as a separate PR either before or after the main migration, since they don't affect the codebase directly.
  • License file addition (src/LICENSE): If this is not directly related to the migration, it could be its own PR.
  • Localization/translation file moves: If these are just file moves/renames and not structurally changed, they could be split out, but if they're required for the new monorepo structure, it's reasonable to keep them here.

If possible, consider splitting out documentation-only changes and the license file addition into their own PRs. This will help reviewers focus on the core migration logic and make the review process smoother. If these changes are tightly coupled due to the migration process, it's understandable to keep them together, but please clarify in the PR description if that's the case.

Thanks again for tackling this big migration!

@adamhill
Copy link
Contributor

adamhill commented May 9, 2025

wow. understands you can't break this into smaller PRs and congratulates you in the end! 💕

@adamhill
Copy link
Contributor

adamhill commented May 9, 2025

.vsix Build fails - macOS 15.4, Intel, zsh

pulled the PR with gh pr checkout
pnpm install worked fine

main branch install and build worked fine
pnpm dev + F5 works fine

pnpm build failed with

> pnpm build
 WARN  Unsupported engine: wanted: {"node":"20.18.1"} (current: {"node":"v23.11.0","pnpm":"10.10.0"})

> roo-code@ build /Users/adamhill/dev/roo-code/Roo-Code
> pnpm --filter @roo-code/vscode build

.                                        |  WARN  Unsupported engine: wanted: {"node":"20.18.1"} (current: {"node":"v23.11.0","pnpm":"10.10.0"})
src                                      |  WARN  Unsupported engine: wanted: {"node":"20.18.1"} (current: {"node":"v23.11.0","pnpm":"10.10.0"})

> @roo-code/[email protected] build /Users/adamhill/dev/roo-code/Roo-Code/src
> pnpm vsix

 WARN  Unsupported engine: wanted: {"node":"20.18.1"} (current: {"node":"v23.11.0","pnpm":"10.10.0"})


> @roo-code/[email protected] vsix /Users/adamhill/dev/roo-code/Roo-Code/src
>  rimraf bin && mkdirp bin && npx vsce package --no-dependencies --out bin

npm warn Unknown env config "recursive". This will stop working in the next major version of npm.
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm warn Unknown env config "_jsr-registry". This will stop working in the next major version of npm.
 ERROR  Invalid extension name '@roo-code/vscode'
 ELIFECYCLE  Command failed with exit code 1.
/Users/adamhill/dev/roo-code/Roo-Code/src:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @roo-code/[email protected] build: `pnpm vsix`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels May 9, 2025
@cte
Copy link
Collaborator Author

cte commented May 9, 2025

pnpm build failed with ...

Thanks for flagging - I think that's the last outstanding thing (validating the vsix build). I finally got the e2e tests working.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. size:XL This PR changes 500-999 lines, ignoring generated files. labels May 9, 2025
@cte
Copy link
Collaborator Author

cte commented May 10, 2025

Vsix builds are working now, test are passing (including e2e), etc. I think this is good to go.

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 10, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented May 13, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@cte cte changed the title PNPM + Turbo monorepo PNPM + Turbo monorepo + Nightly releases May 21, 2025
src/esbuild.mjs Outdated
const __dirname = path.dirname(__filename)

function setupLocaleWatcher() {
if (!watch) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The function setupLocaleWatcher refers to an undefined variable watch. Pass watch as a parameter or define it in the proper scope.

src/esbuild.mjs Outdated
// Wait 300ms after last change before copying.
debounceTimer = setTimeout(() => {
console.log("Locale files changed, copying...")
copyLocaleFiles()
Copy link
Contributor

Choose a reason for hiding this comment

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

The function copyLocaleFiles() is called in the watcher and later in main but is not defined or imported. Likely it should be replaced with a call to copyLocales(srcDir, distDir).

@adamhill
Copy link
Contributor

adamhill commented May 21, 2025

I have been using the pnpm method for a while and I sometimes I have to do a install:all to get the .vsix to build. dev run works fine with the base install

Edit:

  • I just did a pnpm build, it built the .vsix
  • Ran the cleaner command that was added find . -name node_modules | xargs rm -rvf. Then did a pnpm install then a pnpm build it failed to build the .vsix. dev run worked fine.
  • Did a pnpm install:all. Now pnpm build builds correctly

@cte
Copy link
Collaborator Author

cte commented May 21, 2025

I have been using the pnpm method for a while and I sometimes I have to do a install:all to get the .vsix to build. dev run works fine with the base install

Edit:

* I just did a `pnpm build`, it built the `.vsix`

* Ran the cleaner command that was added `find . -name node_modules | xargs rm -rvf`. Then did a `pnpm install` then a `pnpm build` it failed to build the `.vsix`. `dev run` worked fine.

* Did a `pnpm install:all`. Now `pnpm build` builds correctly

I'm a little confused; how is install:all working for you? I removed it:

$ pnpm install:all
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "install:all" not found

At any rate I think I might have fixed the issue you're encountering with the most recent commit.

Press `F5` (or **Run** → **Start Debugging**) in VSCode to open a new session with Roo Code loaded.
Press `F5` (or **Run** → **Start Debugging**) in VSCode to open a new window with Roo Code running.

Changes to the webview will appear immediately. Changes to the core extension will require a restart of the extension host.
Copy link
Collaborator

@mrubens mrubens May 22, 2025

Choose a reason for hiding this comment

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

This isn't true anymore btw (I can fix as a follow-up in all languages)

@cte cte merged commit 57249a0 into main May 22, 2025
11 checks passed
@cte cte deleted the cte/monorepo branch May 22, 2025 04:01
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 22, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 22, 2025
Copy link
Contributor

@SmartManoj SmartManoj May 30, 2025

Choose a reason for hiding this comment

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

intentionally deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes - is it useful?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, if normal users want to test unmerged PRs quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants