{"id":18039571,"url":"https://github.com/bwillis/packwerk_mermaid","last_synced_at":"2025-03-27T10:32:19.179Z","repository":{"id":200439941,"uuid":"705503642","full_name":"bwillis/packwerk_mermaid","owner":"bwillis","description":"Ruby gem to generate Mermaid diagrams for packwerk projects","archived":false,"fork":false,"pushed_at":"2023-12-02T01:18:55.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-09T16:15:59.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/bwillis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-16T06:26:12.000Z","updated_at":"2023-11-29T05:45:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"80e3305d-57c6-4e7d-ab68-52a96df70679","html_url":"https://github.com/bwillis/packwerk_mermaid","commit_stats":null,"previous_names":["bwillis/packwerk_mermaid"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwillis%2Fpackwerk_mermaid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwillis%2Fpackwerk_mermaid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwillis%2Fpackwerk_mermaid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwillis%2Fpackwerk_mermaid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwillis","download_url":"https://codeload.github.com/bwillis/packwerk_mermaid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222235882,"owners_count":16953366,"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":"2024-10-30T14:09:47.784Z","updated_at":"2024-10-30T14:09:48.455Z","avatar_url":"https://github.com/bwillis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Packwerk Mermaid\n\nThis is a simple gem for a project using [packwerk](https://github.com/Shopify/packwerk) to generate a [Mermaid](https://mermaid.js.org/) diagram. When you generate the output, you can get a diagram that looks like this:\n\n```mermaid\n---\ntitle: App Name\n---\nflowchart TD\n    0(\"Nelson Hamill\") --\u003e 1(\"Msgr. Cynthia Dickens\");\n    0 --\u003e 2(\"Adell Friesen MD\");\n    2 --\u003e 3(\"Cortez Purdy\");\n    2 --\u003e 4(\"Renaldo Collier\");\n    2 --\u003e 5(\"Titus Schamberger\");\n    2 --\u003e 6(\"Efren Kuhlman\");\n    2 --\u003e 7(\"Osvaldo Legros Esq.\");\n    2 --\u003e 8(\"Byron Hammes\");\n    6 --\u003e 9(\"Carlo Nolan DDS\");\n    3 --\u003e 9;\n    1 --\u003e 2;\n    10(\"Mayola Kovacek\") --\u003e 2;\n    10 --\u003e 1;\n    10 --\u003e 5;\n    10 --\u003e 6;\n\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'packwerk_mermaid'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install packwerk_mermaid\n\n## Usage\n\nThere is no CLI, but it's easy enough to write a Ruby script and run it like so:\n\n```ruby\nrequire \"packwerk_mermaid\"\nrequire \"packwerk_mermaid/packwerk_flowchart\"\n\nconfiguration = PackwerkMermaid.configure do |config|\n  # The title that appears at the top of your diagram\n  config.mermaid_title = 'Title of my Diagram'\n  \n  # Text or Markdown support\n  config.mermaid_text_type = 'text'\n  \n  # What shape should the diagram use\n  config.mermaid_shape_style = 'rectangle_rounded'\n  \n  # What directory is packwerk's root dir\n  config.packwerk_directory = '.'\n  \n  # Simple static mapping for renaming packages, these happened\n  # before the packwerk_package_name_callback runs\n  config.packwerk_package_name_mapping = {\n    '.' =\u003e 'root',\n    'packs/cli' =\u003e 'CLI',\n  }\n  \n  # Flexible way to rename packages\n  config.packwerk_package_name_callback = lambda { |name| name.gsub('packs/', '') }\n\n  # Simple static mapping of packages to hide\n  config.packwerk_packages_hidden = [\n    'packs/utilities',\n    'packs/legacy_service',\n  ]\n  \n  # Flexible way to show/hide packages\n  config.packwerk_package_name_callback = lambda { |node_name, parent_node_name| should_show?(node_name) }\nend\n\nPackwerkMermaid::PackwerkFlowchart.new(configuration).generate\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/bwillis/packwerk_mermaid. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/bwillis/packwerk_mermaid/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the PackwerkMermaid project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bwillis/packwerk_mermaid/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwillis%2Fpackwerk_mermaid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwillis%2Fpackwerk_mermaid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwillis%2Fpackwerk_mermaid/lists"}