From 8f43d82cafe3093dddc796ec234d150f5bd6fefe Mon Sep 17 00:00:00 2001 From: Haydn Ewers <27211+haydn@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:57:56 +1100 Subject: [PATCH] clean-up dependencies --- package.json | 3 +-- pnpm-lock.yaml | 18 +++--------------- src/core/postComparisons.ts | 7 ++++--- src/linear/LinearApp.tsx | 13 +++++-------- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 7b2dfc0..8d2e8cf 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "@visx/responsive": "^2.10.0", "@visx/scale": "^2.2.2", "d3-force": "^3.0.0", - "dataloader": "^2.2.2", "date-fns": "^2.29.3", + "dedent": "^1.5.3", "graph-fns": "^0.3.0", "marked": "^4.0.18", "next": "^13.5.3", @@ -23,7 +23,6 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-use": "^17.4.0", - "tiny-invariant": "^1.3.1", "uuid": "^9.0.0", "zod": "^3.21.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4da3377..9354b01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,12 +17,12 @@ dependencies: d3-force: specifier: ^3.0.0 version: 3.0.0 - dataloader: - specifier: ^2.2.2 - version: 2.2.2 date-fns: specifier: ^2.29.3 version: 2.30.0 + dedent: + specifier: ^1.5.3 + version: 1.5.3 graph-fns: specifier: ^0.3.0 version: 0.3.0 @@ -44,9 +44,6 @@ dependencies: react-use: specifier: ^17.4.0 version: 17.5.1(react-dom@18.2.0)(react@18.2.0) - tiny-invariant: - specifier: ^1.3.1 - version: 1.3.3 uuid: specifier: ^9.0.0 version: 9.0.1 @@ -3548,10 +3545,6 @@ packages: is-data-view: 1.0.1 dev: true - /dataloader@2.2.2: - resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} - dev: false - /date-fns@2.30.0: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} @@ -3622,7 +3615,6 @@ packages: peerDependenciesMeta: babel-plugin-macros: optional: true - dev: true /deep-equal@2.2.3: resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==} @@ -8063,10 +8055,6 @@ packages: convert-hrtime: 3.0.0 dev: true - /tiny-invariant@1.3.3: - resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} - dev: false - /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} diff --git a/src/core/postComparisons.ts b/src/core/postComparisons.ts index bfe0243..ef27a3c 100644 --- a/src/core/postComparisons.ts +++ b/src/core/postComparisons.ts @@ -1,8 +1,9 @@ import { formatISO, fromUnixTime } from "date-fns"; +import gql from "dedent"; +import { NextApiRequest } from "next"; +import { z } from "zod"; import { postBodySchema, postLinearResponseSchema } from "../linear/_schema"; import { Comparison } from "./_types"; -import { z } from "zod"; -import { NextApiRequest } from "next"; const KV_REST_API_TOKEN = process.env.KV_REST_API_TOKEN; const KV_REST_API_URL = process.env.KV_REST_API_URL; @@ -41,7 +42,7 @@ const postComparisons = async ( "Content-Type": "application/json", }, body: JSON.stringify({ - query: ` + query: gql` query Issues($issueIds: [ID!]!) { issues(filter: { id: { in: $issueIds } }) { nodes { diff --git a/src/linear/LinearApp.tsx b/src/linear/LinearApp.tsx index fdf6f31..9f61a59 100644 --- a/src/linear/LinearApp.tsx +++ b/src/linear/LinearApp.tsx @@ -1,3 +1,4 @@ +import gql from "dedent"; import { ReactNode, useCallback } from "react"; import Core from "../core/Core"; import { @@ -72,7 +73,7 @@ const LinearApp = ({ children }: Props) => { "Content-Type": "application/json", }, body: JSON.stringify({ - query: ` + query: gql` query IssueDetail($id: String!) { issue(id: $id) { id @@ -203,18 +204,14 @@ const LinearApp = ({ children }: Props) => { "Content-Type": "application/json", }, body: JSON.stringify({ - query: ` + query: gql` query IssueSummary($id: String!, $cursor: String) { team(id: $id) { key issues( first: 100 after: $cursor - filter: { - parent: { - null: true - } - } + filter: { parent: { null: true } } ) { pageInfo { hasNextPage @@ -325,7 +322,7 @@ const LinearApp = ({ children }: Props) => { "Content-Type": "application/json", }, body: JSON.stringify({ - query: ` + query: gql` mutation ($id: String!, $input: IssueUpdateInput!) { issueUpdate(id: $id, input: $input) { success -- 2.51.2