Unverified Commit ce830af2 authored by Maxi Gimenez's avatar Maxi Gimenez Committed by GitHub

chore(create-next-app): add missing types (#12691)

parent fcbffa36
...@@ -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) {
......
...@@ -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`
......
...@@ -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[]
......
...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment