Skip to content
  • Justin Wernick's avatar
    build: Introduce Lerna as a tool for running tasks in the monorepo [EXT-290] · e1b2a477
    Justin Wernick authored
    ## Description
    
    - Lerna is now added as a tool available in the monorepo.
    - Lerna's build tool, NX, is configured in `nx.json`. This defines which tasks are cached, and which tasks need which dependencies to run.
    - Most tasks should now be run on a monorepo level so that Lerna can determine dependencies. There are new scripts to facilitate this.
    - The readme has been updated with examples of how to run tasks at a monorepo level.
    - CI config has been updated to run on a monorepo level. This has also meant updating some docker files used in CI to be run for the root of the monorepo.
    - There are now monorepo-level CI jobs for building, linting and unit testing. If a core utility or fragment only needs these tasks, it does not need its own child pipeline anymore.
    
    ## Motivation and Context
    
    As we start to use the monorepo and break our code into packages, a task like compiling the extension becomes more complicated. As an example already in the monorepo, AdBlock depends on the ui-components library, which itself has a build step. That means that to build AdBlock correctly, you have to first build ui-components if it has changed. This situation will get more complicated as we add the SDK to the monorepo, and as we add fragments.
    
    Lerna (and NX, the build tool it wraps) is a tool for managing this complexity. It detects the dependencies between packages from the `package.json` files.
    
    This MR also removes the recent build changes for ui-components introduced by !162
    
    ## Checklist:
    
    - [x] These changes are internal only and don't require release notes.
    - [x] My changes require a documentation update and I have updated the documentation accordingly.
    - [x] My changes didn't require new tests. The existing tests are being run through the new mechanism.
    - [x] All new and existing tests passed
    
    See !157
    e1b2a477
To learn more about this project, read the wiki.
Loading