diff --git a/configs/plugins/3d-reporter-plugin.mjs b/configs/plugins/3d-reporter-plugin.mjs index 1553d74a2..4ef802e7c 100644 --- a/configs/plugins/3d-reporter-plugin.mjs +++ b/configs/plugins/3d-reporter-plugin.mjs @@ -1,5 +1,4 @@ import * as path from "node:path"; -import figures from "figures"; const TEMPLATE = ` @@ -74,9 +73,7 @@ function formatFileName(pFileName) { return `${path.dirname(pFileName)}/${path.basename(pFileName)}`; } function formatDependency(pFrom, pTo) { - return `${formatFileName(pFrom)} ${figures.arrowRight}
${formatFileName( - pTo - )}`; + return `${formatFileName(pFrom)} →
${formatFileName(pTo)}`; } /** @@ -100,14 +97,14 @@ function render3DThing(pCruiseResult) { source: pCurrentModule.source, target: pDependency.resolved, label: formatDependency(pCurrentModule.source, pDependency.resolved), - })) + })), ), - [] + [], ); return TEMPLATE.replace(/@@NODES@@/g, JSON.stringify(lNodes)).replace( /@@LINKS@@/g, - JSON.stringify(lLinks) + JSON.stringify(lLinks), ); } diff --git a/package-lock.json b/package-lock.json index 8b07c6e00..3ba504b3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "chalk": "5.3.0", "commander": "12.1.0", "enhanced-resolve": "5.17.0", - "figures": "6.1.0", "ignore": "5.3.1", "interpret": "^3.1.1", "is-installed-globally": "1.0.0", @@ -3396,20 +3395,6 @@ "dev": true, "license": "ISC" }, - "node_modules/figures": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", - "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", - "dependencies": { - "is-unicode-supported": "^2.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/file-entry-cache": { "version": "6.0.1", "dev": true, @@ -4286,17 +4271,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-unicode-supported": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", - "integrity": "sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakref": { "version": "1.0.2", "dev": true, diff --git a/package.json b/package.json index 89fe58fac..136f75892 100644 --- a/package.json +++ b/package.json @@ -191,7 +191,7 @@ "test:u": "LANG=en_US.UTF-8 NODE_OPTIONS=--no-warnings mocha --grep \"^\\[[U]\\]\"", "test:e": "LANG=en_US.UTF-8 NODE_OPTIONS=--no-warnings mocha --grep \"^\\[[E]\\]\"", "test:cover": "LANG=en_US.UTF-8 NODE_OPTIONS=--no-warnings c8 mocha", - "test:glob": "set -f && test \"`bin/dependency-cruise.mjs --no-config test/extract/__mocks__/gather-globbing/packages/**/src/**/*.js | grep \"no dependency violations found\"`\" = \"✔ no dependency violations found (6 modules, 0 dependencies cruised)\"", + "test:glob": "set -f && test \"`bin/dependency-cruise.mjs --no-config test/extract/__mocks__/gather-globbing/packages/**/src/**/*.js | grep \"no dependency violations found\"`\" = \"√ no dependency violations found (6 modules, 0 dependencies cruised)\"", "test:load": "hyperfine --warmup 3 --runs 30 \"bin/dependency-cruise.mjs src bin test configs types tools --ignore-known --no-cache --no-progress\"", "test:load:short": "hyperfine --warmup 1 --runs 5 \"bin/dependency-cruise.mjs src bin test configs types tools --ignore-known --no-cache --no-progress\"", "test:load:cached": "hyperfine --warmup 3 --runs 30 \"bin/dependency-cruise.mjs src bin test configs types tools --ignore-known --cache node_modules/.cache/dependency-cruiser/load-cached --no-progress\"", @@ -212,7 +212,6 @@ "chalk": "5.3.0", "commander": "12.1.0", "enhanced-resolve": "5.17.0", - "figures": "6.1.0", "ignore": "5.3.1", "interpret": "^3.1.1", "is-installed-globally": "1.0.0", diff --git a/src/cli/format-meta-info.mjs b/src/cli/format-meta-info.mjs index 5c149fa3c..3c40b080a 100644 --- a/src/cli/format-meta-info.mjs +++ b/src/cli/format-meta-info.mjs @@ -1,10 +1,9 @@ import chalk from "chalk"; -import figures from "figures"; import { getAvailableTranspilers, allExtensions } from "#main/index.mjs"; function bool2Symbol(pBool) { - return pBool ? chalk.green(figures.tick) : chalk.red(figures.cross); + return pBool ? chalk.green("√") : chalk.red("x"); } function formatTranspilers() { @@ -30,7 +29,7 @@ export default function formatMetaInfo() { Supported: If you need a supported, but not enabled transpiler ('${chalk.red( - figures.cross, + "x", )}' below), just install it in the same folder dependency-cruiser is installed. E.g. 'npm i livescript' will enable livescript support if it's installed in your project folder. diff --git a/src/cli/init-config/write-config.mjs b/src/cli/init-config/write-config.mjs index 0f30bfdc4..97cb19e7b 100644 --- a/src/cli/init-config/write-config.mjs +++ b/src/cli/init-config/write-config.mjs @@ -1,5 +1,4 @@ import { writeFileSync } from "node:fs"; -import figures from "figures"; import chalk from "chalk"; import { fileExists, @@ -30,9 +29,7 @@ export default function writeConfig( try { writeFileSync(pFileName, pConfig); pOutStream.write( - `\n ${chalk.green( - figures.tick, - )} Successfully created '${pFileName}'\n\n`, + `\n ${chalk.green("√")} Successfully created '${pFileName}'\n\n`, ); /* c8 ignore start */ } catch (pError) { diff --git a/src/cli/init-config/write-run-scripts-to-manifest.mjs b/src/cli/init-config/write-run-scripts-to-manifest.mjs index 8cd7f518b..910291233 100644 --- a/src/cli/init-config/write-run-scripts-to-manifest.mjs +++ b/src/cli/init-config/write-run-scripts-to-manifest.mjs @@ -1,6 +1,5 @@ /* eslint-disable security/detect-object-injection */ import { writeFileSync } from "node:fs"; -import figures from "figures"; import chalk from "chalk"; import { PACKAGE_MANIFEST as _PACKAGE_MANIFEST } from "../defaults.mjs"; import { readManifest } from "./environment-helpers.mjs"; @@ -121,13 +120,11 @@ function getSuccessMessage(pDestinationManifestFileName) { return EXPERIMENTAL_SCRIPT_DOC.reduce( (pAll, pScript) => { return `${pAll}${ - `\n ${chalk.green(figures.play)} ${pScript.headline}` + + `\n ${chalk.green("►")} ${pScript.headline}` + `\n${wrapAndIndent(`${pScript.description}`, lExplanationIndent)}\n\n` }`; }, - ` ${chalk.green( - figures.tick, - )} Run scripts added to '${pDestinationManifestFileName}':\n`, + ` ${chalk.green("√")} Run scripts added to '${pDestinationManifestFileName}':\n`, ); } diff --git a/src/cli/listeners/cli-feedback.mjs b/src/cli/listeners/cli-feedback.mjs index 5cdfc8771..86284d1af 100644 --- a/src/cli/listeners/cli-feedback.mjs +++ b/src/cli/listeners/cli-feedback.mjs @@ -1,5 +1,4 @@ import chalk from "chalk"; -import figures from "figures"; import { SUMMARY } from "#utl/bus.mjs"; const FULL_ON = 100; @@ -7,8 +6,8 @@ const FULL_ON = 100; function normalizeParameters(pParameters) { return { barSize: 10, - block: figures.squareSmallFilled, - blank: figures.squareSmall, + block: "■", + blank: "□", ...(pParameters || {}), }; } diff --git a/src/report/error.mjs b/src/report/error.mjs index 30e25f74f..4efe45fae 100644 --- a/src/report/error.mjs +++ b/src/report/error.mjs @@ -1,6 +1,5 @@ import { EOL } from "node:os"; import chalk from "chalk"; -import figures from "figures"; import { formatPercentage, formatViolation as _formatViolation, @@ -20,9 +19,7 @@ const EXTRA_PATH_INFORMATION_INDENT = 6; function formatMiniDependency(pMiniDependency) { return EOL.concat( wrapAndIndent( - pMiniDependency - .map(({ name }) => name) - .join(` ${figures.arrowRight} ${EOL}`), + pMiniDependency.map(({ name }) => name).join(` → ${EOL}`), EXTRA_PATH_INFORMATION_INDENT, ), ); @@ -33,19 +30,15 @@ function formatModuleViolation(pViolation) { } function formatDependencyViolation(pViolation) { - return `${chalk.bold(pViolation.from)} ${figures.arrowRight} ${chalk.bold( - pViolation.to, - )}`; + return `${chalk.bold(pViolation.from)} → ${chalk.bold(pViolation.to)}`; } function formatCycleViolation(pViolation) { - return `${chalk.bold(pViolation.from)} ${ - figures.arrowRight - } ${formatMiniDependency(pViolation.cycle)}`; + return `${chalk.bold(pViolation.from)} → ${formatMiniDependency(pViolation.cycle)}`; } function formatReachabilityViolation(pViolation) { - return `${chalk.bold(pViolation.from)} ${figures.arrowRight} ${chalk.bold( + return `${chalk.bold(pViolation.from)} → ${chalk.bold( pViolation.to, )}${formatMiniDependency(pViolation.via)}`; } @@ -53,9 +46,7 @@ function formatReachabilityViolation(pViolation) { function formatInstabilityViolation(pViolation) { return `${formatDependencyViolation(pViolation)}${EOL}${wrapAndIndent( chalk.dim( - `instability: ${formatPercentage(pViolation.metrics.from.instability)} ${ - figures.arrowRight - } ${formatPercentage(pViolation.metrics.to.instability)}`, + `instability: ${formatPercentage(pViolation.metrics.from.instability)} → ${formatPercentage(pViolation.metrics.to.instability)}`, ), EXTRA_PATH_INFORMATION_INDENT, )}`; @@ -96,7 +87,7 @@ function sumMeta(pMeta) { } function formatSummary(pSummary) { - let lMessage = `${EOL}${figures.cross} ${sumMeta( + let lMessage = `${EOL}x ${sumMeta( pSummary, )} dependency violations (${formatMeta(pSummary)}). ${ pSummary.totalCruised @@ -117,7 +108,7 @@ function addExplanation(pRuleSet, pLong) { function formatIgnoreWarning(pNumberOfIgnoredViolations) { if (pNumberOfIgnoredViolations > 0) { return chalk.yellow( - `${figures.warning} ${pNumberOfIgnoredViolations} known violations ignored. Run with --no-ignore-known to see them.${EOL}`, + `‼ ${pNumberOfIgnoredViolations} known violations ignored. Run with --no-ignore-known to see them.${EOL}`, ); } return ""; @@ -129,9 +120,7 @@ function report(pResults, pLong) { ); if (lNonIgnorableViolations.length === 0) { - return `${EOL}${chalk.green( - figures.tick, - )} no dependency violations found (${ + return `${EOL}${chalk.green("√")} no dependency violations found (${ pResults.summary.totalCruised } modules, ${ pResults.summary.totalDependenciesCruised diff --git a/src/report/text.mjs b/src/report/text.mjs index 5c200a506..f4accbb4e 100644 --- a/src/report/text.mjs +++ b/src/report/text.mjs @@ -1,4 +1,3 @@ -import figures from "figures"; import chalk from "chalk"; const DEFAULT_OPTIONS = { @@ -41,9 +40,7 @@ function stringifyModule(pModule) { } function stringify(pFlatDependency) { - return `${stringifyModule(pFlatDependency.from)} ${ - figures.arrowRight - } ${stringifyModule(pFlatDependency.to)}`; + return `${stringifyModule(pFlatDependency.from)} → ${stringifyModule(pFlatDependency.to)}`; } /**