Skip to content
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

Problem with "Sync" when using an Nx monorepo. #209

Open
100jecki opened this issue Oct 21, 2024 · 1 comment
Open

Problem with "Sync" when using an Nx monorepo. #209

100jecki opened this issue Oct 21, 2024 · 1 comment

Comments

@100jecki
Copy link

In the extension's "Project" menu, there's a "sync" command. According to the tooltip, it should perform: "Capacitor Sync copies the web app build assets to the native projects and updates native plugins and dependencies." However, when this command is executed, it runs nx sync, which is a command used by the Nx tool to synchronize dependencies and configurations in the project - it has nothing to do with Capacitor.

src/capacitor-sync.ts

function nxSync(project: Project): string {
  if (project.monoRepo.isNXStandalone) {
    return capCLISync(project);
  }
  return `${npx(project)} nx sync ${project.monoRepo.name}${getConfigurationArgs()}`;
}

Questions and Proposed Solutions:

  • Was this behavior intentional? If so, could you please clarify the reasoning behind using nx sync for the "sync" command when the tooltip describes Capacitor's functionality?
  • Possible Solution: If the current behavior was not intentional, perhaps the extension should handle the sync operation the same way it does for NXStandalone projects. This would ensure that the Capacitor sync is performed correctly in an Nx monorepo environment.
  • Alternative Suggestion: Would it be beneficial to have two separate sync actions in the menu for projects using an Nx monorepo - one for Capacitor sync and another for nx sync? This would provide clarity and allow developers to choose the appropriate sync action based on their needs.

If needed, I am willing to prepare a Pull Request to address this issue.

@dtarnawsky
Copy link
Collaborator

Hey @100jecki , can you provide a sample project to test with?

This should be fairly easy to fix but really depends on your project dependencies so I would need a sample project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants