An extremely opinionated TypeScript monorepo tool.

Unirepo

Unirepo is an extremely opinionated TypeScript build tool.

Typical monorepo management tools in the Node.js ecosystem provide automation around package maintenance, but still permit and require users to muck around with poly-package configuration. Package boundaries must be manually maintained, each with its own sub-configuration.

Unirepo is different because sub-package configuration is managed centrally and uniformly. Package boundaries are managed automatically via bundling and code splitting.

You will have one and only one list of dependencies. Your package.json files will be generated from that source configuration. Same for tsconfig.json. The source configuration file that - believe it or not - allows code comments.

Unirepo is fast because it is ships as a native binary and builds your code using esbuild.

Additionally, Unirepo has a run subcommand that acts as a substitute for ts-node. The run subcomain also supports a --watch flag, and so acts as a substitute for node-dev (or ts-node-dev) as well. Sourcemaps are always enabled.

As mentioned, Unirepo is extremely opinionated. Those opinions will evolve in to documentation, including a a growing list of anti-features.

Want to see it in action? Check out the Demo Video!

Status

Alpha! Don't use this yet.

See the versioning guide and the roadmap.

Only works for targeting Node currently. Targeting Browsers is planned.

Installation

go get -u github.com/deref/uni

Usage

Setup

  1. Create a uni.yml file with some package entrypoints.
  2. Manually add dependencies to your config file.
  3. Run uni deps.

Development

  • Use uni run src/program.ts to execute programs. They must export a main function.
  • Use uni build some-package to pre-compile into out/dist.

Publishing

Here's the steps to do in your CI flow:

  1. uni build --version $VERSION to create packages with version numbers.
  2. uni pack to create packed .tgz files.
  3. uni publish to automate npm publish ./path/to/package.tgz.

Other Features

Patching

The patch-package utility is always available.

Engine Checking

Functionality similar to check-engine is builtin, but much faster and with caching.

Executables

Any runnable script can be exposed as an executable in a package. A shim script (with a #!) will be produced automatically.

Comments
  • "main is not a function" with useless call stack

    I'm trying to switch from ts-node. To narrow down the issue I've deleted basically everything from my project

    First I've built uni in my cloned copy at ~/dev/uni

    My code is this branch here: https://github.com/AvenCloud/cloud/tree/uni-testing

    I attempt to run ~/dev/uni/uni run lib/server/server.ts, and I see this unexplainable error- my code has no reference to "main"

    Screen Shot 2021-02-22 at 8 56 49 AM

    At an earlier time, I saw a lib_uv error(!). But that was before I stripped down my reproduction example.

    Usually I specify a custom tsconfig.json (tsconfig.server.json, while nextjs uses tsconfig.json).. and I couldn't figure out how to do that with uni.

  • Contributing

    Contributing

    I'm really chuffed about this repo. Currently, I'm learning golang and wanted to contribute to uni to expand my knowledge and help that amazing repo. Are there any guidelines and requirements to contribute?

  • Feature workspace

    Feature workspace

    Hi man, this PR is a feature proposal. The mixed dependence is a interesting proposal but, by my self, I prefer yarn workspaces.

    But configure and manage a Yarn workspace with Typescript is boring. That proposal use the simplicity of uni.yml to configure a entire Yarn Workspace with TypeScript, Jest and Lint by replacing index property to folder property. All of your code still compatible.

    All unis created files like package.json, tsconfig, jest.config, eslintrc files are in .gitignore because uni.yml will generante them

    things to do:

    • [ ] A initoption to guid developer create uni.yml
    • [ ] Allow tsconfig.json settings changed by dev
    • [ ] Options to configure importante parameters like minimal test coverage (currently is fixed in 90%)
    • [ ] more uni tests and examples
    • [ ] husky
    • [ ] ...

    I'll continue helping that amazing project. I hope you like that idea.

    Extra: This PR also have VSCode devcontainer suggestion. Maybe itcan facility bring new contributors to uni team.

  • Build watch

    Build watch

    Closes #6

    @BenElgar Could you please give this branch a try and make sure that (A) it does what you expect it to do and (B) it doesn't break existing run/watch/build use cases? If so, feel free to merge & upgrade our dependency on unirepo in the other Deref repo.

  • Graceful shutdown

    Graceful shutdown

    This PR does 3 things:

    • Cause the child process to be stopped with SIGTERM instead of SIGKILL. SIGKILL is still sent if the process has not stopped after a fixed period.
    • Start the child process in its own process group so that stopping the child will also stop any of its owned processes.
    • Intercept SIGKILL/SIGTERM in uni itself and trigger a shutdown of its child process

    Resolves #10

  • Attempt to stop child process gracefully

    Attempt to stop child process gracefully

    When uni exits or reloads the child process on rebuild, it should try to terminate the process with a SIGTERM rather than a SIGKILL in case there is any cleanup that needs to happen. Additionally, it should not orphan any processes started by the subprocess itself.

Related tags
An opinionated package that helps you print user-friendly output messages from your Go command line applications.

github.com/eth-p/clout (Command Line Output) clout is a package that helps you print user-friendly output messages from your Go command line applicati

Jan 15, 2022
A little opinionated program to automatically provision my Aerohive APs without HiveManager/ExtremeCloud IQ

Aerohive Provision A little opinionated program to automatically provision my Aerohive APs without HiveManager/ExtremeCloud IQ. Unfortunately a lot of

Nov 28, 2022
🔥 A fast and beautiful command line tool to build API requests.
🔥 A fast and beautiful command line tool to build API requests.

Poodle A fast and beautiful command line tool to build API requests ?? Check out the full Demo! Poodle is an interactive command line tool to build an

Aug 23, 2022
CLI Tool to Stress Apache Kafka Clusters

Kafka Stress - Stress Test Tool for Kafka Clusters, Producers and Consumers Tunning Installation Docker docker pull fidelissauro/kafka-stress:latest d

Nov 13, 2022
Golang module/tool for decoding proto buffer without message definition.
Golang module/tool for decoding proto buffer without message definition.

Golang module/tool for decoding proto buffer without message definition.

Nov 11, 2022
Golang tool to send notifications to LINE app
Golang tool to send notifications to LINE app

Golang tool to send notifications to LINE app

Nov 9, 2022
Kafka producer and consumer tool in protobuf format.

protokaf Kafka producer and consumer tool in protobuf format. Features Consume and produce messages using Protobuf protocol Trace messages with Jaeger

Nov 15, 2022
Kafka tool to emit tombstones for messages based on header value matches

Langolier Langolier is a CLI tool to consume a Kafka topic and emit tombstones for messages matched by header name/value pairs. Usage Usage of langoli

Sep 22, 2021
A CLI tool for interacting with Kafka through the Confluent Kafka Rest Proxy

kafkactl Table of contents kafkactl Table of contents Overview Build Development Overview kafkactl is a CLI tool to interact with Kafka through the Co

Nov 1, 2021
Tool for collect statistics from AMQP (RabbitMQ) broker. Good for cloud native service calculation.

amqp-statisticator Tool for collect statistics around your AMQP broker. For example RabbitMQ expose a lot information trought the management API, but

Dec 13, 2021
Sim - Command-line tool to manage program symlinks in $XDG_BIN_HOME.

Sim Sim is a command-line tool that manages program symlinks in $XDG_BIN_HOME. Get started Run make install. Make sure your PATH contains $XDG_BIN_HOM

Jan 3, 2022
CLI tool for generating random messages with rules & publishing to the cloud services (SQS,SNS,PUB/SUB and etc.)

Randomsg A CLI tool to generate random messages and publish to cloud services like (SQS,SNS,PUB/SUB and etc.). TODO Generation of nested objects is no

Sep 22, 2022
An extremely opinionated TypeScript monorepo tool.

Unirepo Unirepo is an extremely opinionated TypeScript build tool. Typical monorepo management tools in the Node.js ecosystem provide automation aroun

Nov 29, 2022
protoc-gen-grpc-gateway-ts is a Typescript client generator for the grpc-gateway project. It generates idiomatic Typescript clients that connect the web frontend and golang backend fronted by grpc-gateway.

protoc-gen-grpc-gateway-ts protoc-gen-grpc-gateway-ts is a Typescript client generator for the grpc-gateway project. It generates idiomatic Typescript

Dec 19, 2022
Template repository for a Go monorepo, complete with CI and automatic docker builds

Utility Warehouse template Go monorepo This repo is an abbreviated copy of one used by one of the teams inside Utility Warehouse. It's been built for

Dec 19, 2022
The Monogon Project Monorepo. May contain traces of peanuts and a pure Go Linux userland.

This is the main repository containing the source code for the Monogon Project.

Jan 6, 2023
Monorepo implementing the Optimistic Ethereum protocol
Monorepo implementing the Optimistic Ethereum protocol

The Optimism Monorepo TL;DR This is the primary place where Optimism works on stuff related to Optimistic Ethereum. Documentation Extensive documentat

Sep 18, 2022
Monorepo for Boundary UIs and addons.
Monorepo for Boundary UIs and addons.

Boundary UI Monorepo This monorepo contains multiple projects, including UIs and addons, used by Boundary. This top-level repository provides limited

Dec 15, 2022
GitHub Actions demo for a monorepo Go project

GitHub Actions demo for a monorepo Go project The purpose of this repository is to demonstrate using a GitHub action as a pull request status check in

Oct 31, 2021
L2 D O - The Optimism Monorepo With Golang
L2 D O - The Optimism Monorepo With Golang

The Optimism Monorepo TL;DR This is where Optimism gets built. Documentation Ext

Jan 19, 2022