{"id":26448476,"url":"https://github.com/tj-mc/raspberry","last_synced_at":"2026-05-01T18:32:42.344Z","repository":{"id":65480102,"uuid":"340572619","full_name":"tj-mc/raspberry","owner":"tj-mc","description":"A format for storing JSX Files as JSON","archived":false,"fork":false,"pushed_at":"2021-03-14T12:50:43.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T23:27:25.599Z","etag":null,"topics":["json","jsx","react","reactnative"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"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/tj-mc.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":"2021-02-20T05:44:59.000Z","updated_at":"2021-03-14T12:50:45.000Z","dependencies_parsed_at":"2023-01-25T08:55:12.392Z","dependency_job_id":null,"html_url":"https://github.com/tj-mc/raspberry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tj-mc/raspberry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-mc%2Fraspberry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-mc%2Fraspberry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-mc%2Fraspberry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-mc%2Fraspberry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tj-mc","download_url":"https://codeload.github.com/tj-mc/raspberry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tj-mc%2Fraspberry/sbom","scorecard":{"id":888080,"data":{"date":"2025-08-11","repo":{"name":"github.com/tj-mc/raspberry","commit":"6e07284ec002af9a997a9be6737f3e5e643b452b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T10:45:50.459Z","repository_id":65480102,"created_at":"2025-08-24T10:45:50.459Z","updated_at":"2025-08-24T10:45:50.459Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["json","jsx","react","reactnative"],"created_at":"2025-03-18T14:34:38.514Z","updated_at":"2026-05-01T18:32:42.325Z","avatar_url":"https://github.com/tj-mc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"300\" src=\"logo.png\" /\u003e\n\u003c/p\u003e\n\n# Raspberry - JSX as JSON\nRaspberry is a format for expressing JSX files as plain JSON. This makes it easier to programmatically generate and modify React \u0026 React Native code.\n\n## Why?\nThe point of Raspberry to use some other system (GUI or command line) to generate actual React / RN code. \nThis is useful for creating 'App Builder' type systems, managing your app from a CMS or programmatically generating whitelabel versions of an app. \n\nRaspberry differs from other JSON/XML formats as it is designed specifically for JSX. This includes state logic, hooks and conditional rendering.\n\nBecause of this, Raspberry is provided as a Node script, and is not designed to be run in the front end.\n\n## How it looks\n```json\n{\n  \"meta\": {\n    \"fileName\": \"example\",\n    \"export\": {\n      \"name\": \"{Example}\"\n    }\n  },\n  \"bodyImports\": [\n    {\n      \"name\": \"React\",\n      \"from\": \"react\"\n    },\n    {\n      \"name\": \"{useState}\",\n      \"from\": \"react\"\n    }\n  ],\n  \"body\": \"const x = true; const [textState, setTextState] = useState('Welcome to React Native');\",\n  \"markup\": {\n    \"import\": {\n      \"name\": \"{View}\",\n      \"from\": \"react-native\"\n    },\n    \"props\": {\n      \"style\": {\n        \"flexDirection\": \"row\",\n        \"display\": \"flex\",\n        \"alignItems\": \"center\"\n      }\n    },\n    \"children\": [\n      {\n        \"import\": {\n          \"name\": \"{TouchableOpacity}\",\n          \"from\": \"react-native\"\n        },\n        \"logic\": {\n          \"renderIf\": \"x === true\"\n        },\n        \"props\": {\n          \"onPress\": \"() =\u003e setTextState('Rendered with Raspberry')\"\n        },\n        \"children\": [\n          {\n            \"import\": {\n              \"name\": \"{Text}\",\n              \"from\": \"react-native\"\n            },\n            \"props\": {\n              \"style\": {\n                \"textAlign\": \"right\",\n                \"color\": \"red\"\n              },\n              \"numberOfLines\": 1\n            },\n            \"stringChild\": \"{textState}\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nAs you can see, everything we would expect to find in JSX is modelled in JSON.\n\n## What that makes\nAfter prettifying, this is the output:\n```jsx\nimport React from 'react';\nimport {useState} from 'react';\nimport {View} from 'react-native';\nimport {TouchableOpacity} from 'react-native';\nimport {Text} from 'react-native';\n\nexport const Example = () =\u003e {\n    const x = true;\n    const [textState, setTextState] = useState('Welcome to React Native');\n    return (\n        \u003cView style={{\"flexDirection\": \"row\", \"display\": \"flex\", \"alignItems\": \"center\"}}\u003e\n            \u003cTouchableOpacity\n                onPress={() =\u003e setTextState('Rendered with Raspberry')}\u003e\n                \u003cText\n                    style={{\"textAlign\": \"right\", \"color\": \"red\"}}\n                    numberOfLines={1}\n                \u003e\n                    {textState}\n                \u003c/Text\u003e\n            \u003c/TouchableOpacity\u003e\n        \u003c/View\u003e\n    )\n}\n```\n\n## Converting\nIt's up to you to generate the Raspberry file. To convert it to JSX, simply run.\n```bash\nnode ./raspberry-cli.js path/to/input.raspberry.json path/to/output.jsx\n```\nYour file will be created, or overwritten if it already exists.\n\n## Specification v1.0\n```ts\ntype RsImport = {\n    name: string, // {Component} for named import, or Component\n    from: string  // my-package\n}\n\ntype RsComponent = {\n    import: RsImport,\n    props: object, // Any normal props you would have in React / RN\n    children?: [RsComponent]\n    stringChild?: string, // Components like \u003cText/\u003e take a string child.\n    logic?: {\n        renderIf: string // This string should return true of false when passed to eval()\n    }\n\n}\n\ntype RsFile = {\n    meta: {\n        fileName: string,\n        export: {\n            name: string // Currently only supports named export\n        },\n    },\n    bodyImports: [RsImport], // Any imports required by the body string\n    body: string, // All code that is not part of the return()\n    markup: RsComponent \n}\n```\n\n## Caveats\n- No support for class-based components\n- Currently only supports named export\n\n## Future Improvements\n- Optimise imports automatically\n- Support HOC like React.memo()\n- Better system for managing 'body' logic. Currently it's just a big string, but there is surely a better way to do this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj-mc%2Fraspberry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftj-mc%2Fraspberry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftj-mc%2Fraspberry/lists"}