Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drop terminal-link #29472

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: drop terminal-link
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.
  • Loading branch information
pieh committed Feb 12, 2021
commit 189ff208d09888435d46909834b335d95b3e404b
1 change: 0 additions & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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