{"id":13696611,"url":"https://github.com/ampproject/storybook-addon-amp","last_synced_at":"2025-09-04T10:41:35.732Z","repository":{"id":42526171,"uuid":"281196722","full_name":"ampproject/storybook-addon-amp","owner":"ampproject","description":"The storybook AMP addon","archived":false,"fork":false,"pushed_at":"2025-08-20T23:02:05.000Z","size":108,"stargazers_count":9,"open_issues_count":12,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-21T00:31:46.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ampproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-20T18:33:10.000Z","updated_at":"2025-03-30T00:47:05.000Z","dependencies_parsed_at":"2023-12-11T16:25:32.985Z","dependency_job_id":"0b170677-1bfc-4c24-a30e-eb7c326320ea","html_url":"https://github.com/ampproject/storybook-addon-amp","commit_stats":{"total_commits":68,"total_committers":6,"mean_commits":"11.333333333333334","dds":0.5882352941176471,"last_synced_commit":"5e9f3c026bcf4b310566d244210c575b5f687e97"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ampproject/storybook-addon-amp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fstorybook-addon-amp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fstorybook-addon-amp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fstorybook-addon-amp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fstorybook-addon-amp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ampproject","download_url":"https://codeload.github.com/ampproject/storybook-addon-amp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ampproject%2Fstorybook-addon-amp/sbom","scorecard":{"id":190571,"data":{"date":"2025-08-11","repo":{"name":"github.com/ampproject/storybook-addon-amp","commit":"5e9f3c026bcf4b310566d244210c575b5f687e97"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 2/27 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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T20:35:37.194Z","repository_id":42526171,"created_at":"2025-08-16T20:35:37.194Z","updated_at":"2025-08-16T20:35:37.194Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273595266,"owners_count":25134257,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"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":[],"created_at":"2024-08-02T18:00:43.435Z","updated_at":"2025-09-04T10:41:35.682Z","avatar_url":"https://github.com/ampproject.png","language":"TypeScript","funding_links":[],"categories":["Integrations"],"sub_categories":["React"],"readme":"# @ampproject/storybook-addon\n\nThe storybook AMP addon allows rendering of AMP content inside the Storybook\nenvironment.\n\n`@ampproject/storybook-addon` allows switching between three AMP modes:\nModule (`v0.js`), No-module (`v0.mjs`) and Bento. It also allows switching\nbetween development mode (locally hosted `v0.js`) and production mode (CDN\nhosted `v0.js`).\n\n## Getting Started\n\nFirst, add the `@ampproject/storybook-addon` to your project:\n\n```sh\nnpm install --save-dev @ampproject/storybook-addon\n```\n\nSecond, register the `@ampproject/storybook-addon` to your\nconfig (`.storybook/main.js`):\n\n```js\nmodule.exports = {\n  addons: ['@ampproject/storybook-addon'],\n};\n```\n\n## Writing storybooks\n\nAn AMP story uses `withAmp` decorator:\n\n```js\nimport {h} from 'preact';\nimport {storiesOf} from '@storybook/preact';\nimport {withAmp} from '@ampproject/storybook-addon';\n\nexport default {\n  title: 'amp-carousel',\n  decorators: [withAmp],\n  parameters: {\n    extensions: [{name: 'amp-carousel', version: '0.2'}]},\n  },\n};\n\nexport const Default = () =\u003e {\n  return (\n    \u003camp-base-carousel width=\"440\" height=\"225\"\u003e\n      {['lightcoral', 'peachpuff', 'lavender'].map((color) =\u003e (\n        \u003cdiv key={color}\u003e{color}\u003c/div\u003e\n      ))}\n    \u003c/amp-base-carousel\u003e\n  );\n};\n```\n\nThe following parameters can be specified:\n\n1. `extensions: [{name, version}]` - a list of extensions to be installed.\n2. `experiments: [string]` - a list of experiments to enabled.\n\n### `amp-script` hashes\n\nInline scripts used by `amp-script` require a `\u003cmeta name=\"amp-script-src\"\u003e` tag that includes [their content hash](https://amp.dev/documentation/components/amp-script/#calculating-the-script-hash).\n\nThis addon generates the script hash for stories that need it. The following works without writing the respective `\u003cmeta\u003e` tag:\n\n```js\nexport const UsingInlineScript = () =\u003e (\n  \u003c\u003e\n    \u003camp-script script=\"hello\" nodom\u003e\u003c/amp-script\u003e\n    \u003cscript id=\"hello\" type=\"text/plain\" target=\"amp-script\"\u003e\n      {`console.log('Hello');`}\n    \u003c/script\u003e\n  \u003c/\u003e\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampproject%2Fstorybook-addon-amp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fampproject%2Fstorybook-addon-amp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fampproject%2Fstorybook-addon-amp/lists"}