Skip to content

Commit

Permalink
Remove tty-table dependency (#1390)
Browse files Browse the repository at this point in the history
* Remove tty-table dependency

* Better name

* Display as list

* Update .changeset/thirty-glasses-complain.md
  • Loading branch information
bluwy authored Jun 24, 2024
1 parent f295b3e commit 6a3452e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 288 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-glasses-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@changesets/cli": patch
---

Display `changeset status --verbose` in list form and remove `tty-table` dependency
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@
"resolve-from": "^5.0.0",
"semver": "^7.5.3",
"spawndamnit": "^2.0.0",
"term-size": "^2.1.0",
"tty-table": "^4.1.5"
"term-size": "^2.1.0"
},
"devDependencies": {
"@changesets/parse": "*",
Expand Down
26 changes: 6 additions & 20 deletions packages/cli/src/commands/status/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import chalk from "chalk";
import fs from "fs-extra";
import path from "path";
import table from "tty-table";

import getReleasePlan from "@changesets/get-release-plan";
import { error, info, log, warn } from "@changesets/logger";
import {
Expand Down Expand Up @@ -91,24 +89,12 @@ function verbosePrint(
if (packages.length) {
info(chalk`Packages to be bumped at {green ${type}}`);

const columns = packages.map(
({ name, newVersion: version, changesets }) => [
chalk.green(name),
version,
changesets.map((c) => chalk.blue(` .changeset/${c}.md`)).join(" +"),
]
);

const t1 = table(
[
{ value: "Package Name", width: 20 },
{ value: "New Version", width: 20 },
{ value: "Related Changeset Summaries", width: 70 },
],
columns,
{ paddingLeft: 1, paddingRight: 0, headerAlign: "center", align: "left" }
);
log(t1.render() + "\n");
for (const { name, newVersion: version, changesets } of packages) {
log(chalk`- {green ${name}} {cyan ${version}}`);
for (const c of changesets) {
log(chalk` - {blue .changeset/${c}.md}`);
}
}
} else {
info(
chalk`Running release would release {red NO} packages as a {green ${type}}`
Expand Down
15 changes: 0 additions & 15 deletions types/tty-table.d.ts

This file was deleted.

Loading

0 comments on commit 6a3452e

Please sign in to comment.