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({
useNpm: boolean
example?: string
examplePath?: string
}) {
}): Promise<void> {
let repoInfo: RepoInfo | undefined
if (example) {
......
......@@ -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 packagePath = `${filePath ? `/${filePath}` : ''}/package.json`
......
......@@ -5,7 +5,7 @@ export function install(
root: string,
dependencies: string[] | null,
{ useYarn, isOnline }: { useYarn: boolean; isOnline: boolean }
) {
): Promise<void> {
return new Promise((resolve, reject) => {
let command: string
let args: string[]
......
......@@ -43,7 +43,7 @@ const program = new Commander.Command(packageJson.name)
.allowUnknownOption()
.parse(process.argv)
async function run() {
async function run(): Promise<void> {
if (typeof projectPath === 'string') {
projectPath = projectPath.trim()
}
......@@ -177,7 +177,7 @@ async function run() {
const update = checkForUpdate(packageJson).catch(() => null)
async function notifyUpdate() {
async function notifyUpdate(): Promise<void> {
try {
const res = await update
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