From 43be613b3d2778f36961813eba6b6d4716df2492 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Nov 2026 05:53:55 +0000 Subject: [PATCH 1/2] Rename the package and PHP namespace to ShadeTheory. The GitHub account is gone and the org is shadetheory, so the Composer package, PSR-4 root, and Laravel discovery entries move with it. Co-authored-by: Jordan Partridge --- .claude/CLAUDE.md | 4 +- .claude/agents/github-repo-maintainer.md | 18 +++--- .github/FUNDING.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 6 +- .github/workflows/devnull.yml | 2 +- CHANGELOG.md | 2 + LICENSE.md | 2 +- README.md | 58 +++++++++---------- composer.json | 10 ++-- docs/ARCHITECTURE.md | 6 +- docs/advanced-usage.md | 6 +- docs/api-reference.md | 8 +-- docs/core-concepts.md | 2 +- docs/getting-started.md | 4 +- src/Auth/AuthenticationStrategy.php | 4 +- src/Auth/GitHubAppAuthentication.php | 6 +- src/Auth/GithubOAuth.php | 4 +- src/Auth/TokenAuthentication.php | 4 +- src/Auth/TokenResolver.php | 2 +- src/Commands/GithubClientCommand.php | 6 +- src/Concerns/HandlesIssueResponses.php | 4 +- src/Concerns/ValidatesRepoName.php | 2 +- src/Connectors/GithubConnector.php | 22 +++---- src/Contracts/ResourceInterface.php | 4 +- src/Data/Commits/CommitAuthorData.php | 2 +- src/Data/Commits/CommitData.php | 4 +- src/Data/Commits/CommitDetailsData.php | 8 +-- src/Data/Commits/CommitFileData.php | 2 +- src/Data/Commits/CommitStatsData.php | 2 +- src/Data/FileDTO.php | 2 +- src/Data/GitUserData.php | 2 +- src/Data/Installations/InstallationData.php | 2 +- .../Installations/InstallationTokenData.php | 2 +- src/Data/Issues/IssueCommentDTO.php | 4 +- src/Data/Issues/IssueDTO.php | 4 +- src/Data/Issues/LabelDTO.php | 2 +- src/Data/Pulls/CommentMetadata.php | 2 +- src/Data/Pulls/MergeResponseDTO.php | 2 +- src/Data/Pulls/Params.php | 8 +-- src/Data/Pulls/PullRequestCommentDTO.php | 4 +- src/Data/Pulls/PullRequestDTO.php | 4 +- src/Data/Pulls/PullRequestDTOFactory.php | 2 +- src/Data/Pulls/PullRequestDetailDTO.php | 4 +- src/Data/Pulls/PullRequestFileDTO.php | 2 +- src/Data/Pulls/PullRequestReviewDTO.php | 4 +- src/Data/Pulls/PullRequestSummaryDTO.php | 4 +- src/Data/RateLimitDTO.php | 2 +- src/Data/Releases/ReleaseData.php | 4 +- src/Data/Repos/LicenseData.php | 2 +- src/Data/Repos/RepoData.php | 6 +- src/Data/Repos/SearchRepositoriesData.php | 2 +- src/Data/TreeData.php | 2 +- src/Data/VerificationData.php | 2 +- src/Enums/Direction.php | 2 +- src/Enums/Issues/Sort.php | 2 +- src/Enums/Issues/State.php | 2 +- src/Enums/MergeMethod.php | 2 +- src/Enums/Pulls/Sort.php | 2 +- src/Enums/Pulls/State.php | 2 +- src/Enums/Repos/State.php | 2 +- src/Enums/Repos/Type.php | 2 +- src/Enums/Sort.php | 2 +- src/Enums/Visibility.php | 2 +- src/Exceptions/ApiException.php | 2 +- src/Exceptions/AuthenticationException.php | 2 +- src/Exceptions/GithubAuthException.php | 2 +- src/Exceptions/GithubClientException.php | 2 +- src/Exceptions/NetworkException.php | 2 +- src/Exceptions/RateLimitException.php | 2 +- src/Exceptions/ResourceNotFoundException.php | 2 +- src/Exceptions/ValidationException.php | 2 +- src/Facades/Github.php | 30 +++++----- src/Facades/GithubOAuth.php | 4 +- src/Github.php | 38 ++++++------ src/GithubClientServiceProvider.php | 8 +-- src/Requests/Actions/GetWorkflowRuns.php | 2 +- src/Requests/Actions/ListWorkflows.php | 2 +- src/Requests/Actions/TriggerWorkflow.php | 2 +- src/Requests/Commits/Get.php | 8 +-- src/Requests/Commits/Index.php | 4 +- src/Requests/Files/Index.php | 6 +- .../Installations/CreateAccessToken.php | 4 +- .../Installations/GetInstallation.php | 4 +- .../Installations/ListInstallations.php | 4 +- src/Requests/Issues/Comments.php | 4 +- src/Requests/Issues/Create.php | 4 +- src/Requests/Issues/CreateComment.php | 4 +- src/Requests/Issues/DeleteComment.php | 2 +- src/Requests/Issues/Get.php | 4 +- src/Requests/Issues/GetComment.php | 4 +- src/Requests/Issues/Index.php | 10 ++-- src/Requests/Issues/RepoIndex.php | 10 ++-- src/Requests/Issues/Update.php | 6 +- src/Requests/Issues/UpdateComment.php | 4 +- src/Requests/Pulls/Comments.php | 6 +- src/Requests/Pulls/CommentsWithFilters.php | 6 +- src/Requests/Pulls/Create.php | 6 +- src/Requests/Pulls/CreateComment.php | 6 +- src/Requests/Pulls/CreateReview.php | 6 +- src/Requests/Pulls/DeleteComment.php | 2 +- src/Requests/Pulls/Files.php | 6 +- src/Requests/Pulls/Get.php | 6 +- src/Requests/Pulls/GetComment.php | 4 +- src/Requests/Pulls/GetWithDetailDTO.php | 10 ++-- src/Requests/Pulls/Index.php | 10 ++-- src/Requests/Pulls/IndexWithSummaryDTO.php | 12 ++-- src/Requests/Pulls/Merge.php | 8 +-- src/Requests/Pulls/Reviews.php | 6 +- src/Requests/Pulls/Update.php | 6 +- src/Requests/Pulls/UpdateComment.php | 4 +- src/Requests/RateLimit/Get.php | 4 +- src/Requests/Releases/Get.php | 4 +- src/Requests/Releases/Index.php | 4 +- src/Requests/Releases/Latest.php | 4 +- src/Requests/Repos/Delete.php | 4 +- src/Requests/Repos/Get.php | 6 +- src/Requests/Repos/Index.php | 12 ++-- src/Requests/Repos/Search.php | 8 +-- src/Requests/User.php | 2 +- src/Resources/ActionsResource.php | 8 +-- src/Resources/BaseResource.php | 6 +- src/Resources/CommentsResource.php | 6 +- src/Resources/CommitResource.md | 2 +- src/Resources/CommitResource.php | 10 ++-- src/Resources/FileResource.php | 6 +- src/Resources/InstallationsResource.php | 12 ++-- src/Resources/IssuesResource.php | 32 +++++----- src/Resources/PullRequestResource.php | 50 ++++++++-------- src/Resources/PullRequestResourceEnhanced.php | 8 +-- src/Resources/README.md | 4 +- src/Resources/ReleasesResource.php | 10 ++-- src/Resources/RepoResource.php | 26 ++++----- src/ValueObjects/Repo.php | 2 +- tests/ActionsResourceTest.php | 2 +- tests/ArchTest.php | 6 +- tests/AuthenticationTest.php | 10 ++-- tests/CommentMappingBugfixTest.php | 2 +- tests/CommitResourceTest.php | 28 ++++----- tests/DTOConversionTest.php | 4 +- tests/DTOPatternTest.php | 8 +-- tests/DocumentationExamplesTest.php | 52 ++++++++--------- tests/GithubAppAuthenticationTest.php | 6 +- tests/GithubConnectorAuthStatusTest.php | 12 ++-- tests/IssuesTest.php | 8 +-- tests/IssuesValidationTest.php | 2 +- tests/OAuthTest.php | 4 +- tests/Pest.php | 2 +- tests/PullRequestCommentMappingTest.php | 2 +- tests/PullRequestDTOTest.php | 2 +- tests/PullRequestDiffAnalysisTest.php | 2 +- tests/PullRequestFilesTest.php | 2 +- tests/PullRequestImprovementsTest.php | 2 +- tests/PullRequestsTest.php | 10 ++-- tests/RateLimitTest.php | 6 +- tests/ReleasesTest.php | 4 +- tests/ReposTest.php | 8 +-- tests/SearchTest.php | 8 +-- tests/TestCase.php | 4 +- .../Data/CommentMetadataExtractionTest.php | 2 +- tests/Unit/Data/GitUserDataTest.php | 2 +- tests/Unit/Data/RepoDataTest.php | 4 +- tests/Unit/Data/SimpleFileAnalysisTest.php | 2 +- tests/Unit/ExceptionTest.php | 12 ++-- tests/Unit/ValueObjects/RepoTest.php | 2 +- tests/ValidatesRepoNameTest.php | 2 +- 165 files changed, 521 insertions(+), 519 deletions(-) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 6a116516..b834cf81 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -6,9 +6,9 @@ Notes for working in this repository. A Laravel package that calls the GitHub REST API with Saloon. Resources live in `src/Resources` and build request classes in `src/Requests`. Responses are mapped by `createDtoFromResponse()` onto plain PHP objects in `src/Data`. Those objects are not Spatie Laravel Data objects. -The facade `JordanPartridge\GithubClient\Facades\Github` resolves `JordanPartridge\GithubClient\Github`. Inject that class. There is no `GithubConnectorInterface`. +The facade `ShadeTheory\GithubClient\Facades\Github` resolves `ShadeTheory\GithubClient\Github`. Inject that class. There is no `GithubConnectorInterface`. -The connector is `JordanPartridge\GithubClient\Connectors\GithubConnector`. Its base URL is `https://api.github.com`. +The connector is `ShadeTheory\GithubClient\Connectors\GithubConnector`. Its base URL is `https://api.github.com`. ## Commands diff --git a/.claude/agents/github-repo-maintainer.md b/.claude/agents/github-repo-maintainer.md index 801e0134..52497609 100644 --- a/.claude/agents/github-repo-maintainer.md +++ b/.claude/agents/github-repo-maintainer.md @@ -29,7 +29,7 @@ Automatically categorize, label, and prioritize incoming issues based on content ### Example ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; // Fetch new issues without labels $issues = Github::issues()->all('owner/repo', state: 'open'); @@ -96,7 +96,7 @@ Perform automated code review checks on incoming pull requests. ### Example ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; // Get open PRs ready for review $pulls = Github::pulls()->all('owner/repo', state: 'open'); @@ -178,7 +178,7 @@ Detect and help resolve merge conflicts in pull requests. ### Example ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; // Find PRs with merge conflicts $pulls = Github::pulls()->all('owner/repo', state: 'open'); @@ -258,7 +258,7 @@ Automate the release process including changelog generation and version tagging. ### Example ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; // Get the latest release $releases = Github::releases()->all('owner/repo'); @@ -371,7 +371,7 @@ Identify and manage stale issues and pull requests to keep the repository clean. ### Example ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; use Carbon\Carbon; $staleDays = 30; @@ -452,7 +452,7 @@ Monitor and respond to dependency security vulnerabilities. ### Example ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; use Illuminate\Support\Facades\Process; // Run composer audit to check for vulnerabilities @@ -604,9 +604,9 @@ protected function schedule(Schedule $schedule) All skills should implement proper error handling: ```php -use JordanPartridge\GithubClient\Exceptions\RateLimitException; -use JordanPartridge\GithubClient\Exceptions\AuthenticationException; -use JordanPartridge\GithubClient\Exceptions\ApiException; +use ShadeTheory\GithubClient\Exceptions\RateLimitException; +use ShadeTheory\GithubClient\Exceptions\AuthenticationException; +use ShadeTheory\GithubClient\Exceptions\ApiException; try { $result = Github::issues()->all('owner/repo'); diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 98c1f075..a62a4a6c 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -github: JordanPartridge +github: shadetheory diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 70a997a9..de651804 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,11 @@ blank_issues_enabled: false contact_links: - name: Ask a question - url: https://github.com/jordanpartridge/github-client/discussions/new?category=q-a + url: https://github.com/shadetheory/github-client/discussions/new?category=q-a about: Ask the community for help - name: Request a feature - url: https://github.com/jordanpartridge/github-client/discussions/new?category=ideas + url: https://github.com/shadetheory/github-client/discussions/new?category=ideas about: Share ideas for new features - name: Report a security issue - url: https://github.com/jordanpartridge/github-client/security/policy + url: https://github.com/shadetheory/github-client/security/policy about: Learn how to notify us for sensitive bugs diff --git a/.github/workflows/devnull.yml b/.github/workflows/devnull.yml index be5ecbb5..4e86e943 100644 --- a/.github/workflows/devnull.yml +++ b/.github/workflows/devnull.yml @@ -43,7 +43,7 @@ jobs: RELEASE_BODY: ${{ github.event.release.body }} RELEASE_URL: ${{ github.event.release.html_url }} PITCH: 'A Laravel client for GitHub''s REST API, built on Saloon, covering repositories, issues, pull requests, commits, releases and Actions, with token or GitHub App auth.' - PACKAGE: 'jordanpartridge/github-client' + PACKAGE: 'shadetheory/github-client' SELF_JOBS: compose,post run: | body="$(python3 .github/scripts/devnull-post.py)" diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f57ef78..c5ca5459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to `github-client` will be documented in this file. ## Unreleased +* **Breaking:** Composer package renamed from `jordanpartridge/github-client` to `shadetheory/github-client`. PHP namespace renamed from `JordanPartridge\GithubClient` to `ShadeTheory\GithubClient`, including PSR-4 autoload, the Laravel service provider, and the `Github` facade alias. Install with `composer require shadetheory/github-client`. + ## v3.1.0 - 2026-10-21 * GitHub App authentication: `Github::forInstallation()`, `Github::withApp()`, and the `installations()` resource diff --git a/LICENSE.md b/LICENSE.md index 4778a734..0eddfeb7 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) JordanPartridge +Copyright (c) shadetheory Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4a6999fb..fcf9c70f 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ A Laravel package for GitHub's REST API. It uses [Saloon](https://docs.saloon.dev) for HTTP, maps responses onto PHP objects, and exposes repositories, issues, pull requests, commits, releases, and Actions from a facade or the container. ```bash -composer require jordanpartridge/github-client +composer require shadetheory/github-client ``` [![Tests](https://img.shields.io/github/actions/workflow/status/shadetheory/github-client/run-tests.yml?branch=master&label=tests&style=flat-square)](https://github.com/shadetheory/github-client/actions/workflows/run-tests.yml) [![PHPStan](https://img.shields.io/github/actions/workflow/status/shadetheory/github-client/phpstan.yml?branch=master&label=phpstan&style=flat-square)](https://github.com/shadetheory/github-client/actions/workflows/phpstan.yml) -[![Latest Version](https://img.shields.io/packagist/v/jordanpartridge/github-client.svg?style=flat-square)](https://packagist.org/packages/jordanpartridge/github-client) -[![Downloads](https://img.shields.io/packagist/dt/jordanpartridge/github-client.svg?style=flat-square)](https://packagist.org/packages/jordanpartridge/github-client) +[![Latest Version](https://img.shields.io/packagist/v/shadetheory/github-client.svg?style=flat-square)](https://packagist.org/packages/shadetheory/github-client) +[![Downloads](https://img.shields.io/packagist/dt/shadetheory/github-client.svg?style=flat-square)](https://packagist.org/packages/shadetheory/github-client) [![License](https://img.shields.io/github/license/shadetheory/github-client?style=flat-square)](LICENSE.md) `Github::forInstallation()`, `Github::withApp()`, and `installations()` are available from `v3.1.0`. @@ -19,7 +19,7 @@ See the [documentation index](docs/README.md) for the API reference, authenticat ## Install ```bash -composer require jordanpartridge/github-client +composer require shadetheory/github-client ``` Publish the config file: @@ -53,11 +53,11 @@ OAuth and GitHub App settings are in the same config file. See [OAuth](#oauth) a ## Usage ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; $repos = Github::repos()->all()->dto(); -$repo = Github::getRepo('jordanpartridge/github-client'); +$repo = Github::getRepo('shadetheory/github-client'); echo $repo->name; echo $repo->stargazers_count; @@ -69,9 +69,9 @@ echo $repo->owner->login; `repos()->get()` takes a `Repo` value object, not a string: ```php -use JordanPartridge\GithubClient\ValueObjects\Repo; +use ShadeTheory\GithubClient\ValueObjects\Repo; -$repo = Github::repos()->get(Repo::fromFullName('jordanpartridge/github-client')); +$repo = Github::repos()->get(Repo::fromFullName('shadetheory/github-client')); ``` `repos()->delete()` takes the same value object and returns the Saloon response. @@ -81,9 +81,9 @@ $repo = Github::repos()->get(Repo::fromFullName('jordanpartridge/github-client') `all()` requests one page (GitHub's default is 30). `allWithPagination()` follows the `Link` header and returns every `RepoData` it can fetch, up to 1000 pages. ```php -use JordanPartridge\GithubClient\Enums\Direction; -use JordanPartridge\GithubClient\Enums\Sort; -use JordanPartridge\GithubClient\Enums\Visibility; +use ShadeTheory\GithubClient\Enums\Direction; +use ShadeTheory\GithubClient\Enums\Sort; +use ShadeTheory\GithubClient\Enums\Visibility; $repos = Github::repos()->allWithPagination( visibility: Visibility::PUBLIC, @@ -95,32 +95,32 @@ $repos = Github::repos()->allWithPagination( ### Issues ```php -use JordanPartridge\GithubClient\Enums\Issues\State; +use ShadeTheory\GithubClient\Enums\Issues\State; $issue = Github::issues()->create( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', title: 'Bug: Something broke', body: 'Here are the details...', labels: ['bug'], - assignees: ['jordanpartridge'], + assignees: ['shadetheory'], ); echo $issue->number; echo $issue->html_url; $bugs = Github::issues()->forRepo( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', state: State::OPEN, labels: 'bug', )->dto(); -$comments = Github::issues()->comments('jordanpartridge', 'github-client', $issue->number); +$comments = Github::issues()->comments('shadetheory', 'github-client', $issue->number); -Github::issues()->addComment('jordanpartridge', 'github-client', $issue->number, 'Fixed in the latest release.'); +Github::issues()->addComment('shadetheory', 'github-client', $issue->number, 'Fixed in the latest release.'); -Github::issues()->close('jordanpartridge', 'github-client', $issue->number); +Github::issues()->close('shadetheory', 'github-client', $issue->number); ``` `forRepo()` and `all()` return a Saloon response. Call `dto()` for `IssueDTO` objects. `allForRepo()` paginates the same way `allWithPagination()` does and returns the array itself. @@ -132,10 +132,10 @@ GitHub's issue list includes pull requests. List endpoints skip items that have ### Pull requests ```php -use JordanPartridge\GithubClient\Enums\MergeMethod; +use ShadeTheory\GithubClient\Enums\MergeMethod; $pr = Github::pullRequests()->create( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', title: 'Add a feature', head: 'feature-branch', @@ -145,7 +145,7 @@ $pr = Github::pullRequests()->create( ); $merged = Github::pullRequests()->merge( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', number: $pr->number, mergeMethod: MergeMethod::Squash, @@ -254,10 +254,10 @@ The package does not retry rate-limited calls. A rate limit response throws `Rat ## Dependency injection -The container binds `JordanPartridge\GithubClient\Github`. There is no connector interface. +The container binds `ShadeTheory\GithubClient\Github`. There is no connector interface. ```php -use JordanPartridge\GithubClient\Github; +use ShadeTheory\GithubClient\Github; class RepoListing { @@ -283,8 +283,8 @@ GITHUB_REDIRECT_URL=https://example.com/auth/github/callback ``` ```php -use JordanPartridge\GithubClient\Connectors\GithubConnector; -use JordanPartridge\GithubClient\Facades\GithubOAuth; +use ShadeTheory\GithubClient\Connectors\GithubConnector; +use ShadeTheory\GithubClient\Facades\GithubOAuth; $state = bin2hex(random_bytes(16)); @@ -298,14 +298,14 @@ $token = GithubOAuth::getAccessToken($request->string('code')); $github = new GithubConnector($token); $repos = $github->send( - new \JordanPartridge\GithubClient\Requests\Repos\Index(), + new \ShadeTheory\GithubClient\Requests\Repos\Index(), ); ``` To keep using the facade-style resources with that token, build a client around the connector: ```php -$github = new \JordanPartridge\GithubClient\Github(new GithubConnector($token)); +$github = new \ShadeTheory\GithubClient\Github(new GithubConnector($token)); $repos = $github->repos()->all()->dto(); ``` @@ -324,7 +324,7 @@ GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVA `GITHUB_APP_PRIVATE_KEY_PATH` is used when `GITHUB_APP_PRIVATE_KEY` is empty. The path may be absolute or relative to the Laravel base path. ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; $github = Github::forInstallation(12345678); @@ -358,7 +358,7 @@ php artisan github-client commits --repo=laravel/framework --limit=10 Mock the connector with Saloon. The test suite blocks unmocked Saloon network requests; no GitHub credentials are needed. `IssueDTO` reads a full issue payload, including `user`. A short fixture will throw while mapping. `tests/TestCase.php` builds a complete one, and `tests/DocumentationExamplesTest.php` covers README examples. ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; diff --git a/composer.json b/composer.json index e6f466b8..c463b620 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "jordanpartridge/github-client", + "name": "shadetheory/github-client", "description": "Laravel client for the GitHub REST API, built with Saloon. Typed responses for repositories, issues, pull requests, commits, releases, and Actions.", "keywords": [ "laravel", @@ -45,12 +45,12 @@ }, "autoload": { "psr-4": { - "JordanPartridge\\GithubClient\\": "src/" + "ShadeTheory\\GithubClient\\": "src/" } }, "autoload-dev": { "psr-4": { - "JordanPartridge\\GithubClient\\Tests\\": "tests/", + "ShadeTheory\\GithubClient\\Tests\\": "tests/", "Workbench\\App\\": "workbench/app/" } }, @@ -82,10 +82,10 @@ "extra": { "laravel": { "providers": [ - "JordanPartridge\\GithubClient\\GithubClientServiceProvider" + "ShadeTheory\\GithubClient\\GithubClientServiceProvider" ], "aliases": { - "Github": "JordanPartridge\\GithubClient\\Facades\\Github" + "Github": "ShadeTheory\\GithubClient\\Facades\\Github" } } }, diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 33207b34..1b1cc47c 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -1,6 +1,6 @@ # Architecture -`jordanpartridge/github-client` is a Laravel package for the GitHub REST API. It is built on [Saloon](https://docs.saloon.dev) and returns typed PHP objects instead of raw arrays. It requires PHP 8.2 or newer and Laravel 11, 12, or 13. CI runs the suite on PHP 8.2, 8.3, and 8.4. +`shadetheory/github-client` is a Laravel package for the GitHub REST API. It is built on [Saloon](https://docs.saloon.dev) and returns typed PHP objects instead of raw arrays. It requires PHP 8.2 or newer and Laravel 11, 12, or 13. CI runs the suite on PHP 8.2, 8.3, and 8.4. ## Layers @@ -59,8 +59,8 @@ $github->pullRequests()->all('owner', 'repo'); ## Usage ```php -use JordanPartridge\GithubClient\Facades\Github; -use JordanPartridge\GithubClient\Enums\MergeMethod; +use ShadeTheory\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Enums\MergeMethod; $repo = Github::getRepo('laravel/framework'); // RepoData $prs = Github::pullRequests()->all('laravel', 'framework'); diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 81f98951..d2d8584e 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -20,7 +20,7 @@ GITHUB_REDIRECT_URL= ``` ```php -use JordanPartridge\GithubClient\Facades\GithubOAuth; +use ShadeTheory\GithubClient\Facades\GithubOAuth; $url = GithubOAuth::getAuthorizationUrl(['repo'], $state); $token = GithubOAuth::getAccessToken($code); @@ -41,7 +41,7 @@ GITHUB_APP_PRIVATE_KEY_PATH= `Github::forInstallation(int $installationId): Github` reads the app id and key from config and returns an installation-authenticated client. These helpers are available from `v3.1.0`: ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; $github = Github::forInstallation(12345678); $repo = $github->getRepo('owner/repo'); @@ -67,7 +67,7 @@ $repo = $github->getRepo('owner/repo'); | Status | Exception | | --- | --- | -| 401 | `JordanPartridge\GithubClient\Exceptions\AuthenticationException` | +| 401 | `ShadeTheory\GithubClient\Exceptions\AuthenticationException` | | 403 when the body or headers say the rate limit is spent | `RateLimitException` | | 403 otherwise | `ApiException` | | 404 | `ResourceNotFoundException` | diff --git a/docs/api-reference.md b/docs/api-reference.md index 8495a14d..56c354ff 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -1,6 +1,6 @@ # API reference -Entry points are the `Github` facade and `JordanPartridge\GithubClient\Github` from the container. +Entry points are the `Github` facade and `ShadeTheory\GithubClient\Github` from the container. Return values are not uniform. Some methods return a Saloon response; call `dto()` only when the request supplies a DTO mapper. Others return a DTO or an array of DTOs. The signatures below preserve public parameter names for PHP named arguments; they are reference notation, not executable statements. `Response` is `Saloon\Http\Response`, `Collection` is `Illuminate\Support\Collection`, and `Github` in return types is the client, not the facade. @@ -17,7 +17,7 @@ Github::getRepo(string $fullName): RepoData Github::deleteRepo(string $fullName): Response ``` -`all` hits `GET /user/repos` and needs an authenticated user. `allWithPagination` returns `RepoData[]`, follows the next-page `Link` header, and caps at 1000 pages. `search` hits the repository search API. `sort` on search is a string such as `stars`, not the `Sort` enum. `Type` is `Enums\Repos\Type`; `Visibility`, `Sort`, and `Direction` are in `JordanPartridge\GithubClient\Enums`. +`all` hits `GET /user/repos` and needs an authenticated user. `allWithPagination` returns `RepoData[]`, follows the next-page `Link` header, and caps at 1000 pages. `search` hits the repository search API. `sort` on search is a string such as `stars`, not the `Sort` enum. `Type` is `Enums\Repos\Type`; `Visibility`, `Sort`, and `Direction` are in `ShadeTheory\GithubClient\Enums`. ## Issues @@ -37,7 +37,7 @@ Github::issues()->updateComment(string $owner, string $repo, int $commentId, str Github::issues()->deleteComment(string $owner, string $repo, int $commentId): bool ``` -Here `State` and `Sort` are in `JordanPartridge\GithubClient\Enums\Issues`. `State` is `OPEN`, `CLOSED`, or `ALL`; `Sort` is `CREATED`, `UPDATED`, or `COMMENTS`. `labels` is a comma-separated string for list filters, but an array for create/update. `all` and `forRepo` return one page; `allForRepo` follows next-page links up to 1000 pages and returns `IssueDTO[]`. It has no `page` argument. Issue lists exclude pull requests. +Here `State` and `Sort` are in `ShadeTheory\GithubClient\Enums\Issues`. `State` is `OPEN`, `CLOSED`, or `ALL`; `Sort` is `CREATED`, `UPDATED`, or `COMMENTS`. `labels` is a comma-separated string for list filters, but an array for create/update. `all` and `forRepo` return one page; `allForRepo` follows next-page links up to 1000 pages and returns `IssueDTO[]`. It has no `page` argument. Issue lists exclude pull requests. ## Pull requests @@ -188,4 +188,4 @@ Github::installations()->get(int $installationId): InstallationData Github::installations()->createAccessToken(int $installationId, ?array $repositories = null, ?array $permissions = null): InstallationTokenData ``` -Here `self` is `JordanPartridge\GithubClient\Github`. `forInstallation()` reads `github-client.github_app.app_id` and the private key from config, returning an installation-authenticated client. `withApp()` accepts PEM contents directly, not a key path. Omit its installation id for app-level JWT authentication when calling `installations()`; supply the id for repository operations as that installation. `list()` returns one page of `InstallationData`; `listAll()` follows next-page links up to 100 pages. See [authentication](./advanced-usage.md#github-app) for examples and config key paths. +Here `self` is `ShadeTheory\GithubClient\Github`. `forInstallation()` reads `github-client.github_app.app_id` and the private key from config, returning an installation-authenticated client. `withApp()` accepts PEM contents directly, not a key path. Omit its installation id for app-level JWT authentication when calling `installations()`; supply the id for repository operations as that installation. `list()` returns one page of `InstallationData`; `listAll()` follows next-page links up to 100 pages. See [authentication](./advanced-usage.md#github-app) for examples and config key paths. diff --git a/docs/core-concepts.md b/docs/core-concepts.md index 7ff4dc91..61f1a196 100644 --- a/docs/core-concepts.md +++ b/docs/core-concepts.md @@ -5,7 +5,7 @@ - The `github-client` config file - The `github-client` Artisan command - A singleton `GithubConnector` -- `JordanPartridge\GithubClient\Github`, which the `Github` facade resolves +- `ShadeTheory\GithubClient\Github`, which the `Github` facade resolves Each resource (`repos()`, `issues()`, `pullRequests()`, and the rest) builds a Saloon request and sends it through `GithubConnector`. Methods returning DTOs map the body in `createDtoFromResponse()`; some methods return the raw response instead. For example, `files()->all()` returns a commit payload whose changed files are available through `json('files')`, not a Git tree. diff --git a/docs/getting-started.md b/docs/getting-started.md index 69dabcf4..c0814165 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -3,7 +3,7 @@ ## Install ```bash -composer require jordanpartridge/github-client +composer require shadetheory/github-client php artisan vendor:publish --tag=github-client-config ``` @@ -20,7 +20,7 @@ GITHUB_TOKEN=ghp_your_token_here ## First calls ```php -use JordanPartridge\GithubClient\Facades\Github; +use ShadeTheory\GithubClient\Facades\Github; $repos = Github::repos()->all()->dto(); diff --git a/src/Auth/AuthenticationStrategy.php b/src/Auth/AuthenticationStrategy.php index 31dbb91a..b133d218 100644 --- a/src/Auth/AuthenticationStrategy.php +++ b/src/Auth/AuthenticationStrategy.php @@ -1,8 +1,8 @@ all('owner/repo'); diff --git a/src/Resources/CommitResource.php b/src/Resources/CommitResource.php index 574b0844..1fa96389 100644 --- a/src/Resources/CommitResource.php +++ b/src/Resources/CommitResource.php @@ -1,11 +1,11 @@ all()->dto(); diff --git a/src/Resources/ReleasesResource.php b/src/Resources/ReleasesResource.php index 557f5414..756f2da5 100644 --- a/src/Resources/ReleasesResource.php +++ b/src/Resources/ReleasesResource.php @@ -1,11 +1,11 @@ get(Repo::fromFullName('jordanpartridge/github-client')); + * $repo = $repos->get(Repo::fromFullName('shadetheory/github-client')); * echo $repo->full_name; * ``` */ diff --git a/src/ValueObjects/Repo.php b/src/ValueObjects/Repo.php index df2f87d9..24ffc8e9 100644 --- a/src/ValueObjects/Repo.php +++ b/src/ValueObjects/Repo.php @@ -1,6 +1,6 @@ toExtend(BaseResource::class); + expect('ShadeTheory\GithubClient\Resources')->toExtend(BaseResource::class); }); }); describe('Requests', function () { arch('requests extend the base resource', function () { - expect('JordanPartridge\GithubClient\Requests')->toExtend(Request::class); + expect('ShadeTheory\GithubClient\Requests')->toExtend(Request::class); }); }); diff --git a/tests/AuthenticationTest.php b/tests/AuthenticationTest.php index 6670c143..807b0b35 100644 --- a/tests/AuthenticationTest.php +++ b/tests/AuthenticationTest.php @@ -1,12 +1,12 @@ withMockClient($mockClient); // Create Github instance with unauthenticated connector - $github = new JordanPartridge\GithubClient\Github($connector); + $github = new ShadeTheory\GithubClient\Github($connector); // Should be able to get public repo without auth $repo = $github->getRepo('owner/public-repo'); diff --git a/tests/CommentMappingBugfixTest.php b/tests/CommentMappingBugfixTest.php index da8d91ee..f85bde80 100644 --- a/tests/CommentMappingBugfixTest.php +++ b/tests/CommentMappingBugfixTest.php @@ -1,6 +1,6 @@ withMockClient($mockClient); - $this->resource = new CommitResource(app(JordanPartridge\GithubClient\Github::class)); + $this->resource = new CommitResource(app(ShadeTheory\GithubClient\Github::class)); }); it('can fetch all commits for a repository', function () { - $response = $this->resource->all('jordanpartridge/github-client'); + $response = $this->resource->all('shadetheory/github-client'); expect($response)->toBeArray(); }); @@ -37,9 +37,9 @@ '*' => MockResponse::make([ 'sha' => $sha, 'node_id' => 'MDQ6QmxvYjE0ODMzNDY0NjpkZjE5N2EzZTgwMjhmN2E5ODM3MDc2M2ZlN2EzNWFlYjYzOTMxOGExOg==', - 'url' => 'https://api.github.com/repos/jordanpartridge/github-client/git/commits/' . $sha, - 'html_url' => 'https://github.com/jordanpartridge/github-client/commit/' . $sha, - 'comments_url' => 'https://api.github.com/repos/jordanpartridge/github-client/commits/' . $sha . '/comments', + 'url' => 'https://api.github.com/repos/shadetheory/github-client/git/commits/' . $sha, + 'html_url' => 'https://github.com/shadetheory/github-client/commit/' . $sha, + 'comments_url' => 'https://api.github.com/repos/shadetheory/github-client/commits/' . $sha . '/comments', 'commit' => [ 'author' => [ 'name' => 'John Doe', @@ -54,9 +54,9 @@ 'message' => 'Test commit message', 'tree' => [ 'sha' => '1234567890123456789012345678901234567890', - 'url' => 'https://api.github.com/repos/jordanpartridge/github-client/git/trees/1234567890123456789012345678901234567890', + 'url' => 'https://api.github.com/repos/shadetheory/github-client/git/trees/1234567890123456789012345678901234567890', ], - 'url' => 'https://api.github.com/repos/jordanpartridge/github-client/git/commits/' . $sha, + 'url' => 'https://api.github.com/repos/shadetheory/github-client/git/commits/' . $sha, 'comment_count' => 0, 'verification' => [ 'verified' => true, @@ -77,7 +77,7 @@ ], 200), ])); - $response = $this->resource->get('jordanpartridge/github-client', $sha); + $response = $this->resource->get('shadetheory/github-client', $sha); // Test passes if no exception is thrown expect($response->sha)->toBe($sha); @@ -89,15 +89,15 @@ }); it('handles pagination parameters correctly', function () { - $response = $this->resource->all('jordanpartridge/github-client', 50, 2); + $response = $this->resource->all('shadetheory/github-client', 50, 2); // Test passes if no exception is thrown expect($response)->toBeArray(); }); it('converts repository name to value object correctly', function () { - $repo = Repo::fromFullName('jordanpartridge/github-client'); + $repo = Repo::fromFullName('shadetheory/github-client'); - expect($repo->owner())->toBe('jordanpartridge') + expect($repo->owner())->toBe('shadetheory') ->and($repo->name())->toBe('github-client'); }); diff --git a/tests/DTOConversionTest.php b/tests/DTOConversionTest.php index 93e89312..5ae6156a 100644 --- a/tests/DTOConversionTest.php +++ b/tests/DTOConversionTest.php @@ -1,7 +1,7 @@ createMockRepoData('github-client', 1, 'jordanpartridge'); + $payload = $this->createMockRepoData('github-client', 1, 'shadetheory'); Github::connector()->withMockClient(new MockClient([ '*' => MockResponse::make([$payload], 200), @@ -34,21 +34,21 @@ '*' => MockResponse::make($payload, 200), ])); - $repo = Github::getRepo('jordanpartridge/github-client'); + $repo = Github::getRepo('shadetheory/github-client'); expect($repo->name)->toBe('github-client') - ->and($repo->owner->login)->toBe('jordanpartridge') + ->and($repo->owner->login)->toBe('shadetheory') ->and($repo->stargazers_count)->toBe(80); - $same = Github::repos()->get(Repo::fromFullName('jordanpartridge/github-client')); + $same = Github::repos()->get(Repo::fromFullName('shadetheory/github-client')); - expect($same->full_name)->toBe('jordanpartridge/github-client'); + expect($same->full_name)->toBe('shadetheory/github-client'); }); it('paginates public repositories with enums', function () { Github::connector()->withMockClient(new MockClient([ '*' => MockResponse::make([ - $this->createMockRepoData('github-client', 1, 'jordanpartridge'), + $this->createMockRepoData('github-client', 1, 'shadetheory'), ], 200), ])); @@ -66,7 +66,7 @@ $created = $this->createMockIssueData([ 'number' => 42, 'title' => 'Bug: Something broke', - 'html_url' => 'https://github.com/jordanpartridge/github-client/issues/42', + 'html_url' => 'https://github.com/shadetheory/github-client/issues/42', 'labels' => [ ['id' => 1, 'name' => 'bug', 'color' => 'd73a4a', 'description' => null, 'default' => true], ], @@ -77,24 +77,24 @@ ])); $issue = Github::issues()->create( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', title: 'Bug: Something broke', body: 'Here are the details...', labels: ['bug'], - assignees: ['jordanpartridge'], + assignees: ['shadetheory'], ); expect($issue)->toBeInstanceOf(IssueDTO::class) ->and($issue->number)->toBe(42) - ->and($issue->html_url)->toBe('https://github.com/jordanpartridge/github-client/issues/42'); + ->and($issue->html_url)->toBe('https://github.com/shadetheory/github-client/issues/42'); Github::connector()->withMockClient(new MockClient([ '*' => MockResponse::make([$created], 200), ])); $bugs = Github::issues()->forRepo( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', state: State::OPEN, labels: 'bug', @@ -107,7 +107,7 @@ '*' => MockResponse::make([$this->createMockCommentData()], 200), ])); - $comments = Github::issues()->comments('jordanpartridge', 'github-client', $issue->number); + $comments = Github::issues()->comments('shadetheory', 'github-client', $issue->number); expect($comments)->toHaveCount(1); @@ -116,7 +116,7 @@ ])); $comment = Github::issues()->addComment( - 'jordanpartridge', + 'shadetheory', 'github-client', $issue->number, 'Fixed in the latest release.', @@ -128,7 +128,7 @@ '*' => MockResponse::make($this->createMockIssueData(['number' => 42, 'state' => 'closed']), 200), ])); - $closed = Github::issues()->close('jordanpartridge', 'github-client', $issue->number); + $closed = Github::issues()->close('shadetheory', 'github-client', $issue->number); expect($closed->state)->toBe('closed'); }); @@ -139,7 +139,7 @@ ])); $pr = Github::pullRequests()->create( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', title: 'Add a feature', head: 'feature-branch', @@ -160,7 +160,7 @@ ])); $merged = Github::pullRequests()->merge( - owner: 'jordanpartridge', + owner: 'shadetheory', repo: 'github-client', number: $pr->number, mergeMethod: MergeMethod::Squash, diff --git a/tests/GithubAppAuthenticationTest.php b/tests/GithubAppAuthenticationTest.php index fe9711f5..b807c29b 100644 --- a/tests/GithubAppAuthenticationTest.php +++ b/tests/GithubAppAuthenticationTest.php @@ -2,9 +2,9 @@ use Firebase\JWT\JWT; use Firebase\JWT\Key; -use JordanPartridge\GithubClient\Auth\GitHubAppAuthentication; -use JordanPartridge\GithubClient\Exceptions\AuthenticationException; -use JordanPartridge\GithubClient\Github; +use ShadeTheory\GithubClient\Auth\GitHubAppAuthentication; +use ShadeTheory\GithubClient\Exceptions\AuthenticationException; +use ShadeTheory\GithubClient\Github; use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; use Saloon\Http\PendingRequest; diff --git a/tests/GithubConnectorAuthStatusTest.php b/tests/GithubConnectorAuthStatusTest.php index 183b5103..e57165f0 100644 --- a/tests/GithubConnectorAuthStatusTest.php +++ b/tests/GithubConnectorAuthStatusTest.php @@ -1,11 +1,11 @@ toBeTrue(); + expect(class_exists('ShadeTheory\\GithubClient\\Exceptions\\ApiException'))->toBeTrue(); }); }); diff --git a/tests/Unit/ValueObjects/RepoTest.php b/tests/Unit/ValueObjects/RepoTest.php index 98158cd1..ab5b9baf 100644 --- a/tests/Unit/ValueObjects/RepoTest.php +++ b/tests/Unit/ValueObjects/RepoTest.php @@ -1,6 +1,6 @@ Date: Thu, 12 Nov 2026 05:57:28 +0000 Subject: [PATCH 2/2] Let the approved namespace rename pass release checks. Baseline the old JordanPartridge classes in Roave, and keep the .agents setup scripts out of the distribution archive. Co-authored-by: Jordan Partridge --- .gitattributes | 1 + .roave-backward-compatibility-check.xml | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 9a752093..bbcabaa4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,7 @@ # https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html # Ignore all test and documentation with "export-ignore". +.agents/ export-ignore .claude/ export-ignore .claude/agents/ export-ignore .claude/CLAUDE.md export-ignore diff --git a/.roave-backward-compatibility-check.xml b/.roave-backward-compatibility-check.xml index 8526222e..4371c743 100644 --- a/.roave-backward-compatibility-check.xml +++ b/.roave-backward-compatibility-check.xml @@ -1,8 +1,13 @@ #\[BC\] REMOVED: Method [^ ]+ \(inherited from (Symfony\\Component\\Console|Illuminate\\Console)\\[^)]+\) was removed# #\[BC\] CHANGED: The return type of (Symfony\\Component\\Console|Illuminate\\Console)\\[^ ]+\#[A-Za-z_]+\(\) changed from no type to void# + #\[BC\] REMOVED: Class JordanPartridge\\GithubClient\\.* has been deleted#