@pentacore/vite-plugin-laravel-typefinder 8.2.3 → 8.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -98,11 +98,13 @@ typefinder({ command: 'docker compose exec app php artisan typefinder:watch' })
|
|
|
98
98
|
|
|
99
99
|
**Development (`vite dev`):** The plugin spawns `typefinder:watch` — a persistent Laravel process that boots once and accepts incremental regeneration requests over NDJSON. When a `.php` file matching the watched paths changes via HMR, the plugin sends the changed file paths to the watcher, which re-extracts only those files and rewrites only the affected `.d.ts` outputs. Multiple rapid edits within the debounce window are coalesced into a single request.
|
|
100
100
|
|
|
101
|
+
A PHP process cannot reload a class it has loaded, so the watcher answers each request in a forked worker that reads the edited classes from the files as they are now. Forking needs PHP's `pcntl` extension. Without it (Windows, some Docker images), or once a class the application loads while booting (a service provider, for example) has been edited, each request starts a new PHP process instead: the same output, but a Laravel boot slower per change. The watcher says so once on stderr; in the second case, restarting the dev server makes it fast again.
|
|
102
|
+
|
|
101
103
|
The watched paths are read from the watcher's startup handshake, which mirrors your `config/typefinder.php`. If you enable Inertia pages or broadcasting in the config, the plugin automatically watches those directories too — no manual `watch` array needed.
|
|
102
104
|
|
|
103
105
|
**Production (`vite build`):** No watcher. The plugin runs `typefinder:generate --json` once in `buildStart` and fails the build on non-zero exit. Set `buildCommand: false` to skip generation entirely (e.g. for pre-built containers without a PHP runtime).
|
|
104
106
|
|
|
105
|
-
**Shutdown:** The watcher is killed on `closeBundle` and on process exit. If the watcher dies mid-session
|
|
107
|
+
**Shutdown:** The watcher is killed on `closeBundle` and on process exit. A PHP fatal error or out-of-memory while regenerating ends only the worker of that request: the plugin logs the error and the watcher keeps running. If the watcher itself dies mid-session, the plugin logs the error and stops regenerating — restart the dev server to recover.
|
|
106
108
|
|
|
107
109
|
### Migration from v4.0
|
|
108
110
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pentacore/vite-plugin-laravel-typefinder",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.4",
|
|
4
4
|
"description": "Vite plugin for Laravel Typefinder — auto-generate TypeScript types from Models, Enums, Casts, and Requests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@vitest/coverage-v8": "^5.1.0",
|
|
43
43
|
"eslint": "^10.14.0",
|
|
44
44
|
"typescript": "^6.0.3",
|
|
45
|
-
"typescript-eslint": "^8.72.
|
|
45
|
+
"typescript-eslint": "^8.72.2",
|
|
46
46
|
"vite": "^8.3.3",
|
|
47
47
|
"vite-plugin-dts": "^5.1.2",
|
|
48
48
|
"vitest": "^5.0.3"
|