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
ce830af2
Unverified
Commit
ce830af2
authored
May 10, 2020
by
Maxi Gimenez
Committed by
GitHub
May 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(create-next-app): add missing types (#12691)
parent
fcbffa36
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
create-app.ts
packages/create-next-app/create-app.ts
+1
-1
examples.ts
packages/create-next-app/helpers/examples.ts
+6
-1
install.ts
packages/create-next-app/helpers/install.ts
+1
-1
index.ts
packages/create-next-app/index.ts
+2
-2
No files found.
packages/create-next-app/create-app.ts
View file @
ce830af2
...
@@ -29,7 +29,7 @@ export async function createApp({
...
@@ -29,7 +29,7 @@ export async function createApp({
useNpm
:
boolean
useNpm
:
boolean
example
?:
string
example
?:
string
examplePath
?:
string
examplePath
?:
string
})
{
})
:
Promise
<
void
>
{
let
repoInfo
:
RepoInfo
|
undefined
let
repoInfo
:
RepoInfo
|
undefined
if
(
example
)
{
if
(
example
)
{
...
...
packages/create-next-app/helpers/examples.ts
View file @
ce830af2
...
@@ -47,7 +47,12 @@ export async function getRepoInfo(
...
@@ -47,7 +47,12 @@ export async function getRepoInfo(
}
}
}
}
export
function
hasRepo
({
username
,
name
,
branch
,
filePath
}:
RepoInfo
)
{
export
function
hasRepo
({
username
,
name
,
branch
,
filePath
,
}:
RepoInfo
):
Promise
<
boolean
>
{
const
contentsUrl
=
`https://api.github.com/repos/
${
username
}
/
${
name
}
/contents`
const
contentsUrl
=
`https://api.github.com/repos/
${
username
}
/
${
name
}
/contents`
const
packagePath
=
`
${
filePath
?
`/
${
filePath
}
`
:
''
}
/package.json`
const
packagePath
=
`
${
filePath
?
`/
${
filePath
}
`
:
''
}
/package.json`
...
...
packages/create-next-app/helpers/install.ts
View file @
ce830af2
...
@@ -5,7 +5,7 @@ export function install(
...
@@ -5,7 +5,7 @@ export function install(
root
:
string
,
root
:
string
,
dependencies
:
string
[]
|
null
,
dependencies
:
string
[]
|
null
,
{
useYarn
,
isOnline
}:
{
useYarn
:
boolean
;
isOnline
:
boolean
}
{
useYarn
,
isOnline
}:
{
useYarn
:
boolean
;
isOnline
:
boolean
}
)
{
)
:
Promise
<
void
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
command
:
string
let
command
:
string
let
args
:
string
[]
let
args
:
string
[]
...
...
packages/create-next-app/index.ts
View file @
ce830af2
...
@@ -43,7 +43,7 @@ const program = new Commander.Command(packageJson.name)
...
@@ -43,7 +43,7 @@ const program = new Commander.Command(packageJson.name)
.
allowUnknownOption
()
.
allowUnknownOption
()
.
parse
(
process
.
argv
)
.
parse
(
process
.
argv
)
async
function
run
()
{
async
function
run
()
:
Promise
<
void
>
{
if
(
typeof
projectPath
===
'string'
)
{
if
(
typeof
projectPath
===
'string'
)
{
projectPath
=
projectPath
.
trim
()
projectPath
=
projectPath
.
trim
()
}
}
...
@@ -177,7 +177,7 @@ async function run() {
...
@@ -177,7 +177,7 @@ async function run() {
const
update
=
checkForUpdate
(
packageJson
).
catch
(()
=>
null
)
const
update
=
checkForUpdate
(
packageJson
).
catch
(()
=>
null
)
async
function
notifyUpdate
()
{
async
function
notifyUpdate
()
:
Promise
<
void
>
{
try
{
try
{
const
res
=
await
update
const
res
=
await
update
if
(
res
?.
latest
)
{
if
(
res
?.
latest
)
{
...
...
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