Skip to content

Commit 6374419

Browse files
ascorbicpieh
andauthored
fix: drop terminal-link (#29472) (#29477)
There is weird interaction in some terminals with our usage of terminal-link and ink where following lines turn blank. Let's just remove our usage of terminal-link as value it provides is not worth spending a lot of time on figuring exact reason for this. (cherry picked from commit 260c297) Co-authored-by: Michal Piechowiak <[email protected]>
1 parent 72c4a5a commit 6374419

File tree

5 files changed

+4
-13
lines changed

5 files changed

+4
-13
lines changed

packages/gatsby/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
"string-similarity": "^1.2.2",
148148
"strip-ansi": "^5.2.0",
149149
"style-loader": "^0.23.1",
150-
"terminal-link": "^2.1.1",
151150
"terser-webpack-plugin": "^2.3.8",
152151
"tmp": "^0.2.1",
153152
"true-case-path": "^2.2.1",

packages/gatsby/src/utils/__tests__/handle-flags.ts

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ jest.mock(`gatsby-core-utils`, () => {
1010
}
1111
})
1212

13-
jest.mock(`terminal-link`, () => (text: string, url: string): string =>
14-
`${text} (${url})`
15-
)
16-
1713
describe(`satisfies semver`, () => {
1814
it(`returns false if a module doesn't exist`, () => {
1915
const semverConstraints = {

packages/gatsby/src/utils/__tests__/show-experiment-notice.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { createNoticeMessage } from "../show-experiment-notice"
22
import stripAnsi from "strip-ansi"
33

4-
jest.mock(`terminal-link`, () => (text, url) => `${text} (${url})`)
5-
64
describe(`show-experiment-notice`, () => {
75
it(`generates a message`, () => {
86
expect(

packages/gatsby/src/utils/handle-flags.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import _ from "lodash"
22
import { isCI } from "gatsby-core-utils"
3-
import terminalLink from "terminal-link"
43
import { IFlag } from "./flags"
54
import chalk from "chalk"
65
import { commaListsAnd } from "common-tags"
@@ -133,7 +132,7 @@ const handleFlags = (
133132
message += ` · ${chalk.white.bgRed.bold(`EXPERIMENTAL`)}`
134133
}
135134
if (flag.umbrellaIssue) {
136-
message += ` · (${terminalLink(`Umbrella Issue`, flag.umbrellaIssue)})`
135+
message += ` · (Umbrella Issue (${flag.umbrellaIssue}))`
137136
}
138137
message += ` · ${flag.description}`
139138

packages/gatsby/src/utils/show-experiment-notice.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { getConfigStore } from "gatsby-core-utils"
22
import reporter from "gatsby-cli/lib/reporter"
33
import chalk from "chalk"
44
import telemetry from "gatsby-telemetry"
5-
import terminalLink from "terminal-link"
65

76
type CancelExperimentNoticeCallback = () => void
87

@@ -57,9 +56,9 @@ flags (samples below)`
5756
notice =>
5857
(message += `
5958
60-
${chalk.bgBlue.bold(
61-
terminalLink(notice.experimentIdentifier, notice.umbrellaLink)
62-
)}, ${notice.noticeText}\n`)
59+
${chalk.bgBlue.bold(notice.experimentIdentifier)} (${notice.umbrellaLink}), ${
60+
notice.noticeText
61+
}\n`)
6362
)
6463

6564
return message

0 commit comments

Comments
 (0)