From 920df83cad4851d8d8f6b6f62c0b29079e4ef33e Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Jan 2023 11:01:08 +0000 Subject: [PATCH 1/6] add lint:functions script and make it pass --- functions/ap/users/[id]/followers/page.ts | 4 ---- functions/ap/users/[id]/following/page.ts | 4 ---- functions/ap/users/[id]/inbox.ts | 1 - functions/ap/users/[id]/outbox.ts | 5 +---- functions/ap/users/[id]/outbox/page.ts | 1 + functions/api/v1/accounts/[id].ts | 1 - functions/api/v1/accounts/[id]/statuses.ts | 5 +++-- functions/api/v1/accounts/relationships.ts | 2 +- functions/api/v1/accounts/update_credentials.ts | 2 +- functions/api/v1/apps.ts | 4 +--- functions/api/v1/notifications.ts | 3 --- functions/api/v1/notifications/[id].ts | 1 - functions/api/v1/push/subscription.ts | 4 ---- functions/api/v1/statuses.ts | 5 +---- functions/api/v1/statuses/[id].ts | 6 +----- functions/api/v1/statuses/[id]/favourite.ts | 4 +--- functions/api/v1/statuses/[id]/reblog.ts | 4 +--- functions/api/v1/timelines/home.ts | 7 +------ functions/api/v1/timelines/public.ts | 3 ++- functions/first-login.ts | 4 +--- functions/oauth/authorize.ts | 4 +--- functions/oauth/token.ts | 2 +- functions/start-instance-test-access.ts | 11 +++++------ functions/start-instance.ts | 6 ++---- package.json | 1 + 25 files changed, 26 insertions(+), 68 deletions(-) diff --git a/functions/ap/users/[id]/followers/page.ts b/functions/ap/users/[id]/followers/page.ts index a77cc82..4b52f49 100644 --- a/functions/ap/users/[id]/followers/page.ts +++ b/functions/ap/users/[id]/followers/page.ts @@ -1,13 +1,9 @@ import { parseHandle } from 'wildebeest/backend/src/utils/parse' import { getFollowers } from 'wildebeest/backend/src/mastodon/follow' -import * as objects from 'wildebeest/backend/src/activitypub/objects' -import type { Activity } from 'wildebeest/backend/src/activitypub/activities' import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' import { actorURL } from 'wildebeest/backend/src/activitypub/actors' import type { ContextData } from 'wildebeest/backend/src/types/context' import type { Env } from 'wildebeest/backend/src/types/env' -import type { Note } from 'wildebeest/backend/src/activitypub/objects/note' -import * as activityCreate from 'wildebeest/backend/src/activitypub/activities/create' export const onRequest: PagesFunction = async ({ request, env, params }) => { const domain = new URL(request.url).hostname diff --git a/functions/ap/users/[id]/following/page.ts b/functions/ap/users/[id]/following/page.ts index 43164c2..c4a44da 100644 --- a/functions/ap/users/[id]/following/page.ts +++ b/functions/ap/users/[id]/following/page.ts @@ -1,13 +1,9 @@ import { parseHandle } from 'wildebeest/backend/src/utils/parse' import { getFollowingId } from 'wildebeest/backend/src/mastodon/follow' -import * as objects from 'wildebeest/backend/src/activitypub/objects' -import type { Activity } from 'wildebeest/backend/src/activitypub/activities' import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' import { actorURL } from 'wildebeest/backend/src/activitypub/actors' import type { ContextData } from 'wildebeest/backend/src/types/context' import type { Env } from 'wildebeest/backend/src/types/env' -import type { Note } from 'wildebeest/backend/src/activitypub/objects/note' -import * as activityCreate from 'wildebeest/backend/src/activitypub/activities/create' export const onRequest: PagesFunction = async ({ request, env, params }) => { const domain = new URL(request.url).hostname diff --git a/functions/ap/users/[id]/inbox.ts b/functions/ap/users/[id]/inbox.ts index b283851..d9b8acf 100644 --- a/functions/ap/users/[id]/inbox.ts +++ b/functions/ap/users/[id]/inbox.ts @@ -3,7 +3,6 @@ import * as activityHandler from 'wildebeest/backend/src/activitypub/activities/ import type { Env } from 'wildebeest/backend/src/types/env' import * as actors from 'wildebeest/backend/src/activitypub/actors' import type { Activity } from 'wildebeest/backend/src/activitypub/activities' -import * as activities from 'wildebeest/backend/src/activitypub/activities' import { actorURL } from 'wildebeest/backend/src/activitypub/actors' import { parseRequest } from 'wildebeest/backend/src/utils/httpsigjs/parser' import { fetchKey, verifySignature } from 'wildebeest/backend/src/utils/httpsigjs/verifier' diff --git a/functions/ap/users/[id]/outbox.ts b/functions/ap/users/[id]/outbox.ts index 811a7c7..a6be63a 100644 --- a/functions/ap/users/[id]/outbox.ts +++ b/functions/ap/users/[id]/outbox.ts @@ -1,12 +1,8 @@ import { parseHandle } from 'wildebeest/backend/src/utils/parse' -import * as objects from 'wildebeest/backend/src/activitypub/objects' -import type { Activity } from 'wildebeest/backend/src/activitypub/activities' import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' import { actorURL } from 'wildebeest/backend/src/activitypub/actors' import type { ContextData } from 'wildebeest/backend/src/types/context' import type { Env } from 'wildebeest/backend/src/types/env' -import type { Note } from 'wildebeest/backend/src/activitypub/objects/note' -import * as activityCreate from 'wildebeest/backend/src/activitypub/activities/create' export const onRequest: PagesFunction = async ({ request, env, params }) => { const domain = new URL(request.url).hostname @@ -17,6 +13,7 @@ const headers = { 'content-type': 'application/json; charset=utf-8', } +// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO: use userKEK export async function handleRequest(domain: string, db: D1Database, id: string, userKEK: string): Promise { const handle = parseHandle(id) diff --git a/functions/ap/users/[id]/outbox/page.ts b/functions/ap/users/[id]/outbox/page.ts index bbd265f..543f7a9 100644 --- a/functions/ap/users/[id]/outbox/page.ts +++ b/functions/ap/users/[id]/outbox/page.ts @@ -21,6 +21,7 @@ const headers = { const DEFAULT_LIMIT = 20 +// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO: use userKEK export async function handleRequest(domain: string, db: D1Database, id: string, userKEK: string): Promise { const handle = parseHandle(id) diff --git a/functions/api/v1/accounts/[id].ts b/functions/api/v1/accounts/[id].ts index 85db96a..3489894 100644 --- a/functions/api/v1/accounts/[id].ts +++ b/functions/api/v1/accounts/[id].ts @@ -4,7 +4,6 @@ import { actorURL } from 'wildebeest/backend/src/activitypub/actors' import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' import type { ContextData } from 'wildebeest/backend/src/types/context' import type { Env } from 'wildebeest/backend/src/types/env' -import type { MastodonAccount } from 'wildebeest/backend/src/types/account' import { parseHandle } from 'wildebeest/backend/src/utils/parse' import type { Handle } from 'wildebeest/backend/src/utils/parse' import { queryAcct } from 'wildebeest/backend/src/webfinger/index' diff --git a/functions/api/v1/accounts/[id]/statuses.ts b/functions/api/v1/accounts/[id]/statuses.ts index 22d009d..49d91ee 100644 --- a/functions/api/v1/accounts/[id]/statuses.ts +++ b/functions/api/v1/accounts/[id]/statuses.ts @@ -2,13 +2,12 @@ import type { Env } from 'wildebeest/backend/src/types/env' import type { Activity } from 'wildebeest/backend/src/activitypub/activities' import type { Note } from 'wildebeest/backend/src/activitypub/objects/note' import { loadExternalMastodonAccount } from 'wildebeest/backend/src/mastodon/account' -import type { Object } from 'wildebeest/backend/src/activitypub/objects' import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' import { makeGetActorAsId, makeGetObjectAsId } from 'wildebeest/backend/src/activitypub/activities/handle' import { parseHandle } from 'wildebeest/backend/src/utils/parse' import type { Handle } from 'wildebeest/backend/src/utils/parse' import type { ContextData } from 'wildebeest/backend/src/types/context' -import type { MastodonAccount, MastodonStatus } from 'wildebeest/backend/src/types' +import type { MastodonStatus } from 'wildebeest/backend/src/types' import { toMastodonStatusFromObject } from 'wildebeest/backend/src/mastodon/status' import * as objects from 'wildebeest/backend/src/activitypub/objects' import { actorURL } from 'wildebeest/backend/src/activitypub/actors' @@ -41,6 +40,7 @@ export async function handleRequest(request: Request, db: D1Database, id: string } } +// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO: use userKEK async function getRemoteStatuses(request: Request, handle: Handle, db: D1Database, userKEK: string): Promise { const url = new URL(request.url) const domain = url.hostname @@ -61,6 +61,7 @@ async function getRemoteStatuses(request: Request, handle: Handle, db: D1Databas const activities = await outbox.get(actor) + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO: use account const account = await loadExternalMastodonAccount(acct, actor) const promises = activities.items.map(async (activity: Activity) => { diff --git a/functions/api/v1/accounts/relationships.ts b/functions/api/v1/accounts/relationships.ts index 4f74737..6f61e5e 100644 --- a/functions/api/v1/accounts/relationships.ts +++ b/functions/api/v1/accounts/relationships.ts @@ -5,7 +5,7 @@ import type { Env } from 'wildebeest/backend/src/types/env' import type { ContextData } from 'wildebeest/backend/src/types/context' import { getFollowingAcct, getFollowingRequestedAcct } from 'wildebeest/backend/src/mastodon/follow' -export const onRequest: PagesFunction = async ({ request, env, params, data }) => { +export const onRequest: PagesFunction = async ({ request, env, data }) => { return handleRequest(request, env.DATABASE, data.connectedActor) } diff --git a/functions/api/v1/accounts/update_credentials.ts b/functions/api/v1/accounts/update_credentials.ts index f29837f..02dcf1e 100644 --- a/functions/api/v1/accounts/update_credentials.ts +++ b/functions/api/v1/accounts/update_credentials.ts @@ -9,7 +9,7 @@ import * as images from 'wildebeest/backend/src/media/image' import type { Env } from 'wildebeest/backend/src/types/env' import type { Actor } from 'wildebeest/backend/src/activitypub/actors' import { updateActorProperty } from 'wildebeest/backend/src/activitypub/actors' -import type { CredentialAccount, MastodonAccount } from 'wildebeest/backend/src/types/account' +import type { CredentialAccount } from 'wildebeest/backend/src/types/account' import type { ContextData } from 'wildebeest/backend/src/types/context' import { loadLocalMastodonAccount } from 'wildebeest/backend/src/mastodon/account' diff --git a/functions/api/v1/apps.ts b/functions/api/v1/apps.ts index 828aa0b..de7e186 100644 --- a/functions/api/v1/apps.ts +++ b/functions/api/v1/apps.ts @@ -1,6 +1,4 @@ import { ContextData } from 'wildebeest/backend/src/types/context' -import { b64ToUrlEncoded, exportPublicKeyPair } from 'wildebeest/backend/src/webpush/util' -import type { JWK } from 'wildebeest/backend/src/webpush/jwk' import { Env } from 'wildebeest/backend/src/types/env' import { createClient } from 'wildebeest/backend/src/mastodon/client' import { getVAPIDKeys, VAPIDPublicKey } from 'wildebeest/backend/src/mastodon/subscription' @@ -12,7 +10,7 @@ type AppsPost = { scopes: string } -export const onRequest: PagesFunction = async ({ request, env, data }) => { +export const onRequest: PagesFunction = async ({ request, env }) => { return handleRequest(env.DATABASE, request) } diff --git a/functions/api/v1/notifications.ts b/functions/api/v1/notifications.ts index 8aaf6db..6c1195e 100644 --- a/functions/api/v1/notifications.ts +++ b/functions/api/v1/notifications.ts @@ -1,11 +1,8 @@ // https://docs.joinmastodon.org/methods/notifications/#get import type { Env } from 'wildebeest/backend/src/types/env' -import * as objects from 'wildebeest/backend/src/activitypub/objects' import type { Person } from 'wildebeest/backend/src/activitypub/actors' import type { ContextData } from 'wildebeest/backend/src/types/context' -import { getNotifications } from 'wildebeest/backend/src/mastodon/notification' -import type { MastodonStatus } from 'wildebeest/backend/src/types' export const onRequest: PagesFunction = async ({ request, env, data }) => { return handleRequest(request, env.KV_CACHE, data.connectedActor) diff --git a/functions/api/v1/notifications/[id].ts b/functions/api/v1/notifications/[id].ts index d4b05a7..c698826 100644 --- a/functions/api/v1/notifications/[id].ts +++ b/functions/api/v1/notifications/[id].ts @@ -4,7 +4,6 @@ import type { Notification } from 'wildebeest/backend/src/types/notification' import { urlToHandle } from 'wildebeest/backend/src/utils/handle' import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' import { loadExternalMastodonAccount } from 'wildebeest/backend/src/mastodon/account' -import * as objects from 'wildebeest/backend/src/activitypub/objects' import type { Person } from 'wildebeest/backend/src/activitypub/actors' import type { Env } from 'wildebeest/backend/src/types/env' import type { ContextData } from 'wildebeest/backend/src/types/context' diff --git a/functions/api/v1/push/subscription.ts b/functions/api/v1/push/subscription.ts index 99f71da..8dc85fa 100644 --- a/functions/api/v1/push/subscription.ts +++ b/functions/api/v1/push/subscription.ts @@ -5,10 +5,6 @@ import type { CreateRequest } from 'wildebeest/backend/src/mastodon/subscription import { ContextData } from 'wildebeest/backend/src/types/context' import { Env } from 'wildebeest/backend/src/types/env' import * as errors from 'wildebeest/backend/src/errors' -import type { JWK } from 'wildebeest/backend/src/webpush/jwk' -import type { WebPushInfos, WebPushMessage, WebPushResult } from 'wildebeest/backend/src/webpush/webpushinfos' -import { b64ToUrlEncoded, exportPublicKeyPair } from 'wildebeest/backend/src/webpush/util' -import { generateWebPushMessage } from 'wildebeest/backend/src/webpush' import { getVAPIDKeys, VAPIDPublicKey } from 'wildebeest/backend/src/mastodon/subscription' export const onRequestGet: PagesFunction = async ({ request, env, data }) => { diff --git a/functions/api/v1/statuses.ts b/functions/api/v1/statuses.ts index 6abc4b3..bc46a29 100644 --- a/functions/api/v1/statuses.ts +++ b/functions/api/v1/statuses.ts @@ -1,7 +1,6 @@ // https://docs.joinmastodon.org/methods/statuses/#create import { loadLocalMastodonAccount } from 'wildebeest/backend/src/mastodon/account' -import type { MediaAttachment } from 'wildebeest/backend/src/types/media' import { createPublicNote } from 'wildebeest/backend/src/activitypub/objects/note' import type { Document } from 'wildebeest/backend/src/activitypub/objects' import { getObjectByMastodonId } from 'wildebeest/backend/src/activitypub/objects' @@ -9,8 +8,6 @@ import { getMentions } from 'wildebeest/backend/src/mastodon/status' import * as activities from 'wildebeest/backend/src/activitypub/activities/create' import type { Env } from 'wildebeest/backend/src/types/env' import type { ContextData } from 'wildebeest/backend/src/types/context' -import type { MastodonAccount } from 'wildebeest/backend/src/types/account' -import type { MastodonStatus } from 'wildebeest/backend/src/types/status' import { queryAcct } from 'wildebeest/backend/src/webfinger' import { deliverFollowers, deliverToActor } from 'wildebeest/backend/src/activitypub/deliver' import { addObjectInOutbox } from 'wildebeest/backend/src/activitypub/actors/outbox' @@ -47,7 +44,7 @@ export async function handleRequest( return new Response('', { status: 400 }) } - let mediaAttachments: Array = [] + const mediaAttachments: Array = [] if (body.media_ids && body.media_ids.length > 0) { for (let i = 0, len = body.media_ids.length; i < len; i++) { const id = body.media_ids[i] diff --git a/functions/api/v1/statuses/[id].ts b/functions/api/v1/statuses/[id].ts index 00f1e1b..e9e4b1d 100644 --- a/functions/api/v1/statuses/[id].ts +++ b/functions/api/v1/statuses/[id].ts @@ -1,15 +1,11 @@ // https://docs.joinmastodon.org/methods/statuses/#get import type { UUID } from 'wildebeest/backend/src/types' -import { urlToHandle } from 'wildebeest/backend/src/utils/handle' -import { parseHandle } from 'wildebeest/backend/src/utils/parse' -import type { Person } from 'wildebeest/backend/src/activitypub/actors' import type { ContextData } from 'wildebeest/backend/src/types/context' -import { getFollowers } from 'wildebeest/backend/src/mastodon/follow' import { getMastodonStatusById } from 'wildebeest/backend/src/mastodon/status' import type { Env } from 'wildebeest/backend/src/types/env' -export const onRequest: PagesFunction = async ({ params, request, env, data }) => { +export const onRequest: PagesFunction = async ({ params, env }) => { return handleRequest(env.DATABASE, params.id as UUID) } diff --git a/functions/api/v1/statuses/[id]/favourite.ts b/functions/api/v1/statuses/[id]/favourite.ts index 17cb920..36f7ea8 100644 --- a/functions/api/v1/statuses/[id]/favourite.ts +++ b/functions/api/v1/statuses/[id]/favourite.ts @@ -1,7 +1,6 @@ // https://docs.joinmastodon.org/methods/statuses/#favourite import type { Env } from 'wildebeest/backend/src/types/env' -import { parseHandle } from 'wildebeest/backend/src/utils/parse' import { insertLike } from 'wildebeest/backend/src/mastodon/like' import { getSigningKey } from 'wildebeest/backend/src/mastodon/account' import { deliverToActor } from 'wildebeest/backend/src/activitypub/deliver' @@ -11,10 +10,9 @@ import * as like from 'wildebeest/backend/src/activitypub/activities/like' import { getObjectByMastodonId } from 'wildebeest/backend/src/activitypub/objects' import type { Note } from 'wildebeest/backend/src/activitypub/objects/note' import type { ContextData } from 'wildebeest/backend/src/types/context' -import { queryAcct } from 'wildebeest/backend/src/webfinger' import { toMastodonStatusFromObject } from 'wildebeest/backend/src/mastodon/status' -export const onRequest: PagesFunction = async ({ request, env, data, params }) => { +export const onRequest: PagesFunction = async ({ env, data, params }) => { return handleRequest(env.DATABASE, params.id as string, data.connectedActor, env.userKEK) } diff --git a/functions/api/v1/statuses/[id]/reblog.ts b/functions/api/v1/statuses/[id]/reblog.ts index 3ba7090..fe89945 100644 --- a/functions/api/v1/statuses/[id]/reblog.ts +++ b/functions/api/v1/statuses/[id]/reblog.ts @@ -1,7 +1,6 @@ // https://docs.joinmastodon.org/methods/statuses/#boost import type { Env } from 'wildebeest/backend/src/types/env' -import { parseHandle } from 'wildebeest/backend/src/utils/parse' import { addObjectInOutbox } from 'wildebeest/backend/src/activitypub/actors/outbox' import { insertReblog } from 'wildebeest/backend/src/mastodon/reblog' import { getSigningKey } from 'wildebeest/backend/src/mastodon/account' @@ -12,10 +11,9 @@ import * as announce from 'wildebeest/backend/src/activitypub/activities/announc import { getObjectByMastodonId } from 'wildebeest/backend/src/activitypub/objects' import type { Note } from 'wildebeest/backend/src/activitypub/objects/note' import type { ContextData } from 'wildebeest/backend/src/types/context' -import { queryAcct } from 'wildebeest/backend/src/webfinger' import { toMastodonStatusFromObject } from 'wildebeest/backend/src/mastodon/status' -export const onRequest: PagesFunction = async ({ request, env, data, params }) => { +export const onRequest: PagesFunction = async ({ env, data, params }) => { return handleRequest(env.DATABASE, params.id as string, data.connectedActor, env.userKEK) } diff --git a/functions/api/v1/timelines/home.ts b/functions/api/v1/timelines/home.ts index 5f8209e..7296a01 100644 --- a/functions/api/v1/timelines/home.ts +++ b/functions/api/v1/timelines/home.ts @@ -1,11 +1,6 @@ import type { Env } from 'wildebeest/backend/src/types/env' import type { ContextData } from 'wildebeest/backend/src/types/context' import type { Actor } from 'wildebeest/backend/src/activitypub/actors/' -import * as objects from 'wildebeest/backend/src/activitypub/objects/' -import { urlToHandle } from 'wildebeest/backend/src/utils/handle' -import { getHomeTimeline } from 'wildebeest/backend/src/mastodon/timeline' -import { getPersonById } from 'wildebeest/backend/src/activitypub/actors' -import type { MastodonAccount, MastodonStatus } from 'wildebeest/backend/src/types/' import * as errors from 'wildebeest/backend/src/errors' const headers = { @@ -14,7 +9,7 @@ const headers = { 'content-type': 'application/json; charset=utf-8', } -export const onRequest: PagesFunction = async ({ request, env, params, data }) => { +export const onRequest: PagesFunction = async ({ request, env, data }) => { return handleRequest(request, env.KV_CACHE, data.connectedActor) } diff --git a/functions/api/v1/timelines/public.ts b/functions/api/v1/timelines/public.ts index ada9e62..d68249d 100644 --- a/functions/api/v1/timelines/public.ts +++ b/functions/api/v1/timelines/public.ts @@ -8,7 +8,7 @@ const headers = { 'content-type': 'application/json; charset=utf-8', } -export const onRequest: PagesFunction = async ({ request, env, params, data }) => { +export const onRequest: PagesFunction = async ({ request, env }) => { const { searchParams } = new URL(request.url) const local = searchParams.get('local') === 'true' const remote = searchParams.get('remote') === 'true' @@ -21,6 +21,7 @@ export const onRequest: PagesFunction = async ({ request, export async function handleRequest( domain: string, db: D1Database, + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO: use only_media { local = false, remote = false, only_media = false, offset = 0 } = {} ): Promise { let localParam = LocalPreference.NotSet diff --git a/functions/first-login.ts b/functions/first-login.ts index bef2a96..f53e603 100644 --- a/functions/first-login.ts +++ b/functions/first-login.ts @@ -2,11 +2,9 @@ // especially) import type { Env } from 'wildebeest/backend/src/types/env' import type { ContextData } from 'wildebeest/backend/src/types/context' -import type { Person } from 'wildebeest/backend/src/activitypub/actors' import { createPerson } from 'wildebeest/backend/src/activitypub/actors' -import * as errors from 'wildebeest/backend/src/errors' -export const onRequestPost: PagesFunction = async ({ request, env, data }) => { +export const onRequestPost: PagesFunction = async ({ request, env }) => { return handlePostRequest(request, env.DATABASE, env.userKEK) } diff --git a/functions/oauth/authorize.ts b/functions/oauth/authorize.ts index 32201db..e707ad6 100644 --- a/functions/oauth/authorize.ts +++ b/functions/oauth/authorize.ts @@ -10,7 +10,7 @@ import { getPersonByEmail } from 'wildebeest/backend/src/activitypub/actors' // Extract the JWT token sent by Access (running before us). const extractJWTFromRequest = (request: Request) => request.headers.get('Cf-Access-Jwt-Assertion') || '' -export const onRequest: PagesFunction = async ({ data, request, env }) => { +export const onRequest: PagesFunction = async ({ request, env }) => { return handleRequest(request, env.DATABASE, env.userKEK, env.ACCESS_AUTH_DOMAIN, env.ACCESS_AUD) } @@ -58,8 +58,6 @@ export async function handleRequest( return new Response('', { status: 403 }) } - const scope = url.searchParams.get('scope') || '' - const jwt = extractJWTFromRequest(request) const validate = access.generateValidator({ jwt, domain: accessDomain, aud: accessAud }) await validate(request) diff --git a/functions/oauth/token.ts b/functions/oauth/token.ts index 5b00d31..ca84436 100644 --- a/functions/oauth/token.ts +++ b/functions/oauth/token.ts @@ -9,7 +9,7 @@ type Body = { code: string | null } -export const onRequest: PagesFunction = async ({ params, request, env }) => { +export const onRequest: PagesFunction = async ({ request, env }) => { return handleRequest(env.DATABASE, request) } diff --git a/functions/start-instance-test-access.ts b/functions/start-instance-test-access.ts index eaee63e..c2c182a 100644 --- a/functions/start-instance-test-access.ts +++ b/functions/start-instance-test-access.ts @@ -3,15 +3,14 @@ import * as access from 'wildebeest/backend/src/access' import * as errors from 'wildebeest/backend/src/errors' import { parse } from 'cookie' import type { ContextData } from 'wildebeest/backend/src/types/context' -import type { InstanceConfig } from 'wildebeest/backend/src/config' -import { configure } from 'wildebeest/backend/src/config' -export const onRequestGet: PagesFunction = async ({ request, data, env }) => { - return handleGetRequest(env.DATABASE, request) +export const onRequestGet: PagesFunction = async ({ request, env }) => { + return handleGetRequest(env, request) } // Route to test if Access has been configured properly -export async function handleGetRequest(db: D1Database, request: Request): Promise { +export async function handleGetRequest(env: Env, request: Request): Promise { + const db = env.DATABASE const query = ` SELECT * FROM instance_config WHERE key IN ('accessDomain', 'accessAud') ` @@ -37,7 +36,7 @@ export async function handleGetRequest(db: D1Database, request: Request): Promis const domain = env.ACCESS_AUTH_DOMAIN const validator = access.generateValidator({ jwt, domain, aud: env.ACCESS_AUD }) - const { payload } = await validator(request) + await validator(request) const identity = await access.getIdentity({ jwt, domain }) if (!identity) { diff --git a/functions/start-instance.ts b/functions/start-instance.ts index 803adac..e9172f6 100644 --- a/functions/start-instance.ts +++ b/functions/start-instance.ts @@ -3,7 +3,6 @@ import type { Env } from 'wildebeest/backend/src/types/env' import * as errors from 'wildebeest/backend/src/errors' import * as access from 'wildebeest/backend/src/access' import { parse } from 'cookie' -import type { ContextData } from 'wildebeest/backend/src/types/context' import type { InstanceConfig } from 'wildebeest/backend/src/config' import * as config from 'wildebeest/backend/src/config' @@ -12,11 +11,10 @@ export const onRequestPost: PagesFunction = async ({ request, env }) = } export const onRequestGet: PagesFunction = async (ctx) => { - const { request, env, next } = ctx + const { request, env } = ctx const cookie = parse(request.headers.get('Cookie') || '') const jwt = cookie['CF_Authorization'] if (!jwt) { - const { hostname } = new URL(request.url) const url = access.generateLoginURL({ redirectURL: new URL('/start-instance', 'https://' + env.DOMAIN), domain: env.ACCESS_AUTH_DOMAIN, @@ -44,7 +42,7 @@ export async function handlePostRequest( } const validator = access.generateValidator({ jwt, domain: accessDomain, aud: accessAud }) - const { payload } = await validator(request) + await validator(request) const identity = await access.getIdentity({ jwt, domain: accessDomain }) if (!identity) { diff --git a/package.json b/package.json index b8ee622..f46d554 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "test": "NODE_OPTIONS=--experimental-vm-modules yarn jest", "lint": "npx eslint .", "lint:be": "npx eslint backend", + "lint:functions": "npx eslint functions", "build": "yarn --cwd frontend install && yarn --cwd frontend build", "d1": "NO_D1_WARNING=true wrangler d1", "pages": "NO_D1_WARNING=true wrangler pages", From d7dba3dc25a1e1fee97bf93ef0908653b21137f2 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Jan 2023 11:03:05 +0000 Subject: [PATCH 2/6] move be eslint rules we want off before linting comment --- .eslintrc.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9fb0ab7..febab33 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -16,6 +16,8 @@ module.exports = { 'no-var': 'error', '@typescript-eslint/no-unsafe-return': 'error', '@typescript-eslint/no-unused-vars': 'error', + 'no-console': 'off', + 'no-constant-condition': 'off', /* Note: the following rules have been set to off so that linting can pass with the current code, but we need to gradually @@ -26,13 +28,11 @@ module.exports = { '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/restrict-plus-operands': 'off', - 'no-constant-condition': 'off', '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/require-await': 'off', '@typescript-eslint/restrict-template-expressions': 'off', '@typescript-eslint/no-misused-promises': 'off', '@typescript-eslint/no-unnecessary-type-assertion': 'off', - 'no-console': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-inferrable-types': 'off', '@typescript-eslint/no-non-null-assertion': 'off', From 822fd9de6068a5839e00ba11b988ae71afc7ce11 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Jan 2023 11:05:23 +0000 Subject: [PATCH 3/6] add lint:frontend script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f46d554..20554a1 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "pretty": "npx prettier --list-different './**/*.ts'", "test": "NODE_OPTIONS=--experimental-vm-modules yarn jest", "lint": "npx eslint .", + "lint:frontend": "npm --prefix frontend run lint", "lint:be": "npx eslint backend", "lint:functions": "npx eslint functions", "build": "yarn --cwd frontend install && yarn --cwd frontend build", From 68cf43df19132bd5a4c6d42b9416d3471327163b Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Jan 2023 11:17:21 +0000 Subject: [PATCH 4/6] make backend linting pass --- backend/src/mastodon/status.ts | 2 -- backend/src/utils/body.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/mastodon/status.ts b/backend/src/mastodon/status.ts index cfb94bf..c6ddfe1 100644 --- a/backend/src/mastodon/status.ts +++ b/backend/src/mastodon/status.ts @@ -9,8 +9,6 @@ import * as media from 'wildebeest/backend/src/media/' import type { MastodonStatus } from 'wildebeest/backend/src/types' import { parseHandle } from '../utils/parse' import { urlToHandle } from '../utils/handle' -import { getLikes } from './like' -import { getReblogs } from './reblog' export function getMentions(input: string): Array { const mentions: Array = [] diff --git a/backend/src/utils/body.ts b/backend/src/utils/body.ts index 9c2fcbb..18e4fee 100644 --- a/backend/src/utils/body.ts +++ b/backend/src/utils/body.ts @@ -10,7 +10,7 @@ export async function readBody(request: Request): Promise { return request.json() } else { const form = await request.formData() - let out: any = {} + const out: any = {} for (const [key, value] of form) { out[key] = value From 00463b233a5eb9a90493dff2e29c4ae53234388b Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Jan 2023 11:17:32 +0000 Subject: [PATCH 5/6] update lint script --- package.json | 3 +- yarn.lock | 555 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 553 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 20554a1..9bc736d 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "eslint": "^8.29.0", "jest": "^29.3.1", "jest-environment-miniflare": "^2.11.0", + "npm-run-all": "^4.1.5", "prettier": "^2.8.1", "ts-jest": "^29.0.3", "typescript": "^4.9.4", @@ -26,7 +27,7 @@ "scripts": { "pretty": "npx prettier --list-different './**/*.ts'", "test": "NODE_OPTIONS=--experimental-vm-modules yarn jest", - "lint": "npx eslint .", + "lint": "run-s lint:* --print-label", "lint:frontend": "npm --prefix frontend run lint", "lint:be": "npx eslint backend", "lint:functions": "npx eslint functions", diff --git a/yarn.lock b/yarn.lock index 817488a..2aa3473 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1127,6 +1127,11 @@ array-union@^2.1.0: resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + babel-jest@^29.3.1: version "29.3.1" resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.3.1.tgz" @@ -1297,6 +1302,14 @@ busboy@^1.6.0: dependencies: streamsearch "^1.1.0" +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" @@ -1317,7 +1330,7 @@ caniuse-lite@^1.0.30001400: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001436.tgz" integrity sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg== -chalk@^2.0.0: +chalk@^2.0.0, chalk@^2.4.1: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1457,6 +1470,17 @@ cron-schedule@^3.0.4: resolved "https://registry.npmjs.org/cron-schedule/-/cron-schedule-3.0.6.tgz" integrity sha512-izfGgKyzzIyLaeb1EtZ3KbglkS6AKp9cv7LxmiyoOu+fXfol1tQDC0Cof0enVZGNtudTHW+3lfuW9ZkLQss4Wg== +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" @@ -1505,6 +1529,14 @@ deepmerge@^4.2.2: resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== +define-properties@^1.1.3, define-properties@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + detect-libc@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz" @@ -1568,6 +1600,62 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.19.0, es-abstract@^1.20.4: + version "1.21.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.0.tgz#dd1b69ea5bfc3c27199c9753efd4de015102c252" + integrity sha512-GUGtW7eXQay0c+PRq0sGIKSdaBorfVqsCMhGHo4elP7YVqZu9nCZS4UkK4gv71gOWNMra/PaSKD3ao1oWExO0g== + dependencies: + call-bind "^1.0.2" + es-set-tostringtag "^2.0.0" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.1.3" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.4" + is-array-buffer "^3.0.0" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.2" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + safe-regex-test "^1.0.0" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" + +es-set-tostringtag@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + esbuild-android-64@0.14.51: version "0.14.51" resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.51.tgz#414a087cb0de8db1e347ecca6c8320513de433db" @@ -1979,6 +2067,13 @@ flatted@^3.1.0: resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + fs-constants@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" @@ -1999,6 +2094,21 @@ function-bind@^1.1.1: resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" @@ -2009,6 +2119,15 @@ get-caller-file@^2.0.5: resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" @@ -2019,6 +2138,14 @@ get-stream@^6.0.0, get-stream@^6.0.1: resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + github-from-package@0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" @@ -2062,6 +2189,13 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" @@ -2074,7 +2208,14 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -graceful-fs@^4.2.9: +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +graceful-fs@^4.1.2, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -2084,6 +2225,11 @@ grapheme-splitter@^1.0.4: resolved "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" @@ -2094,6 +2240,30 @@ has-flag@^4.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" @@ -2101,6 +2271,11 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +hosted-git-info@^2.1.4: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" @@ -2180,11 +2355,36 @@ ini@~1.3.0: resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +internal-slot@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.4.tgz#8551e7baf74a7a6ba5f749cfb16aa60722f0d6f3" + integrity sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + side-channel "^1.0.4" + +is-array-buffer@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.1.tgz#deb1db4fcae48308d54ef2442706c0393997052a" + integrity sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" @@ -2192,6 +2392,19 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" @@ -2199,6 +2412,13 @@ is-core-module@^2.9.0: dependencies: has "^1.0.3" +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" @@ -2221,6 +2441,18 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + is-number@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" @@ -2231,6 +2463,21 @@ is-path-inside@^3.0.3: resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" @@ -2241,6 +2488,38 @@ is-stream@^3.0.0: resolved "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz" integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10, is-typed-array@^1.1.9: + version "1.1.10" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" + integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" @@ -2694,6 +2973,11 @@ jsesc@^2.5.1: resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" @@ -2742,6 +3026,16 @@ lines-and-columns@^1.1.6: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" @@ -2804,6 +3098,11 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" @@ -2916,6 +3215,11 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + node-abi@^3.3.0: version "3.30.0" resolved "https://registry.npmjs.org/node-abi/-/node-abi-3.30.0.tgz" @@ -2938,11 +3242,36 @@ node-releases@^2.0.6: resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz" integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +npm-run-all@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba" + integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ== + dependencies: + ansi-styles "^3.2.1" + chalk "^2.4.1" + cross-spawn "^6.0.5" + memorystream "^0.3.1" + minimatch "^3.0.4" + pidtree "^0.3.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" @@ -2967,6 +3296,26 @@ npx-import@^1.1.3: semver "^7.3.7" validate-npm-package-name "^4.0.0" +object-inspect@^1.12.2, object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" @@ -3040,6 +3389,14 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + parse-json@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" @@ -3065,6 +3422,11 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" @@ -3085,6 +3447,13 @@ path-to-regexp@^6.2.0: resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz" integrity sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw== +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + path-type@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" @@ -3100,6 +3469,16 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +pidtree@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" + integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== + pirates@^4.0.4: version "4.0.5" resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz" @@ -3190,6 +3569,15 @@ react-is@^18.0.0: resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA== + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + readable-stream@^3.1.1, readable-stream@^3.4.0: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" @@ -3206,6 +3594,15 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + regexpp@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz" @@ -3238,7 +3635,7 @@ resolve.exports@^1.1.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.20.0: +resolve@^1.10.0, resolve@^1.20.0: version "1.22.1" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -3301,6 +3698,15 @@ safe-buffer@^5.0.1, safe-buffer@~5.2.0: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + selfsigned@^2.0.0, selfsigned@^2.0.1: version "2.1.1" resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz" @@ -3313,6 +3719,11 @@ semiver@^1.1.0: resolved "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz" integrity sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg== +"semver@2 || 3 || 4 || 5", semver@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + semver@7.x, semver@^7.0.0, semver@^7.3.5, semver@^7.3.7: version "7.3.8" resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz" @@ -3330,6 +3741,13 @@ set-cookie-parser@^2.4.8: resolved "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.5.1.tgz" integrity sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ== +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + dependencies: + shebang-regex "^1.0.0" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -3337,16 +3755,30 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== + shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shell-quote@^1.7.3: +shell-quote@^1.6.1, shell-quote@^1.7.3: version "1.7.4" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.4.tgz#33fe15dee71ab2a81fcbd3a52106c5cfb9fb75d8" integrity sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" @@ -3412,6 +3844,32 @@ spawn-command@^0.0.2-1: resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" integrity sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg== +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.12" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz#69077835abe2710b65f03969898b6637b505a779" + integrity sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -3451,6 +3909,33 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string.prototype.padend@^3.0.0: + version "3.1.4" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.4.tgz#2c43bb3a89eb54b6750de5942c123d6c98dd65b6" + integrity sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" @@ -3465,6 +3950,11 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + strip-bom@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" @@ -3633,11 +4123,30 @@ type-fest@^0.21.3: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + typescript@^4.9.4: version "4.9.4" resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz" integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + undici@5.9.1: version "5.9.1" resolved "https://registry.npmjs.org/undici/-/undici-5.9.1.tgz" @@ -3677,6 +4186,14 @@ v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + validate-npm-package-name@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz" @@ -3691,6 +4208,36 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-typed-array@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" + integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + is-typed-array "^1.1.10" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + which@^2.0.1: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" From 11040ba8e241ed9d5ca1404e985cd409db516789 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 10 Jan 2023 11:29:28 +0000 Subject: [PATCH 6/6] add linting checks to PRs checks --- .github/workflows/PRs.yml | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PRs.yml b/.github/workflows/PRs.yml index 251dce4..bd7ce08 100644 --- a/.github/workflows/PRs.yml +++ b/.github/workflows/PRs.yml @@ -23,7 +23,11 @@ jobs: - name: Build run: yarn build - name: Check formatting - run: yarn pretty + run: yarn pretty + - name: Check backend linting + run: yarn lint:backend + - name: Check functions linting + run: yarn lint:functions - name: Run API tests run: yarn test @@ -40,5 +44,7 @@ jobs: run: yarn && yarn --cwd frontend - name: Initialize local database run: yarn database:create-mock + - name: Check frontend linting + run: yarn lint:frontend - name: Run UI tests run: yarn test:ui diff --git a/package.json b/package.json index 9bc736d..24a5682 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "test": "NODE_OPTIONS=--experimental-vm-modules yarn jest", "lint": "run-s lint:* --print-label", "lint:frontend": "npm --prefix frontend run lint", - "lint:be": "npx eslint backend", + "lint:backend": "npx eslint backend", "lint:functions": "npx eslint functions", "build": "yarn --cwd frontend install && yarn --cwd frontend build", "d1": "NO_D1_WARNING=true wrangler d1",