Skip to content

Commit

Permalink
refactor(algolia): use new config schema (#5357)
Browse files Browse the repository at this point in the history
Change-Id: I4d1173f293f7824d107b4a0ad704d8afcd36b5df
  • Loading branch information
jd authored Oct 14, 2024
1 parent ac4abcd commit 39f09b9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/remark-algolia.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { visit } from 'unist-util-visit';
import futureConfigSchema from '../public/mergify-configuration-schema-future-version.json';
import configSchema from '../public/mergify-configuration-schema.json';
import configSchema from '../public/mergify-configuration-schema-future-version.json';
import { toString } from 'mdast-util-to-string';
import algoliasearch from 'algoliasearch';
import type * as unified from 'unified';
Expand Down Expand Up @@ -64,7 +63,7 @@ export function remarkAlgolia(): unified.Plugin<[], mdast.Root> {
(attr) => attr.type === 'mdxJsxAttribute' && attr.name === 'def'
).value;

const optionsTableData = futureConfigSchema?.$defs?.[def as string]?.properties;
const optionsTableData = configSchema?.$defs?.[def as string]?.properties;

tables.push({
node: JSON.stringify(element),
Expand All @@ -74,7 +73,7 @@ export function remarkAlgolia(): unified.Plugin<[], mdast.Root> {
break;

case 'PullRequestAttributesTable':
const pullRequestAttributes = futureConfigSchema.$defs.PullRequestAttributes.properties;
const pullRequestAttributes = configSchema.$defs.PullRequestAttributes.properties;
tables.push({
node: JSON.stringify(element),
data: JSON.stringify(pullRequestAttributes),
Expand Down

0 comments on commit 39f09b9

Please sign in to comment.