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

Is it possible to run specific commands in monorepo? #224

Open
rxliuli opened this issue Jul 30, 2021 · 0 comments
Open

Is it possible to run specific commands in monorepo? #224

rxliuli opened this issue Jul 30, 2021 · 0 comments

Comments

@rxliuli
Copy link

rxliuli commented Jul 30, 2021

Summarize

  • Is it possible to run the specified submodule and dependent submodules
  • Can it support common usage of yarn and yarn <cmd>
  • How to solve the situation where the submodule contains cli - fatal

progress

I saw that only the example of ultra -r build is given in the README. When I try the ultra -r setup command, it will prompt error The "path" argument must be of type string. Received undefined, I Not sure what happened? The specific project is in https://github.com/rxliuli/joplin-utils


In addition, I want to know whether it is possible to run commands in the modules that the specified module depends on, for example, the following modules

  • apps
    • app1
    • app2
  • libs
    • lib1
    • lib2
    • lib3

app1 only depends on lib1 and lib2, I want to run the build commands in lib1 and lib2 only before running app1, and ignore other modules


The problem is determined because my package.json script contains the usage of yarn and yarn <other script>, which will cause an error, Is it possible to be compatible with them, because it is really common to use yarn to install dependencies and run other scripts directly


After fixing the problem with the yarn script, other errors appeared, but in fact this directory can run successfully. It seems that it has not detected the joplin-api package (it feels related to the operation mechanism of ultra)

[!] (plugin rpt2) Error: C:/Users/rxliuli/Code/Web/joplin-utils/apps/joplin-blog/src/wiki/WikiDocsifyIntegrated.ts(27,22): semantic error TS2345: Argument of type 'object[]' is not assignable to parameter of type 'ListNode[]'.
          │   Type '{}' is missing the following properties from type 'ListNode': id, title

When I add the parameter of --concurrency 1, it can run correctly. It seems that joplin-blog cannot be run after it depends on joplin-api.

ultra-runner-error


By adding -b, it is forced to build in parallel as much as possible according to the dependencies, but the dist generated by each build will affect the node_modules, which will cause the cache to never take effect. It feels related to another problem: #165

image


The reason for the above situation is that our monorepo project contains cli, so after each build, we need lerna clean -y && yarn to write cli.js to the node_modules/.bin directory of the submodule used , So are there other ways to circumvent this?

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

1 participant