@jutge.org/toolkit 4.4.38 → 4.4.40
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 +17 -18
- package/dist/index.js +355 -355
- package/package.json +1 -1
- package/toolkit/lint.ts +2 -1
- package/toolkit/make.ts +3 -3
package/package.json
CHANGED
package/toolkit/lint.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from '@commander-js/extra-typings'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
3
|
import { resolve } from 'path'
|
|
4
|
+
import { noProblemDirsMessage } from '../lib/helpers'
|
|
4
5
|
import { lintDirectories, type LintIssue, type LintPassed, type LintResult } from '../lib/lint'
|
|
5
6
|
import tui from '../lib/tui'
|
|
6
7
|
|
|
@@ -66,7 +67,7 @@ export const lintCmd = new Command('lint')
|
|
|
66
67
|
|
|
67
68
|
await tui.section(`Linting ${tui.hyperlink(resolve(directory))}`, async () => {
|
|
68
69
|
const results = await lintDirectories([directory], { verbose })
|
|
69
|
-
if (results.length === 0) throw new Error(
|
|
70
|
+
if (results.length === 0) throw new Error(noProblemDirsMessage)
|
|
70
71
|
const { hasError } = printLintResults(results, [directory], { verbose })
|
|
71
72
|
if (hasError) {
|
|
72
73
|
process.exitCode = 1
|
package/toolkit/make.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@commander-js/extra-typings'
|
|
2
2
|
import chokidar from 'chokidar'
|
|
3
3
|
import { basename, dirname, join, resolve } from 'path'
|
|
4
|
-
import { findRealDirectories } from '../lib/helpers'
|
|
4
|
+
import { findRealDirectories, noProblemDirsMessage } from '../lib/helpers'
|
|
5
5
|
import { lintDirectories } from '../lib/lint'
|
|
6
6
|
import { printLintResults } from './lint'
|
|
7
7
|
import { newMaker, type Maker } from '../lib/maker'
|
|
@@ -115,7 +115,7 @@ export const makeCmd = new Command('make')
|
|
|
115
115
|
await tui.section('', async () => {
|
|
116
116
|
await nothing()
|
|
117
117
|
if (realDirectories.length === 0) {
|
|
118
|
-
tui.warning(
|
|
118
|
+
tui.warning(noProblemDirsMessage)
|
|
119
119
|
}
|
|
120
120
|
for (const directory of realDirectories) {
|
|
121
121
|
if (errors[directory]) {
|
|
@@ -365,7 +365,7 @@ async function runWatch(maker: Maker): Promise<void> {
|
|
|
365
365
|
try {
|
|
366
366
|
const results = await lintDirectories([directory])
|
|
367
367
|
if (results.length === 0) {
|
|
368
|
-
tui.warning(
|
|
368
|
+
tui.warning(noProblemDirsMessage)
|
|
369
369
|
} else {
|
|
370
370
|
await printLintResults(results, [directory])
|
|
371
371
|
}
|