@tryghost/listr-smart-renderer 0.15.2 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -104,8 +104,8 @@ Follow the instructions for the top-level repo.
104
104
 
105
105
  ## Test
106
106
 
107
- - `pnpm lint` run just eslint
108
- - `pnpm test` run lint and tests
107
+ - `pnpm test` runs the package tests
108
+ - Linting and formatting are run from the repo root (`pnpm lint`, `pnpm format`)
109
109
 
110
110
  # Copyright & License
111
111
 
package/index.js CHANGED
@@ -3,6 +3,4 @@ import makeTaskRunner from './lib/task-runner.js';
3
3
 
4
4
  export default SmartRenderer;
5
5
 
6
- export {
7
- makeTaskRunner
8
- };
6
+ export {makeTaskRunner};
@@ -71,7 +71,12 @@ const summaryRenderer = (tasks, options, level = 0) => {
71
71
  if (!task.output && task.hasSubtasks()) {
72
72
  task.output = `${chalk.red.dim(`Subtask failed ${arrowDown}`)}`;
73
73
  }
74
- output.push(indentString(`${getSymbol(task, options)} ${taskNumber(index, tasks)}: ${task.title} - ${task.output}`, level));
74
+ output.push(
75
+ indentString(
76
+ `${getSymbol(task, options)} ${taskNumber(index, tasks)}: ${task.title} - ${task.output}`,
77
+ level
78
+ )
79
+ );
75
80
  } else {
76
81
  // Handle any task data that needs to be output
77
82
  if (isDefined(task.output)) {
@@ -102,7 +107,12 @@ const summaryRenderer = (tasks, options, level = 0) => {
102
107
  }
103
108
  });
104
109
 
105
- output.push(indentString(`Total: ${tasks.length}. Complete: ${states.complete.length}, Failed: ${(states.failed.length) ? chalk.red(states.failed.length) : 0}, Skipped: ${states.skipped.length}, Disabled: ${states.disabled.length}`, level));
110
+ output.push(
111
+ indentString(
112
+ `Total: ${tasks.length}. Complete: ${states.complete.length}, Failed: ${states.failed.length ? chalk.red(states.failed.length) : 0}, Skipped: ${states.skipped.length}, Disabled: ${states.disabled.length}`,
113
+ level
114
+ )
115
+ );
106
116
 
107
117
  return output.join('\n');
108
118
  };
@@ -121,10 +131,13 @@ class SmartRenderer {
121
131
  constructor(tasks, options) {
122
132
  this._tasks = tasks;
123
133
  this._mode = 'full';
124
- this._options = Object.assign({
125
- maxFullTasks: 30,
126
- clearOutput: false
127
- }, options);
134
+ this._options = Object.assign(
135
+ {
136
+ maxFullTasks: 30,
137
+ clearOutput: false
138
+ },
139
+ options
140
+ );
128
141
  }
129
142
 
130
143
  render() {
package/lib/utils.js CHANGED
@@ -40,15 +40,10 @@ const indentString = (string, level) => IndentString(string, level, ' ');
40
40
  const taskNumber = (index, tasks) => {
41
41
  // Quick and dirty left pad
42
42
  let padSize = String(tasks.length).length;
43
- let padding = new Array(padSize).join(0);
43
+ let padding = Array.from({length: padSize}).join(0);
44
44
  let taskNum = `${padding}${index + 1}`.slice(-padSize);
45
45
 
46
46
  return `${taskNum}/${tasks.length}`;
47
47
  };
48
48
 
49
- export {
50
- isDefined,
51
- getSymbol,
52
- indentString,
53
- taskNumber
54
- };
49
+ export {isDefined, getSymbol, indentString, taskNumber};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/listr-smart-renderer",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/TryGhost/migrate.git",
@@ -35,8 +35,6 @@
35
35
  },
36
36
  "scripts": {
37
37
  "dev": "echo \"Implement me!\"",
38
- "test": "node --test 'test/**/*.test.js'",
39
- "posttest": "pnpm lint",
40
- "lint": "eslint . --ext .js --cache"
38
+ "test": "node --test 'test/**/*.test.js'"
41
39
  }
42
40
  }