Welcome! This package supports local development of custom GitHub Blocks.
Scripts
Using the blocks command, you can run the following commands:
start - Starts a local development environment and builds Blocks bundles.
build - Builds Blocks bundles.
Utility functions
To reduce the cognitive load associated with writing file and folder block components, we've assembled a helper library that exposes interface definitions and a few helper functions.
How to use
yarn add @githubnext/blocks
import { FileBlockProps, FolderBlockProps, getLanguageFromFilename, getNestedFileTree,} from '@githubnext/blocks`
FileBlockProps
import { FileBlockProps } from '@githubnext/blocks';export default function (props: FileBlockProps) { const { content, metadata, onUpdateMetadata } = props; ...}