Skip to content

Commit

Permalink
fix: drop terminal-link (#29472) (#29477)
Browse files Browse the repository at this point in the history
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 <misiek.piechowiak@gmail.com>
  • Loading branch information
ascorbic and pieh committed Feb 12, 2021
1 parent 72c4a5a commit 6374419
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion packages/gatsby/package.json
Expand Up @@ -147,7 +147,6 @@
"string-similarity": "^1.2.2",
"strip-ansi": "^5.2.0",
"style-loader": "^0.23.1",
"terminal-link": "^2.1.1",
"terser-webpack-plugin": "^2.3.8",
"tmp": "^0.2.1",
"true-case-path": "^2.2.1",
Expand Down
4 changes: 0 additions & 4 deletions packages/gatsby/src/utils/__tests__/handle-flags.ts
Expand Up @@ -10,10 +10,6 @@ jest.mock(`gatsby-core-utils`, () => {
}
})

jest.mock(`terminal-link`, () => (text: string, url: string): string =>
`${text} (${url})`
)

describe(`satisfies semver`, () => {
it(`returns false if a module doesn't exist`, () => {
const semverConstraints = {
Expand Down
2 changes: 0 additions & 2 deletions packages/gatsby/src/utils/__tests__/show-experiment-notice.js
@@ -1,8 +1,6 @@
import { createNoticeMessage } from "../show-experiment-notice"
import stripAnsi from "strip-ansi"

jest.mock(`terminal-link`, () => (text, url) => `${text} (${url})`)

describe(`show-experiment-notice`, () => {
it(`generates a message`, () => {
expect(
Expand Down
3 changes: 1 addition & 2 deletions packages/gatsby/src/utils/handle-flags.ts
@@ -1,6 +1,5 @@
import _ from "lodash"
import { isCI } from "gatsby-core-utils"
import terminalLink from "terminal-link"
import { IFlag } from "./flags"
import chalk from "chalk"
import { commaListsAnd } from "common-tags"
Expand Down Expand Up @@ -133,7 +132,7 @@ const handleFlags = (
message += ` · ${chalk.white.bgRed.bold(`EXPERIMENTAL`)}`
}
if (flag.umbrellaIssue) {
message += ` · (${terminalLink(`Umbrella Issue`, flag.umbrellaIssue)})`
message += ` · (Umbrella Issue (${flag.umbrellaIssue}))`
}
message += ` · ${flag.description}`

Expand Down
7 changes: 3 additions & 4 deletions packages/gatsby/src/utils/show-experiment-notice.ts
Expand Up @@ -2,7 +2,6 @@ import { getConfigStore } from "gatsby-core-utils"
import reporter from "gatsby-cli/lib/reporter"
import chalk from "chalk"
import telemetry from "gatsby-telemetry"
import terminalLink from "terminal-link"

type CancelExperimentNoticeCallback = () => void

Expand Down Expand Up @@ -57,9 +56,9 @@ flags (samples below)`
notice =>
(message += `
${chalk.bgBlue.bold(
terminalLink(notice.experimentIdentifier, notice.umbrellaLink)
)}, ${notice.noticeText}\n`)
${chalk.bgBlue.bold(notice.experimentIdentifier)} (${notice.umbrellaLink}), ${
notice.noticeText
}\n`)
)

return message
Expand Down

0 comments on commit 6374419

Please sign in to comment.