Skip to content

Izhaki/mono.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oh Hello!

My name is mono.ts. I'm a minimal example of a typescript mono-repo.

I'm Different

Unlike many similar examples I can do the following, before you build anything:

Run Tests

/packages/line/package.json:

"test": "mocha --require ts-node/register --require tsconfig-paths/register test/*.ts"

VSCode Package Linking

If you click on @geo/point (/packages/line/src/index.ts):

import { Point, getDistance } from '@geo/point';

VScode will take you to /packages/point/src/index.ts

The Stuff I'm Made Of

How do I work?

There are basically two parallel typescript configuration hierarchies.

Pre-build

This tree is using aliases (or paths in typescript world). This allows VSCode to reference the correct files, and tests to run.

  • /packages/tsconfig.base.json (common configuration for both pre-build and build configurations)
    • /packages/tsconfig.json
      • /packages/line/tsconfig.json

Build

This tree uses typescript's project reference for optimised builds.

  • /packages/tsconfig.base.json
    • /packages/tsconfig.build.json
      • /packages/point/tsconfig.build.json
      • /packages/line/tsconfig.build.json

Note that to build the packages you run (/package.json):

"build": "tsc --build packages/tsconfig.build.json"

This is allegedly better than letting yarn or lerna build the packages in turn based on the dependency tree.

About

A minimal example of a typescript mono repo with pre-build support (tests, vscode).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy