Composite Builds

TypeScript Programming Monorepo

TypeScript has a way of describing a build process as multiple subpieces of a project. This saves from having to build every piece, and instead build independent parts and stitch them together as needed. In a monorepo environment, multiple packages will have multiple builds and, possibly, refer to those builds amongst each other. The root tsconfig.json file can be used, but a problem of independent sources of truth arises. For instance, one project may have a different level of type strictness, or use a different version of Node. ...

Jest Setup for a Monorepo

Programming Jest Monorepo

Out of the box, Jest mostly works in a Monorepo environment, with the exception of a few Babel plugins so that (as an example) TypeScript works. Needs: @babel/preset-env (Babel will transform whatever it needs to transform based on the build target, e.g. TypeScript, IE11, ES6, Node10, etc.) @babel/preset-typescript (Babel will strip out the symbols that are specific to TypeScript) The root-level .babelrc file would look like: { "presets": [ ["@babel/preset-env", { "targets": { "node": 10 } }], "@babel/preset-typescript" ] } The target above is arbitrary, and can be anything (or nothing). ...