From 821af093a7224c1b1256575481a3e87bb68907f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trevor=20Mu=C3=B1oz?= Date: Tue, 30 Jul 2024 12:56:31 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20found=20the=20option=20to=20generate=20t?= =?UTF-8?q?ypes=20for=20build=20=F0=9F=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run-typescript.yml | 1 - gatsby-config.ts | 84 ++++++++++++---------------- package.json | 1 - 3 files changed, 37 insertions(+), 49 deletions(-) diff --git a/.github/workflows/run-typescript.yml b/.github/workflows/run-typescript.yml index 377688a64d..06468b605e 100644 --- a/.github/workflows/run-typescript.yml +++ b/.github/workflows/run-typescript.yml @@ -27,7 +27,6 @@ jobs: - name: Install dependencies and build run: | npm ci - npm run build:types - name: Check for gatsby-types.d.ts run: | ls -l src/gatsby-types.d.ts diff --git a/gatsby-config.ts b/gatsby-config.ts index d39f8ddf22..9762c4904f 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -1,13 +1,14 @@ -import "dotenv/config"; -import type { GatsbyConfig } from "gatsby"; +import "dotenv/config" +import type { GatsbyConfig } from "gatsby" - -const baseId = process.env.AIRTABLE_MITH_BASE_ID; +const baseId = process.env.AIRTABLE_MITH_BASE_ID const basePath = process.env.BASEPATH const config: GatsbyConfig = { pathPrefix: basePath, - graphqlTypegen: true, + graphqlTypegen: { + generateOnBuild: true, + }, siteMetadata: { title: `MITH`, siteUrl: "https://mith.umd.edu", @@ -79,7 +80,7 @@ const config: GatsbyConfig = { tableView: `All Research Items`, queryName: `ResearchItems`, separateNodeType: true, - mapping: { + mapping: { image: `fileNode`, description: `text/markdown`, excerpt: `text/markdown`, @@ -101,8 +102,8 @@ const config: GatsbyConfig = { `linked_sponsors`, `linked_posts`, `linked_events`, - `related_research` - ] + `related_research`, + ], }, { baseId, @@ -110,10 +111,10 @@ const config: GatsbyConfig = { tableView: `All Events`, queryName: `Events`, separateNodeType: true, - mapping: { + mapping: { excerpt: `text/markdown`, description: `text/markdown`, - image: `fileNode` + image: `fileNode`, }, tableLinks: [ `linked_research_item`, @@ -129,8 +130,8 @@ const config: GatsbyConfig = { `methods`, `disciplines`, `tags`, - `event_types` - ] + `event_types`, + ], }, { baseId, @@ -138,10 +139,7 @@ const config: GatsbyConfig = { tableView: `All Links`, queryName: `Links`, separateNodeType: true, - tableLinks: [ - `linked_research_items`, - `linked_events` - ] + tableLinks: [`linked_research_items`, `linked_events`], }, { baseId, @@ -149,22 +147,22 @@ const config: GatsbyConfig = { tableView: `All Partners & Sponsors`, queryName: `PartnersSponsors`, separateNodeType: true, - mapping: { + mapping: { logo: `fileNode`, }, tableLinks: [ `linked_research_items_as_partner`, `linked_events_as_partner`, `linked_research_items_as_sponsor`, - `linked_events_as_sponsor` - ] + `linked_events_as_sponsor`, + ], }, { baseId, tableName: `People`, tableView: `All People`, queryName: `People`, // optionally default is false - makes all records in this table a separate node type, based on your tableView, or if not present, tableName, e.g. a table called "Fruit" would become "allAirtableFruit". Useful when pulling many airtables with similar structures or fields that have different types. See https://github.com/jbolda/gatsby-source-airtable/pull/52. - mapping: { + mapping: { headshot: `fileNode`, bio: `text/markdown`, }, // optional, e.g. "text/markdown", "fileNode" @@ -175,7 +173,7 @@ const config: GatsbyConfig = { `linked_featured_research`, `linked_research_as_participant`, `events_as_participant`, - `events_as_speaker` + `events_as_speaker`, ], // optional, for deep linking to records across tables. separateNodeType: true, // boolean, default is false, see the documentation on naming conflicts for more information // separateMapType: false, // boolean, default is false, see the documentation on using markdown and attachments for more information @@ -186,7 +184,7 @@ const config: GatsbyConfig = { tableView: `All Identities`, queryName: `Identities`, separateNodeType: true, - mapping: { + mapping: { linked_person_bio: `text/markdown`, person_bio: `text/markdown`, }, @@ -198,8 +196,8 @@ const config: GatsbyConfig = { `linked_research_as_internal`, `linked_research_as_external`, `linked_events_as_speaker`, - `linked_events_as_participant` - ] + `linked_events_as_participant`, + ], }, { baseId, @@ -207,10 +205,7 @@ const config: GatsbyConfig = { tableView: `All Groups`, queryName: `Groups`, separateNodeType: true, - tableLinks: [ - `linked_people`, - `linked_affiliations` - ] + tableLinks: [`linked_people`, `linked_affiliations`], }, { baseId, @@ -223,8 +218,8 @@ const config: GatsbyConfig = { `linked_events`, `linked_people`, `disciplines`, - `methods` - ] + `methods`, + ], }, { baseId, @@ -232,10 +227,7 @@ const config: GatsbyConfig = { tableView: `All Tags`, queryName: `Tags`, separateNodeType: true, - tableLinks: [ - `linked_research`, - `linked_events` - ] + tableLinks: [`linked_research`, `linked_events`], }, { baseId, @@ -243,10 +235,7 @@ const config: GatsbyConfig = { tableView: `All Research Types`, queryName: `ResearchTypes`, separateNodeType: true, - tableLinks: [ - `linked_research`, - `linked_events` - ] + tableLinks: [`linked_research`, `linked_events`], }, { baseId, @@ -258,8 +247,8 @@ const config: GatsbyConfig = { `linked_research`, `linked_events`, `methods`, - `disciplines` - ] + `disciplines`, + ], }, { baseId, @@ -273,17 +262,17 @@ const config: GatsbyConfig = { `linked_events_methods`, `linked_events_disciplines`, `linked_posts_methods`, - `linked_posts_disciplines` - ] + `linked_posts_disciplines`, + ], }, - ] - } + ], + }, }, { resolve: `gatsby-plugin-plausible`, options: { domain: `mith.umd.edu`, - excludePaths: ["/mith-static/*"] + excludePaths: ["/mith-static/*"], }, }, { @@ -323,7 +312,7 @@ const config: GatsbyConfig = { }, }, ], - pedantic: false + pedantic: false, }, }, { @@ -442,4 +431,5 @@ const config: GatsbyConfig = { ], } -export default config; \ No newline at end of file +export default config + diff --git a/package.json b/package.json index 988566826e..11a4d99b2e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "scripts": { "start": "npm run develop", "build": "gatsby build", - "build:types": "tsc --emitDeclarationOnly --declaration --outDir src/gatsby-types.d.ts", "build-pages": "BASEPATH=/mith-static gatsby build --prefix-paths", "develop": "gatsby develop", "test": "playwright test",