Skip to content

Commit 981528a

Browse files
authored
chore: migrate chalk to picocolors and NO_COLOR env (#4)
1 parent 1a0d9b2 commit 981528a

File tree

13 files changed

+20
-17
lines changed

13 files changed

+20
-17
lines changed

.changeset/soft-moons-lay.md

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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"

0 commit comments

Comments
 (0)