Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoCo_Code_Op2
next.js
提交
90f9c64b
N
next.js
项目概览
CoCo_Code_Op2
/
next.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
next.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
90f9c64b
编写于
2月 20, 2019
作者:
J
Joe Haddad
提交者:
GitHub
2月 20, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use alternate screen buffer if terminal supports it (#6364)
上级
17ad1eb8
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
22 addition
and
3 deletion
+22
-3
packages/next/build/output/clearConsole.ts
packages/next/build/output/clearConsole.ts
+2
-2
packages/next/build/output/store.ts
packages/next/build/output/store.ts
+12
-0
packages/next/package.json
packages/next/package.json
+2
-0
yarn.lock
yarn.lock
+6
-1
未找到文件。
packages/next/build/output/clearConsole.ts
浏览文件 @
90f9c64b
...
...
@@ -2,12 +2,12 @@
// https://github.com/facebook/jest/blob/d9d501ac342212b8a58ddb23a31518beb7b56f47/packages/jest-util/src/specialChars.ts#L18
const
isWindows
=
process
.
platform
===
'
win32
'
const
isInteractive
=
process
.
std
out
.
isTTY
const
isInteractive
=
process
.
std
err
.
isTTY
export
function
clearConsole
()
{
if
(
!
isInteractive
)
{
return
}
process
.
std
out
.
write
(
isWindows
?
'
\
x1B[2J
\
x1B[0f
'
:
'
\
x1B[2J
\
x1B[3J
\
x1B[H
'
)
process
.
std
err
.
write
(
isWindows
?
'
\
x1B[2J
\
x1B[0f
'
:
'
\
x1B[2J
\
x1B[3J
\
x1B[H
'
)
}
packages/next/build/output/store.ts
浏览文件 @
90f9c64b
import
chalk
from
'
chalk
'
import
createStore
from
'
unistore
'
import
onExit
from
'
signal-exit
'
import
{
clearConsole
}
from
'
./clearConsole
'
...
...
@@ -15,7 +16,18 @@ export type OutputState =
export
const
store
=
createStore
<
OutputState
>
({
appUrl
:
null
,
bootstrap
:
true
})
let
registered
=
false
store
.
subscribe
(
state
=>
{
if
(
!
registered
)
{
registered
=
true
process
.
stderr
.
write
(
'
\
u001B[?1049h
'
)
onExit
(
function
()
{
process
.
stderr
.
write
(
'
\
u001B[?1049l
'
)
})
}
clearConsole
()
if
(
state
.
bootstrap
)
{
...
...
packages/next/package.json
浏览文件 @
90f9c64b
...
...
@@ -82,6 +82,7 @@
"resolve"
:
"1.5.0"
,
"schema-utils"
:
"1.0.0"
,
"serialize-javascript"
:
"1.4.0"
,
"signal-exit"
:
"3.0.2"
,
"source-map"
:
"0.6.1"
,
"strip-ansi"
:
"3.0.1"
,
"styled-jsx"
:
"3.2.1"
,
...
...
@@ -119,6 +120,7 @@
"@types/nanoid"
:
"1.2.0"
,
"@types/node-fetch"
:
"2.1.4"
,
"@types/rimraf"
:
"2.0.2"
,
"@types/signal-exit"
:
"3.0.0"
,
"@types/webpack"
:
"4.4.22"
,
"taskr"
:
"1.1.0"
,
"typescript"
:
"3.1.6"
...
...
yarn.lock
浏览文件 @
90f9c64b
...
...
@@ -1512,6 +1512,11 @@
"@types/mime" "*"
"@types/node" "*"
"@types/signal-exit@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/signal-exit/-/signal-exit-3.0.0.tgz#75e3b17660cf1f6c6cb8557675b4e680e43bbf36"
integrity sha512-MaJ+16SOXz0Z27EMf3d88+B6UDglq1sn140a+5X/ROLkIcEfRq0CPg+1B2efF1GXQn4n+aKH4ti2hHG4Ya+Dzg==
"@types/tapable@*":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370"
...
...
@@ -10651,7 +10656,7 @@ shellwords@^0.1.0, shellwords@^0.1.1:
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
signal-exit@^3.0.0, signal-exit@^3.0.2:
signal-exit@
3.0.2, signal-exit@
^3.0.0, signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录