Skip to content

Commit

Permalink
fix: Remove Crimson as basic color (#450)
Browse files Browse the repository at this point in the history
* fix: Remove Crimson as basic color

* chore: Update all dev packages
  • Loading branch information
ayonious authored Jul 2, 2023
1 parent 6348031 commit ec89482
Show file tree
Hide file tree
Showing 25 changed files with 2,056 additions and 1,849 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
"author": "Nahiyan Kamal",
"license": "MIT",
"devDependencies": {
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@types/jest": "^29.5.2",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"chalk": "^4.1.2",
"eslint": "^8.34.0",
"eslint": "^8.44.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.3",
"jest": "^29.4.3",
"prettier": "^2.8.4",
"jest": "^29.5.0",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"semantic-release": "^20.1.0",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
"semantic-release": "^21.0.6",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6"
},
"homepage": "https://console-table.netlify.app",
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/utils/colored-console-line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const DEFAULT_COLOR_MAP: ColorMap = {
magenta: '\x1b[35m',
cyan: '\x1b[36m',
white: '\x1b[37m',
crimson: '\x1b[38m',
white_bold: '\x1b[01m',
reset: '\x1b[0m',
};
Expand Down
1 change: 0 additions & 1 deletion src/utils/table-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const COLORS = [
'blue',
'magenta',
'cyan',
'crimson',
'white_bold',
'reset',
];
Expand Down
1 change: 0 additions & 1 deletion test/__snapshots__/alignment.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Testing column alignment all kind of alignments are working 1`] = `
│ 3  │  I would like some red wine please │  10.212  │
│ 4  │  I would like some cyan wine please │  10.212  │
│ 5  │ I would like some white_bold wine please │  10.212  │
│ 6  │  I would like some crimson sky please │  10.212  │
│ 7  │  I would like some green gemuse please │  20  │
│ 8  │  I would like some gelb bananen bitte │  100  │
└──────────────────────┴──────────────────────────────────────────┴────────────────────┘"
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/cellColor.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Example: Print a simple Table with cell colors cell colors are working 1`] = `
exports[`Example: Print a simple Table with cell colors cell colors are working: ++++Might Fail on CI++++++++ 1`] = `
"┌───────┬─────────┬────────┐
│ index │  text │  value │
├───────┼─────────┼────────┤
Expand Down
1 change: 0 additions & 1 deletion test/__snapshots__/columnColor.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Example: Print a simple Table with column colors column colors are work
│ 3  │  I would like some red wine please │  10.212 │
│ 4  │  I would like some cyan wine please │  10.212 │
│ 5  │ I would like some white_bold wine please │  10.212 │
│ 6  │  I would like some crimson sky please │  10.212 │
│ 7  │  I would like some green gemuse please │  20 │
│ 8  │  I would like some gelb bananen bitte │  100 │
└──────────────────────┴──────────────────────────────────────────┴─────────────┘"
Expand Down
3 changes: 0 additions & 3 deletions test/__snapshots__/lineWidthLimit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ exports[`Testing column max Width Simple Line Limit 1`] = `
│ 5  │  I would like │ 10.212 │
│   │  some white_bold │   │
│   │  wine please │   │
│ 6  │  I would like │ 10.212 │
│   │ some crimson sky │   │
│   │  please │   │
│ 7  │  I would like │  20  │
│   │  some green │   │
│   │  gemuse please │   │
Expand Down
8 changes: 0 additions & 8 deletions test/alignment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ describe('Testing column alignment', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow(
{
red_left_align_index: 7,
Expand Down
2 changes: 1 addition & 1 deletion test/cellColor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import chalk from 'chalk';
import { Table } from '../index';

describe('Example: Print a simple Table with cell colors', () => {
it('cell colors are working', () => {
it('cell colors are working: ++++Might Fail on CI++++++++', () => {
// Create a table
const p = new Table();

Expand Down
8 changes: 0 additions & 8 deletions test/columnColor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ describe('Example: Print a simple Table with column colors', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value: 10.212,
},
{ color: 'crimson' }
);
p.addRow(
{
red_left_align_index: 7,
Expand Down
1 change: 0 additions & 1 deletion test/internalTable/__snapshots__/alignment.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Testing column alignment all kind of alignments are working 1`] = `
│ 3  │  I would like some red wine please │  10.212  │
│ 4  │  I would like some cyan wine please │  10.212  │
│ 5  │ I would like some white_bold wine please │  10.212  │
│ 6  │  I would like some crimson sky please │  10.212  │
│ 7  │  I would like some green gemuse please │  20  │
│ 8  │  I would like some gelb bananen bitte │  100  │
└──────────────────────┴──────────────────────────────────────────┴────────────────────┘"
Expand Down
2 changes: 1 addition & 1 deletion test/internalTable/__snapshots__/columnColor.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Example: Print a simple Table with column colors column colors are work
│ 3  │  I would like some red wine please │  10.212 │
│ 4  │  I would like some cyan wine please │  10.212 │
│ 5  │ I would like some white_bold wine please │  10.212 │
│[37m [0m[31m6 [0m │[37m [0m[38m I would like some crimson sky please[0m │[37m [0m[32m 10.212[0m │
│[37m [0m[31m6 [0m │[37m [0m[37m I would like some crimson sky please[0m │[37m [0m[32m 10.212[0m │
│ 7  │  I would like some green gemuse please │  20 │
│ 8  │  I would like some gelb bananen bitte │  100 │
└──────────────────────┴──────────────────────────────────────────┴─────────────┘"
Expand Down
4 changes: 2 additions & 2 deletions test/internalTable/__snapshots__/enableDisable.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Testing column Enable and Disable disable basic example 1`] = `
│  10.212 │
│  10.212 │
│  10.212 │
│[37m [0m[38m 10.212[0m │
│[37m [0m[37m 10.212[0m │
│  20 │
│  100 │
└────────────────────┘"
Expand All @@ -22,7 +22,7 @@ exports[`Testing column Enable and Disable enable basic example 1`] = `
│  3 │  I would like some red wine please │
│  4 │  I would like some cyan wine please │
│  5 │ I would like some white_bold wine please │
│[37m [0m[38m 6[0m │[37m [0m[38m I would like some crimson sky please[0m │
│[37m [0m[37m 6[0m │[37m [0m[37m I would like some crimson sky please[0m │
│  7 │  I would like some green gemuse please │
│  8 │  I would like some gelb bananen bitte │
└──────────────────────┴──────────────────────────────────────────┘"
Expand Down
2 changes: 1 addition & 1 deletion test/internalTable/__snapshots__/sorting.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`Testing column alignment all kind of alignments are working 1`] = `
├──────────────────────┼──────────────────────────────────────────┼────────────────────┤
│ 8  │  I would like some gelb bananen bitte │  100  │
│ 7  │  I would like some green gemuse please │  20  │
│[37m [0m[38m6 [0m │[37m [0m[38m I would like some crimson sky please[0m │[37m [0m[38m 10.212 [0m │
│[37m [0m[37m6 [0m │[37m [0m[37m I would like some crimson sky please[0m │[37m [0m[37m 10.212 [0m │
│ 5  │ I would like some white_bold wine please │  10.212  │
│ 4  │  I would like some cyan wine please │  10.212  │
│ 3  │  I would like some red wine please │  10.212  │
Expand Down
2 changes: 1 addition & 1 deletion test/internalTable/__snapshots__/title.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`Testing column alignment all kind of alignments are working 1`] = `
│ 3  │  I would like some red wine please │  10.212  │
│ 4  │  I would like some cyan wine please │  10.212  │
│ 5  │ I would like some white_bold wine please │  10.212  │
│[37m [0m[31m6 [0m │[37m [0m[38m I would like some crimson sky please[0m │[37m [0m[32m 10.212 [0m │
│[37m [0m[31m6 [0m │[37m [0m[37m I would like some crimson sky please[0m │[37m [0m[32m 10.212 [0m │
│ 7  │  I would like some green gemuse please │  20  │
│ 8  │  I would like some gelb bananen bitte │  100  │
└──────────────────────┴──────────────────────────────────────────┴────────────────────┘"
Expand Down
8 changes: 0 additions & 8 deletions test/internalTable/alignment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ describe('Testing column alignment', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow(
{
red_left_align_index: 7,
Expand Down
13 changes: 5 additions & 8 deletions test/internalTable/columnColor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ describe('Example: Print a simple Table with column colors', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down
26 changes: 10 additions & 16 deletions test/internalTable/enableDisable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@ describe('Testing column Enable and Disable', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down Expand Up @@ -113,14 +110,11 @@ describe('Testing column Enable and Disable', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down
13 changes: 5 additions & 8 deletions test/internalTable/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,11 @@ describe('Testing column alignment', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down
13 changes: 5 additions & 8 deletions test/internalTable/sorting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ describe('Testing column alignment', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down
13 changes: 5 additions & 8 deletions test/internalTable/title.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,11 @@ describe('Testing column alignment', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down
8 changes: 0 additions & 8 deletions test/lineWidthLimit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ describe('Testing column max Width', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green: 10.212,
},
{ color: 'crimson' }
);
p.addRow(
{
red_left_align_index: 7,
Expand Down
35 changes: 34 additions & 1 deletion test/readme/readmeExamples1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,40 @@ describe('Example: 1', () => {
{ color: 'white_bold' }
);
p.addRow(
{ index: 6, text: 'I would like some crimson sky please', value: 10.212 },
{ index: 7, text: 'I would like some green gemuse please', value: 20.0 },
{ color: 'green' }
);
p.addRow(
{ index: 8, text: 'I would like some gelb bananen bitte', value: 100 },
{ color: 'yellow' }
);

// print
const returned = p.printTable();
expect(returned).toBeUndefined();
});

it('table With all colored rows', () => {
// Create a table
const p = new Table({
columns: [
{ name: 'index', alignment: 'left' },
{ name: 'text', alignment: 'right' },
{ name: 'value' },
],
});

// add rows with color
p.addRow(
{ index: 2, text: 'I would like some Color I dont know', value: 10.212 },
{ color: 'some Color' }
);
p.addRow(
{
index: 6,
text: 'I would like some crimson I dont know the color sky please',
value: 10.212,
},
{ color: 'crimson' }
);
p.addRow(
Expand Down
13 changes: 5 additions & 8 deletions test/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@ describe('Testing rendering column alignment', () => {
},
{ color: 'white_bold' }
);
p.addRow(
{
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
},
{ color: 'crimson' }
);
p.addRow({
red_left_align_index: 6,
right_align_text: 'I would like some crimson sky please',
green_value_center: 10.212,
});
p.addRow(
{
red_left_align_index: 7,
Expand Down
Loading

0 comments on commit ec89482

Please sign in to comment.