tonka-vite-plugin 1.32.7 → 1.32.10

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.
@@ -0,0 +1 @@
1
+ export declare const resolvePageComponent: (name: string, pages: Record<string, string>, extensions?: string[]) => string;
@@ -0,0 +1 @@
1
+ export const resolvePageComponent = (name, pages, extensions = []) => pages[name];
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from 'vite';
2
- import { TonkaPluginOptions } from '../types';
2
+ import { TonkaPluginOptions } from './types';
3
3
  export default function tonkaPlugin(options?: TonkaPluginOptions): Plugin;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ export default function tonkaPlugin(options = {}) {
7
7
  : path.resolve(root, 'public');
8
8
  const hotFile = path.resolve(publicDir, 'hot');
9
9
  const refreshPaths = options.refresh === true
10
- ? ['resources/views/**', 'app/**/*.php', 'routes/**']
10
+ ? ['resources/js/**']
11
11
  : Array.isArray(options.refresh)
12
12
  ? options.refresh
13
13
  : typeof options.refresh === 'string'
@@ -57,7 +57,7 @@ export default function tonkaPlugin(options = {}) {
57
57
  '**/public/hot',
58
58
  '**/node_modules/**',
59
59
  '**/vendor/**',
60
- '**/storage/**',
60
+ ...['ap', 'routes', 'bootstrap', 'database', 'config', 'test'].map((dir) => path.resolve(root, dir) + '/**'),
61
61
  ],
62
62
  },
63
63
  },
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "tonka-vite-plugin",
3
- "version": "1.32.7",
3
+ "version": "1.32.10",
4
+ "type": "module",
4
5
  "description": "A Vite plugin for Inertia.js that provides automatic page imports and enhanced development experience.",
5
6
  "main": "./dist/index.js",
6
7
  "types": "./dist/index.d.ts",
7
8
  "exports": {
8
- ".": "./dist/index.js"
9
+ ".": "./dist/index.js",
10
+ "./helpers": "./dist/helpers/index.js"
9
11
  },
10
12
  "files": [
11
13
  "dist",
12
- "types"
14
+ "types",
15
+ "LICENSE",
16
+ "README.md"
13
17
  ],
14
18
  "scripts": {
15
19
  "build": "tsc"
package/types/index.d.ts CHANGED
@@ -16,17 +16,10 @@ export interface TonkaPluginOptions {
16
16
  ssr?: string | false;
17
17
 
18
18
  /**
19
- * Whether to watch server-rendered files (views, routes, PHP, ...) and
20
- * trigger a full browser reload when they change, since Vite's module
21
- * graph can't HMR server-rendered templates.
22
- *
23
- * - `true` → watch a sensible default set (`resources/views/**`,
24
- * `app/**\/*.php`, `routes/**`)
25
- * - string → a single glob pattern to watch
26
- * - string[] → an explicit list of glob patterns to watch
27
- * - false → disabled (default)
19
+ * Whether to enable React Fast Refresh (HMR).
20
+ * If true, the plugin may attempt to configure HMR settings.
28
21
  */
29
- refresh?: boolean | string | string[];
22
+ refresh?: boolean;
30
23
 
31
24
  /**
32
25
  * The output directory for the production build.
@@ -41,34 +34,18 @@ export interface TonkaPluginOptions {
41
34
 
42
35
  /**
43
36
  * Path aliases (e.g., '@' to point to the root or resources).
44
- * Merged with the plugin's default alias ('@' -> 'resources/js').
45
37
  */
46
38
  alias?: Record<string, string>;
47
-
39
+
48
40
  /**
49
41
  * Whether to generate a manifest.json file.
50
42
  * Defaults to true for production.
51
43
  */
52
44
  manifest?: boolean;
45
+ }
53
46
 
54
- /**
55
- * The public directory of the project, used to locate/write the `hot`
56
- * file that signals the dev server's URL to the backend.
57
- * Defaults to 'public'.
58
- */
59
- publicDirectory?: string;
60
-
61
- /**
62
- * The `base` path used for built asset URLs in production
63
- * (i.e. what the backend should prefix asset paths with).
64
- * Defaults to '/build/'.
65
- */
66
- buildBase?: string;
67
-
68
- /**
69
- * Whether to emit sourcemaps for the production build.
70
- * Dev builds always emit sourcemaps regardless of this setting.
71
- * Defaults to false.
72
- */
73
- sourcemap?: boolean;
74
- }
47
+ export type resolvePageComponent = (
48
+ name: string,
49
+ pages: Record<string, string>,
50
+ extensions?: string[],
51
+ ) => string;