Skip to content
Merged
Prev Previous commit
Next Next commit
refactor(react): move the jsx-ast plugins out of utils
They are the remark and rehype plugins of `jsx-ast`, rather than
utilities.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
  • Loading branch information
ovflowd committed Oct 8, 2026
commit 83a5f223ea836bf6295439fe3ba3ce1916570f87
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import { SKIP, visit } from 'unist-util-visit';

import { JSX_IMPORTS } from '../../../html/constants.mjs';
import { ALERT_MARKER, GITHUB_ALERT_TYPES } from '../../constants.mjs';
import { createJSXElement } from '../ast.mjs';
import { JSX_IMPORTS } from '../../html/constants.mjs';
import { ALERT_MARKER, GITHUB_ALERT_TYPES } from '../constants.mjs';
import { createJSXElement } from '../utils/ast.mjs';

/**
* Converts a marker keyword into a human-readable title (e.g. `NOTE` -> `Note`).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { toString } from 'hast-util-to-string';
import { visit } from 'unist-util-visit';

import { TAG_TRANSFORMS } from '../../constants.mjs';
import { TAG_TRANSFORMS } from '../constants.mjs';

/**
* Checks whether a HAST node is the generated GFM footnotes section.
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/jsx-ast/utils/remark.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { unified } from 'unified';
import { visit } from 'unist-util-visit';

import { AST_NODE_TYPES } from '../constants.mjs';
import transformAlerts from './plugins/alerts.mjs';
import transformElements from './plugins/transformer.mjs';
import transformAlerts from '../plugins/alerts.mjs';
import transformElements from '../plugins/transformer.mjs';

const passThrough = ['element', ...Object.values(AST_NODE_TYPES.MDX)];
const codeMetaProperty = 'codeMeta';
Expand Down