{"id":15171887,"url":"https://github.com/devfle/badgy","last_synced_at":"2026-01-27T10:01:34.085Z","repository":{"id":256974342,"uuid":"856979492","full_name":"devfle/badgy","owner":"devfle","description":"An addon that allows you to add a badge to your storybook for many different creative purposes.","archived":false,"fork":false,"pushed_at":"2024-09-13T15:24:58.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T03:37:56.907Z","etag":null,"topics":["reactjs","storybook","storybook-addon"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devfle.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}},"created_at":"2024-09-13T15:14:18.000Z","updated_at":"2024-09-13T15:25:01.000Z","dependencies_parsed_at":"2024-09-14T15:30:31.991Z","dependency_job_id":null,"html_url":"https://github.com/devfle/badgy","commit_stats":null,"previous_names":["devfle/badgy"],"tags_count":0,"template":false,"template_full_name":"storybookjs/addon-kit","purl":"pkg:github/devfle/badgy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfle%2Fbadgy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfle%2Fbadgy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfle%2Fbadgy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfle%2Fbadgy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devfle","download_url":"https://codeload.github.com/devfle/badgy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfle%2Fbadgy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["reactjs","storybook","storybook-addon"],"created_at":"2024-09-27T09:21:11.889Z","updated_at":"2026-01-27T10:01:34.061Z","avatar_url":"https://github.com/devfle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storybook Addon Badgy\nAn addon that allows you to add a badge to your storybook for many different creative purposes.\n\n### Development scripts\n\n- `npm run start` runs babel in watch mode and starts Storybook\n- `npm run build` build and package your addon code\n\n### Switch from TypeScript to JavaScript\n\nDon't want to use TypeScript? We offer a handy eject command: `npm run eject-ts`\n\nThis will convert all code to JS. It is a destructive process, so we recommended running this before you start writing any code.\n\n## What's included?\n\n![Demo](https://user-images.githubusercontent.com/42671/107857205-e7044380-6dfa-11eb-8718-ad02e3ba1a3f.gif)\n\nThe addon code lives in `src`. It demonstrates all core addon related concepts. The three [UI paradigms](https://storybook.js.org/docs/react/addons/addon-types#ui-based-addons)\n\n- `src/Tool.tsx`\n- `src/Panel.tsx`\n- `src/Tab.tsx`\n\nWhich, along with the addon itself, are registered in `src/manager.ts`.\n\nManaging State and interacting with a story:\n\n- `src/withGlobals.ts` \u0026 `src/Tool.tsx` demonstrates how to use `useGlobals` to manage global state and modify the contents of a Story.\n- `src/withRoundTrip.ts` \u0026 `src/Panel.tsx` demonstrates two-way communication using channels.\n- `src/Tab.tsx` demonstrates how to use `useParameter` to access the current story's parameters.\n\nYour addon might use one or more of these patterns. Feel free to delete unused code. Update `src/manager.ts` and `src/preview.ts` accordingly.\n\nLastly, configure you addon name in `src/constants.ts`.\n\n### Bundling\n\nAddons can interact with a Storybook project in multiple ways. It is recommended to familiarize yourself with [the basics](https://storybook.js.org/docs/react/addons/introduction) before getting started.\n\n- Manager entries are used to add UI or behavior to the Storybook manager UI.\n- Preview entries are used to add UI or behavior to the preview iframe where stories are rendered.\n- Presets are used to modify the Storybook configuration, similar to how [users can configure their `main.ts` configurations](https://storybook.js.org/docs/react/api/main-config).\n\nSince each of these places represents a different environment with different features and modules, it is also recommended to split and build your modules accordingly. This addon-kit comes with a preconfigured [bundling configuration](./tsup.config.ts) that supports this split, and you are free to modify and extend it as needed.\n\nYou can define which modules match which environments in the [`package.json#bundler`](./package.json) property:\n\n- `exportEntries` is a list of module entries that users can manually import from anywhere they need to. For example, you could have decorators that users need to import into their `preview.ts` file or utility functions that can be used in their `main.ts` files.\n- `managerEntries` is a list of module entries meant only for the manager UI. These modules will be bundled to ESM and won't include types since they are mostly loaded by Storybook directly.\n- `previewEntries` is a list of module entries meant only for the preview UI. These modules will be bundled to ESM and won't include types since they are mostly loaded by Storybook directly.\n\nManager and preview entries are only used in the browser so they only output ESM modules. Export entries could be used both in the browser and in Node depending on their use case, so they both output ESM and CJS modules.\n\n#### Globalized packages\n\nStorybook provides a predefined set of packages that are available in the manager UI and the preview UI. In the final bundle of your addon, these packages should not be included. Instead, the imports should stay in place, allowing Storybook to replace those imports with the actual packages during the Storybook build process.\n\nThe list of packages differs between the manager and the preview, which is why there is a slight difference between `managerEntries` and `previewEntries`. Most notably, `react` and `react-dom` are prebundled in the manager but not in the preview. This means that your manager entries can use React to build UI without bundling it or having a direct reference to it. Therefore, it is safe to have React as a `devDependency` even though you are using it in production. _Requiring React as a peer dependency would unnecessarily force your users to install React._\n\nAn exception to this rule is if you are using React to inject UI into the preview, which does not come prebundled with React. In such cases, you need to move `react` and `react-dom` to a peer dependency. However, we generally advise against this pattern since it would limit the usage of your addon to React-based Storybooks.\n\n### Metadata\n\nStorybook addons are listed in the [catalog](https://storybook.js.org/addons) and distributed via npm. The catalog is populated by querying npm's registry for Storybook-specific metadata in `package.json`. This project has been configured with sample data. Learn more about available options in the [Addon metadata docs](https://storybook.js.org/docs/react/addons/addon-catalog#addon-metadata).\n\n## Documentation\n\nTo help the community use your addon and understand its capabilities, please document it thoroughly.\n\nTo get started, replace this README with the content in this sample template, modeled after how essential addons (like [Actions](https://storybook.js.org/docs/essentials/actions)) are documented. Then update the content to describe your addon.\n\n### Sample documentation template\n\n````md\n# My Addon\n\n## Installation\n\nFirst, install the package.\n\n```sh\nnpm install --save-dev my-addon\n```\n\nThen, register it as an addon in `.storybook/main.js`.\n\n```js\n// .storybook/main.ts\n\n// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)\nimport type { StorybookConfig } from '@storybook/your-framework';\n\nconst config: StorybookConfig = {\n  // ...rest of config\n  addons: [\n    '@storybook/addon-essentials'\n    'my-addon', // 👈 register the addon here\n  ],\n};\n\nexport default config;\n```\n\n## Usage\n\nThe primary way to use this addon is to define the `exampleParameter` parameter. You can do this the\ncomponent level, as below, to affect all stories in the file, or you can do it for a single story.\n\n```js\n// Button.stories.ts\n\n// Replace your-framework with the name of your framework\nimport type { Meta } from '@storybook/your-framework';\n\nimport { Button } from './Button';\n\nconst meta: Meta\u003ctypeof Button\u003e = {\n  component: Button,\n  parameters: {\n    myAddon: {\n      exampleParameter: true,\n      // See API section below for available parameters\n    }\n  }\n};\n\nexport default meta;\n```\n\nAnother way to use the addon is...\n\n## API\n\n### Parameters\n\nThis addon contributes the following parameters to Storybook, under the `myAddon` namespace:\n\n#### `disable`\n\nType: `boolean`\n\nDisable this addon's behavior. This parameter is most useful to allow overriding at more specific\nlevels. For example, if this parameter is set to true at the project level, it could then be\nre-enabled by setting it to false at the meta (component) or story level.\n\n### Options\n\nWhen registering this addon, you can configure it with the following options, which are passed when\nregistering the addon, like so:\n\n```ts\n// .storybook/main.ts\n\n// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)\nimport type { StorybookConfig } from '@storybook/your-framework';\n\nconst config: StorybookConfig = {\n  // ...rest of config\n  addons: [\n    '@storybook/essentials',\n    {\n      name: 'my-addon',\n      options: {\n        // 👈 options for my-addon go here\n      },\n    },\n  ],\n};\n\nexport default config;\n```\n\n#### `useExperimentalBehavior`\n\nType: `boolean`\n\nEnable experimental behavior to...\n\n````\n\n## Release Management\n\n### Setup\n\nThis project is configured to use [auto](https://github.com/intuit/auto) for release management. It generates a changelog and pushes it to both GitHub and npm. Therefore, you need to configure access to both:\n\n- [`NPM_TOKEN`](https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-access-tokens) Create a token with both _Read and Publish_ permissions.\n- [`GH_TOKEN`](https://github.com/settings/tokens) Create a token with the `repo` scope.\n\nThen open your `package.json` and edit the following fields:\n\n- `name`\n- `author`\n- `repository`\n\n#### Local\n\nTo use `auto` locally create a `.env` file at the root of your project and add your tokens to it:\n\n```bash\nGH_TOKEN=\u003cvalue you just got from GitHub\u003e\nNPM_TOKEN=\u003cvalue you just got from npm\u003e\n```\n\nLastly, **create labels on GitHub**. You’ll use these labels in the future when making changes to the package.\n\n```bash\nnpx auto create-labels\n```\n\nIf you check on GitHub, you’ll now see a set of labels that `auto` would like you to use. Use these to tag future pull requests.\n\n#### GitHub Actions\n\nThis template comes with GitHub actions already set up to publish your addon anytime someone pushes to your repository.\n\nGo to `Settings \u003e Secrets`, click `New repository secret`, and add your `NPM_TOKEN`.\n\n### Creating a release\n\nTo create a release locally you can run the following command, otherwise the GitHub action will make the release for you.\n\n```sh\nnpm run release\n```\n\nThat will:\n\n- Build and package the addon code\n- Bump the version\n- Push a release to GitHub and npm\n- Push a changelog to GitHub\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfle%2Fbadgy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevfle%2Fbadgy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfle%2Fbadgy/lists"}