{"id":37261767,"url":"https://github.com/yardinternet/nutshell","last_synced_at":"2026-01-15T23:12:37.596Z","repository":{"id":332455788,"uuid":"893786262","full_name":"yardinternet/nutshell","owner":"yardinternet","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-07T17:25:18.000Z","size":567,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-14T01:00:03.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/yardinternet.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-25T07:59:05.000Z","updated_at":"2026-01-07T17:25:22.000Z","dependencies_parsed_at":"2026-01-14T01:00:10.506Z","dependency_job_id":null,"html_url":"https://github.com/yardinternet/nutshell","commit_stats":null,"previous_names":["yardinternet/nutshell"],"tags_count":8,"template":false,"template_full_name":"yardinternet/skeleton-package","purl":"pkg:github/yardinternet/nutshell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yardinternet%2Fnutshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yardinternet%2Fnutshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yardinternet%2Fnutshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yardinternet%2Fnutshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yardinternet","download_url":"https://codeload.github.com/yardinternet/nutshell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yardinternet%2Fnutshell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"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":[],"created_at":"2026-01-15T23:12:36.832Z","updated_at":"2026-01-15T23:12:37.590Z","avatar_url":"https://github.com/yardinternet.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nutshell: Enhanced Acorn Support for WordPress Themes\n\n[![Code Style](https://github.com/yardinternet/skeleton-package/actions/workflows/format-php.yml/badge.svg?no-cache)](https://github.com/yardinternet/skeleton-package/actions/workflows/format-php.yml)\n[![PHPStan](https://github.com/yardinternet/skeleton-package/actions/workflows/phpstan.yml/badge.svg?no-cache)](https://github.com/yardinternet/skeleton-package/actions/workflows/phpstan.yml)\n\n**Nutshell** is a feature-rich package designed to extend [Acorn](https://roots.io/acorn/) for WordPress themes. It provides a flexible foundation for advanced theme development, including configuration inheritance, Sentry integration, Vite asset support, and more.\n\n## Features\n\n- **Child Theme Configuration Inheritance**:\n  - Allows child themes to override parent configuration files without directory scans.\n  - Uses a custom configuration repository to support unsetting and merging config values.\n- **Vite Asset Support**:\n  - Integrates with Vite for modern asset bundling and hot reloading.\n- **Sentry Integration**:\n  - Seamless error reporting via Sentry for Laravel.\n- **Custom View Composers**:\n  - Manual registration of view composers for fine-grained control.\n- **Custom Console Commands**:\n  - Register custom Artisan commands via configuration.\n\n## Requirements\n\n- PHP \u003e= 8.1\n- [Acorn](https://github.com/roots/acorn) ^4.3\n- Composer\n\n## Installation\n\n1. Install this package with composer\n\n   ```sh\n   composer require yard/nutshell\n   ```\n\n2. Ensure your project's `composer.json` uses PSR-4 autoloading for your theme and childtheme and remove any redundant autoloading from the theme itself.\n\n   ```diff\n   \"autoload\": {\n      \"psr-4\": {\n      \"App\\\\\": \"web/app/themes/sage/app/\",\n   +   \"ChildTheme\\\\App\\\\\": \"web/app/themes/child-theme/app/\",\n      }\n   },\n   ```\n\n## Configuration\n\n\u003e [!IMPORTANT]\n\u003e After this change:\n\u003e\n\u003e - View Composers in the app/View/Composers directory will no longer be loaded automatically. To ensure they are registered, you have to configure them manually.\n\u003e - Console Commands in the app/Console/Commands directory will no longer be loaded automatically. To ensure they are register, you have to configure them manually.\n\n1. **Child Theme Setup**\n   - Create a child theme with Sage as the parent theme. See [WordPress Child Themes](https://developer.wordpress.org/themes/advanced-topics/child-themes/#how-to-create-a-child-theme).\n\n      Example `style.css`:\n\n      ```css\n      /**\n         * Theme Name:         Sage Child Theme\n         * Template:           sage\n         * Theme URI:          https://www.example.com/sage-child/\n         * Description:        Sage child theme\n         * Version:            1.0.0\n         * Author:             Example Inc.\n         * Author URI:         http://www.example.com/\n         * Text Domain:        sage\n         * License:            MIT License\n         * License URI:        https://opensource.org/licenses/MIT\n         * Requires PHP:       8.1\n         * Requires at least:  5.9\n         */\n         ```\n\n   - Place your configuration files in `config/` within your child theme directory. These will be merged with the parent configuration where child theme configuration takes precedence. To unset a configuration option from the parent theme in the child theme you can pass an empty array for that configuration option.\n\n2. **Update Acorn Bootloader**\n\n   - In your theme's `functions.php`, use the `Yard\\Nutshell\\bootloader()` helper to bootstrap Acorn with Nutshell's enhancements.\n\n      ```diff\n      -\\Roots\\bootloader()-\u003eboot();\n      +define('ACORN_BASEPATH', __DIR__);\n      +\\Yard\\Nutshell\\bootloader()-\u003eboot();\n      ```\n\n3. **Update app config**\n\n   - In your themes `config/app.php' replace Acorn's ServiceProvider with Nutshell's ServiceProvider\n\n      ```diff\n      -use Roots\\Acorn\\ServiceProvider;\n      +use Yard\\Nutshell\\ServiceProvider;\n      ```\n\n4. **Register View Composers**\n   - Add your view composers to `config/view.php` under the `composers` key. Automatic discovery is disabled for explicit control.\n\n      ```diff\n      -  'composers' =\u003e [],\n      +  'composers =\u003e [\n      +    'app' =\u003e App\\View\\Composers\\App::class,\n      +    'comments' =\u003e App\\View\\Composers\\Comments::class,\n      +    'post' =\u003e App\\View\\Composers\\Post::class,\n      +  ],\n      ```\n\n5. **Register Console Commands**\n   - Add custom Artisan commands to `config/console.php` under the `commands` key.\n\n      ```diff\n      +  'commands =\u003e [\n      +    'test' =\u003e App\\Console\\Commands\\Test::class,\n      +  ],\n      ```\n\n6. **Vite Integration**\n   - Vite is enabled by default. Use the provided `Yard\\Nutshell\\Assets\\Vite` class for asset management.\n\n7. **Sentry Integration**\n   - Sentry is automatically integrated if `sentry/sentry-laravel` is installed and configured.\n\n## Usage\n\n- **Configuration Inheritance**: Any config file in your child theme's `config/` directory will override the parent. Empty config files will unset the corresponding configuration.\n- **View Composers**: Register all composers manually in `config/view.php`.\n- **Console Commands**: Register all commands manually in `config/console.php`.\n- **Vite**: Use the `@vite` directive or helper as usual; Nutshell ensures correct asset paths.\n- **Sentry**: Errors and exceptions are reported to Sentry automatically.\n\n## About us\n\n[![banner](https://raw.githubusercontent.com/yardinternet/.github/refs/heads/main/profile/assets/small-banner-github.svg)](https://www.yard.nl/werken-bij/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyardinternet%2Fnutshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyardinternet%2Fnutshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyardinternet%2Fnutshell/lists"}