From 36fb4462cc9c58171f8cd772f8a4717feb4f9abe Mon Sep 17 00:00:00 2001 From: benhancock Date: Thu, 17 Oct 2024 15:55:20 -0400 Subject: [PATCH] chore: rename new ReposFromGithub interface to GithubRepos Co-authored-by: Dylan Spyer --- src/commands/sites/sites-create-template.ts | 8 ++++---- src/utils/sites/utils.ts | 8 ++++---- src/utils/types.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/commands/sites/sites-create-template.ts b/src/commands/sites/sites-create-template.ts index f0c0b650351..a26401a62ea 100644 --- a/src/commands/sites/sites-create-template.ts +++ b/src/commands/sites/sites-create-template.ts @@ -13,15 +13,15 @@ import { configureRepo } from '../../utils/init/config.js' import { createRepo, getTemplatesFromGitHub, validateTemplate } from '../../utils/sites/utils.js' import { track } from '../../utils/telemetry/index.js' import BaseCommand from '../base-command.js' -import { RepoFromGithub, Template } from '../../utils/types.js' +import { GithubRepo, Template } from '../../utils/types.js' import { getSiteNameInput } from './sites-create.js' export const fetchTemplates = async (token: string): Promise => { - const templatesFromGithubOrg: RepoFromGithub[] = await getTemplatesFromGitHub(token) + const templatesFromGithubOrg: GithubRepo[] = await getTemplatesFromGitHub(token) return templatesFromGithubOrg - .filter((repo: RepoFromGithub) => !repo.archived && !repo.disabled) - .map((template: RepoFromGithub) => ({ + .filter((repo: GithubRepo) => !repo.archived && !repo.disabled) + .map((template: GithubRepo) => ({ name: template.name, sourceCodeUrl: template.html_url, slug: template.full_name, diff --git a/src/utils/sites/utils.ts b/src/utils/sites/utils.ts index 2f270f8abf1..61667f50050 100644 --- a/src/utils/sites/utils.ts +++ b/src/utils/sites/utils.ts @@ -1,8 +1,8 @@ import fetch from 'node-fetch' import { error } from '../../utils/command-helpers.js' -import { RepoFromGithub } from '../../utils/types.js' +import { GithubRepo } from '../../utils/types.js' -export const getTemplatesFromGitHub = async (token: string): Promise => { +export const getTemplatesFromGitHub = async (token: string): Promise => { const getPublicGitHubReposFromOrg = new URL(`https://api.github.com/orgs/netlify-templates/repos`) // GitHub returns 30 by default and we want to avoid our limit // due to our archived repositories at any given time @@ -13,7 +13,7 @@ export const getTemplatesFromGitHub = async (token: string): Promise