Skip to content

Commit 13b76f2

Browse files
committed
fix: declare prism-react-renderer as a direct dependency
It was being imported from components/liveHighlight.tsx, components/prismLanguageSC.ts, and components/prismTheme.ts but only resolved as a transitive of react-live-runner. Pinned to 1.3.5 because the code uses the v1 API (default Highlight export plus named Prism and Language exports), which v2 dropped. Also clean up two oxlint warnings in prismLanguageSC.ts: switch the keyword sort to Array#toSorted and drop a redundant empty export.
1 parent da835d4 commit 13b76f2

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

components/prismLanguageSC.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const CSS_VALUE_KEYWORDS = [
160160
// Sort by length descending so longer matches win over shorter prefixes
161161
// (e.g. `inline-block` before `inline`). Prism's regex engine is greedy
162162
// with alternation order, not string length.
163-
const sortedKeywords = [...CSS_VALUE_KEYWORDS].sort((a, b) => b.length - a.length);
163+
const sortedKeywords = CSS_VALUE_KEYWORDS.toSorted((a, b) => b.length - a.length);
164164

165165
// Lookbehind scopes the match to CSS value positions: after a `:` (property
166166
// value), whitespace, comma, or `(`. Prevents matching inside selectors or
@@ -254,5 +254,3 @@ if (existingStyledRule && existingStyledRule.pattern) {
254254
};
255255
tsxTemplateStrings.unshift(styledWithGenericsRule);
256256
}
257-
258-
export {};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"invariant": "^2.2.4",
3131
"markdown-to-jsx": "^9.7.15",
3232
"next": "16.1.7",
33+
"prism-react-renderer": "1.3.5",
3334
"react": "^19.2.4",
3435
"react-dom": "^19.2.4",
3536
"react-is": "^19.0.0",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)