@tanstack/router-plugin 1.121.0-alpha.2 → 1.121.0-alpha.26
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/dist/cjs/core/config.cjs.map +1 -1
- package/dist/cjs/core/config.d.cts +10 -4
- package/dist/cjs/core/route-hmr-statement.cjs +1 -1
- package/dist/cjs/core/route-hmr-statement.cjs.map +1 -1
- package/dist/cjs/core/router-generator-plugin.cjs +35 -47
- package/dist/cjs/core/router-generator-plugin.cjs.map +1 -1
- package/dist/cjs/esbuild.d.cts +8 -4
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/rspack.d.cts +8 -4
- package/dist/cjs/vite.cjs +11 -8
- package/dist/cjs/vite.cjs.map +1 -1
- package/dist/cjs/vite.d.cts +53 -13
- package/dist/cjs/webpack.d.cts +8 -4
- package/dist/esm/core/config.d.ts +10 -4
- package/dist/esm/core/config.js.map +1 -1
- package/dist/esm/core/route-hmr-statement.js +1 -1
- package/dist/esm/core/route-hmr-statement.js.map +1 -1
- package/dist/esm/core/router-generator-plugin.js +37 -49
- package/dist/esm/core/router-generator-plugin.js.map +1 -1
- package/dist/esm/esbuild.d.ts +8 -4
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/rspack.d.ts +8 -4
- package/dist/esm/vite.d.ts +53 -13
- package/dist/esm/vite.js +12 -9
- package/dist/esm/vite.js.map +1 -1
- package/dist/esm/webpack.d.ts +8 -4
- package/package.json +10 -8
- package/src/core/config.ts +2 -0
- package/src/core/route-hmr-statement.ts +1 -1
- package/src/core/router-generator-plugin.ts +39 -63
- package/src/index.ts +2 -2
- package/src/vite.ts +20 -13
package/dist/cjs/vite.d.cts
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import { configSchema, Config } from './core/config.cjs';
|
|
2
|
+
declare const tanstackRouterAutoImport: (options?: Partial<{
|
|
3
|
+
target: "react" | "solid";
|
|
4
|
+
routeFileIgnorePrefix: string;
|
|
5
|
+
routesDirectory: string;
|
|
6
|
+
quoteStyle: "single" | "double";
|
|
7
|
+
semicolons: boolean;
|
|
8
|
+
disableLogging: boolean;
|
|
9
|
+
routeTreeFileHeader: string[];
|
|
10
|
+
indexToken: string;
|
|
11
|
+
routeToken: string;
|
|
12
|
+
generatedRouteTree: string;
|
|
13
|
+
disableTypes: boolean;
|
|
14
|
+
addExtensions: boolean;
|
|
15
|
+
enableRouteTreeFormatting: boolean;
|
|
16
|
+
routeTreeFileFooter: string[];
|
|
17
|
+
tmpDir: string;
|
|
18
|
+
enableRouteGeneration?: boolean | undefined;
|
|
19
|
+
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
20
|
+
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
21
|
+
routeFilePrefix?: string | undefined;
|
|
22
|
+
routeFileIgnorePattern?: string | undefined;
|
|
23
|
+
pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
|
|
24
|
+
verboseFileRoutes?: boolean | undefined;
|
|
25
|
+
autoCodeSplitting?: boolean | undefined;
|
|
26
|
+
customScaffolding?: {
|
|
27
|
+
routeTemplate?: string | undefined;
|
|
28
|
+
lazyRouteTemplate?: string | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
experimental?: {
|
|
31
|
+
enableCodeSplitting?: boolean | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
34
|
+
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
2
35
|
/**
|
|
3
36
|
* @example
|
|
4
37
|
* ```ts
|
|
5
38
|
* export default defineConfig({
|
|
6
|
-
* plugins: [
|
|
39
|
+
* plugins: [tanstackRouterGenerator()],
|
|
7
40
|
* // ...
|
|
8
41
|
* })
|
|
9
42
|
* ```
|
|
10
43
|
*/
|
|
11
|
-
declare const
|
|
44
|
+
declare const tanstackRouterGenerator: (options?: Partial<{
|
|
12
45
|
target: "react" | "solid";
|
|
13
46
|
routeFileIgnorePrefix: string;
|
|
14
47
|
routesDirectory: string;
|
|
@@ -21,9 +54,9 @@ declare const TanStackRouterGeneratorVite: (options?: Partial<{
|
|
|
21
54
|
generatedRouteTree: string;
|
|
22
55
|
disableTypes: boolean;
|
|
23
56
|
addExtensions: boolean;
|
|
24
|
-
disableManifestGeneration: boolean;
|
|
25
57
|
enableRouteTreeFormatting: boolean;
|
|
26
58
|
routeTreeFileFooter: string[];
|
|
59
|
+
tmpDir: string;
|
|
27
60
|
enableRouteGeneration?: boolean | undefined;
|
|
28
61
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
29
62
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -39,17 +72,18 @@ declare const TanStackRouterGeneratorVite: (options?: Partial<{
|
|
|
39
72
|
experimental?: {
|
|
40
73
|
enableCodeSplitting?: boolean | undefined;
|
|
41
74
|
} | undefined;
|
|
75
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
42
76
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
43
77
|
/**
|
|
44
78
|
* @example
|
|
45
79
|
* ```ts
|
|
46
80
|
* export default defineConfig({
|
|
47
|
-
* plugins: [
|
|
81
|
+
* plugins: [tanStackRouterCodeSplitter()],
|
|
48
82
|
* // ...
|
|
49
83
|
* })
|
|
50
84
|
* ```
|
|
51
85
|
*/
|
|
52
|
-
declare const
|
|
86
|
+
declare const tanStackRouterCodeSplitter: (options?: Partial<{
|
|
53
87
|
target: "react" | "solid";
|
|
54
88
|
routeFileIgnorePrefix: string;
|
|
55
89
|
routesDirectory: string;
|
|
@@ -62,9 +96,9 @@ declare const TanStackRouterCodeSplitterVite: (options?: Partial<{
|
|
|
62
96
|
generatedRouteTree: string;
|
|
63
97
|
disableTypes: boolean;
|
|
64
98
|
addExtensions: boolean;
|
|
65
|
-
disableManifestGeneration: boolean;
|
|
66
99
|
enableRouteTreeFormatting: boolean;
|
|
67
100
|
routeTreeFileFooter: string[];
|
|
101
|
+
tmpDir: string;
|
|
68
102
|
enableRouteGeneration?: boolean | undefined;
|
|
69
103
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
70
104
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -80,17 +114,18 @@ declare const TanStackRouterCodeSplitterVite: (options?: Partial<{
|
|
|
80
114
|
experimental?: {
|
|
81
115
|
enableCodeSplitting?: boolean | undefined;
|
|
82
116
|
} | undefined;
|
|
117
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
83
118
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
84
119
|
/**
|
|
85
120
|
* @example
|
|
86
121
|
* ```ts
|
|
87
122
|
* export default defineConfig({
|
|
88
|
-
* plugins: [
|
|
123
|
+
* plugins: [tanstackRouter()],
|
|
89
124
|
* // ...
|
|
90
125
|
* })
|
|
91
126
|
* ```
|
|
92
127
|
*/
|
|
93
|
-
declare const
|
|
128
|
+
declare const tanstackRouter: (options?: Partial<{
|
|
94
129
|
target: "react" | "solid";
|
|
95
130
|
routeFileIgnorePrefix: string;
|
|
96
131
|
routesDirectory: string;
|
|
@@ -103,9 +138,9 @@ declare const TanStackRouterVite: (options?: Partial<{
|
|
|
103
138
|
generatedRouteTree: string;
|
|
104
139
|
disableTypes: boolean;
|
|
105
140
|
addExtensions: boolean;
|
|
106
|
-
disableManifestGeneration: boolean;
|
|
107
141
|
enableRouteTreeFormatting: boolean;
|
|
108
142
|
routeTreeFileFooter: string[];
|
|
143
|
+
tmpDir: string;
|
|
109
144
|
enableRouteGeneration?: boolean | undefined;
|
|
110
145
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
111
146
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -121,8 +156,12 @@ declare const TanStackRouterVite: (options?: Partial<{
|
|
|
121
156
|
experimental?: {
|
|
122
157
|
enableCodeSplitting?: boolean | undefined;
|
|
123
158
|
} | undefined;
|
|
159
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
124
160
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
125
|
-
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Use `tanstackRouter` instead.
|
|
163
|
+
*/
|
|
164
|
+
declare const TanStackRouterVite: (options?: Partial<{
|
|
126
165
|
target: "react" | "solid";
|
|
127
166
|
routeFileIgnorePrefix: string;
|
|
128
167
|
routesDirectory: string;
|
|
@@ -135,9 +174,9 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
135
174
|
generatedRouteTree: string;
|
|
136
175
|
disableTypes: boolean;
|
|
137
176
|
addExtensions: boolean;
|
|
138
|
-
disableManifestGeneration: boolean;
|
|
139
177
|
enableRouteTreeFormatting: boolean;
|
|
140
178
|
routeTreeFileFooter: string[];
|
|
179
|
+
tmpDir: string;
|
|
141
180
|
enableRouteGeneration?: boolean | undefined;
|
|
142
181
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
143
182
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -153,7 +192,8 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
153
192
|
experimental?: {
|
|
154
193
|
enableCodeSplitting?: boolean | undefined;
|
|
155
194
|
} | undefined;
|
|
195
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
156
196
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
157
|
-
export default
|
|
158
|
-
export { configSchema,
|
|
197
|
+
export default tanstackRouter;
|
|
198
|
+
export { configSchema, tanstackRouterAutoImport, tanStackRouterCodeSplitter, tanstackRouterGenerator, TanStackRouterVite, tanstackRouter, };
|
|
159
199
|
export type { Config };
|
package/dist/cjs/webpack.d.cts
CHANGED
|
@@ -21,9 +21,9 @@ declare const TanStackRouterGeneratorWebpack: (options?: Partial<{
|
|
|
21
21
|
generatedRouteTree: string;
|
|
22
22
|
disableTypes: boolean;
|
|
23
23
|
addExtensions: boolean;
|
|
24
|
-
disableManifestGeneration: boolean;
|
|
25
24
|
enableRouteTreeFormatting: boolean;
|
|
26
25
|
routeTreeFileFooter: string[];
|
|
26
|
+
tmpDir: string;
|
|
27
27
|
enableRouteGeneration?: boolean | undefined;
|
|
28
28
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
29
29
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -39,6 +39,7 @@ declare const TanStackRouterGeneratorWebpack: (options?: Partial<{
|
|
|
39
39
|
experimental?: {
|
|
40
40
|
enableCodeSplitting?: boolean | undefined;
|
|
41
41
|
} | undefined;
|
|
42
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
42
43
|
}> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
43
44
|
/**
|
|
44
45
|
* @example
|
|
@@ -62,9 +63,9 @@ declare const TanStackRouterCodeSplitterWebpack: (options?: Partial<{
|
|
|
62
63
|
generatedRouteTree: string;
|
|
63
64
|
disableTypes: boolean;
|
|
64
65
|
addExtensions: boolean;
|
|
65
|
-
disableManifestGeneration: boolean;
|
|
66
66
|
enableRouteTreeFormatting: boolean;
|
|
67
67
|
routeTreeFileFooter: string[];
|
|
68
|
+
tmpDir: string;
|
|
68
69
|
enableRouteGeneration?: boolean | undefined;
|
|
69
70
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
70
71
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -80,6 +81,7 @@ declare const TanStackRouterCodeSplitterWebpack: (options?: Partial<{
|
|
|
80
81
|
experimental?: {
|
|
81
82
|
enableCodeSplitting?: boolean | undefined;
|
|
82
83
|
} | undefined;
|
|
84
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
83
85
|
}> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
84
86
|
/**
|
|
85
87
|
* @example
|
|
@@ -103,9 +105,9 @@ declare const TanStackRouterWebpack: (options?: Partial<{
|
|
|
103
105
|
generatedRouteTree: string;
|
|
104
106
|
disableTypes: boolean;
|
|
105
107
|
addExtensions: boolean;
|
|
106
|
-
disableManifestGeneration: boolean;
|
|
107
108
|
enableRouteTreeFormatting: boolean;
|
|
108
109
|
routeTreeFileFooter: string[];
|
|
110
|
+
tmpDir: string;
|
|
109
111
|
enableRouteGeneration?: boolean | undefined;
|
|
110
112
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
111
113
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -121,6 +123,7 @@ declare const TanStackRouterWebpack: (options?: Partial<{
|
|
|
121
123
|
experimental?: {
|
|
122
124
|
enableCodeSplitting?: boolean | undefined;
|
|
123
125
|
} | undefined;
|
|
126
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
124
127
|
}> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
125
128
|
declare const tanstackRouter: (options?: Partial<{
|
|
126
129
|
target: "react" | "solid";
|
|
@@ -135,9 +138,9 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
135
138
|
generatedRouteTree: string;
|
|
136
139
|
disableTypes: boolean;
|
|
137
140
|
addExtensions: boolean;
|
|
138
|
-
disableManifestGeneration: boolean;
|
|
139
141
|
enableRouteTreeFormatting: boolean;
|
|
140
142
|
routeTreeFileFooter: string[];
|
|
143
|
+
tmpDir: string;
|
|
141
144
|
enableRouteGeneration?: boolean | undefined;
|
|
142
145
|
codeSplittingOptions?: import('./core/config.cjs').CodeSplittingOptions | undefined;
|
|
143
146
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -153,6 +156,7 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
153
156
|
experimental?: {
|
|
154
157
|
enableCodeSplitting?: boolean | undefined;
|
|
155
158
|
} | undefined;
|
|
159
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
156
160
|
}> | undefined) => import('unplugin').WebpackPluginInstance;
|
|
157
161
|
export default TanStackRouterWebpack;
|
|
158
162
|
export { configSchema, TanStackRouterWebpack, TanStackRouterGeneratorWebpack, TanStackRouterCodeSplitterWebpack, tanstackRouter, };
|
|
@@ -38,7 +38,6 @@ export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.object
|
|
|
38
38
|
disableTypes: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
39
39
|
verboseFileRoutes: z.ZodOptional<z.ZodBoolean>;
|
|
40
40
|
addExtensions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
41
|
-
disableManifestGeneration: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
42
41
|
enableRouteTreeFormatting: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
43
42
|
routeTreeFileFooter: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
44
43
|
autoCodeSplitting: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -59,6 +58,8 @@ export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.object
|
|
|
59
58
|
}, {
|
|
60
59
|
enableCodeSplitting?: boolean | undefined;
|
|
61
60
|
}>>;
|
|
61
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import('@tanstack/router-generator').GeneratorPlugin, z.ZodTypeDef, import('@tanstack/router-generator').GeneratorPlugin>, "many">>;
|
|
62
|
+
tmpDir: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
62
63
|
}>, {
|
|
63
64
|
enableRouteGeneration: z.ZodOptional<z.ZodBoolean>;
|
|
64
65
|
codeSplittingOptions: z.ZodOptional<z.ZodType<CodeSplittingOptions, z.ZodTypeDef, CodeSplittingOptions>>;
|
|
@@ -75,9 +76,9 @@ export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.object
|
|
|
75
76
|
generatedRouteTree: string;
|
|
76
77
|
disableTypes: boolean;
|
|
77
78
|
addExtensions: boolean;
|
|
78
|
-
disableManifestGeneration: boolean;
|
|
79
79
|
enableRouteTreeFormatting: boolean;
|
|
80
80
|
routeTreeFileFooter: string[];
|
|
81
|
+
tmpDir: string;
|
|
81
82
|
enableRouteGeneration?: boolean | undefined;
|
|
82
83
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
83
84
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -93,6 +94,7 @@ export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.object
|
|
|
93
94
|
experimental?: {
|
|
94
95
|
enableCodeSplitting?: boolean | undefined;
|
|
95
96
|
} | undefined;
|
|
97
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
96
98
|
}, {
|
|
97
99
|
enableRouteGeneration?: boolean | undefined;
|
|
98
100
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
@@ -113,7 +115,6 @@ export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.object
|
|
|
113
115
|
disableTypes?: boolean | undefined;
|
|
114
116
|
verboseFileRoutes?: boolean | undefined;
|
|
115
117
|
addExtensions?: boolean | undefined;
|
|
116
|
-
disableManifestGeneration?: boolean | undefined;
|
|
117
118
|
enableRouteTreeFormatting?: boolean | undefined;
|
|
118
119
|
routeTreeFileFooter?: string[] | undefined;
|
|
119
120
|
autoCodeSplitting?: boolean | undefined;
|
|
@@ -124,6 +125,8 @@ export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.object
|
|
|
124
125
|
experimental?: {
|
|
125
126
|
enableCodeSplitting?: boolean | undefined;
|
|
126
127
|
} | undefined;
|
|
128
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
129
|
+
tmpDir?: string | undefined;
|
|
127
130
|
}>;
|
|
128
131
|
export declare const getConfig: (inlineConfig: Partial<Config>, root: string) => {
|
|
129
132
|
target: "react" | "solid";
|
|
@@ -138,9 +141,9 @@ export declare const getConfig: (inlineConfig: Partial<Config>, root: string) =>
|
|
|
138
141
|
generatedRouteTree: string;
|
|
139
142
|
disableTypes: boolean;
|
|
140
143
|
addExtensions: boolean;
|
|
141
|
-
disableManifestGeneration: boolean;
|
|
142
144
|
enableRouteTreeFormatting: boolean;
|
|
143
145
|
routeTreeFileFooter: string[];
|
|
146
|
+
tmpDir: string;
|
|
144
147
|
enableRouteGeneration?: boolean | undefined;
|
|
145
148
|
codeSplittingOptions?: CodeSplittingOptions | undefined;
|
|
146
149
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -156,5 +159,8 @@ export declare const getConfig: (inlineConfig: Partial<Config>, root: string) =>
|
|
|
156
159
|
experimental?: {
|
|
157
160
|
enableCodeSplitting?: boolean | undefined;
|
|
158
161
|
} | undefined;
|
|
162
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
159
163
|
};
|
|
160
164
|
export type Config = z.infer<typeof configSchema>;
|
|
165
|
+
export type ConfigInput = z.input<typeof configSchema>;
|
|
166
|
+
export type ConfigOutput = z.output<typeof configSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/core/config.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n configSchema as generatorConfigSchema,\n getConfig as getGeneratorConfig,\n} from '@tanstack/router-generator'\nimport type { RegisteredRouter, RouteIds } from '@tanstack/router-core'\nimport type { CodeSplitGroupings } from './constants'\n\nexport const splitGroupingsSchema = z\n .array(\n z.array(\n z.union([\n z.literal('loader'),\n z.literal('component'),\n z.literal('pendingComponent'),\n z.literal('errorComponent'),\n z.literal('notFoundComponent'),\n ]),\n ),\n {\n message:\n \" Must be an Array of Arrays containing the split groupings. i.e. [['component'], ['pendingComponent'], ['errorComponent', 'notFoundComponent']]\",\n },\n )\n .superRefine((val, ctx) => {\n const flattened = val.flat()\n const unique = [...new Set(flattened)]\n\n // Elements must be unique,\n // ie. this shouldn't be allows [['component'], ['component', 'loader']]\n if (unique.length !== flattened.length) {\n ctx.addIssue({\n code: 'custom',\n message:\n \" Split groupings must be unique and not repeated. i.e. i.e. [['component'], ['pendingComponent'], ['errorComponent', 'notFoundComponent']].\" +\n `\\n You input was: ${JSON.stringify(val)}.`,\n })\n }\n })\n\nexport type CodeSplittingOptions = {\n /**\n * Use this function to programmatically control the code splitting behavior\n * based on the `routeId` for each route.\n *\n * If you just need to change the default behavior, you can use the `defaultBehavior` option.\n * @param params\n */\n splitBehavior?: (params: {\n routeId: RouteIds<RegisteredRouter['routeTree']>\n }) => CodeSplitGroupings | undefined | void\n\n /**\n * The default/global configuration to control your code splitting behavior per route.\n * @default [['component'],['pendingComponent'],['errorComponent'],['notFoundComponent']]\n */\n defaultBehavior?: CodeSplitGroupings\n}\n\nconst codeSplittingOptionsSchema = z.object({\n splitBehavior: z.function().optional(),\n defaultBehavior: splitGroupingsSchema.optional(),\n})\n\nexport const configSchema = generatorConfigSchema.extend({\n enableRouteGeneration: z.boolean().optional(),\n codeSplittingOptions: z\n .custom<CodeSplittingOptions>((v) => {\n return codeSplittingOptionsSchema.parse(v)\n })\n .optional(),\n})\n\nexport const getConfig = (inlineConfig: Partial<Config>, root: string) => {\n const config = getGeneratorConfig(inlineConfig, root)\n\n return configSchema.parse({ ...config, ...inlineConfig })\n}\n\nexport type Config = z.infer<typeof configSchema>\n"],"names":["generatorConfigSchema","getGeneratorConfig"],"mappings":";;AAQO,MAAM,uBAAuB,EACjC;AAAA,EACC,EAAE;AAAA,IACA,EAAE,MAAM;AAAA,MACN,EAAE,QAAQ,QAAQ;AAAA,MAClB,EAAE,QAAQ,WAAW;AAAA,MACrB,EAAE,QAAQ,kBAAkB;AAAA,MAC5B,EAAE,QAAQ,gBAAgB;AAAA,MAC1B,EAAE,QAAQ,mBAAmB;AAAA,IAC9B,CAAA;AAAA,EACH;AAAA,EACA;AAAA,IACE,SACE;AAAA,EAAA;AAEN,EACC,YAAY,CAAC,KAAK,QAAQ;AACnB,QAAA,YAAY,IAAI,KAAK;AAC3B,QAAM,SAAS,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC;AAIjC,MAAA,OAAO,WAAW,UAAU,QAAQ;AACtC,QAAI,SAAS;AAAA,MACX,MAAM;AAAA,MACN,SACE;AAAA,mBACsB,KAAK,UAAU,GAAG,CAAC;AAAA,IAAA,CAC5C;AAAA,EAAA;AAEL,CAAC;AAqBH,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,eAAe,EAAE,SAAS,EAAE,SAAS;AAAA,EACrC,iBAAiB,qBAAqB,SAAS;AACjD,CAAC;AAEY,MAAA,eAAeA,eAAsB,OAAO;AAAA,EACvD,uBAAuB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC5C,sBAAsB,EACnB,OAA6B,CAAC,MAAM;AAC5B,WAAA,2BAA2B,MAAM,CAAC;AAAA,EAC1C,CAAA,EACA,SAAS;AACd,CAAC;AAEY,MAAA,YAAY,CAAC,cAA+B,SAAiB;AAClE,QAAA,SAASC,YAAmB,cAAc,IAAI;AAEpD,SAAO,aAAa,MAAM,EAAE,GAAG,QAAQ,GAAG,cAAc;AAC1D;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/core/config.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n configSchema as generatorConfigSchema,\n getConfig as getGeneratorConfig,\n} from '@tanstack/router-generator'\nimport type { RegisteredRouter, RouteIds } from '@tanstack/router-core'\nimport type { CodeSplitGroupings } from './constants'\n\nexport const splitGroupingsSchema = z\n .array(\n z.array(\n z.union([\n z.literal('loader'),\n z.literal('component'),\n z.literal('pendingComponent'),\n z.literal('errorComponent'),\n z.literal('notFoundComponent'),\n ]),\n ),\n {\n message:\n \" Must be an Array of Arrays containing the split groupings. i.e. [['component'], ['pendingComponent'], ['errorComponent', 'notFoundComponent']]\",\n },\n )\n .superRefine((val, ctx) => {\n const flattened = val.flat()\n const unique = [...new Set(flattened)]\n\n // Elements must be unique,\n // ie. this shouldn't be allows [['component'], ['component', 'loader']]\n if (unique.length !== flattened.length) {\n ctx.addIssue({\n code: 'custom',\n message:\n \" Split groupings must be unique and not repeated. i.e. i.e. [['component'], ['pendingComponent'], ['errorComponent', 'notFoundComponent']].\" +\n `\\n You input was: ${JSON.stringify(val)}.`,\n })\n }\n })\n\nexport type CodeSplittingOptions = {\n /**\n * Use this function to programmatically control the code splitting behavior\n * based on the `routeId` for each route.\n *\n * If you just need to change the default behavior, you can use the `defaultBehavior` option.\n * @param params\n */\n splitBehavior?: (params: {\n routeId: RouteIds<RegisteredRouter['routeTree']>\n }) => CodeSplitGroupings | undefined | void\n\n /**\n * The default/global configuration to control your code splitting behavior per route.\n * @default [['component'],['pendingComponent'],['errorComponent'],['notFoundComponent']]\n */\n defaultBehavior?: CodeSplitGroupings\n}\n\nconst codeSplittingOptionsSchema = z.object({\n splitBehavior: z.function().optional(),\n defaultBehavior: splitGroupingsSchema.optional(),\n})\n\nexport const configSchema = generatorConfigSchema.extend({\n enableRouteGeneration: z.boolean().optional(),\n codeSplittingOptions: z\n .custom<CodeSplittingOptions>((v) => {\n return codeSplittingOptionsSchema.parse(v)\n })\n .optional(),\n})\n\nexport const getConfig = (inlineConfig: Partial<Config>, root: string) => {\n const config = getGeneratorConfig(inlineConfig, root)\n\n return configSchema.parse({ ...config, ...inlineConfig })\n}\n\nexport type Config = z.infer<typeof configSchema>\nexport type ConfigInput = z.input<typeof configSchema>\nexport type ConfigOutput = z.output<typeof configSchema>\n"],"names":["generatorConfigSchema","getGeneratorConfig"],"mappings":";;AAQO,MAAM,uBAAuB,EACjC;AAAA,EACC,EAAE;AAAA,IACA,EAAE,MAAM;AAAA,MACN,EAAE,QAAQ,QAAQ;AAAA,MAClB,EAAE,QAAQ,WAAW;AAAA,MACrB,EAAE,QAAQ,kBAAkB;AAAA,MAC5B,EAAE,QAAQ,gBAAgB;AAAA,MAC1B,EAAE,QAAQ,mBAAmB;AAAA,IAC9B,CAAA;AAAA,EACH;AAAA,EACA;AAAA,IACE,SACE;AAAA,EAAA;AAEN,EACC,YAAY,CAAC,KAAK,QAAQ;AACnB,QAAA,YAAY,IAAI,KAAK;AAC3B,QAAM,SAAS,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC;AAIjC,MAAA,OAAO,WAAW,UAAU,QAAQ;AACtC,QAAI,SAAS;AAAA,MACX,MAAM;AAAA,MACN,SACE;AAAA,mBACsB,KAAK,UAAU,GAAG,CAAC;AAAA,IAAA,CAC5C;AAAA,EAAA;AAEL,CAAC;AAqBH,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,eAAe,EAAE,SAAS,EAAE,SAAS;AAAA,EACrC,iBAAiB,qBAAqB,SAAS;AACjD,CAAC;AAEY,MAAA,eAAeA,eAAsB,OAAO;AAAA,EACvD,uBAAuB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC5C,sBAAsB,EACnB,OAA6B,CAAC,MAAM;AAC5B,WAAA,2BAA2B,MAAM,CAAC;AAAA,EAC1C,CAAA,EACA,SAAS;AACd,CAAC;AAEY,MAAA,YAAY,CAAC,cAA+B,SAAiB;AAClE,QAAA,SAASC,YAAmB,cAAc,IAAI;AAEpD,SAAO,aAAa,MAAM,EAAE,GAAG,QAAQ,GAAG,cAAc;AAC1D;"}
|
|
@@ -3,7 +3,7 @@ const routeHmrStatement = template.statement(
|
|
|
3
3
|
`
|
|
4
4
|
if (import.meta.hot) {
|
|
5
5
|
import.meta.hot.accept((newModule) => {
|
|
6
|
-
if (newModule.Route && typeof newModule.Route.clone === 'function') {
|
|
6
|
+
if (newModule && newModule.Route && typeof newModule.Route.clone === 'function') {
|
|
7
7
|
newModule.Route.clone(Route)
|
|
8
8
|
}
|
|
9
9
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-hmr-statement.js","sources":["../../../src/core/route-hmr-statement.ts"],"sourcesContent":["import * as template from '@babel/template'\n\nexport const routeHmrStatement = template.statement(\n `\nif (import.meta.hot) {\n import.meta.hot.accept((newModule) => {\n if (newModule.Route && typeof newModule.Route.clone === 'function') {\n newModule.Route.clone(Route)\n }\n })\n}\n`,\n)()\n"],"names":[],"mappings":";AAEO,MAAM,oBAAoB,SAAS;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASF,EAAE;"}
|
|
1
|
+
{"version":3,"file":"route-hmr-statement.js","sources":["../../../src/core/route-hmr-statement.ts"],"sourcesContent":["import * as template from '@babel/template'\n\nexport const routeHmrStatement = template.statement(\n `\nif (import.meta.hot) {\n import.meta.hot.accept((newModule) => {\n if (newModule && newModule.Route && typeof newModule.Route.clone === 'function') {\n newModule.Route.clone(Route)\n }\n })\n}\n`,\n)()\n"],"names":[],"mappings":";AAEO,MAAM,oBAAoB,SAAS;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASF,EAAE;"}
|
|
@@ -1,87 +1,79 @@
|
|
|
1
|
-
import { join, isAbsolute, normalize
|
|
2
|
-
import {
|
|
1
|
+
import { join, isAbsolute, normalize } from "node:path";
|
|
2
|
+
import { Generator, resolveConfigPath } from "@tanstack/router-generator";
|
|
3
3
|
import { getConfig } from "./config.js";
|
|
4
|
-
let lock = false;
|
|
5
|
-
const checkLock = () => lock;
|
|
6
|
-
const setLock = (bool) => {
|
|
7
|
-
lock = bool;
|
|
8
|
-
};
|
|
9
4
|
const PLUGIN_NAME = "unplugin:router-generator";
|
|
10
5
|
const unpluginRouterGeneratorFactory = (options = {}) => {
|
|
11
|
-
|
|
6
|
+
const ROOT = process.cwd();
|
|
12
7
|
let userConfig = options;
|
|
8
|
+
let generator;
|
|
9
|
+
const routeGenerationDisabled = () => userConfig.enableRouteGeneration === false;
|
|
13
10
|
const getRoutesDirectoryPath = () => {
|
|
14
11
|
return isAbsolute(userConfig.routesDirectory) ? userConfig.routesDirectory : join(ROOT, userConfig.routesDirectory);
|
|
15
12
|
};
|
|
13
|
+
const initConfigAndGenerator = () => {
|
|
14
|
+
userConfig = getConfig(options, ROOT);
|
|
15
|
+
generator = new Generator({
|
|
16
|
+
config: userConfig,
|
|
17
|
+
root: ROOT
|
|
18
|
+
});
|
|
19
|
+
};
|
|
16
20
|
const generate = async () => {
|
|
17
|
-
if (
|
|
21
|
+
if (routeGenerationDisabled()) {
|
|
18
22
|
return;
|
|
19
23
|
}
|
|
20
|
-
setLock(true);
|
|
21
24
|
try {
|
|
22
|
-
await generator
|
|
23
|
-
} catch (
|
|
24
|
-
console.error(
|
|
25
|
-
console.info();
|
|
26
|
-
} finally {
|
|
27
|
-
setLock(false);
|
|
25
|
+
await generator.run();
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error(e);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const handleFile = async (file, event) => {
|
|
31
31
|
const filePath = normalize(file);
|
|
32
32
|
if (filePath === resolveConfigPath({ configDirectory: ROOT })) {
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (event === "update" && filePath === resolve(userConfig.generatedRouteTree)) {
|
|
33
|
+
initConfigAndGenerator();
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
const run = async (cb) => {
|
|
45
|
-
if (userConfig.enableRouteGeneration ?? true) {
|
|
46
|
-
await cb();
|
|
36
|
+
try {
|
|
37
|
+
await generator.run({ path: filePath, type: event });
|
|
38
|
+
} catch (e) {
|
|
39
|
+
console.error(e);
|
|
47
40
|
}
|
|
48
41
|
};
|
|
49
42
|
return {
|
|
50
43
|
name: "router-generator-plugin",
|
|
44
|
+
enforce: "pre",
|
|
51
45
|
async watchChange(id, { event }) {
|
|
52
|
-
|
|
46
|
+
if (!routeGenerationDisabled()) {
|
|
53
47
|
await handleFile(id, event);
|
|
54
|
-
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
async buildStart() {
|
|
51
|
+
await generate();
|
|
55
52
|
},
|
|
56
53
|
vite: {
|
|
57
|
-
configResolved(
|
|
58
|
-
|
|
59
|
-
userConfig = getConfig(options, ROOT);
|
|
54
|
+
configResolved() {
|
|
55
|
+
initConfigAndGenerator();
|
|
60
56
|
},
|
|
61
57
|
async buildStart() {
|
|
62
58
|
if (this.environment.config.consumer === "server") {
|
|
63
59
|
return;
|
|
64
60
|
}
|
|
65
|
-
await
|
|
61
|
+
await generate();
|
|
66
62
|
},
|
|
67
63
|
sharedDuringBuild: true
|
|
68
64
|
},
|
|
69
65
|
rspack(compiler) {
|
|
70
|
-
|
|
66
|
+
initConfigAndGenerator();
|
|
71
67
|
let handle = null;
|
|
72
|
-
compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME,
|
|
73
|
-
await run(generate);
|
|
74
|
-
});
|
|
68
|
+
compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, generate);
|
|
75
69
|
compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {
|
|
76
70
|
if (handle) {
|
|
77
71
|
return;
|
|
78
72
|
}
|
|
79
73
|
const routesDirectoryPath = getRoutesDirectoryPath();
|
|
80
74
|
const chokidar = await import("chokidar");
|
|
81
|
-
handle = chokidar.watch(routesDirectoryPath, { ignoreInitial: true }).on("add",
|
|
82
|
-
|
|
83
|
-
});
|
|
84
|
-
await run(generate);
|
|
75
|
+
handle = chokidar.watch(routesDirectoryPath, { ignoreInitial: true }).on("add", generate);
|
|
76
|
+
await generate();
|
|
85
77
|
});
|
|
86
78
|
compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => {
|
|
87
79
|
if (handle) {
|
|
@@ -92,19 +84,15 @@ const unpluginRouterGeneratorFactory = (options = {}) => {
|
|
|
92
84
|
webpack(compiler) {
|
|
93
85
|
userConfig = getConfig(options, ROOT);
|
|
94
86
|
let handle = null;
|
|
95
|
-
compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME,
|
|
96
|
-
await run(generate);
|
|
97
|
-
});
|
|
87
|
+
compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, generate);
|
|
98
88
|
compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {
|
|
99
89
|
if (handle) {
|
|
100
90
|
return;
|
|
101
91
|
}
|
|
102
92
|
const routesDirectoryPath = getRoutesDirectoryPath();
|
|
103
93
|
const chokidar = await import("chokidar");
|
|
104
|
-
handle = chokidar.watch(routesDirectoryPath, { ignoreInitial: true }).on("add",
|
|
105
|
-
|
|
106
|
-
});
|
|
107
|
-
await run(generate);
|
|
94
|
+
handle = chokidar.watch(routesDirectoryPath, { ignoreInitial: true }).on("add", generate);
|
|
95
|
+
await generate();
|
|
108
96
|
});
|
|
109
97
|
compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => {
|
|
110
98
|
if (handle) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-generator-plugin.js","sources":["../../../src/core/router-generator-plugin.ts"],"sourcesContent":["import { isAbsolute, join, normalize
|
|
1
|
+
{"version":3,"file":"router-generator-plugin.js","sources":["../../../src/core/router-generator-plugin.ts"],"sourcesContent":["import { isAbsolute, join, normalize } from 'node:path'\nimport { Generator, resolveConfigPath } from '@tanstack/router-generator'\n\nimport { getConfig } from './config'\nimport type { FSWatcher } from 'chokidar'\nimport type { UnpluginFactory } from 'unplugin'\nimport type { Config } from './config'\n\nconst PLUGIN_NAME = 'unplugin:router-generator'\n\nexport const unpluginRouterGeneratorFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}) => {\n const ROOT: string = process.cwd()\n let userConfig = options as Config\n let generator: Generator\n\n const routeGenerationDisabled = () =>\n userConfig.enableRouteGeneration === false\n const getRoutesDirectoryPath = () => {\n return isAbsolute(userConfig.routesDirectory)\n ? userConfig.routesDirectory\n : join(ROOT, userConfig.routesDirectory)\n }\n\n const initConfigAndGenerator = () => {\n userConfig = getConfig(options, ROOT)\n generator = new Generator({\n config: userConfig,\n root: ROOT,\n })\n }\n\n const generate = async () => {\n if (routeGenerationDisabled()) {\n return\n }\n try {\n await generator.run()\n } catch (e) {\n console.error(e)\n }\n }\n\n const handleFile = async (\n file: string,\n event: 'create' | 'update' | 'delete',\n ) => {\n const filePath = normalize(file)\n\n if (filePath === resolveConfigPath({ configDirectory: ROOT })) {\n initConfigAndGenerator()\n return\n }\n try {\n await generator.run({ path: filePath, type: event })\n } catch (e) {\n console.error(e)\n }\n }\n\n return {\n name: 'router-generator-plugin',\n enforce: 'pre',\n async watchChange(id, { event }) {\n if (!routeGenerationDisabled()) {\n await handleFile(id, event)\n }\n },\n async buildStart() {\n await generate()\n },\n vite: {\n configResolved() {\n initConfigAndGenerator()\n },\n async buildStart() {\n if (this.environment.config.consumer === 'server') {\n // When building in environment mode, we only need to generate routes\n // for the client environment\n return\n }\n await generate()\n },\n sharedDuringBuild: true,\n },\n rspack(compiler) {\n initConfigAndGenerator()\n\n let handle: FSWatcher | null = null\n\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, generate)\n\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {\n if (handle) {\n return\n }\n\n // rspack watcher doesn't register newly created files\n const routesDirectoryPath = getRoutesDirectoryPath()\n const chokidar = await import('chokidar')\n handle = chokidar\n .watch(routesDirectoryPath, { ignoreInitial: true })\n .on('add', generate)\n\n await generate()\n })\n\n compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => {\n if (handle) {\n await handle.close()\n }\n })\n },\n webpack(compiler) {\n userConfig = getConfig(options, ROOT)\n\n let handle: FSWatcher | null = null\n\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, generate)\n\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {\n if (handle) {\n return\n }\n\n // webpack watcher doesn't register newly created files\n const routesDirectoryPath = getRoutesDirectoryPath()\n const chokidar = await import('chokidar')\n handle = chokidar\n .watch(routesDirectoryPath, { ignoreInitial: true })\n .on('add', generate)\n\n await generate()\n })\n\n compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => {\n if (handle) {\n await handle.close()\n }\n })\n\n compiler.hooks.done.tap(PLUGIN_NAME, () => {\n console.info('✅ ' + PLUGIN_NAME + ': route-tree generation done')\n })\n },\n }\n}\n"],"names":[],"mappings":"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"}
|
package/dist/esm/esbuild.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ declare const TanStackRouterGeneratorEsbuild: (options?: Partial<{
|
|
|
21
21
|
generatedRouteTree: string;
|
|
22
22
|
disableTypes: boolean;
|
|
23
23
|
addExtensions: boolean;
|
|
24
|
-
disableManifestGeneration: boolean;
|
|
25
24
|
enableRouteTreeFormatting: boolean;
|
|
26
25
|
routeTreeFileFooter: string[];
|
|
26
|
+
tmpDir: string;
|
|
27
27
|
enableRouteGeneration?: boolean | undefined;
|
|
28
28
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
29
29
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -39,6 +39,7 @@ declare const TanStackRouterGeneratorEsbuild: (options?: Partial<{
|
|
|
39
39
|
experimental?: {
|
|
40
40
|
enableCodeSplitting?: boolean | undefined;
|
|
41
41
|
} | undefined;
|
|
42
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
42
43
|
}> | undefined) => import('unplugin').EsbuildPlugin;
|
|
43
44
|
/**
|
|
44
45
|
* @example
|
|
@@ -62,9 +63,9 @@ declare const TanStackRouterCodeSplitterEsbuild: (options?: Partial<{
|
|
|
62
63
|
generatedRouteTree: string;
|
|
63
64
|
disableTypes: boolean;
|
|
64
65
|
addExtensions: boolean;
|
|
65
|
-
disableManifestGeneration: boolean;
|
|
66
66
|
enableRouteTreeFormatting: boolean;
|
|
67
67
|
routeTreeFileFooter: string[];
|
|
68
|
+
tmpDir: string;
|
|
68
69
|
enableRouteGeneration?: boolean | undefined;
|
|
69
70
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
70
71
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -80,6 +81,7 @@ declare const TanStackRouterCodeSplitterEsbuild: (options?: Partial<{
|
|
|
80
81
|
experimental?: {
|
|
81
82
|
enableCodeSplitting?: boolean | undefined;
|
|
82
83
|
} | undefined;
|
|
84
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
83
85
|
}> | undefined) => import('unplugin').EsbuildPlugin;
|
|
84
86
|
/**
|
|
85
87
|
* @example
|
|
@@ -103,9 +105,9 @@ declare const TanStackRouterEsbuild: (options?: Partial<{
|
|
|
103
105
|
generatedRouteTree: string;
|
|
104
106
|
disableTypes: boolean;
|
|
105
107
|
addExtensions: boolean;
|
|
106
|
-
disableManifestGeneration: boolean;
|
|
107
108
|
enableRouteTreeFormatting: boolean;
|
|
108
109
|
routeTreeFileFooter: string[];
|
|
110
|
+
tmpDir: string;
|
|
109
111
|
enableRouteGeneration?: boolean | undefined;
|
|
110
112
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
111
113
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -121,6 +123,7 @@ declare const TanStackRouterEsbuild: (options?: Partial<{
|
|
|
121
123
|
experimental?: {
|
|
122
124
|
enableCodeSplitting?: boolean | undefined;
|
|
123
125
|
} | undefined;
|
|
126
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
124
127
|
}> | undefined) => import('unplugin').EsbuildPlugin;
|
|
125
128
|
declare const tanstackRouter: (options?: Partial<{
|
|
126
129
|
target: "react" | "solid";
|
|
@@ -135,9 +138,9 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
135
138
|
generatedRouteTree: string;
|
|
136
139
|
disableTypes: boolean;
|
|
137
140
|
addExtensions: boolean;
|
|
138
|
-
disableManifestGeneration: boolean;
|
|
139
141
|
enableRouteTreeFormatting: boolean;
|
|
140
142
|
routeTreeFileFooter: string[];
|
|
143
|
+
tmpDir: string;
|
|
141
144
|
enableRouteGeneration?: boolean | undefined;
|
|
142
145
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
143
146
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -153,6 +156,7 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
153
156
|
experimental?: {
|
|
154
157
|
enableCodeSplitting?: boolean | undefined;
|
|
155
158
|
} | undefined;
|
|
159
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
156
160
|
}> | undefined) => import('unplugin').EsbuildPlugin;
|
|
157
161
|
export default TanStackRouterEsbuild;
|
|
158
162
|
export { configSchema, TanStackRouterGeneratorEsbuild, TanStackRouterCodeSplitterEsbuild, TanStackRouterEsbuild, tanstackRouter, };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { configSchema } from './core/config.js';
|
|
1
|
+
export { configSchema, getConfig } from './core/config.js';
|
|
2
2
|
export { unpluginRouterCodeSplitterFactory } from './core/router-code-splitter-plugin.js';
|
|
3
3
|
export { unpluginRouterGeneratorFactory } from './core/router-generator-plugin.js';
|
|
4
|
-
export type { Config } from './core/config.js';
|
|
4
|
+
export type { Config, ConfigInput, ConfigOutput } from './core/config.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { configSchema } from "./core/config.js";
|
|
1
|
+
import { configSchema, getConfig } from "./core/config.js";
|
|
2
2
|
import { unpluginRouterCodeSplitterFactory } from "./core/router-code-splitter-plugin.js";
|
|
3
3
|
import { unpluginRouterGeneratorFactory } from "./core/router-generator-plugin.js";
|
|
4
4
|
export {
|
|
5
5
|
configSchema,
|
|
6
|
+
getConfig,
|
|
6
7
|
unpluginRouterCodeSplitterFactory,
|
|
7
8
|
unpluginRouterGeneratorFactory
|
|
8
9
|
};
|