Skip to content

Aarul5/cmd-table

Repository files navigation

cmd-table monorepo

This repository is a pnpm monorepo for the cmd-table ecosystem.

Packages

Package Description Version
cmd-table Core CLI table library npm
cmd-table-jest-reporter Jest reporter that renders results as a cmd-table npm
cmd-table-vitest-reporter Vitest reporter (watch-mode aware) npm
cmd-table-oclif Drop-in cli-ux table replacement for oclif CLIs npm
@cmd-table/reporter-core Shared rendering code for the test reporters private

Development

Prerequisites

  • Node.js >= 20
  • pnpm >= 9

Setup

pnpm install

Build all packages

pnpm -r build

Test all packages

pnpm -r test

Run the docs site

pnpm --filter cmd-table docs:dev

Release Process

We use Changesets for versioning and publishing. No more manual release: commits — versioning, changelogs, and npm publishes are all driven by changeset files.

Day-to-day flow

  1. Make your changes in any package (packages/cmd-table, packages/cmd-table-oclif, etc.).

  2. Add a changeset describing what changed:

    pnpm changeset

    The CLI walks you through:

    • Which packages changed (select with space, confirm with enter).
    • The bump type — patch for fixes, minor for new features, major for breaking changes.
    • A short summary that becomes the changelog entry.

    This creates a markdown file in .changeset/ that you commit alongside your code.

  3. Open a PR and merge it to main as usual.

What happens after merge

The CI's Release job runs on every push to main and does one of two things:

  • If there are pending changesets: it opens (or updates) a PR titled "chore: version packages" that bumps the affected versions, updates each package's CHANGELOG.md, and removes the consumed .changeset/*.md files. Review and merge that PR when you're ready to ship.
  • If there are no pending changesets: the job is a no-op.

When the "chore: version packages" PR merges, the same Release job sees the version bumps with no remaining changesets, and runs changeset publish — which calls npm publish for each updated package using your existing Trusted Publishing OIDC setup. No NPM_TOKEN secret needed.

Quick reference

What you want to do Command
Document a change for the next release pnpm changeset
Preview what will be released pnpm changeset status
Manually bump versions (rare) pnpm version-packages
Manually publish (rare; CI does this) pnpm release

CI requirements

PRs that touch packages/*/src/ files must include a changeset — the changeset-check job will fail otherwise. Run pnpm changeset before pushing.

If a PR is purely chore/docs/test and shouldn't trigger a release, you can add an empty changeset:

pnpm changeset --empty

First-time package setup

When publishing a brand-new package for the first time, configure npm Trusted Publishing for it on npmjs.com:

  • Repository: Aarul5/cmd-table
  • Workflow: ci.yml

Then merge the version PR — the Release job will publish it.

About

A modern, zero-dependency CLI table library for Node.js. Features responsive layouts, tree views, auto-merging cells, rich styling, and exports to Markdown/CSV/JSON

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors