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
33176806
Unverified
Commit
33176806
authored
Aug 13, 2020
by
Joe Haddad
Committed by
GitHub
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused dependency (#16168)
parent
0e48ea39
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1 addition
and
53 deletions
+1
-53
index.js
packages/next/compiled/launch-editor/index.js
+0
-1
package.json
packages/next/compiled/launch-editor/package.json
+0
-1
package.json
packages/next/package.json
+0
-1
hot-reloader.ts
packages/next/server/hot-reloader.ts
+0
-2
error-overlay-middleware.ts
packages/next/server/lib/error-overlay-middleware.ts
+0
-26
taskfile.js
packages/next/taskfile.js
+0
-9
misc.d.ts
packages/next/types/misc.d.ts
+0
-5
yarn.lock
yarn.lock
+1
-8
No files found.
packages/next/compiled/launch-editor/index.js
deleted
100644 → 0
View file @
0e48ea39
module
.
exports
=
function
(
e
,
n
){
"use strict"
;
var
t
=
{};
function
__webpack_require__
(
n
){
if
(
t
[
n
]){
return
t
[
n
].
exports
}
var
r
=
t
[
n
]
=
{
i
:
n
,
l
:
false
,
exports
:{}};
e
[
n
].
call
(
r
.
exports
,
r
,
r
.
exports
,
__webpack_require__
);
r
.
l
=
true
;
return
r
.
exports
}
__webpack_require__
.
ab
=
__dirname
+
"/"
;
function
startup
(){
return
__webpack_require__
(
231
)}
return
startup
()}({
87
:
function
(
e
){
e
.
exports
=
require
(
"os"
)},
91
:
function
(
e
){
e
.
exports
=
{
atom
:
"atom"
,
Brackets
:
"brackets"
,
code
:
"code"
,
emacs
:
"emacs"
,
"idea.sh"
:
"idea"
,
"phpstorm.sh"
:
"phpstorm"
,
"pycharm.sh"
:
"pycharm"
,
"rubymine.sh"
:
"rubymine"
,
sublime_text
:
"subl"
,
vim
:
"vim"
,
"webstorm.sh"
:
"webstorm"
}},
129
:
function
(
e
){
e
.
exports
=
require
(
"child_process"
)},
231
:
function
(
e
,
n
,
t
){
const
r
=
t
(
747
);
const
a
=
t
(
87
);
const
p
=
t
(
622
);
const
i
=
t
(
736
);
const
s
=
t
(
129
);
const
o
=
t
(
470
);
const
l
=
t
(
514
);
function
wrapErrorCallback
(
e
){
return
(
n
,
t
)
=>
{
console
.
log
();
console
.
log
(
i
.
red
(
"Could not open "
+
p
.
basename
(
n
)
+
" in the editor."
));
if
(
t
){
if
(
t
[
t
.
length
-
1
]
!==
"."
){
t
+=
"."
}
console
.
log
(
i
.
red
(
"The editor process exited with an error: "
+
t
))}
console
.
log
();
if
(
e
)
e
(
n
,
t
)}}
function
isTerminalEditor
(
e
){
switch
(
e
){
case
"vim"
:
case
"emacs"
:
case
"nano"
:
return
true
}
return
false
}
const
c
=
/:
(\d
+
)(
:
(\d
+
))?
$/
;
function
parseFile
(
e
){
const
n
=
e
.
replace
(
c
,
""
);
const
t
=
e
.
match
(
c
);
const
r
=
t
&&
t
[
1
];
const
a
=
t
&&
t
[
3
];
return
{
fileName
:
n
,
lineNumber
:
r
,
columnNumber
:
a
}}
let
f
=
null
;
function
launchEditor
(
e
,
n
,
t
){
const
i
=
parseFile
(
e
);
let
{
fileName
:
c
}
=
i
;
const
{
lineNumber
:
m
,
columnNumber
:
b
}
=
i
;
if
(
!
r
.
existsSync
(
c
)){
return
}
if
(
typeof
n
===
"function"
){
t
=
n
;
n
=
undefined
}
t
=
wrapErrorCallback
(
t
);
const
[
u
,...
x
]
=
o
(
n
);
if
(
!
u
){
t
(
c
,
null
);
return
}
if
(
process
.
platform
===
"linux"
&&
c
.
startsWith
(
"/mnt/"
)
&&
/Microsoft/i
.
test
(
a
.
release
())){
c
=
p
.
relative
(
""
,
c
)}
if
(
m
){
const
e
=
l
(
u
,
c
,
m
,
b
);
x
.
push
.
apply
(
x
,
e
)}
else
{
x
.
push
(
c
)}
if
(
f
&&
isTerminalEditor
(
u
)){
f
.
kill
(
"SIGKILL"
)}
if
(
process
.
platform
===
"win32"
){
f
=
s
.
spawn
(
"cmd.exe"
,[
"/C"
,
u
].
concat
(
x
),{
stdio
:
"inherit"
})}
else
{
f
=
s
.
spawn
(
u
,
x
,{
stdio
:
"inherit"
})}
f
.
on
(
"exit"
,
function
(
e
){
f
=
null
;
if
(
e
){
t
(
c
,
"(code "
+
e
+
")"
)}});
f
.
on
(
"error"
,
function
(
e
){
t
(
c
,
e
.
message
)})}
e
.
exports
=
launchEditor
},
313
:
function
(
e
,
n
){
n
.
quote
=
function
(
e
){
return
e
.
map
(
function
(
e
){
if
(
e
&&
typeof
e
===
"object"
){
return
e
.
op
.
replace
(
/
(
.
)
/g
,
"
\\
$1"
)}
else
if
(
/
[
"
\s]
/
.
test
(
e
)
&&!
/'/
.
test
(
e
)){
return
"'"
+
e
.
replace
(
/
([
'
\\])
/g
,
"
\\
$1"
)
+
"'"
}
else
if
(
/
[
"'
\s]
/
.
test
(
e
)){
return
'"'
+
e
.
replace
(
/
([
"
\\
$`!
])
/g
,
"
\\
$1"
)
+
'"'
}
else
{
return
String
(
e
).
replace
(
/
([
A-z
]
:
)?([
#!"$&'()*,:;<=>?@
\[\\\]
^`{|}
])
/g
,
"$1
\\
$2"
)}}).
join
(
" "
)};
var
t
=
"(?:"
+
[
"
\\
|
\\
|"
,
"
\\
&
\\
&"
,
";;"
,
"
\\
|
\\
&"
,
"
\\
<
\\
("
,
">>"
,
">
\\
&"
,
"[&;()|<>]"
].
join
(
"|"
)
+
")"
;
var
r
=
"|&;()<>
\\
t"
;
var
a
=
"(
\\\\
['
\"
"
+
r
+
"]|[^
\\
s'
\"
"
+
r
+
"])+"
;
var
p
=
'"((
\\\\
"|[^"])*?)"'
;
var
i
=
"'((
\\\\
'|[^'])*?)'"
;
var
s
=
""
;
for
(
var
o
=
0
;
o
<
4
;
o
++
){
s
+=
(
Math
.
pow
(
16
,
8
)
*
Math
.
random
()).
toString
(
16
)}
n
.
parse
=
function
(
e
,
n
,
t
){
var
r
=
parse
(
e
,
n
,
t
);
if
(
typeof
n
!==
"function"
)
return
r
;
return
r
.
reduce
(
function
(
e
,
n
){
if
(
typeof
n
===
"object"
)
return
e
.
concat
(
n
);
var
t
=
n
.
split
(
RegExp
(
"("
+
s
+
".*?"
+
s
+
")"
,
"g"
));
if
(
t
.
length
===
1
)
return
e
.
concat
(
t
[
0
]);
return
e
.
concat
(
t
.
filter
(
Boolean
).
map
(
function
(
e
){
if
(
RegExp
(
"^"
+
s
).
test
(
e
)){
return
JSON
.
parse
(
e
.
split
(
s
)[
1
])}
else
return
e
}))},[])};
function
parse
(
e
,
n
,
r
){
var
o
=
new
RegExp
([
"("
+
t
+
")"
,
"("
+
a
+
"|"
+
p
+
"|"
+
i
+
")*"
].
join
(
"|"
),
"g"
);
var
l
=
e
.
match
(
o
).
filter
(
Boolean
);
var
c
=
false
;
if
(
!
l
)
return
[];
if
(
!
n
)
n
=
{};
if
(
!
r
)
r
=
{};
return
l
.
map
(
function
(
e
,
n
){
if
(
c
){
return
}
if
(
RegExp
(
"^"
+
t
+
"$"
).
test
(
e
)){
return
{
op
:
e
}}
var
a
=
"'"
;
var
p
=
'"'
;
var
i
=
"$"
;
var
s
=
r
.
escape
||
"
\
\"
;var o=false;var f=false;var m="";var b=false;for(var u=0,x=e.length;u<x;u++){var d=e.charAt(u);b=b||!o&&(d==="
*
"||d==="
?
");if(f){m+=d;f=false}else if(o){if(d===o){o=false}else if(o==a){m+=d}else{if(d===s){u+=1;d=e.charAt(u);if(d===p||d===s||d===i){m+=d}else{m+=s+d}}else if(d===i){m+=parseEnvVar()}else{m+=d}}}else if(d===p||d===a){o=d}else if(RegExp("
^
"+t+"
$
").test(d)){return{op:e}}else if(RegExp("
^
#
$
").test(d)){c=true;if(m.length){return[m,{comment:e.slice(u+1)+l.slice(n+1).join("
")}]}return[{comment:e.slice(u+1)+l.slice(n+1).join("
")}]}else if(d===s){f=true}else if(d===i){m+=parseEnvVar()}else m+=d}if(b)return{op:"
glob
",pattern:m};return m;function parseEnvVar(){u+=1;var n,t;if(e.charAt(u)==="
{
"){u+=1;if(e.charAt(u)==="
}
"){throw new Error("
Bad
substitution
:
"+e.substr(u-2,3))}n=e.indexOf("
}
",u);if(n<0){throw new Error("
Bad
substitution
:
"+e.substr(u))}t=e.substr(u,n-u);u=n}else if(/[*@#?$!_
\
-]/.test(e.charAt(u))){t=e.charAt(u);u+=1}else{n=e.substr(u).match(/[^
\
w
\
d_]/);if(!n){t=e.substr(u);u=e.length}else{t=e.substr(u,n.index);u+=n.index-1}}return getVar(null,"",t)}}).reduce(function(e,n){if(n===undefined){return e}return e.concat(n)},[]);function getVar(e,t,r){var a=typeof n==="
function
"?n(r):n[r];if(a===undefined&&r!="")a="";else if(a===undefined)a="
$
";if(typeof a==="
object
"){return t+s+JSON.stringify(a)+s}else return t+a}}},373:function(e){e.exports=["
Brackets
.
exe
","
Code
.
exe
","
atom
.
exe
","
sublime_text
.
exe
","
notepad
++
.
exe
","
clion
.
exe
","
clion64
.
exe
","
idea
.
exe
","
idea64
.
exe
","
phpstorm
.
exe
","
phpstorm64
.
exe
","
pycharm
.
exe
","
pycharm64
.
exe
","
rubymine
.
exe
","
rubymine64
.
exe
","
webstorm
.
exe
","
webstorm64
.
exe
"]},470:function(e,n,t){const r=t(622);const a=t(313);const p=t(129);const i=t(788);const s=t(91);const o=t(373);e.exports=function guessEditor(e){if(e){return a.parse(e)}try{if(process.platform==="
darwin
"){const e=p.execSync("
ps
x
").toString();const n=Object.keys(i);for(let t=0;t<n.length;t++){const r=n[t];if(e.indexOf(r)!==-1){return[i[r]]}}}else if(process.platform==="
win32
"){const e=p.execSync('powershell -Command "
Get
-
Process
|
Select
-
Object
Path
"',{stdio:["
pipe
","
pipe
","
ignore
"]}).toString();const n=e.split("
\
r
\
n
");for(let e=0;e<n.length;e++){if(!n[e]){continue}const t=n[e].trim();const a=r.basename(t);if(o.indexOf(a)!==-1){return[t]}}}else if(process.platform==="
linux
"){const e=p.execSync("
ps
x
--
no
-
heading
-
o
comm
--
sort
=
comm
").toString();const n=Object.keys(s);for(let t=0;t<n.length;t++){const r=n[t];if(e.indexOf(r)!==-1){return[s[r]]}}}}catch(e){}if(process.env.VISUAL){return[process.env.VISUAL]}else if(process.env.EDITOR){return[process.env.EDITOR]}return[null]}},514:function(e,n,t){const r=t(622);e.exports=function getArgumentsForPosition(e,n,t,a=1){const p=r.basename(e).replace(/
\
.(exe|cmd|bat)$/i,"");switch(p){case"
atom
":case"
Atom
":case"
Atom
Beta
":case"
subl
":case"
sublime
":case"
sublime_text
":case"
wstorm
":case"
charm
":return[`${n}:${t}:${a}`];case"
notepad
++
":return["
-
n
"+t,n];case"
vim
":case"
mvim
":return[`+call cursor(${t}, ${a})`,n];case"
joe
":return["
+
"+`${t}`,n];case"
emacs
":case"
emacsclient
":return[`+${t}:${a}`,n];case"
rmate
":case"
mate
":case"
mine
":return["
--
line
",t,n];case"
code
":case"
code
-
insiders
":case"
Code
":return["
-
r
","
-
g
",`${n}:${t}:${a}`];case"
appcode
":case"
clion
":case"
clion64
":case"
idea
":case"
idea64
":case"
phpstorm
":case"
phpstorm64
":case"
pycharm
":case"
pycharm64
":case"
rubymine
":case"
rubymine64
":case"
webstorm
":case"
webstorm64
":return["
--
line
",t,n]}return[n]}},622:function(e){e.exports=require("
path
")},736:function(e){e.exports=require("
next
/
dist
/
compiled
/
chalk
")},747:function(e){e.exports=require("
fs
")},788:function(e){e.exports={"
/
Applications
/
Atom
.
app
/
Contents
/
MacOS
/
Atom
":"
atom
","
/
Applications
/
Atom
Beta
.
app
/
Contents
/
MacOS
/
Atom
Beta
":"
/
Applications
/
Atom
Beta
.
app
/
Contents
/
MacOS
/
Atom
Beta
","
/
Applications
/
Brackets
.
app
/
Contents
/
MacOS
/
Brackets
":"
brackets
","
/
Applications
/
Sublime
Text
.
app
/
Contents
/
MacOS
/
Sublime
Text
":"
/
Applications
/
Sublime
Text
.
app
/
Contents
/
SharedSupport
/
bin
/
subl
","
/
Applications
/
Sublime
Text
2
.
app
/
Contents
/
MacOS
/
Sublime
Text
2
":"
/
Applications
/
Sublime
Text
2
.
app
/
Contents
/
SharedSupport
/
bin
/
subl
","
/
Applications
/
Sublime
Text
Dev
.
app
/
Contents
/
MacOS
/
Sublime
Text
":"
/
Applications
/
Sublime
Text
Dev
.
app
/
Contents
/
SharedSupport
/
bin
/
subl
","
/
Applications
/
Visual
Studio
Code
.
app
/
Contents
/
MacOS
/
Electron
":"
code
","
/
Applications
/
Visual
Studio
Code
-
Insiders
.
app
/
Contents
/
MacOS
/
Electron
":"
code
-
insiders
","
/
Applications
/
AppCode
.
app
/
Contents
/
MacOS
/
appcode
":"
/
Applications
/
AppCode
.
app
/
Contents
/
MacOS
/
appcode
","
/
Applications
/
CLion
.
app
/
Contents
/
MacOS
/
clion
":"
/
Applications
/
CLion
.
app
/
Contents
/
MacOS
/
clion
","
/
Applications
/
IntelliJ
IDEA
.
app
/
Contents
/
MacOS
/
idea
":"
/
Applications
/
IntelliJ
IDEA
.
app
/
Contents
/
MacOS
/
idea
","
/
Applications
/
PhpStorm
.
app
/
Contents
/
MacOS
/
phpstorm
":"
/
Applications
/
PhpStorm
.
app
/
Contents
/
MacOS
/
phpstorm
","
/
Applications
/
PyCharm
.
app
/
Contents
/
MacOS
/
pycharm
":"
/
Applications
/
PyCharm
.
app
/
Contents
/
MacOS
/
pycharm
","
/
Applications
/
PyCharm
CE
.
app
/
Contents
/
MacOS
/
pycharm
":"
/
Applications
/
PyCharm
CE
.
app
/
Contents
/
MacOS
/
pycharm
","
/
Applications
/
RubyMine
.
app
/
Contents
/
MacOS
/
rubymine
":"
/
Applications
/
RubyMine
.
app
/
Contents
/
MacOS
/
rubymine
","
/
Applications
/
WebStorm
.
app
/
Contents
/
MacOS
/
webstorm
":"
/
Applications
/
WebStorm
.
app
/
Contents
/
MacOS
/
webstorm
"}}});
\ No newline at end of file
packages/next/compiled/launch-editor/package.json
deleted
100644 → 0
View file @
0e48ea39
{
"name"
:
"launch-editor"
,
"main"
:
"index.js"
,
"author"
:
"Evan You"
,
"license"
:
"MIT"
}
packages/next/package.json
View file @
33176806
...
...
@@ -192,7 +192,6 @@
"is-wsl"
:
"2.2.0"
,
"json5"
:
"2.1.3"
,
"jsonwebtoken"
:
"8.5.1"
,
"launch-editor"
:
"2.2.1"
,
"lodash.curry"
:
"4.1.1"
,
"lru-cache"
:
"5.1.1"
,
"nanoid"
:
"2.0.3"
,
...
...
packages/next/server/hot-reloader.ts
View file @
33176806
...
...
@@ -17,7 +17,6 @@ import {
}
from
'../next-server/lib/constants'
import
{
__ApiPreviewProps
}
from
'../next-server/server/api-utils'
import
{
route
}
from
'../next-server/server/router'
import
errorOverlayMiddleware
from
'./lib/error-overlay-middleware'
import
{
findPageFile
}
from
'./lib/find-page-file'
import
onDemandEntryHandler
,
{
entries
,
...
...
@@ -477,7 +476,6 @@ export default class HotReloader {
// must come before hotMiddleware
this
.
onDemandEntries
.
middleware
,
this
.
webpackHotMiddleware
.
middleware
,
errorOverlayMiddleware
({
dir
:
this
.
dir
}),
getOverlayMiddleware
({
rootDirectory
:
this
.
dir
,
stats
:
()
=>
this
.
stats
,
...
...
packages/next/server/lib/error-overlay-middleware.ts
deleted
100644 → 0
View file @
0e48ea39
import
url
from
'url'
import
launchEditor
from
'next/dist/compiled/launch-editor'
import
fs
from
'fs'
import
path
from
'path'
import
{
IncomingMessage
,
ServerResponse
}
from
'http'
export
default
function
errorOverlayMiddleware
(
options
:
{
dir
:
string
})
{
return
(
req
:
IncomingMessage
,
res
:
ServerResponse
,
next
:
Function
)
=>
{
if
(
req
.
url
!
.
startsWith
(
'/_next/development/open-stack-frame-in-editor'
))
{
const
query
=
url
.
parse
(
req
.
url
!
,
true
).
query
const
lineNumber
=
parseInt
(
query
.
lineNumber
as
string
,
10
)
||
1
const
colNumber
=
parseInt
(
query
.
colNumber
as
string
,
10
)
||
1
let
resolvedFileName
=
query
.
fileName
if
(
!
fs
.
existsSync
(
resolvedFileName
as
string
))
{
resolvedFileName
=
path
.
join
(
options
.
dir
,
resolvedFileName
as
string
)
}
launchEditor
(
`
${
resolvedFileName
}
:
${
lineNumber
}
:
${
colNumber
}
`
)
res
.
end
()
}
else
{
next
()
}
}
}
packages/next/taskfile.js
View file @
33176806
...
...
@@ -302,14 +302,6 @@ export async function ncc_jsonwebtoken(task, opts) {
.
target
(
'compiled/jsonwebtoken'
)
}
// eslint-disable-next-line camelcase
externals
[
'launch-editor'
]
=
'next/dist/compiled/launch-editor'
export
async
function
ncc_launch_editor
(
task
,
opts
)
{
await
task
.
source
(
opts
.
src
||
relative
(
__dirname
,
require
.
resolve
(
'launch-editor'
)))
.
ncc
({
packageName
:
'launch-editor'
,
externals
})
.
target
(
'compiled/launch-editor'
)
}
// eslint-disable-next-line camelcase
externals
[
'lodash.curry'
]
=
'next/dist/compiled/lodash.curry'
export
async
function
ncc_lodash_curry
(
task
,
opts
)
{
await
task
...
...
@@ -547,7 +539,6 @@ export async function ncc(task) {
'ncc_is_wsl'
,
'ncc_json5'
,
'ncc_jsonwebtoken'
,
'ncc_launch_editor'
,
'ncc_lodash_curry'
,
'ncc_lru_cache'
,
'ncc_nanoid'
,
...
...
packages/next/types/misc.d.ts
View file @
33176806
...
...
@@ -6,7 +6,6 @@ declare module 'cssnano-simple' {
const
cssnanoSimple
:
Plugin
<
{}
>
export
=
cssnanoSimple
}
declare
module
'launch-editor'
declare
module
'styled-jsx/server'
declare
module
'unfetch'
declare
module
'webpack/lib/GraphHelpers'
...
...
@@ -130,10 +129,6 @@ declare module 'next/dist/compiled/jsonwebtoken' {
import
m
from
'jsonwebtoken'
export
=
m
}
declare
module
'next/dist/compiled/launch-editor'
{
import
m
from
'launch-editor'
export
=
m
}
declare
module
'next/dist/compiled/lodash.curry'
{
import
m
from
'lodash.curry'
export
=
m
...
...
yarn.lock
View file @
33176806
...
...
@@ -5352,7 +5352,7 @@ chalk@2.4.0:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.
0, chalk@^2.3.
1, chalk@^2.4.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.0, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
dependencies:
...
...
@@ -10663,13 +10663,6 @@ last-call-webpack-plugin@^3.0.0:
lodash "^4.17.5"
webpack-sources "^1.1.0"
launch-editor@2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.2.1.tgz#871b5a3ee39d6680fcc26d37930b6eeda89db0ca"
dependencies:
chalk "^2.3.0"
shell-quote "^1.6.1"
lazy-cache@^0.2.3:
version "0.2.7"
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65"
...
...
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