@pentacore/vite-plugin-laravel-typefinder 4.2.0 → 4.2.2

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 CHANGED
@@ -1,9 +1,27 @@
1
1
  # @pentacore/vite-plugin-laravel-typefinder
2
2
 
3
+ [![NPM Version](https://img.shields.io/npm/v/%40pentacore%2Fvite-plugin-laravel-typefinder?logo=npm&logoColor=white)](https://www.npmjs.com/package/@pentacore/vite-plugin-laravel-typefinder)
4
+ [![NPM Downloads](https://img.shields.io/npm/dm/%40pentacore%2Fvite-plugin-laravel-typefinder?logo=npm&logoColor=white)](https://www.npmjs.com/package/@pentacore/vite-plugin-laravel-typefinder)
5
+ [![Vite](https://img.shields.io/badge/Vite-6%2B-646CFF?logo=vite&logoColor=white)](https://vitejs.dev/)
6
+ [![Types](https://img.shields.io/npm/types/%40pentacore%2Fvite-plugin-laravel-typefinder?logo=typescript&logoColor=white)](https://www.npmjs.com/package/@pentacore/vite-plugin-laravel-typefinder)
7
+ [![Tests](https://github.com/pentacore/Laravel-Typefinder/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/pentacore/Laravel-Typefinder/actions/workflows/tests.yml)
8
+ [![codecov](https://codecov.io/github/pentacore/Laravel-Typefinder/graph/badge.svg?token=QZGUJ8XF9D&component=Vite%20Plugin)](https://codecov.io/github/pentacore/Laravel-Typefinder)
9
+ [![License](https://img.shields.io/github/license/pentacore/Laravel-Typefinder)](../../LICENSE)
10
+
3
11
  A Vite plugin that keeps your TypeScript type definitions in sync with your Laravel codebase. In development, it spawns a persistent `typefinder:watch` process that regenerates only the `.d.ts` files affected by each edit — typical latency is 20-60ms per change. In production builds, it runs a one-shot `typefinder:generate` before bundling.
4
12
 
5
13
  > **This plugin is a companion to the [`pentacore/laravel-typefinder`](https://packagist.org/packages/pentacore/laravel-typefinder) Composer package — you must install that first.**
6
14
 
15
+ ## Contents
16
+
17
+ - [Requirements](#requirements)
18
+ - [Installation](#installation)
19
+ - [Usage](#usage)
20
+ - [Configuration](#configuration)
21
+ - [Behavior](#behavior)
22
+ - [Alternative install (from vendor)](#alternative-install-from-vendor)
23
+ - [License](#license)
24
+
7
25
  ## Requirements
8
26
 
9
27
  - The Composer package `pentacore/laravel-typefinder` installed and auto-discovered in your Laravel app.
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export { }
1
+ export { typefinder as default, typefinder, type TypefinderOptions } from './vite-plugin-typefinder';
2
+ export type { Handshake, Categories, Category, RegenRequest, RegenResponse, RegenError, } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrG,YAAY,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,GACb,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const compileMatcher: (paths: string[]) => ((file: string) => boolean);
2
+ //# sourceMappingURL=matcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../src/matcher.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GACvB,OAAO,MAAM,EAAE,KAChB,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAgB5B,CAAC"}
@@ -0,0 +1,43 @@
1
+ export interface Category {
2
+ enabled: boolean;
3
+ paths: string[];
4
+ }
5
+ export interface Categories {
6
+ models: Category;
7
+ enums: Category;
8
+ requests: Category;
9
+ resources: Category;
10
+ inertia: Category;
11
+ broadcasting: Category;
12
+ }
13
+ export interface Handshake {
14
+ type: 'ready';
15
+ version: string;
16
+ protocol: number;
17
+ output_path: string;
18
+ categories: Categories;
19
+ }
20
+ export interface RegenRequest {
21
+ type: 'regen';
22
+ id: string;
23
+ paths: string[];
24
+ }
25
+ export interface RegenResponse {
26
+ type: 'regen.done';
27
+ id: string;
28
+ duration_ms: number;
29
+ changed: string[];
30
+ warnings: string[];
31
+ failed: Array<{
32
+ path: string;
33
+ message: string;
34
+ }>;
35
+ }
36
+ export interface RegenError {
37
+ type: 'regen.error';
38
+ id: string | null;
39
+ message: string;
40
+ trace?: string;
41
+ }
42
+ export type IncomingMessage = Handshake | RegenResponse | RegenError;
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC;IAClB,YAAY,EAAE,QAAQ,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,aAAa,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Plugin } from 'vite';
2
+ export interface TypefinderOptions {
3
+ command?: string;
4
+ buildCommand?: string | false;
5
+ watch?: string[];
6
+ debounceMs?: number;
7
+ startupTimeoutMs?: number;
8
+ killTimeoutMs?: number;
9
+ }
10
+ export declare const typefinder: ({ command, buildCommand, watch, debounceMs, startupTimeoutMs, killTimeoutMs, }?: TypefinderOptions) => Plugin;
11
+ export default typefinder;
12
+ //# sourceMappingURL=vite-plugin-typefinder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-plugin-typefinder.d.ts","sourceRoot":"","sources":["../src/vite-plugin-typefinder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAOnD,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,UAAU,GAAI,iFAOxB,iBAAsB,KAAG,MAkH3B,CAAC;AAaF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { ChildProcess } from 'node:child_process';
2
+ import { EventEmitter } from 'node:events';
3
+ import { Handshake, RegenResponse } from './types';
4
+ export interface WatcherSpawnOptions {
5
+ command: string;
6
+ cwd: string;
7
+ startupTimeoutMs: number;
8
+ killTimeoutMs?: number;
9
+ spawnFn?: (cmd: string, args: string[], opts: {
10
+ cwd: string;
11
+ shell: boolean;
12
+ }) => ChildProcess;
13
+ }
14
+ export declare class Watcher extends EventEmitter {
15
+ readonly handshake: Handshake;
16
+ private readonly child;
17
+ private readonly killTimeoutMs;
18
+ private buffer;
19
+ private inflight;
20
+ private nextBatch;
21
+ private nextResolvers;
22
+ private idCounter;
23
+ private _dead;
24
+ private constructor();
25
+ get dead(): boolean;
26
+ static spawn(opts: WatcherSpawnOptions): Promise<Watcher>;
27
+ regen(paths: string[]): Promise<RegenResponse>;
28
+ private dispatch;
29
+ private onStdout;
30
+ private handleLine;
31
+ private drainQueued;
32
+ kill(): Promise<void>;
33
+ }
34
+ //# sourceMappingURL=watcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../src/watcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAiC,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvF,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,YAAY,CAAC;CAClG;AAED,qBAAa,OAAQ,SAAQ,YAAY;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,QAAQ,CAIA;IAChB,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,aAAa,CAGb;IACR,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO;IAiCP,IAAI,IAAI,IAAI,OAAO,CAElB;WAEY,KAAK,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmDzD,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBpD,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,UAAU;IA0BlB,OAAO,CAAC,WAAW;IAcb,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAa9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pentacore/vite-plugin-laravel-typefinder",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "Vite plugin for Laravel Typefinder — auto-generate TypeScript types from Models, Enums, Casts, and Requests.",
5
5
  "keywords": [
6
6
  "vite",
@@ -28,8 +28,8 @@
28
28
  "types": "dist/index.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
- "import": "./dist/index.js",
32
- "types": "./dist/index.d.ts"
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
33
  }
34
34
  },
35
35
  "dependencies": {