Projects STRLCPY cfonts Commits 9dde49ad
🤬
  • ■ ■ ■ ■ ■
    README.md
    skipped 509 lines
    510 510   
    511 511   
    512 512  ## Release History
     513 +* 2.8.2 - bumped dependencies, added linting, fixed #22 (again)
    513 514  * 2.8.1 - bumped dependencies
    514 515  * 2.8.0 - added environment support, added font `tiny`
    515 516  * 2.7.0 - added font `slick`, `grid` and `pallet`, added double quote to all fonts
    skipped 52 lines
  • ■ ■ ■ ■ ■
    package.json
    1 1  {
    2 2   "name": "cfonts",
    3 3   "description": "Sexy fonts for the console",
    4  - "version": "2.8.1",
     4 + "version": "2.8.2",
    5 5   "homepage": "https://github.com/dominikwilkowski/cfonts",
    6 6   "author": {
    7 7   "name": "Dominik Wilkowski",
    skipped 23 lines
    31 31   },
    32 32   "scripts": {
    33 33   "prepublish": "yarn build && yarn test",
    34  - "test": "yarn build && yarn test:unit && yarn test:fonts",
     34 + "test": "yarn build && yarn test:unit && yarn test:lint && yarn test:types && yarn test:fonts",
    35 35   "test:fonts": "node ./test/fonttest.js",
    36 36   "test:watch": "jest --watchAll --coverage",
    37 37   "test:unit": "npx cross-env FORCE_COLOR=3 jest",
    38  - "test:types": "yarn types:clean && yarn types:declaration",
     38 + "test:types": "yarn types:clean && yarn types:declaration && yarn types:clean",
     39 + "test:lint": "eslint src/",
    39 40   "build": "yarn build:lib && yarn build:bin",
    40 41   "build:bin": "npx mkdirp bin && mv lib/bin.js bin/index.js",
    41 42   "build:lib": "npx mkdirp lib && babel src --out-dir lib",
    42 43   "watch": "yarn build:lib && onchange 'src/**/*' -- yarn build:lib",
    43 44   "types:clean": "find lib/ -type f -name '*.d.ts' -exec rm {} +",
    44  - "types:declaration": "tsc -p declaration.tsconfig.json",
     45 + "types:declaration": "tsc -p declaration.tsconfig.json --resolveJsonModule",
    45 46   "coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls",
    46 47   "nuke": "rm -rf lib && rm -rf node_modules && rm yarn.lock"
    47 48   },
    48 49   "devDependencies": {
    49 50   "@babel/cli": "^7.8.4",
    50  - "@babel/core": "^7.8.7",
    51  - "@babel/preset-env": "^7.8.7",
     51 + "@babel/core": "^7.9.6",
     52 + "@babel/preset-env": "^7.9.6",
    52 53   "@types/node": "latest",
    53  - "coveralls": "^3.0.9",
    54  - "jest-cli": "^25.1.0",
    55  - "onchange": "^6.1.0",
     54 + "coveralls": "^3.1.0",
     55 + "eslint": "^6.8.0",
     56 + "jest-cli": "^25.5.3",
     57 + "onchange": "^7.0.2",
    56 58   "typescript": "^3.8.3"
    57 59   },
    58 60   "peerDependencies": {},
    59 61   "dependencies": {
    60  - "chalk": "^3.0.0",
     62 + "chalk": "^4.0.0",
    61 63   "window-size": "^1.1.1"
    62 64   },
    63 65   "resolutions": {
    skipped 16 lines
    80 82   "lines": 95,
    81 83   "statements": 95
    82 84   }
     85 + }
     86 + },
     87 + "eslintConfig": {
     88 + "env": {
     89 + "node": true,
     90 + "commonjs": true,
     91 + "es6": true
     92 + },
     93 + "extends": "eslint:recommended",
     94 + "globals": {
     95 + "Atomics": "readonly",
     96 + "SharedArrayBuffer": "readonly"
     97 + },
     98 + "parserOptions": {
     99 + "ecmaVersion": 2018
     100 + },
     101 + "rules": {
     102 + "no-async-promise-executor": "off",
     103 + "no-console": "off",
     104 + "no-unused-vars": [
     105 + "error",
     106 + {
     107 + "argsIgnorePattern": "_"
     108 + }
     109 + ]
    83 110   }
    84 111   },
    85 112   "browserslist": [
    skipped 23 lines
  • ■ ■ ■ ■ ■
    src/Chalk.js
    skipped 16 lines
    17 17   
    18 18  const chalkOriginal = require(`chalk`);
    19 19   
     20 +// all possible level of chalk: https://github.com/chalk/chalk#chalklevel
     21 +const level = {
     22 + '0': 0, // All colors disabled
     23 + '1': 1, // Basic 16 colors support
     24 + '2': 2, // ANSI 256 colors support
     25 + '3': 3, // Truecolor 16 million colors support
     26 +}
    20 27   
    21 28  // We pass on the FORCE_COLOR env var to chalk so we can force it in ci
    22 29  const Chalk = new chalkOriginal.Instance({
    23 30   ...(
    24 31   process.env.FORCE_COLOR
    25  - ? { level: parseInt( process.env.FORCE_COLOR ) }
     32 + ? { level: level[ process.env.FORCE_COLOR ] }
    26 33   : null
    27 34   )
    28 35  });
    skipped 6 lines
  • ■ ■ ■ ■
    src/CharLength.js
    skipped 37 lines
    38 38   if( char.length > charWidth ) {
    39 39   charWidth = char.length; // assign only largest
    40 40   }
    41  - };
     41 + }
    42 42   
    43 43   if( charWidth === 0 && letterSpacing > 0 ) {
    44 44   Debugging.report( `CharLength: Adding space to letter spacing`, 1 );
    skipped 12 lines
  • ■ ■ ■ ■ ■
    src/CheckInput.js
    skipped 14 lines
    15 15   
    16 16  'use strict';
    17 17   
    18  -const { Debugging } = require('./Debugging.js');
    19 18  const { Chalk } = require('./Chalk.js');
    20 19  const {
    21 20   COLORS,
    skipped 173 lines
  • ■ ■ ■ ■
    src/GetFirstCharacterPosition.js
    skipped 29 lines
    30 30   );
    31 31   
    32 32   return ( earliest.length - earliest.trimStart().length );
    33  -};
     33 +}
    34 34   
    35 35   
    36 36  module.exports = exports = {
    skipped 3 lines
  • ■ ■ ■ ■ ■
    src/Gradient.js
    skipped 76 lines
    77 77   }
    78 78   else { // if( max === b ) {
    79 79   h = 60 * ( ( r - g ) / diff ) + 240;
    80  - };
     80 + }
    81 81   
    82 82   return [ h, ( s * 100 ), ( v * 100 ) ];
    83 83  }
    skipped 250 lines
    334 334   
    335 335   Debugging.report( colors, 2 );
    336 336   
    337  - const output = [];
    338 337   const space = ' '.repeat( firstCharacterPosition );
    339 338   
    340 339   return lines
    skipped 211 lines
  • ■ ■ ■ ■
    src/ParseArgs.js
    skipped 70 lines
    71 71   else {
    72 72   Debugging.report( `The cli argument ${ args[ index ] } was not found and ignored`, 2 );
    73 73   }
    74  - };
     74 + }
    75 75   
    76 76   return parsedArgs;
    77 77  };
    skipped 6 lines
  • ■ ■ ■ ■ ■
    src/Render.js
    skipped 22 lines
    23 23  const { CheckInput } = require('./CheckInput.js');
    24 24  const { CleanInput } = require('./CleanInput.js');
    25 25  const { AlignText } = require('./AlignText.js');
    26  -const { Colorize } = require('./Colorize.js');
    27 26  const { AddLine } = require('./AddLine.js');
    28 27  const { AddChar } = require('./AddChar.js');
    29 28  const { Options } = require('./Options.js');
    skipped 222 lines
  • ■ ■ ■ ■ ■ ■
    src/RenderConsole.js
    skipped 15 lines
    16 16  'use strict';
    17 17   
    18 18  const { AlignText } = require('./AlignText.js');
    19  -const { Debugging } = require('./Debugging.js');
    20 19  const { Colorize } = require('./Colorize.js');
    21  -const { AddLine } = require('./AddLine.js');
    22 20  const { Size } = require('./Size.js');
    23 21   
    24 22   
    skipped 81 lines
  • ■ ■ ■ ■ ■
    src/constants.js
    skipped 23 lines
    24 24  'use strict';
    25 25   
    26 26  const { Chalk } = require('./Chalk.js');
    27  -const path = require('path');
    28 27   
    29 28   
    30 29  // global defaults
    skipped 204 lines
    235 234   },
    236 235  };
    237 236   
    238  -const PACKAGE = require(path.normalize(`${ __dirname }/../package.json`));
     237 +const PACKAGE = require('../package.json');
    239 238   
    240 239  const HEXTEST = RegExp('^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$');
    241 240   
    skipped 14 lines
  • ■ ■ ■ ■ ■
    src/index.js
    skipped 14 lines
    15 15   
    16 16  'use strict';
    17 17   
    18  -const { AddLetterSpacing } = require('./AddLetterSpacing.js');
    19 18  const { DisplayVersion } = require('./DisplayVersion.js');
    20 19  const { DisplayHelp } = require('./DisplayHelp.js');
    21 20  const { CLIOPTIONS } = require('./constants.js');
    skipped 79 lines
  • yarn.lock
    Diff is too large to be displayed.
Please wait...
Page is in error, reload to recover