Skip to content

Commit

Permalink
bumed version and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikwilkowski committed Jun 14, 2024
1 parent 58d12f7 commit c5a86be
Show file tree
Hide file tree
Showing 7 changed files with 1,654 additions and 1,951 deletions.
1 change: 1 addition & 0 deletions nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Please look at the coding style and work with it, not against it ;)

## Release History

* 3.3.0 - Added raw-mode flag, bumped dependencies
* 3.2.0 - Added TS type to the published npm package
* 3.1.1 - Fixed #58 gradient color bug, added `gray` to gradient colors
* 3.1.0 - Added support for -V flag fallback
Expand Down
26 changes: 13 additions & 13 deletions nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cfonts",
"description": "Sexy ANSI fonts for the console",
"version": "3.2.0",
"version": "3.3.0",
"homepage": "https://github.com/dominikwilkowski/cfonts",
"author": {
"name": "Dominik Wilkowski",
Expand All @@ -24,7 +24,7 @@
"node": ">=10"
},
"scripts": {
"test": "yarn format && yarn build && yarn test:unit && yarn test:lint && yarn test:types && yarn test:fonts",
"test": "yarn test:format && yarn build && yarn test:unit && yarn test:lint && yarn test:types && yarn test:fonts",
"test:fonts": "node ./test/fonttest.js",
"test:watch": "jest --watchAll --coverage",
"test:unit": "npx cross-env FORCE_COLOR=3 jest",
Expand All @@ -42,21 +42,21 @@
"nuke": "rm -rf lib && rm -rf node_modules && rm yarn.lock"
},
"devDependencies": {
"@babel/cli": "^7.21.0",
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@types/node": "latest",
"coveralls": "^3.1.1",
"eslint": "^8.36.0",
"jest-cli": "^27",
"onchange": "^7.1.0",
"prettier": "^2.8.7",
"typescript": "^5.0.2"
"@babel/cli": "^7",
"@babel/core": "^7",
"@babel/preset-env": "^7",
"@types/node": "^20",
"coveralls": "^3",
"eslint": "^8",
"jest-cli": "^29",
"onchange": "^7",
"prettier": "^3",
"typescript": "^5"
},
"peerDependencies": {},
"dependencies": {
"supports-color": "^8",
"window-size": "^1.1.1"
"window-size": "^1"
},
"jest": {
"displayName": "CFonts",
Expand Down
12 changes: 6 additions & 6 deletions nodejs/src/Options.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ const Options = {
letterSpacing !== undefined
? parseInt(letterSpacing.toString())
: font.toLowerCase() === 'console'
? 0
: this.store.letterSpacing;
? 0
: this.store.letterSpacing;

this.store.lineHeight =
lineHeight !== undefined
? parseInt(lineHeight.toString())
: font.toLowerCase() === 'console'
? 0
: this.store.lineHeight;
? 0
: this.store.lineHeight;

this.store.spaceless = typeof spaceless === 'boolean' ? spaceless : this.store.spaceless;

Expand All @@ -130,8 +130,8 @@ const Options = {
? gradient
: gradient.split(',')
: gradient === false
? false
: this.store.gradient;
? false
: this.store.gradient;

this.store.independentGradient =
independentGradient !== undefined ? independentGradient : this.store.independentGradient;
Expand Down
21 changes: 21 additions & 0 deletions nodejs/test/unit/Render.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ test(`Render - Render block font`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -227,6 +228,7 @@ test(`Render - Render letter spacing`, () => {
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n' +
'\n'
);
// prettier-ignore
expect(test1.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -272,6 +274,7 @@ test(`Render - Render letter spacing`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test2.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -319,6 +322,7 @@ test(`Render - Center align block font`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -366,6 +370,7 @@ test(`Render - Right align block font`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -404,6 +409,7 @@ test(`Render - Top align block font`, () => {
{ width: 50, height: 10 }
);

// prettier-ignore
expect(test.string).toBe(
' ████████╗ ███████╗ ██╗ ██╗ ████████╗\n' +
' ╚══██╔══╝ ██╔════╝ ╚██╗██╔╝ ╚══██╔══╝\n' +
Expand Down Expand Up @@ -458,6 +464,7 @@ test(`Render - Bottom align block font`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ '
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -497,6 +504,7 @@ test(`Render - Ignore alignment top when combining it with space option`, () =>
{ width: 100, height: 10 }
);

// prettier-ignore
expect(test.string).toBe(
' ████████╗ ███████╗ ██╗ ██╗ ████████╗\n' +
' ╚══██╔══╝ ██╔════╝ ╚██╗██╔╝ ╚══██╔══╝\n' +
Expand Down Expand Up @@ -543,6 +551,7 @@ test(`Render - Ignore alignment bottom when combining it with space option`, ()
{ width: 100, height: 10 }
);

// prettier-ignore
expect(test.string).toBe(
' ████████╗ ███████╗ ██╗ ██╗ ████████╗\n' +
' ╚══██╔══╝ ██╔════╝ ╚██╗██╔╝ ╚══██╔══╝\n' +
Expand Down Expand Up @@ -595,6 +604,7 @@ test(`Render - Break into new line on smaller viewports`, () => {
' ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗',
Expand Down Expand Up @@ -641,6 +651,7 @@ test(`Render - Fallback to huge viewport in browser environments`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ <br>\n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n</div>'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -686,6 +697,7 @@ test(`Render - Respect maxLength over viewport in browser env`, () => {
' ██╔╝ ██╗ ██║ <br>\n' +
' ╚═╝ ╚═╝ ╚═╝ \n\n</div>'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗',
Expand Down Expand Up @@ -732,6 +744,7 @@ test(`Render - Add background color in browser environments`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ <br>\n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n</div>'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -777,6 +790,7 @@ test(`Render - Add line break`, () => {
' ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗',
Expand Down Expand Up @@ -829,6 +843,7 @@ test(`Render - Add line height`, () => {
' ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗',
Expand Down Expand Up @@ -876,6 +891,7 @@ test(`Render - Non supported characters are ignored`, () => {
' ██║ ███████╗ ██╔╝ ██╗ ██║ \n' +
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -906,6 +922,7 @@ test(`Render - Non supported characters are ignored`, () => {
test(`Render - Remove space`, () => {
const test = Render('text', { spaceless: true }, false, 1, { width: 100, height: 10 });

// prettier-ignore
expect(test.string).toBe(
' ████████╗ ███████╗ ██╗ ██╗ ████████╗\n' +
' ╚══██╔══╝ ██╔════╝ ╚██╗██╔╝ ╚══██╔══╝\n' +
Expand Down Expand Up @@ -954,6 +971,7 @@ test(`Render - Add background color`, () => {
' ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ \n\n' +
'\u001b[49m'
);
// prettier-ignore
expect(test.array).toEqual([
'\u001b[41m\n\n\n' +
' ████████╗ ███████╗ ██╗ ██╗ ████████╗',
Expand Down Expand Up @@ -1045,6 +1063,7 @@ test(`Render - Break into new line on smaller viewports in raw mode`, () => {
' ██╔╝ ██╗ ██║ \r\n' +
' ╚═╝ ╚═╝ ╚═╝ \r\n\r\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\r\n\r\n' +
' ████████╗ ███████╗',
Expand Down Expand Up @@ -1097,6 +1116,7 @@ test(`Render - Add line break in raw mode`, () => {
' ██╔╝ ██╗ ██║ \r\n' +
' ╚═╝ ╚═╝ ╚═╝ \r\n\r\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\r\n\r\n' +
' ████████╗ ███████╗',
Expand Down Expand Up @@ -1149,6 +1169,7 @@ test(`Render - Add line height in raw mode`, () => {
' ██╔╝ ██╗ ██║ \r\n' +
' ╚═╝ ╚═╝ ╚═╝ \r\n\r\n'
);
// prettier-ignore
expect(test.array).toEqual([
'\r\n\r\n' +
' ████████╗ ███████╗',
Expand Down
Loading

0 comments on commit c5a86be

Please sign in to comment.