Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: rename component html processors
  • Loading branch information
HiDeoo committed Aug 20, 2026
commit 4233e31954ce1ff83f4aac03efc9deefff1f3955
2 changes: 1 addition & 1 deletion packages/file-icons-generator/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Definitions } from '../starlight/user-components/rehype-file-tree';
import type { Definitions } from '../starlight/user-components/file-tree-processor';

export const seti = {
/** The GitHub repository containing the Seti UI theme using the `username/repo` format. */
Expand Down
4 changes: 2 additions & 2 deletions packages/file-icons-generator/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { spawn } from 'node:child_process';
import fs from 'node:fs/promises';
import path from 'node:path';
import { starlight } from '../config.ts';
import type { Definitions } from '../../starlight/user-components/rehype-file-tree.ts';
import type { Definitions } from '../../starlight/user-components/file-tree-processor.ts';

const copyrightNotice = `/**
* Based on https://github.com/elviswolcott/seti-icons which
Expand Down Expand Up @@ -42,7 +42,7 @@ export async function writeDefinitionsAndSVGs(
) {
const content = `${generatedFileHeader}

import type { Definitions } from './rehype-file-tree.ts';
import type { Definitions } from './file-tree-processor.ts';

${copyrightNotice}
export const definitions: Definitions = ${JSON.stringify(definitions)};
Expand Down
2 changes: 1 addition & 1 deletion packages/file-icons-generator/utils/font.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import opentype, { type Font, Glyph } from 'opentype.js';
import { seti, starlight } from '../config.ts';
import type { Definitions } from '../../starlight/user-components/rehype-file-tree.ts';
import type { Definitions } from '../../starlight/user-components/file-tree-processor.ts';
import { getFont, getSetiIconName } from './seti.ts';

// This matches the default precision used by the SVGO default preset.
Expand Down
2 changes: 1 addition & 1 deletion packages/file-icons-generator/utils/seti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import { seti, starlight } from '../config.ts';
import type { Definitions } from '../../starlight/user-components/rehype-file-tree.ts';
import type { Definitions } from '../../starlight/user-components/file-tree-processor.ts';

// https://github.com/jesseweed/seti-ui/blob/master/styles/components/icons/mapping.less
// .icon-set(".bsl", "bsl", @red);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test, vi } from 'vitest';
import { processFileTree } from '../../user-components/rehype-file-tree';
import { processFileTree } from '../../user-components/file-tree-processor';
import { Icons, type StarlightIcon } from '../../components-internals/Icons';

describe('validation', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest';
import { processSteps } from '../../user-components/rehype-steps';
import { processSteps } from '../../user-components/steps-processor';

test('empty component throws an error', () => {
expect(() => processSteps('')).toThrowErrorMatchingInlineSnapshot(
Expand Down Expand Up @@ -63,7 +63,7 @@ test('component with multiple children throws an error', () => {
});

// This tests a workaround added for https://github.com/withastro/astro/issues/15627
// See rehype-steps.ts for more details.
// See steps-processor.ts for more details.
test('component with top-level script child is processed successfully', () => {
const { html } = processSteps(
'<script type="module" src="/test-script.js"></script><ol><li>List item</li></ol>'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { expect, test } from 'vitest';
import { toHtml } from 'hast-util-to-html';
import { selectAll } from 'hast-util-select';
import { htmlToHast } from 'satteri';
import { processPanels, TabItemTagname } from '../../user-components/rehype-tabs';
import { processPanels, TabItemTagname } from '../../user-components/tabs-processor';

const TabItem = ({ label, slot, icon }: { label: string; slot: string; icon?: string }) => {
const iconAttr = icon ? ` data-icon="${icon}"` : '';
return `<${TabItemTagname} data-label="${label}"${iconAttr}>${slot}</${TabItemTagname}>`;
};

/** Get an array of HTML strings, one for each `<div role="tabpanel">` created by rehype-tabs for each tab item. */
/** Get an array of HTML strings, one for each `<div role="tabpanel">` created by tabs-processor for each tab item. */
const extractTabPanels = (html: string) => {
const tree = htmlToHast(html, { fragment: true });
const tabPanels = selectAll('div[role="tabpanel"]', tree);
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/user-components/FileTree.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { processFileTree } from './rehype-file-tree';
import { processFileTree } from './file-tree-processor';

const fileTreeHtml = await Astro.slots.render('default');
const html = processFileTree(fileTreeHtml, Astro.locals.t('fileTree.directory'));
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/user-components/Steps.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { processSteps } from './rehype-steps';
import { processSteps } from './steps-processor';

const content = await Astro.slots.render('default');
const { html } = processSteps(content);
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/user-components/TabItem.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { TabItemTagname } from './rehype-tabs';
import { TabItemTagname } from './tabs-processor';
import type { StarlightIcon } from '../components-internals/Icons';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/user-components/Tabs.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Icon from './Icon.astro';
import { processPanels } from './rehype-tabs';
import { processPanels } from './tabs-processor';

interface Props {
syncKey?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/user-components/file-tree-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Do not edit this file directly as it will be overwritten.
*/

import type { Definitions } from './rehype-file-tree.ts';
import type { Definitions } from './file-tree-processor.ts';

/**
* Based on https://github.com/elviswolcott/seti-icons which
Expand Down