1- // @ts -check
2- // Note: type annotations allow type checking and IDEs autocompletion
31import "dotenv/config.js" ;
2+ import type { Config } from "@docusaurus/types" ;
3+ import { themes as prismThemes } from "prism-react-renderer" ;
4+ import type { Options as ClassicPresetOptions } from "@docusaurus/preset-classic" ;
5+ import fs from "fs" ;
6+ import { PluginOptions as LLmPluginOptions } from "@signalwire/docusaurus-plugin-llms-txt" ;
47
5- const { themes } = require ( "prism-react-renderer" ) ;
6- const lightCodeTheme = themes . github ;
7- const darkCodeTheme = themes . dracula ;
8- const npm2yarn = require ( "@docusaurus/remark-plugin-npm2yarn" ) ;
9-
8+ // Import remark plugins
109const docsHeaderDecoration = require ( "./src/remark/docsHeaderDecoration" ) ;
1110const enterpriseDocsHeaderInformation = require ( "./src/remark/enterpriseDocsHeaderInformation" ) ;
1211const productInformation = require ( "./src/remark/productInformation" ) ;
1312const connectorList = require ( "./src/remark/connectorList" ) ;
1413const specDecoration = require ( "./src/remark/specDecoration" ) ;
1514const docMetaTags = require ( "./src/remark/docMetaTags" ) ;
1615const addButtonToTitle = require ( "./src/remark/addButtonToTitle" ) ;
17- const fs = require ( "fs " ) ;
16+ const npm2yarn = require ( "@docusaurus/remark-plugin-npm2yarn " ) ;
1817
19- const { SPEC_CACHE_PATH , API_SIDEBAR_PATH } = require ( "./src/scripts/embedded-api/constants" ) ;
18+ // Import constants
19+ const {
20+ SPEC_CACHE_PATH ,
21+ API_SIDEBAR_PATH ,
22+ } = require ( "./src/scripts/embedded-api/constants" ) ;
2023
21- /** @type {import('@docusaurus/types').Config } */
22- const config = {
24+ const lightCodeTheme = prismThemes . github ;
25+ const darkCodeTheme = prismThemes . dracula ;
26+
27+ const config : Config = {
2328 future : {
24- experimental_faster : true ,
29+ experimental_faster : {
30+ rspackBundler : true ,
31+ rspackPersistentCache : true ,
32+ swcJsMinimizer : true ,
33+ swcJsLoader : true ,
34+ } ,
2535 } ,
2636 markdown : {
2737 mermaid : true ,
@@ -87,22 +97,21 @@ const config = {
8797 : [ ] ) ,
8898 ] ,
8999 i18n : {
90- defaultLocale : 'en' ,
91- locales : [ 'en' ] ,
100+ defaultLocale : "en" ,
101+ locales : [ "en" ] ,
92102 } ,
93103 // The preset is the "main" docs instance, though in reality, most content does not live under this preset. See the plugins array below, which defines the behavior of each docs instance.
94104 presets : [
95105 [
96106 "classic" ,
97- /** @type {import('@docusaurus/preset-classic').Options } */
98- ( {
107+ {
99108 docs : false , // Disable default docs plugin since we're using a custom page for home
100109 blog : false ,
101110 pages : { } , // Enable pages plugin for standalone pages
102111 theme : {
103112 customCss : require . resolve ( "./src/css/custom.css" ) ,
104113 } ,
105- } ) ,
114+ } satisfies ClassicPresetOptions ,
106115 ] ,
107116 ] ,
108117 plugins : [
@@ -201,7 +210,7 @@ const config = {
201210 // items from the generated file structure.
202211
203212 try {
204- const specPath = SPEC_CACHE_PATH ;
213+ const specPath = SPEC_CACHE_PATH ;
205214
206215 if ( ! fs . existsSync ( specPath ) ) {
207216 console . warn (
@@ -215,14 +224,14 @@ const config = {
215224
216225 // Load the freshly generated sidebar (not the cached one from module load)
217226 const sidebarPath = API_SIDEBAR_PATH ;
218- let freshSidebar = [ ] ;
227+ let freshSidebar : any [ ] = [ ] ;
219228
220229 if ( fs . existsSync ( sidebarPath ) ) {
221230 try {
222231 const sidebarModule = require ( "./api-docs/embedded-api/sidebar.ts" ) ;
223232 freshSidebar = sidebarModule . default || sidebarModule ;
224233 console . log ( "Loaded fresh sidebar from generated files" ) ;
225- } catch ( sidebarError ) {
234+ } catch ( sidebarError : any ) {
226235 console . warn (
227236 "Could not load fresh sidebar, using empty array:" ,
228237 sidebarError . message ,
@@ -236,14 +245,14 @@ const config = {
236245 freshSidebar = [ ] ;
237246 }
238247
239- const allowedTags = data . tags ?. map ( ( tag ) => tag [ "name" ] ) || [ ] ;
248+ const allowedTags = data . tags ?. map ( ( tag : any ) => tag [ "name" ] ) || [ ] ;
240249
241250 // Use freshly loaded sidebar items from the generated file
242251 const sidebarItems = Array . isArray ( freshSidebar )
243252 ? freshSidebar
244253 : [ ] ;
245254
246- const filteredItems = sidebarItems . filter ( ( item ) => {
255+ const filteredItems = sidebarItems . filter ( ( item : any ) => {
247256 if ( item . type !== "category" ) {
248257 return true ;
249258 }
@@ -252,7 +261,7 @@ const config = {
252261 } ) ;
253262
254263 return filteredItems ;
255- } catch ( error ) {
264+ } catch ( error : any ) {
256265 console . warn (
257266 "Error loading embedded API spec from cache:" ,
258267 error . message ,
@@ -292,7 +301,7 @@ const config = {
292301 content : {
293302 includePages : true ,
294303 } ,
295- } ,
304+ } satisfies LLmPluginOptions ,
296305 ] ,
297306 ( ) => ( {
298307 name : "Yaml loader" ,
@@ -326,127 +335,122 @@ const config = {
326335 require . resolve ( "./src/scripts/fontAwesomeIcons.js" ) ,
327336 ] ,
328337
329- themeConfig :
330- /** @type {import('@docusaurus/preset-classic').ThemeConfig } */
331- ( {
332- colorMode : {
333- disableSwitch : false ,
338+ themeConfig : {
339+ colorMode : {
340+ disableSwitch : false ,
341+ } ,
342+ mermaid : {
343+ theme : {
344+ light : "base" ,
345+ dark : "base" ,
334346 } ,
335- mermaid : {
336- theme : {
337- light : 'base' , // "base" theme is fully customizable
338- dark : 'base'
339- } ,
340- options : {
341- themeVariables : {
342- primaryColor : '#5F5CFF' , // Airbyte blue
343- primaryTextColor : '#FFFFFF' , // white labels on colored shapes
344- primaryBorderColor : '#1A194D' , // slightly darker for contrast
345- secondaryColor : '#FF6A4D' , // accent orange
346- // secondaryTextColor: '#FF6A4D', // accent orange
347- // secondaryBorderColor: '#FF6A4D', // accent orange
348- tertiaryColor : '#E8EAF6' , // light neutral fill
349- tertiaryTextColor : '#000000' , // black labels on light shapes
350- tertiaryBorderColor : '#E8EAF6' , // light neutral border
351- background : '#FFFFFF' ,
352- clusterBkg : '#F5F5F5' ,
353- fontFamily : 'var(--ifm-font-family-base)' ,
354- } ,
355- flowchart : {
356- rankSpacing : 100 , // vertical space
357- subGraphTitleMargin : 10 , // space within subgraph border for title
358- nodeSpacing : 100 , // horizontal space
359- } ,
347+ options : {
348+ themeVariables : {
349+ primaryColor : "#5F5CFF" ,
350+ primaryTextColor : "#FFFFFF" ,
351+ primaryBorderColor : "#1A194D" ,
352+ secondaryColor : "#FF6A4D" ,
353+ tertiaryColor : "#E8EAF6" ,
354+ tertiaryTextColor : "#000000" ,
355+ tertiaryBorderColor : "#E8EAF6" ,
356+ background : "#FFFFFF" ,
357+ clusterBkg : "#F5F5F5" ,
358+ fontFamily : "var(--ifm-font-family-base)" ,
360359 } ,
361- } ,
362- docs : {
363- sidebar : {
364- autoCollapseCategories : true ,
360+ flowchart : {
361+ rankSpacing : 100 ,
362+ subGraphTitleMargin : 10 ,
363+ nodeSpacing : 100 ,
365364 } ,
366365 } ,
367- algolia : {
368- appId : "OYKDBC51MU" ,
369- apiKey : "15c487fd9f7722282efd8fcb76746fce" , // Public API key: it is safe to commit it
370- indexName : "airbyte" ,
366+ } ,
367+ docs : {
368+ sidebar : {
369+ autoCollapseCategories : true ,
371370 } ,
372- announcementBar : {
373- id : "try_airbyte_cloud" ,
374- content :
375- '<a target="_blank" rel="noopener noreferrer" href="https://cloud.airbyte.io/signup?utm_campaign=22Q1_AirbyteCloudSignUpCampaign_Trial&utm_source=Docs&utm_content=NavBar">Try Airbyte Cloud</a>! Free for 30 days, no credit card needed.' ,
376- backgroundColor : "#615eff" ,
377- textColor : "#ffffff" ,
378- isCloseable : true ,
371+ } ,
372+ algolia : {
373+ appId : "OYKDBC51MU" ,
374+ apiKey : "15c487fd9f7722282efd8fcb76746fce" ,
375+ indexName : "airbyte" ,
376+ } ,
377+ announcementBar : {
378+ id : "try_airbyte_cloud" ,
379+ content :
380+ '<a target="_blank" rel="noopener noreferrer" href="https://cloud.airbyte.io/signup?utm_campaign=22Q1_AirbyteCloudSignUpCampaign_Trial&utm_source=Docs&utm_content=NavBar">Try Airbyte Cloud</a>! Free for 30 days, no credit card needed.' ,
381+ backgroundColor : "#615eff" ,
382+ textColor : "#ffffff" ,
383+ isCloseable : true ,
384+ } ,
385+ navbar : {
386+ title : "Docs" ,
387+ logo : {
388+ alt : "Simple, secure and extensible data integration" ,
389+ src : "img/logo-dark.png" ,
390+ srcDark : "img/logo-light.png" ,
391+ height : 40 ,
379392 } ,
380- navbar : {
381- title : "Docs" ,
382- logo : {
383- alt : "Simple, secure and extensible data integration " ,
384- src : "img/logo-dark.png " ,
385- srcDark : "img/logo-light.png " ,
386- height : 40 ,
393+ items : [
394+ {
395+ type : "docSidebar" ,
396+ position : "left " ,
397+ docsPluginId : "platform " ,
398+ sidebarId : "platform " ,
399+ label : "Platform" ,
387400 } ,
388- items : [
389- {
390- type : "docSidebar" ,
391- position : "left" ,
392- docsPluginId : "platform" ,
393- sidebarId : "platform" ,
394- label : "Platform" ,
395- } ,
396- {
397- type : "docSidebar" ,
398- position : "left" ,
399- docsPluginId : "connectors" ,
400- sidebarId : "connectors" ,
401- label : "Connectors" ,
402- } ,
403- {
404- type : "docSidebar" ,
405- position : "left" ,
406- docsPluginId : "release_notes" ,
407- sidebarId : "releaseNotes" ,
408- label : "Release notes" ,
409- } ,
410- {
411- type : "docSidebar" ,
412- position : "left" ,
413- docsPluginId : "ai-agents" ,
414- sidebarId : "ai-agents" ,
415- label : "AI Agents" ,
416- } ,
417- {
418- href : "https://support.airbyte.com/" ,
419- label : "Support" ,
420- } ,
421-
422- {
423- href : "https://status.airbyte.com" ,
424- label : "Status" ,
425- className : "cloudStatusLink" ,
426- } ,
427- // --- Right side ---
428- // Platform docs version selector
429- {
430- type : "docsVersionDropdown" ,
431- position : "right" ,
432- docsPluginId : "platform" ,
433- label : "Version" ,
434- dropdownActiveClassDisabled : true , // do not style the dropdown as active when viewing platform docs
435- } ,
436- {
437- href : "https://github.com/airbytehq" ,
438- position : "right" ,
439- "aria-label" : "Airbyte on GitHub" ,
440- className : "header-github-link" ,
441- } ,
442- ] ,
443- } ,
444- prism : {
445- theme : lightCodeTheme ,
446- darkTheme : darkCodeTheme ,
447- additionalLanguages : [ "bash" , "diff" , "json" , "hcl" ] ,
448- } ,
449- } ) ,
401+ {
402+ type : "docSidebar" ,
403+ position : "left" ,
404+ docsPluginId : "connectors" ,
405+ sidebarId : "connectors" ,
406+ label : "Connectors" ,
407+ } ,
408+ {
409+ type : "docSidebar" ,
410+ position : "left" ,
411+ docsPluginId : "release_notes" ,
412+ sidebarId : "releaseNotes" ,
413+ label : "Release notes" ,
414+ } ,
415+ {
416+ type : "docSidebar" ,
417+ position : "left" ,
418+ docsPluginId : "ai-agents" ,
419+ sidebarId : "ai-agents" ,
420+ label : "AI Agents" ,
421+ } ,
422+ {
423+ href : "https://support.airbyte.com/" ,
424+ label : "Support" ,
425+ } ,
426+ {
427+ href : "https://status.airbyte.com" ,
428+ label : "Status" ,
429+ className : "cloudStatusLink" ,
430+ } ,
431+ // --- Right side ---
432+ // Platform docs version selector
433+ {
434+ type : "docsVersionDropdown" ,
435+ position : "right" ,
436+ docsPluginId : "platform" ,
437+ label : "Version" ,
438+ dropdownActiveClassDisabled : true ,
439+ } ,
440+ {
441+ href : "https://github.com/airbytehq" ,
442+ position : "right" ,
443+ "aria-label" : "Airbyte on GitHub" ,
444+ className : "header-github-link" ,
445+ } ,
446+ ] ,
447+ } ,
448+ prism : {
449+ theme : lightCodeTheme ,
450+ darkTheme : darkCodeTheme ,
451+ additionalLanguages : [ "bash" , "diff" , "json" , "hcl" ] ,
452+ } ,
453+ } ,
450454} ;
451455
452- module . exports = config ;
456+ export default config ;
0 commit comments