Skip to content

Commit 981528a

Browse files
authoredMar 2, 2025··
chore: migrate chalk to picocolors and NO_COLOR env (#4)
1 parent 1a0d9b2 commit 981528a

13 files changed

+20
-17
lines changed
 

‎.changeset/soft-moons-lay.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@unts/patch-package": patch
3+
---
4+
5+
chore: migrate `chalk` to `picocolors` and `NO_COLOR` env

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
"dependencies": {
8282
"@nolyfill/json-stable-stringify": "^1.0.30",
8383
"@yarnpkg/lockfile": "^1.1.0",
84-
"chalk": "^4.1.2",
8584
"ci-info": "^3.7.0",
8685
"cross-spawn": "^7.0.3",
8786
"find-yarn-workspace-root": "^2.0.0",
8887
"fs-extra": "^10.0.0",
8988
"klaw-sync": "^6.0.0",
9089
"minimist": "^1.2.6",
9190
"open": "^7.4.2",
91+
"picocolors": "^1.1.1",
9292
"semver": "^7.5.3",
9393
"slash": "^3.0.0",
9494
"tmp": "^0.0.33",

‎run-tests.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
export CI=true
5-
64
yarn clean
75
yarn build
86
version=$(node -e 'console.log(require("./package.json").version)')
97
yarn version --new-version 0.0.0 --no-git-tag-version --no-commit-hooks
108
yarn pack --filename patch-package.test.$(date +%s).tgz
119
yarn version --new-version $version --no-git-tag-version --no-commit-hooks
12-
yarn jest "$@"
10+
NO_COLOR=1 yarn jest "$@"

‎src/applyPatches.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import colors from "chalk"
21
import { existsSync, writeFileSync } from "fs-extra"
32
import { posix } from "path"
3+
import colors from "picocolors"
44
import semver from "semver"
55
import { hashFile } from "./hash"
66
import { logPatchSequenceError } from "./makePatch"

‎src/createIssue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import colors from "chalk"
21
import open from "open"
2+
import colors from "picocolors"
33
import { stringify } from "querystring"
44
import { PackageManager } from "./detectPackageManager"
55
import { PackageDetails } from "./PackageDetails"

‎src/detectPackageManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import colors from "chalk"
21
import findWorkspaceRoot from "find-yarn-workspace-root"
32
import fs from "fs-extra"
3+
import colors from "picocolors"
44
import { join } from "./path"
55

66
export type PackageManager = "yarn" | "npm" | "npm-shrinkwrap"

‎src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import colors from "chalk"
21
import { isCI } from "ci-info"
32
import minimist from "minimist"
43
import { normalize, sep } from "path"
4+
import colors from "picocolors"
55
import slash from "slash"
66
import { applyPatchesForApp } from "./applyPatches"
77
import { detectPackageManager } from "./detectPackageManager"

‎src/makePatch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import colors from "chalk"
21
import {
32
copySync,
43
existsSync,
@@ -9,6 +8,7 @@ import {
98
renameSync,
109
writeFileSync,
1110
} from "fs-extra"
11+
import colors from "picocolors"
1212
import { dirSync } from "tmp"
1313
import { gzipSync } from "zlib"
1414
import { applyPatch } from "./applyPatches"

‎src/makeRegExp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import colors from "chalk"
1+
import colors from "picocolors"
22

33
export const makeRegExp = (
44
reString: string,

‎src/patch/read.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import colors from "chalk"
21
import { readFileSync } from "fs-extra"
32
import { normalize } from "path"
3+
import colors from "picocolors"
44
import { PackageDetails } from "../PackageDetails"
55
import { relative, resolve } from "../path"
66
import { parsePatchFile, PatchFilePart } from "./parse"

‎src/rebase.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import colors from "chalk"
21
import { join, resolve } from "path"
2+
import colors from "picocolors"
33
import { applyPatch } from "./applyPatches"
44
import { hashFile } from "./hash"
55
import { PatchedPackageDetails } from "./PackageDetails"

‎src/stateFile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import stringify from "@nolyfill/json-stable-stringify"
2-
import colors from "chalk"
32
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "fs"
43
import { join } from "path"
4+
import colors from "picocolors"
55
import { hashFile } from "./hash"
66
import { PackageDetails } from "./PackageDetails"
77
export interface PatchState {

‎yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -5224,10 +5224,10 @@ performance-now@^2.1.0:
52245224
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
52255225
integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==
52265226

5227-
picocolors@^1.0.0:
5228-
version "1.0.0"
5229-
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
5230-
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
5227+
picocolors@^1.0.0, picocolors@^1.1.1:
5228+
version "1.1.1"
5229+
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
5230+
integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
52315231

52325232
picomatch@^2.3.1:
52335233
version "2.3.1"

0 commit comments

Comments
 (0)
Please sign in to comment.