@tanstack/router-plugin 1.121.0-alpha.22 → 1.121.0-alpha.27
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.d.cts +8 -4
- 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/rspack.d.cts +8 -4
- package/dist/cjs/vite.d.cts +10 -5
- package/dist/cjs/webpack.d.cts +8 -4
- package/dist/esm/core/config.d.ts +8 -4
- 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/rspack.d.ts +8 -4
- package/dist/esm/vite.d.ts +10 -5
- package/dist/esm/webpack.d.ts +8 -4
- package/package.json +10 -8
- package/src/core/router-generator-plugin.ts +39 -63
|
@@ -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/rspack.d.ts
CHANGED
|
@@ -25,9 +25,9 @@ declare const TanStackRouterGeneratorRspack: (options?: Partial<{
|
|
|
25
25
|
generatedRouteTree: string;
|
|
26
26
|
disableTypes: boolean;
|
|
27
27
|
addExtensions: boolean;
|
|
28
|
-
disableManifestGeneration: boolean;
|
|
29
28
|
enableRouteTreeFormatting: boolean;
|
|
30
29
|
routeTreeFileFooter: string[];
|
|
30
|
+
tmpDir: string;
|
|
31
31
|
enableRouteGeneration?: boolean | undefined;
|
|
32
32
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
33
33
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -43,6 +43,7 @@ declare const TanStackRouterGeneratorRspack: (options?: Partial<{
|
|
|
43
43
|
experimental?: {
|
|
44
44
|
enableCodeSplitting?: boolean | undefined;
|
|
45
45
|
} | undefined;
|
|
46
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
46
47
|
}> | undefined) => import('unplugin').RspackPluginInstance;
|
|
47
48
|
/**
|
|
48
49
|
* @example
|
|
@@ -70,9 +71,9 @@ declare const TanStackRouterCodeSplitterRspack: (options?: Partial<{
|
|
|
70
71
|
generatedRouteTree: string;
|
|
71
72
|
disableTypes: boolean;
|
|
72
73
|
addExtensions: boolean;
|
|
73
|
-
disableManifestGeneration: boolean;
|
|
74
74
|
enableRouteTreeFormatting: boolean;
|
|
75
75
|
routeTreeFileFooter: string[];
|
|
76
|
+
tmpDir: string;
|
|
76
77
|
enableRouteGeneration?: boolean | undefined;
|
|
77
78
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
78
79
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -88,6 +89,7 @@ declare const TanStackRouterCodeSplitterRspack: (options?: Partial<{
|
|
|
88
89
|
experimental?: {
|
|
89
90
|
enableCodeSplitting?: boolean | undefined;
|
|
90
91
|
} | undefined;
|
|
92
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
91
93
|
}> | undefined) => import('unplugin').RspackPluginInstance;
|
|
92
94
|
/**
|
|
93
95
|
* @example
|
|
@@ -115,9 +117,9 @@ declare const TanStackRouterRspack: (options?: Partial<{
|
|
|
115
117
|
generatedRouteTree: string;
|
|
116
118
|
disableTypes: boolean;
|
|
117
119
|
addExtensions: boolean;
|
|
118
|
-
disableManifestGeneration: boolean;
|
|
119
120
|
enableRouteTreeFormatting: boolean;
|
|
120
121
|
routeTreeFileFooter: string[];
|
|
122
|
+
tmpDir: string;
|
|
121
123
|
enableRouteGeneration?: boolean | undefined;
|
|
122
124
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
123
125
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -133,6 +135,7 @@ declare const TanStackRouterRspack: (options?: Partial<{
|
|
|
133
135
|
experimental?: {
|
|
134
136
|
enableCodeSplitting?: boolean | undefined;
|
|
135
137
|
} | undefined;
|
|
138
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
136
139
|
}> | undefined) => import('unplugin').RspackPluginInstance;
|
|
137
140
|
declare const tanstackRouter: (options?: Partial<{
|
|
138
141
|
target: "react" | "solid";
|
|
@@ -147,9 +150,9 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
147
150
|
generatedRouteTree: string;
|
|
148
151
|
disableTypes: boolean;
|
|
149
152
|
addExtensions: boolean;
|
|
150
|
-
disableManifestGeneration: boolean;
|
|
151
153
|
enableRouteTreeFormatting: boolean;
|
|
152
154
|
routeTreeFileFooter: string[];
|
|
155
|
+
tmpDir: string;
|
|
153
156
|
enableRouteGeneration?: boolean | undefined;
|
|
154
157
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
155
158
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -165,6 +168,7 @@ declare const tanstackRouter: (options?: Partial<{
|
|
|
165
168
|
experimental?: {
|
|
166
169
|
enableCodeSplitting?: boolean | undefined;
|
|
167
170
|
} | undefined;
|
|
171
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
168
172
|
}> | undefined) => import('unplugin').RspackPluginInstance;
|
|
169
173
|
export default TanStackRouterRspack;
|
|
170
174
|
export { configSchema, TanStackRouterRspack, TanStackRouterGeneratorRspack, TanStackRouterCodeSplitterRspack, tanstackRouter, };
|
package/dist/esm/vite.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ declare const tanstackRouterAutoImport: (options?: Partial<{
|
|
|
12
12
|
generatedRouteTree: string;
|
|
13
13
|
disableTypes: boolean;
|
|
14
14
|
addExtensions: boolean;
|
|
15
|
-
disableManifestGeneration: boolean;
|
|
16
15
|
enableRouteTreeFormatting: boolean;
|
|
17
16
|
routeTreeFileFooter: string[];
|
|
17
|
+
tmpDir: string;
|
|
18
18
|
enableRouteGeneration?: boolean | undefined;
|
|
19
19
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
20
20
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -30,6 +30,7 @@ declare const tanstackRouterAutoImport: (options?: Partial<{
|
|
|
30
30
|
experimental?: {
|
|
31
31
|
enableCodeSplitting?: boolean | undefined;
|
|
32
32
|
} | undefined;
|
|
33
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
33
34
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
34
35
|
/**
|
|
35
36
|
* @example
|
|
@@ -53,9 +54,9 @@ declare const tanstackRouterGenerator: (options?: Partial<{
|
|
|
53
54
|
generatedRouteTree: string;
|
|
54
55
|
disableTypes: boolean;
|
|
55
56
|
addExtensions: boolean;
|
|
56
|
-
disableManifestGeneration: boolean;
|
|
57
57
|
enableRouteTreeFormatting: boolean;
|
|
58
58
|
routeTreeFileFooter: string[];
|
|
59
|
+
tmpDir: string;
|
|
59
60
|
enableRouteGeneration?: boolean | undefined;
|
|
60
61
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
61
62
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -71,6 +72,7 @@ declare const tanstackRouterGenerator: (options?: Partial<{
|
|
|
71
72
|
experimental?: {
|
|
72
73
|
enableCodeSplitting?: boolean | undefined;
|
|
73
74
|
} | undefined;
|
|
75
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
74
76
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
75
77
|
/**
|
|
76
78
|
* @example
|
|
@@ -94,9 +96,9 @@ declare const tanStackRouterCodeSplitter: (options?: Partial<{
|
|
|
94
96
|
generatedRouteTree: string;
|
|
95
97
|
disableTypes: boolean;
|
|
96
98
|
addExtensions: boolean;
|
|
97
|
-
disableManifestGeneration: boolean;
|
|
98
99
|
enableRouteTreeFormatting: boolean;
|
|
99
100
|
routeTreeFileFooter: string[];
|
|
101
|
+
tmpDir: string;
|
|
100
102
|
enableRouteGeneration?: boolean | undefined;
|
|
101
103
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
102
104
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -112,6 +114,7 @@ declare const tanStackRouterCodeSplitter: (options?: Partial<{
|
|
|
112
114
|
experimental?: {
|
|
113
115
|
enableCodeSplitting?: boolean | undefined;
|
|
114
116
|
} | undefined;
|
|
117
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
115
118
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
116
119
|
/**
|
|
117
120
|
* @example
|
|
@@ -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('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
157
161
|
/**
|
|
158
162
|
* @deprecated Use `tanstackRouter` instead.
|
|
@@ -170,9 +174,9 @@ declare const TanStackRouterVite: (options?: Partial<{
|
|
|
170
174
|
generatedRouteTree: string;
|
|
171
175
|
disableTypes: boolean;
|
|
172
176
|
addExtensions: boolean;
|
|
173
|
-
disableManifestGeneration: boolean;
|
|
174
177
|
enableRouteTreeFormatting: boolean;
|
|
175
178
|
routeTreeFileFooter: string[];
|
|
179
|
+
tmpDir: string;
|
|
176
180
|
enableRouteGeneration?: boolean | undefined;
|
|
177
181
|
codeSplittingOptions?: import('./core/config.js').CodeSplittingOptions | undefined;
|
|
178
182
|
virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
|
|
@@ -188,6 +192,7 @@ declare const TanStackRouterVite: (options?: Partial<{
|
|
|
188
192
|
experimental?: {
|
|
189
193
|
enableCodeSplitting?: boolean | undefined;
|
|
190
194
|
} | undefined;
|
|
195
|
+
plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
|
|
191
196
|
}> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
|
|
192
197
|
export default tanstackRouter;
|
|
193
198
|
export { configSchema, tanstackRouterAutoImport, tanStackRouterCodeSplitter, tanstackRouterGenerator, TanStackRouterVite, tanstackRouter, };
|
package/dist/esm/webpack.d.ts
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.js').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.js').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.js').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.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').WebpackPluginInstance;
|
|
157
161
|
export default TanStackRouterWebpack;
|
|
158
162
|
export { configSchema, TanStackRouterWebpack, TanStackRouterGeneratorWebpack, TanStackRouterCodeSplitterWebpack, tanstackRouter, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-plugin",
|
|
3
|
-
"version": "1.121.0-alpha.
|
|
3
|
+
"version": "1.121.0-alpha.27",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -93,24 +93,26 @@
|
|
|
93
93
|
"@babel/template": "^7.26.8",
|
|
94
94
|
"@babel/traverse": "^7.26.8",
|
|
95
95
|
"@babel/types": "^7.26.8",
|
|
96
|
-
"@types/babel__core": "^7.20.5",
|
|
97
|
-
"@types/babel__template": "^7.4.4",
|
|
98
|
-
"@types/babel__traverse": "^7.20.6",
|
|
99
96
|
"babel-dead-code-elimination": "^1.0.10",
|
|
100
97
|
"chokidar": "^3.6.0",
|
|
101
98
|
"unplugin": "^2.1.2",
|
|
102
99
|
"zod": "^3.24.2",
|
|
103
|
-
"@tanstack/router-core": "^1.121.0-alpha.
|
|
104
|
-
"@tanstack/router-utils": "^1.121.0-alpha.
|
|
100
|
+
"@tanstack/router-core": "^1.121.0-alpha.27",
|
|
101
|
+
"@tanstack/router-utils": "^1.121.0-alpha.26",
|
|
105
102
|
"@tanstack/virtual-file-routes": "^1.121.0-alpha.1",
|
|
106
|
-
"@tanstack/router-generator": "^1.121.0-alpha.
|
|
103
|
+
"@tanstack/router-generator": "^1.121.0-alpha.27"
|
|
104
|
+
},
|
|
105
|
+
"devDependencies": {
|
|
106
|
+
"@types/babel__core": "^7.20.5",
|
|
107
|
+
"@types/babel__template": "^7.4.4",
|
|
108
|
+
"@types/babel__traverse": "^7.20.6"
|
|
107
109
|
},
|
|
108
110
|
"peerDependencies": {
|
|
109
111
|
"@rsbuild/core": ">=1.0.2",
|
|
110
112
|
"vite": ">=5.0.0 || >=6.0.0",
|
|
111
113
|
"vite-plugin-solid": "^2.11.2",
|
|
112
114
|
"webpack": ">=5.92.0",
|
|
113
|
-
"@tanstack/react-router": "^1.121.0-alpha.
|
|
115
|
+
"@tanstack/react-router": "^1.121.0-alpha.27"
|
|
114
116
|
},
|
|
115
117
|
"peerDependenciesMeta": {
|
|
116
118
|
"@rsbuild/core": {
|