Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
1757ad02
Commit
1757ad02
authored
Feb 21, 2019
by
Joe Haddad
Committed by
Tim Neutkens
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop cli-cursor dependency (#6387)
parent
414e8fab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
20 deletions
+52
-20
LangSwitcher.js
examples/with-lingui/components/LangSwitcher.js
+2
-2
exit.ts
packages/next/build/output/exit.ts
+38
-0
store.ts
packages/next/build/output/store.ts
+5
-2
package.json
packages/next/package.json
+0
-2
yarn.lock
yarn.lock
+7
-14
No files found.
examples/with-lingui/components/LangSwitcher.js
View file @
1757ad02
...
...
@@ -13,12 +13,12 @@ export default () => {
evt
.
preventDefault
()
Router
.
push
({
pathname
:
window
.
location
.
pathname
,
query
:
{
lang
:
evt
.
currentTarget
.
lang
.
value
}
query
:
{
lang
:
evt
.
currentTarget
.
lang
.
value
}
})
}
return
(
<
I18n
>
{({
i18n
})
=>
<
I18n
>
{({
i18n
})
=>
<
form
onSubmit
=
{
onSubmit
}
>
<
select
key
=
{
i18n
.
language
}
name
=
'lang'
defaultValue
=
{
availableLanguages
.
find
(
lang
=>
lang
!==
i18n
.
language
)}
>
{
availableLanguages
.
map
(
lang
=>
(
...
...
packages/next/build/output/exit.ts
0 → 100644
View file @
1757ad02
export
function
onExit
(
fn
:
Function
)
{
function
exit
(
signal
:
string
=
''
)
{
try
{
if
(
listeners
.
length
)
{
fn
()
}
}
finally
{
while
(
listeners
.
length
)
{
const
{
event
,
handler
}
=
listeners
.
shift
()
!
process
.
removeListener
(
event
,
handler
)
}
if
(
signal
)
{
process
.
kill
(
process
.
pid
,
signal
)
}
}
}
const
listeners
=
[
{
event
:
'SIGINT'
,
handler
:
()
=>
exit
(
'SIGINT'
)
},
{
event
:
'SIGHUP'
,
handler
:
()
=>
exit
(
'SIGHUP'
)
},
{
event
:
'SIGQUIT'
,
handler
:
()
=>
exit
(
'SIGQUIT'
)
},
{
event
:
'SIGTERM'
,
handler
:
()
=>
exit
(
'SIGTERM'
)
},
{
event
:
'uncaughtException'
,
handler
:
()
=>
{
exit
()
process
.
exit
(
1
)
},
},
{
event
:
'exit'
,
handler
:
()
=>
exit
()
},
]
for
(
const
{
event
,
handler
}
of
listeners
)
{
process
.
on
(
event
as
any
,
handler
)
}
}
packages/next/build/output/store.ts
View file @
1757ad02
import
chalk
from
'chalk'
import
createStore
from
'unistore'
import
readline
from
'readline'
import
cliCursor
from
'cli-cursor
'
import
{
onExit
}
from
'./exit
'
export
type
OutputState
=
|
{
bootstrap
:
true
;
appUrl
:
string
|
null
}
...
...
@@ -15,8 +15,11 @@ export type OutputState =
export
const
store
=
createStore
<
OutputState
>
({
appUrl
:
null
,
bootstrap
:
true
})
cliCursor
.
hide
()
process
.
stdout
.
write
(
'
\
n'
.
repeat
(
process
.
stdout
.
rows
||
1
))
process
.
stdout
.
write
(
'
\
u001b[?25l'
)
onExit
(()
=>
{
process
.
stdout
.
write
(
'
\
u001b[?25h'
)
})
store
.
subscribe
(
state
=>
{
readline
.
cursorTo
(
process
.
stdout
,
0
,
0
)
readline
.
clearScreenDown
(
process
.
stdout
)
...
...
packages/next/package.json
View file @
1757ad02
...
...
@@ -60,7 +60,6 @@
"cacache"
:
"^11.0.2"
,
"case-sensitive-paths-webpack-plugin"
:
"2.1.2"
,
"chalk"
:
"2.4.2"
,
"cli-cursor"
:
"2.1.0"
,
"cross-spawn"
:
"5.1.0"
,
"del"
:
"3.0.0"
,
"event-source-polyfill"
:
"0.0.12"
,
...
...
@@ -112,7 +111,6 @@
"@types/babel__template"
:
"7.0.1"
,
"@types/babel__traverse"
:
"7.0.3"
,
"@types/case-sensitive-paths-webpack-plugin"
:
"2.1.2"
,
"@types/cli-cursor"
:
"2.1.0"
,
"@types/cross-spawn"
:
"6.0.0"
,
"@types/etag"
:
"1.8.0"
,
"@types/fresh"
:
"0.5.0"
,
...
...
yarn.lock
View file @
1757ad02
...
...
@@ -1526,13 +1526,6 @@
dependencies:
"@types/webpack" "*"
"@types/cli-cursor@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/cli-cursor/-/cli-cursor-2.1.0.tgz#bf293a75efb7bd8a3dd020413ec41cd317e5f128"
integrity sha512-tICz3BCZI/XDB0+qbtHEyFp7JNaL9AP+HCzrH7sRdf6mO9KMnntKlPv8Dhk01nMtCod+4Xh/pjEoJWAr0A0VmQ==
dependencies:
"@types/node" "*"
"@types/cross-spawn@6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@types/cross-spawn/-/cross-spawn-6.0.0.tgz#320aaf1d1a12979f1b84fe7a5590a7e860bf3a80"
...
...
@@ -3245,13 +3238,6 @@ clean-stack@^1.0.0:
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31"
integrity sha1-noIVAa6XmYbEax1m0tQy2y/UrjE=
cli-cursor@2.1.0, cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=
dependencies:
restore-cursor "^2.0.0"
cli-cursor@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987"
...
...
@@ -3259,6 +3245,13 @@ cli-cursor@^1.0.2:
dependencies:
restore-cursor "^1.0.1"
cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=
dependencies:
restore-cursor "^2.0.0"
cli-spinners@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment