Skip to content

Commit

Permalink
get bash support
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes committed Mar 6, 2025
1 parent e6d046b commit 8560b9d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/_components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"clsx": "^2.1.1",
"next": "^15.1.5",
"prism-react-renderer": "^2.4.1",
"prismjs": "^1.29.0",
"react-code-block": "^1.1.3"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions apps/_components/src/CodeBlock/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { useState } from 'react';
import { CodeBlock as ReactCodeBlock } from 'react-code-block';
import classes from './CodeBlock.module.css';

import { Prism } from 'prism-react-renderer';

(typeof global !== 'undefined' ? global : window).Prism = Prism;
/* @ts-ignore - TODO: fix this */
await import('prismjs/components/prism-bash');

export type CodeBlockProps = {
children: string;
className?: string;
Expand Down Expand Up @@ -33,6 +39,7 @@ export type CodeBlockProps = {
| 'python'
| 'json'
| 'text'
| 'bash'
| string;
};

Expand Down
4 changes: 2 additions & 2 deletions apps/theme/components/TokenModal/TokenModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const TokenModal = () => {
</Paragraph>
</div>
<div className={classes.snippet}>
<CodeBlock language='shell'>{cliSnippet}</CodeBlock>
<CodeBlock language='bash'>{cliSnippet}</CodeBlock>
</div>
<div
className={classes.step}
Expand All @@ -153,7 +153,7 @@ export const TokenModal = () => {
</Paragraph>
</div>
<div className={classes.snippet}>
<CodeBlock language='shell'>{buildSnippet}</CodeBlock>
<CodeBlock language='bash'>{buildSnippet}</CodeBlock>
</div>

<Divider />
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,7 @@ __metadata:
clsx: "npm:^2.1.1"
next: "npm:^15.1.5"
prism-react-renderer: "npm:^2.4.1"
prismjs: "npm:^1.29.0"
react-code-block: "npm:^1.1.3"
typescript: "npm:^5.7.3"
peerDependencies:
Expand Down Expand Up @@ -10575,6 +10576,13 @@ __metadata:
languageName: node
linkType: hard

"prismjs@npm:^1.29.0":
version: 1.29.0
resolution: "prismjs@npm:1.29.0"
checksum: 10/2080db382c2dde0cfc7693769e89b501ef1bfc8ff4f8d25c07fd4c37ca31bc443f6133d5b7c145a73309dc396e829ddb7cc18560026d862a887ae08864ef6b07
languageName: node
linkType: hard

"process-nextick-args@npm:~2.0.0":
version: 2.0.1
resolution: "process-nextick-args@npm:2.0.1"
Expand Down

0 comments on commit 8560b9d

Please sign in to comment.