An extremely opinionated TypeScript monorepo tool.

Related tags

Build Tools uni
Overview

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/brandonbloom/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.

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.

    opened by ericvicenti 6
  • 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?

    opened by Aslemammad 5
  • 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.

    opened by teintinu 2
  • 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.

    opened by brandonbloom 1
  • 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

    opened by kendru 1
  • 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.

    opened by kendru 0
Owner
Brandon Bloom
Brandon Bloom
packM 🧬 is fivem resource compiler for golang with the power of golang+typescript+webpack

packM ?? packM ?? is fivem resource compiler for golang ,typescript with the power of golang+typescript compiler+webpack

normalM 2 Jun 28, 2022
Various tools for usage with Golang like installer, github tool and cloud features.

Gopei2 (Go Programming Environment Installer) Gopei shell install Go compiler, LiteIDE and configure for you the entire environment, variables, paths,

George Calianu 100 Nov 9, 2022
a build tool for Go, with a focus on cross-compiling, packaging and deployment

goxc NOTE: goxc has long been in maintenance mode. Ever since Go1.5 supported simple cross-compilation, this tool lost much of its value. There are st

Am Laher 1.7k Nov 30, 2022
Tool to check for dependency confusion vulnerabilities in multiple package management systems

Confused A tool for checking for lingering free namespaces for private package names referenced in dependency configuration for Python (pypi) requirem

Visma Product Security 517 Dec 2, 2022
a Make/rake-like dev tool using Go

About Mage is a make-like build tool using Go. You write plain-old go functions, and Mage automatically uses them as Makefile-like runnable targets. I

Mage 3.3k Dec 2, 2022
🚀 gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.

gowatch 中文文档 gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file. Installation To insta

silenceper 732 Dec 4, 2022
🌍 Earthly is a build automation tool for the container era

?? Earthly is a build automation tool for the container era. It allows you to execute all your builds in containers. This makes them self-contained, repeatable, portable and parallel. You can use Earthly to create Docker images and artifacts (eg binaries, packages, arbitrary files).

Earthly 8.4k Dec 8, 2022
A simple tool to help WoW repack administrators manipulate the repack database(s)

WoW Repack Manipulator This tool makes it easier for an administrator of a WoW Repack (private WoW server, basically) to manipulate the database that

Michael Crilly 2 Feb 7, 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

Deref 220 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

gRPC Ecosystem 92 Nov 28, 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

UW Labs 46 Sep 18, 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.

null 48 Nov 8, 2022
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

OMG Network 39 Sep 18, 2022
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

HashiCorp 66 Nov 30, 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

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

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

Debris Protocol 0 Jan 19, 2022
Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching.

Trie Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching. Usage Create a Trie with: t := trie.New() Add Keys with:

Derek Parker 616 Dec 2, 2022
RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue

RapidMQ RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue in the Go programming langu

Vadim Shakun 65 Sep 27, 2022
Extremely flexible golang deep comparison, extends the go testing package and tests HTTP APIs

go-testdeep Extremely flexible golang deep comparison, extends the go testing package. Latest news Synopsis Description Installation Functions Availab

Maxime Soulé 330 Dec 1, 2022
An extremely fast UUID alternative written in golang

Overview WUID is a globally unique number generator, while it is NOT a UUID implementation. WUID is 10-135 times faster than UUID and 4600 times faste

Edwin 479 Nov 21, 2022