Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Add missing prop documentation, update package.json #6

Merged
merged 4 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/friendly-pears-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-shiki": patch
---

Update README, package.json, and tsup config
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"packageManager": "[email protected]",
"scripts": {
"dev": "pnpm --stream -r --parallel dev",
"build": "pnpm --stream -r --parallel build",
"package:dev": "pnpm --filter react-shiki dev",
"package:build": "pnpm --filter react-shiki build",
"playground:dev": "pnpm --filter playground dev",
Expand Down
3 changes: 2 additions & 1 deletion package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ function CodeBlock() {
The component accepts several props in addition to language and theme:

- `showLanguage: boolean` - Shows the language name in the top right corner of the code block.
- `style: object` - Style object to be passed to the component.
- `addDefaultStyles`: boolean - Adds default styles (padding, overflow handling, and border-radius) to the code block.
- `as: string` - The component to be rendered. Defaults to 'pre'.
- `className: string` - Class name to be passed to the component.
- `style: object` - Style object to be passed to the component.

```tsx
function Houston() {
Expand Down
6 changes: 2 additions & 4 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"repository": {
"type": "git",
"directory": "package",
"url": "https://github.com/avgvstvs96/react-shiki"
"url": "git+https://github.com/avgvstvs96/react-shiki.git"
},
"homepage": "https://react-shiki.vercel.app/",
"keywords": [
Expand All @@ -26,9 +26,7 @@
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"files": ["dist"],
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion package/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from 'tsup';
import { peerDependencies } from './package.json';

export default defineConfig((options) => {
const dev = !!options.watch;
Expand All @@ -11,6 +12,6 @@ export default defineConfig((options) => {
clean: true,
minify: !dev,
injectStyle: true,
external: ['react', 'react-dom'],
external: [...Object.keys(peerDependencies)],
};
});
8 changes: 6 additions & 2 deletions playground/src/CodeTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ export const HighlightCodeBlocks = React.memo(() => {
the top right corner of the code block.
</li>
<li>
<code>style: object</code> - Style object to be passed to the
component.
<code>addDefaultStyles: boolean</code> - Adds default styles to
the top right corner of the code block.
</li>
<li>
<code>as: string</code> - The component to be rendered. Defaults
Expand All @@ -341,6 +341,10 @@ export const HighlightCodeBlocks = React.memo(() => {
<code>className: string</code> - Class name to be passed to the
component.
</li>
<li>
<code>style: object</code> - Style object to be passed to the
component.
</li>
</ul>
<Houston />
<p>
Expand Down