diff --git a/.gitattributes b/.gitattributes index 6daa0e75..452e082e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,26 @@ BACKERS.md export-ignore CONTRIBUTING.md export-ignore CHANGELOG.md export-ignore + +# The package ships as the self-contained phar in builds/. Leaving the source out of the +# dist archive keeps Composer from adding the CLI's App\ classes to projects that install it. +/app export-ignore +/bootstrap export-ignore +/config export-ignore +/resources export-ignore +/scripts export-ignore +/tests export-ignore +/cloud export-ignore +/.cursorrules export-ignore +/.editorconfig export-ignore +/.env.example export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/AI_CLI_DESIGN_PRINCIPLES.md export-ignore +/CLAUDE.md export-ignore +/bosun.json export-ignore +/box.json export-ignore +/composer.lock export-ignore +/phpstan.neon.dist export-ignore +/phpunit.xml.dist export-ignore +/pint.json export-ignore diff --git a/bootstrap/app.php b/bootstrap/app.php index c0f685b6..bf03566a 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -2,4 +2,8 @@ use LaravelZero\Framework\Application; +// Loaded here rather than through Composer's "files" autoload, which would also load the +// helpers into every project that installs the CLI with `composer require`. +require_once dirname(__DIR__).'/app/helpers.php'; + return Application::configure(basePath: dirname(__DIR__))->create(); diff --git a/composer.json b/composer.json index e2459723..a88bb82f 100644 --- a/composer.json +++ b/composer.json @@ -44,13 +44,8 @@ }, "autoload": { "psr-4": { - "App\\": "app/", - "Database\\Factories\\": "database/factories/", - "Database\\Seeders\\": "database/seeders/" - }, - "files": [ - "app/helpers.php" - ] + "App\\": "app/" + } }, "autoload-dev": { "psr-4": {