{"id":24989322,"url":"https://github.com/githubnext/blocks-dev","last_synced_at":"2025-10-19T11:32:17.235Z","repository":{"id":63910307,"uuid":"491278656","full_name":"githubnext/blocks-dev","owner":"githubnext","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T01:40:06.000Z","size":481,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-06T13:00:49.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/githubnext.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-11T21:34:24.000Z","updated_at":"2023-03-06T13:00:49.070Z","dependencies_parsed_at":"2023-02-05T01:47:02.250Z","dependency_job_id":null,"html_url":"https://github.com/githubnext/blocks-dev","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubnext%2Fblocks-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubnext%2Fblocks-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubnext%2Fblocks-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubnext%2Fblocks-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/githubnext","download_url":"https://codeload.github.com/githubnext/blocks-dev/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237121644,"owners_count":19258623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-04T12:57:02.323Z","updated_at":"2025-10-19T11:32:11.883Z","avatar_url":"https://github.com/githubnext.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blocks\n\nWelcome! This package supports local development of custom GitHub Blocks.\n\n# Scripts\n\nUsing the `blocks` command, you can run the following commands:\n\n- `start` - Starts a local development environment and builds Blocks bundles.\n- `build` - Builds Blocks bundles.\n\n# Utility functions\n\nTo 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.\n\n## How to use\n\n`yarn add @githubnext/blocks`\n\n```tsx\nimport {\n  FileBlockProps,\n  FolderBlockProps,\n  getLanguageFromFilename,\n  getNestedFileTree,\n} from '@githubnext/blocks`\n```\n\n## FileBlockProps\n\n```tsx\nimport { FileBlockProps } from '@githubnext/blocks';\n\nexport default function (props: FileBlockProps) {\n  const { content, metadata, onUpdateMetadata } = props;\n  ...\n}\n```\n\n## FolderBlockProps\n\n```tsx\nimport { FolderBlockProps } from '@githubnext/blocks';\n\nexport default function (props: FileBlockProps) {\n  const { tree, metadata, onUpdateMetadata, BlockComponent } = props;\n  ...\n}\n```\n\n## getLanguageFromFilename\n\nA helper function that returns the \"language\" of a file, given a valid file path with extension.\n\n## getNestedFileTree\n\nA helper function to turn the flat folder `tree` array into a nested tree structure\n\nimport { FolderBlockProps, getNestedFileTree, } from \"@githubnext/blocks\";\n\n```tsx\nexport default function (props: FolderBlockProps) {\n  const { tree, onNavigateToPath } = props;\n\n  const data = useMemo(() =\u003e {\n    const nestedTree = getNestedFileTree(tree)[0]\n    return nestedTree\n  }, [tree])\n  ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubnext%2Fblocks-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithubnext%2Fblocks-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubnext%2Fblocks-dev/lists"}