From 40d8dd4505ee439892fa24a19a466df23536a766 Mon Sep 17 00:00:00 2001 From: Philipp Melab Date: Tue, 23 Jan 2024 11:50:00 +0100 Subject: [PATCH] refactor(SLB-201): symlink autoloaders instead of building them to the outside --- apps/cms/config/sync/graphql.graphql_servers.main.yml | 4 ++-- apps/website/.gitignore | 2 -- apps/website/gatsby-autoload.mjs | 1 + apps/website/gatsby-config.mjs | 2 +- packages/schema/codegen.ts | 4 ++-- packages/schema/turbo.json | 6 +----- 6 files changed, 7 insertions(+), 12 deletions(-) create mode 120000 apps/website/gatsby-autoload.mjs diff --git a/apps/cms/config/sync/graphql.graphql_servers.main.yml b/apps/cms/config/sync/graphql.graphql_servers.main.yml index 1d9d21d43..76f02690a 100644 --- a/apps/cms/config/sync/graphql.graphql_servers.main.yml +++ b/apps/cms/config/sync/graphql.graphql_servers.main.yml @@ -1,7 +1,7 @@ uuid: f31854e4-2c2b-4687-9553-9f2d1f87028c langcode: en status: true -dependencies: { } +dependencies: {} name: main label: Main endpoint: /graphql @@ -15,7 +15,7 @@ query_complexity: null schema_configuration: directable: schema_definition: ../node_modules/@custom/schema/build/schema.graphql - autoload_registry: ../autoload.json + autoload_registry: ../node_modules/@custom/schema/build/drupal-autoload.json extensions: silverback_campaign_urls: silverback_campaign_urls silverback_gatsby: silverback_gatsby diff --git a/apps/website/.gitignore b/apps/website/.gitignore index 6806e41da..395b0379a 100644 --- a/apps/website/.gitignore +++ b/apps/website/.gitignore @@ -5,5 +5,3 @@ public styles.css persisted-store - -autoload.mjs diff --git a/apps/website/gatsby-autoload.mjs b/apps/website/gatsby-autoload.mjs new file mode 120000 index 000000000..2b3750cdc --- /dev/null +++ b/apps/website/gatsby-autoload.mjs @@ -0,0 +1 @@ +node_modules/@custom/schema/build/gatsby-autoload.mjs \ No newline at end of file diff --git a/apps/website/gatsby-config.mjs b/apps/website/gatsby-config.mjs index 7fd7d8ef0..79a73b0a5 100644 --- a/apps/website/gatsby-config.mjs +++ b/apps/website/gatsby-config.mjs @@ -9,7 +9,7 @@ import { getPages } from '@custom/decap'; import { resolve } from 'path'; -import autoload from './autoload.mjs'; +import autoload from './gatsby-autoload.mjs'; const dir = resolve('node_modules/@custom/decap/data/page'); diff --git a/packages/schema/codegen.ts b/packages/schema/codegen.ts index 5d0086663..44f75b652 100644 --- a/packages/schema/codegen.ts +++ b/packages/schema/codegen.ts @@ -32,7 +32,7 @@ const config: CodegenConfig = { plugins: ['@amazeelabs/codegen-operation-ids'], }, // Directive autoloader for Gatsby. - '../../apps/website/autoload.mjs': { + 'build/gatsby-autoload.mjs': { plugins: ['@amazeelabs/codegen-autoloader'], config: { mode: 'js', @@ -41,7 +41,7 @@ const config: CodegenConfig = { }, }, // Directive autoloader for Drupla. - '../../apps/cms/autoload.json': { + 'build/drupal-autoload.json': { plugins: ['@amazeelabs/codegen-autoloader'], config: { mode: 'drupal', diff --git a/packages/schema/turbo.json b/packages/schema/turbo.json index 5869cc365..8b1331d3c 100644 --- a/packages/schema/turbo.json +++ b/packages/schema/turbo.json @@ -13,11 +13,7 @@ ".graphqlrc.json", "tsconfig.json" ], - "outputs": [ - "build/**", - "../../apps/website/autoload.mjs", - "../../apps/cms/autoload.json" - ] + "outputs": ["build/**"] } } }