DEV Community

Francesco Menghi
Francesco Menghi

Posted on

Last piece of the puzzle: Moving Satellite inside Telescope

This week we released Telescope 2.8 and, as part of the new release, we moved the Satellite project inside of the Telescope monorepo. Satellite is the microservice framework used by Telescope.

I am excited about this change because until now Satellite was the only piece of the telescope project that was in a separate repo. Now we will be able to work on Satellite all from within the monorepo!

This is only possible because we can publish the Satellite package to the Npmjs registry using pnpm -r publish as I discussed in my previous blog post.

The initial idea was to copy the project's files over to src/satellite in Telescope and then add to package.json a section about the original contributors like this:

{ "name" : "Barney Rubble",
  "email" : "b@rubble.com",
  "url" : "http://barnyrubble.tumblr.com/"
}
Enter fullscreen mode Exit fullscreen mode

However this was not great because we would have lost all of the git history. Thanks to Duke, I discovered a very useful git command called subtree.

Git subtree

This is the full command:

git subtree add --prefix src/satellite/ git@github.com:Seneca-CDOT/satellite.git HEAD

Let's break it down.

--prefix: this tells git where to add the repo. In our case it's in src/satellite.

git@github.com:Seneca-CDOT/satellite.git: Satellite repo remote address.

HEAD: reference to the latest commit in the Telescope branch.

After successfully running the above command, we get this commit:

commit 85522ffc4205da8c6a6f736073f55aaff595c382
Merge: 8360d5dc 5491bbb0
Author: Francesco Menghi <53121061+menghif@users.noreply.github.com>
Date:   Tue Mar 8 09:55:48 2022 -0500

    Add 'src/satellite/' from commit '5491bbb058d121552a3191b49199d75cfc56956b'

    git-subtree-dir: src/satellite
    git-subtree-mainline: 8360d5dc434878d92527bc134882ea1aed003e53
    git-subtree-split: 5491bbb058d121552a3191b49199d75cfc56956b
Enter fullscreen mode Exit fullscreen mode

git-subtree-mainline is the last Telescope commit and git-subtree-split is the last Satellite commit.

ESLint fixes

Once the Satellite PR was merged, I worked on the ESLint config for Satellite (Issue, PR). While doing this, I discovered that all of the other package's ESLint configurations were not setup properly and so we were not actually linting our code at all.

Since we had an ESLint config for the whole repo before and now we have a config for each package within the repo, we are still getting used to the change.

Basically we were missing the eslint and @senecacdot/eslint-config-telescope dependencies in each package so the command pnpm lint was not actually doing anything.

This is now being fixed and tracked in this Metabug. Soon ESLint will be fully functional again and faster than ever thanks to Turborepo.

Latest comments (0)