{"id":15771893,"url":"https://github.com/trashhalo/constant_sandbox","last_synced_at":"2025-08-03T18:33:41.613Z","repository":{"id":69481349,"uuid":"339257429","full_name":"trashhalo/constant_sandbox","owner":"trashhalo","description":"Tool for ruby codebases used to enforce boundaries and modularize Rails applications","archived":false,"fork":false,"pushed_at":"2021-02-20T22:45:17.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T15:15:09.120Z","etag":null,"topics":["linter","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/trashhalo.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":"2021-02-16T01:46:06.000Z","updated_at":"2024-03-21T00:29:19.000Z","dependencies_parsed_at":"2023-04-11T19:02:59.261Z","dependency_job_id":null,"html_url":"https://github.com/trashhalo/constant_sandbox","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.5,"last_synced_commit":"48e881930f268a6e0562e40094b14b979112a5ee"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trashhalo%2Fconstant_sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trashhalo%2Fconstant_sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trashhalo%2Fconstant_sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trashhalo%2Fconstant_sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trashhalo","download_url":"https://codeload.github.com/trashhalo/constant_sandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289429,"owners_count":20914464,"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":["linter","rails","ruby"],"created_at":"2024-10-04T15:05:55.724Z","updated_at":"2025-04-05T05:10:35.676Z","avatar_url":"https://github.com/trashhalo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# constant_sandbox\n\nConstant Sandbox is a cli tool for ruby codebases used to enforce boundaries and modularize Rails applications. Inspired by [packwerk](https://github.com/Shopify/packwerk) but without the rails 6 requirement.\n\nConstant Sandbox can be used to:\n\n* Combine groups of files into packages\n* Define package-level constant visibility (i.e. have publicly accessible constants)\n* Enforce privacy (inbound) and dependency (outbound) boundaries between packages\n* Help existing codebases to become more modular without obstructing development\n\n## Prerequisites\n\nNo dependencies are required for your ruby codebase. The [parser library used](https://github.com/lib-ruby-parser/lib-ruby-parser) support ruby 3.0.\n\n## Installation\n\n### Homebrew (linux/mac)\n```\nbrew install trashhalo/homebrew-brews/constant_sandbox\n```\n### Releases (linux/mac/win)\nhttps://github.com/trashhalo/constant_sandbox/releases\n\n## Usage\n\nThe primary sub-command to use this tool is `verify`. This looks for `box.yml` files in your codebase that it treats as entry points for packages. These `box.yml` allow you to define what constants this folder exports and imports to the rest of your codebase.\n\nTo create your first constant sandbox the `init` command can take a folder and generate values for imports and exports based on your current usage.\n\n```\nconstant_sandbox init lib/rubrowser/parser\n```\n\nYou can now verify the box that was created by typing:\n\n```\nconstant_sandbox verify\n```\n\nThe last command available is `inspect`. This command evaluates your ruby codebase and outputs to stdout all of the connections that exist to the provided folder. Outputing a box configuration that would cover your current usage. This is useful for learning more about the cohesion of your codebase.\n\nExample output:\n```\nFor more information try --help\n../constant_sandbox/target/release/constant_sandbox inspect lib/rubrowser/parser\nnon exported reference Rubrowser::Parser::Factory found in lib/rubrowser/data.rb on line 26\nnon imported reference Parser::Builders::Default found in lib/rubrowser/parser/file/builder.rb on line 8\nnon imported reference Parser::SyntaxError found in lib/rubrowser/parser/file.rb on line 26\nnon imported reference Parser::Source::Buffer found in lib/rubrowser/parser/file.rb on line 33\nnon imported reference Encoding::UTF_8 found in lib/rubrowser/parser/file.rb on line 34\nnon imported reference Parser::CurrentRuby found in lib/rubrowser/parser/file.rb on line 41\nnon imported reference Parser::AST::Node found in lib/rubrowser/parser/file.rb on line 145\n---\nimports:\n  - \"Encoding::UTF_8\"\n  - \"Parser::AST::Node\"\n  - \"Parser::Builders::Default\"\n  - \"Parser::CurrentRuby\"\n  - \"Parser::Source::Buffer\"\n  - \"Parser::SyntaxError\"\nexports:\n  - \"Rubrowser::Parser::Factory\"\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrashhalo%2Fconstant_sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrashhalo%2Fconstant_sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrashhalo%2Fconstant_sandbox/lists"}