Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Jordan Partridge

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 0 additions & 48 deletions app/Commands/InspireCommand.php

This file was deleted.

4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
"App\\": "app/"
}
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
|
*/

'name' => 'Cf',
'name' => 'Cloudflare',

/*
|--------------------------------------------------------------------------
Expand Down
43 changes: 43 additions & 0 deletions specs/scaffold-cleanup/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPEC: Scaffold cleanup (LICENSE, drop Inspire, app name Cloudflare)

Status: DRAFT

**Story:** README and `composer.json` say this is a Cloudflare CLI under MIT. `cf list` still ships Laravel Zero's `inspire` and the app name `Cf`, and there is no `LICENSE` file. Cursor PR https://github.com/conduit-ui/cloudflare/pull/3 almost fixed that, then sat one commit behind `#17` (quality-runners) with a body that still claims a CI/lock rewrite.

## Locked

- Apply the cleanup **on current `main`** (`e60415d` / `#17`). Rebase, do not replay the pre-`#17` tree.
- Add MIT `LICENSE` (Copyright (c) 2026 Jordan Partridge).
- Delete `app/Commands/InspireCommand.php` and `tests/Feature/InspireCommandTest.php`.
- `config/app.php` `'name'` → `Cloudflare`. Binary stays `cf`. Keep the `#17` `AppServiceProvider` import.
- Drop nonexistent `Database\\Factories\\` / `Database\\Seeders\\` autoload paths. There is no `database/` directory.
- Replace `tests/Unit/ExampleTest.php` with a `CloudflareConnector` smoke test.
- `composer.json` `config.platform.php` stays `"8.3.33"`. `composer.lock` `platform-overrides.php` stays `"8.3.33"`. Host PHP here is 8.5.x; unconstrained `composer update` resolves past 8.3 and breaks the 8.3 CI runner (closed PR `#12`).
- Keep `phpstan/phpstan` and `rector/rector` in `require-dev` (added by `#17` for `./bin/ci`). Autoload-only edits do **not** change Composer content-hash; do not regenerate the lock.
- Keep `tunnel:expose`: `app/Commands/TunnelExposeCommand.php` + `tests/Feature/TunnelExposeCommandTest.php`.
- Keep `tests/Feature/QualityRunnersCiTest.php` and the residual `.github/workflows/ci.yml` from `#17` (Pint `--test` + Pest; not a fake `quality-runners/gate` job).
- Research owns `specs/` and `~/.grok/tmp/3-notes.md`. Build owns LICENSE / Inspire delete / `config/app.php` / composer autoload. Test owns `tests/Unit/CloudflareConnectorTest.php`.
- Do not merge. Do not deploy.

## Done when

- [ ] `test ! -f app/Commands/InspireCommand.php && test ! -f tests/Feature/InspireCommandTest.php`
- [ ] `python3 -c "import json; assert json.load(open('composer.json'))['config']['platform']['php']=='8.3.33'"`
- [ ] `python3 -c "import json; c=json.load(open('composer.json')); assert 'phpstan/phpstan' in c['require-dev'] and 'rector/rector' in c['require-dev']"`
- [ ] `test -f app/Commands/TunnelExposeCommand.php && test -f tests/Feature/TunnelExposeCommandTest.php && test -f tests/Feature/QualityRunnersCiTest.php && test -f LICENSE`
- [ ] `rg -n "'name' => 'Cloudflare'" config/app.php`
- [ ] After `composer install`: `vendor/bin/pest --compact` exits 0. `php cf list` does not show `inspire`. `php cf tunnel:expose --help` exits 0.

## Out of scope

- Merging PR `#3` or deploying a PHAR
- Regenerating `composer.lock`, bumping Symfony, pinning PHP 8.4/8.5
- Restoring a full GHA quality workflow (PR body is stale; `#17` already retired that)
- `dns:upsert` / `tunnel:status` / `--dry-run` (open issues `#14` `#15` `#16`)
- Daily clone under `~/Projects/conduit-ui/repos/cloudflare`

## Open decisions

- `tests/Feature/.gitkeep` is empty noise (`fc7ba34` commit message still says "regenerate composer.lock"; the file is the whole commit). Optional delete. Do not empty `tests/Feature/` to justify it.
- Smoke test title says "auth header" but only asserts base URL + account id. Optional rename or assert `Authorization` via Saloon public headers. Not blocking.
- PR body still claims "Add CI workflow" and "Refresh composer.lock". Update the body; do not implement those claims.
Empty file added tests/Feature/.gitkeep
Empty file.
5 changes: 0 additions & 5 deletions tests/Feature/InspireCommandTest.php

This file was deleted.

19 changes: 19 additions & 0 deletions tests/Feature/TunnelExposeListedTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Artisan;

it('lists tunnel:expose on the CLI', function () {
$exit = Artisan::call('list');

expect($exit)->toBe(0)
->and(Artisan::output())->toContain('tunnel:expose');
});

it('prints tunnel:expose help', function () {
$exit = Artisan::call('tunnel:expose', ['--help' => true]);

expect($exit)->toBe(0)
->and(Artisan::output())->toContain('Create a tunnel and print cloudflared steps to expose a local app');
});
22 changes: 22 additions & 0 deletions tests/Unit/CloudflareConnectorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

use App\Integrations\Cloudflare\CloudflareConnector;

it('resolves the Cloudflare API base URL and auth header', function () {
$connector = new CloudflareConnector('test-token', 'acct-123');

expect($connector->resolveBaseUrl())->toBe('https://api.cloudflare.com/client/v4')
->and($connector->getAccountId())->toBe('acct-123');
});

it('does not ship the Laravel Zero InspireCommand scaffold', function () {
expect(is_file(dirname(__DIR__, 2).'/app/Commands/InspireCommand.php'))->toBeFalse();
});

it('pins composer platform php to 8.3.33', function () {
$composer = json_decode((string) file_get_contents(dirname(__DIR__, 2).'/composer.json'), true, 512, JSON_THROW_ON_ERROR);

expect($composer['config']['platform']['php'])->toBe('8.3.33');
});
5 changes: 0 additions & 5 deletions tests/Unit/ExampleTest.php

This file was deleted.

Loading