Telescope
Developing
Packages

Packages and workspace

We use lerna/yarn workspaces. You'll see we have in our ./packages folder numerous packages:

├── ast
├── babel
├── lcd
├── parser
├── telescope
├── test
├── types
└── utils
folderpurpose
astfor creating new AST functions
lcdfor giving LCD clients to generated code that uses the LCD client
parserprotobuf parser, and protobuf traversal
telescopethe CLI, as well as the main telescope builder
starshipusing starship for testing things locally or in CI workflow
typestypes and TelescopeOptions objects
utilsother utilities

Editing interdependent packages

Because we are using lerna/yarn workspaces, packages in the ./packages folder act as local npm modules.

If you edit a package, make sure to cd into it, and run yarn buidl, or separately, yarn build and yarn build:ts.

For example, if you edit a file in ./packages/types and you want to make sure it's up-to-date in another package, such as ./packages/ast, the changes propagate after you run these commands:

yarn build
yarn build:ts # now the types will also show up