knuckleswtf / knuckleswtf/scribe
scribe:generate command does not work on Laravel Vapor... due to no local filesystem?
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Description
### Scribe version
4.26.0
### PHP version
8.2
### Framework
Laravel
### Framework version
10.34.2
### Scribe config
```ruby
base_url => "https://example.com"
type => "laravel"
laravel.add_routes => false
laravel.docs_url => "/"
try_it_out.base_url => "https://aaa.com"
auth.enabled => true
auth.default => true
auth.name => "Authorization"
last_updated => ""
```
### What happened?
When deploying to vapor the error below occurs.
I've tried Attaching Storage https://docs.vapor.build/resources/storage.html#attaching-storage
And temporary storage https://docs.vapor.build/resources/storage.html#temporary-storage
This is the code where it is failing. Because (as I see it) it will always select a local filesystem, where vapor does not have/support one:
https://github.com/knuckleswtf/scribe/blob/a720537cb6c03e8900d3ef800bdf3f27599e856e/src/Tools/Utils.php#L194
Exception:
```
Unable to delete file located at: /var/task/.scribe/endpoints/00.yaml.
at vendor/league/flysystem/src/UnableToDeleteFile.php:24
20▕ private $reason;
21▕
22▕ public static function atLocation(string $location, string $reason = '', Throwable $previous = null): UnableToDeleteFile
23▕ {
➜ 24▕ $e = new static(rtrim("Unable to delete file located at: {$location}. {$reason}"), 0, $previous);
25▕ $e->location = $location;
26▕ $e->reason = $reason;
27▕
28▕ return $e;
+19 vendor frames
20 artisan:41
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
```
### Docs
- [X] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution
Contributor guide
Research direction
Start at src/Tools/Utils.php around line 194 and reproduce the failure by running scribe:generate in a Laravel Vapor deployment. Read how the filesystem is selected and compare it with the reported Unable to delete file error. Done means documentation generation completes on Vapor without requiring an unsupported local filesystem.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- backend, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100