/compy

Minimalist (yet helpful) monorepo manager for Deno

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Compy

Minimalist (yet helpful) monorepo manager for Deno

Motivation

Installation

deno install --unstable -Ar -n compy -f 'https://deno.land/x/compy/run.ts'

Usage

Display help

compy -h

Display version

compy -V

Create a new Compy project

compy init <project> [-m=packages] [-c=deno.json] [-i=import_map.json]

List or create a new module

compy mod
compy mod [module]

Add external dependency to import_map.json

compy add <name> [version] [-m <module>] [-u <url>]

Run a Deno command in each modules' context

compy <cache|test|fmt|lint>

Run a Deno command in a module's context

compy <cache|start|dev|run|test|fmt|lint> <module> [...args]
compy <run> <module> <task> [...args]

Generate a shell script to run a Deno command in a module's context

compy <cache|start|dev|run|test|fmt|lint> -e <sh|bash|zsh|ash|fish> <module> [...args]
compy <run> -e <sh|bash|zsh|ash|fish> <module> <task> [...args]

Files

<root>/.compy.ts

import { Compy } from 'https://deno.land/x/compy/types.ts';

export default {
  name: 'my-project',
  modules: 'packages',
  config: 'deno.jsonc',
} satisfies Compy;

<root>/packages/<package>/.compy.egg.ts

import { Egg } from 'https://deno.land/x/compy/types.ts';

export default {
  entry: './src/run.ts',
  allow: ['env', 'net', 'read', 'write'],
  unstable: true,

  cache: './src/run.ts',
  start: './src/run.ts',
  dev: './src/run.ts',
  test: {
    entry: 'spec/',
    lock: 'test.deno.lock',
    env: {
      ENV_TYPE: 'test',
    },
  },
  fmt: './src/',
  lint: './src/',
} satisfies Egg;