@tanstack/router-generator 1.168.0 → 1.169.1
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/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/config.cjs +1 -2
- package/dist/cjs/filesystem/physical/getRouteNodes.cjs +4 -5
- package/dist/cjs/filesystem/physical/rootPathId.cjs +1 -2
- package/dist/cjs/filesystem/virtual/config.cjs +1 -2
- package/dist/cjs/filesystem/virtual/getRouteNodes.cjs +4 -5
- package/dist/cjs/filesystem/virtual/loadConfigFile.cjs +1 -2
- package/dist/cjs/generator.cjs +16 -9
- package/dist/cjs/generator.cjs.map +1 -1
- package/dist/cjs/generator.d.cts +7 -0
- package/dist/cjs/index.cjs +6 -6
- package/dist/cjs/logger.cjs +1 -2
- package/dist/cjs/template.cjs +1 -2
- package/dist/cjs/transform/transform.cjs +1 -2
- package/dist/cjs/utils.cjs +1 -2
- package/dist/cjs/validate-route-params.cjs +1 -2
- package/dist/esm/config.js +1 -2
- package/dist/esm/filesystem/physical/getRouteNodes.js +4 -5
- package/dist/esm/filesystem/physical/rootPathId.js +1 -2
- package/dist/esm/filesystem/virtual/config.js +1 -2
- package/dist/esm/filesystem/virtual/getRouteNodes.js +4 -5
- package/dist/esm/filesystem/virtual/loadConfigFile.js +1 -2
- package/dist/esm/generator.d.ts +7 -0
- package/dist/esm/generator.js +15 -8
- package/dist/esm/generator.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/logger.js +1 -2
- package/dist/esm/template.js +1 -2
- package/dist/esm/transform/transform.js +1 -2
- package/dist/esm/utils.js +1 -2
- package/dist/esm/validate-route-params.js +1 -2
- package/package.json +11 -11
- package/src/generator.ts +32 -3
package/dist/cjs/generator.d.cts
CHANGED
|
@@ -50,6 +50,7 @@ export declare class Generator {
|
|
|
50
50
|
config: Config;
|
|
51
51
|
targetTemplate: TargetTemplate;
|
|
52
52
|
private root;
|
|
53
|
+
private writeRouteFiles;
|
|
53
54
|
private routesDirectoryPath;
|
|
54
55
|
private sessionId?;
|
|
55
56
|
private fs;
|
|
@@ -85,6 +86,12 @@ export declare class Generator {
|
|
|
85
86
|
config: Config;
|
|
86
87
|
root: string;
|
|
87
88
|
fs?: fs;
|
|
89
|
+
/**
|
|
90
|
+
* `false` keeps the generator from scaffolding empty route files and from
|
|
91
|
+
* updating the route path or factory in existing ones. Only the route tree
|
|
92
|
+
* is written. A route file that would have been written gets a warning.
|
|
93
|
+
*/
|
|
94
|
+
writeRouteFiles?: boolean;
|
|
88
95
|
});
|
|
89
96
|
private getGeneratedRouteTreePath;
|
|
90
97
|
private getRoutesDirectoryPath;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_config = require("./config.cjs");
|
|
3
|
-
const require_rootPathId = require("./filesystem/physical/rootPathId.cjs");
|
|
4
|
-
const require_utils = require("./utils.cjs");
|
|
5
|
-
const require_getRouteNodes = require("./filesystem/virtual/getRouteNodes.cjs");
|
|
6
|
-
const require_getRouteNodes$1 = require("./filesystem/physical/getRouteNodes.cjs");
|
|
7
3
|
const require_generator = require("./generator.cjs");
|
|
4
|
+
const require_utils = require("./utils.cjs");
|
|
5
|
+
const require_getRouteNodes = require("./filesystem/physical/getRouteNodes.cjs");
|
|
6
|
+
const require_getRouteNodes$1 = require("./filesystem/virtual/getRouteNodes.cjs");
|
|
7
|
+
const require_rootPathId = require("./filesystem/physical/rootPathId.cjs");
|
|
8
8
|
exports.Generator = require_generator.Generator;
|
|
9
9
|
exports.baseConfigSchema = require_config.baseConfigSchema;
|
|
10
10
|
exports.capitalize = require_utils.capitalize;
|
|
@@ -16,7 +16,7 @@ exports.format = require_utils.format;
|
|
|
16
16
|
exports.getConfig = require_config.getConfig;
|
|
17
17
|
exports.inferFullPath = require_utils.inferFullPath;
|
|
18
18
|
exports.multiSortBy = require_utils.multiSortBy;
|
|
19
|
-
exports.physicalGetRouteNodes = require_getRouteNodes
|
|
19
|
+
exports.physicalGetRouteNodes = require_getRouteNodes.getRouteNodes;
|
|
20
20
|
exports.removeExt = require_utils.removeExt;
|
|
21
21
|
exports.removeLeadingSlash = require_utils.removeLeadingSlash;
|
|
22
22
|
exports.removeTrailingSlash = require_utils.removeTrailingSlash;
|
|
@@ -27,5 +27,5 @@ exports.resolveConfigPath = require_config.resolveConfigPath;
|
|
|
27
27
|
exports.rootPathId = require_rootPathId.rootPathId;
|
|
28
28
|
exports.routePathToVariable = require_utils.routePathToVariable;
|
|
29
29
|
exports.trimPathLeft = require_utils.trimPathLeft;
|
|
30
|
-
exports.virtualGetRouteNodes = require_getRouteNodes.getRouteNodes;
|
|
30
|
+
exports.virtualGetRouteNodes = require_getRouteNodes$1.getRouteNodes;
|
|
31
31
|
exports.writeIfDifferent = require_utils.writeIfDifferent;
|
package/dist/cjs/logger.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/logger.ts
|
|
2
2
|
function logging(config) {
|
|
3
3
|
function stripEmojis(str) {
|
|
4
4
|
return str.replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu, "");
|
|
@@ -25,7 +25,6 @@ function logging(config) {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
exports.logging = logging;
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=logger.cjs.map
|
package/dist/cjs/template.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_utils = require("./utils.cjs");
|
|
2
|
-
|
|
2
|
+
// src/template.ts
|
|
3
3
|
function fillTemplate(config, template, values) {
|
|
4
4
|
const replaced = template.replace(/%%(\w+)%%/g, (_, key) => values[key] || "");
|
|
5
5
|
return require_utils.format(replaced, config);
|
|
@@ -147,7 +147,6 @@ function getTargetTemplate(config) {
|
|
|
147
147
|
default: throw new Error(`router-generator: Unknown target type: ${target}`);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
//#endregion
|
|
151
150
|
exports.fillTemplate = fillTemplate;
|
|
152
151
|
exports.getTargetTemplate = getTargetTemplate;
|
|
153
152
|
|
|
@@ -4,7 +4,7 @@ magic_string = require_runtime.__toESM(magic_string, 1);
|
|
|
4
4
|
let _babel_types = require("@babel/types");
|
|
5
5
|
_babel_types = require_runtime.__toESM(_babel_types, 1);
|
|
6
6
|
let _tanstack_router_utils = require("@tanstack/router-utils");
|
|
7
|
-
|
|
7
|
+
// src/transform/transform.ts
|
|
8
8
|
var routeConstructors = ["createFileRoute", "createLazyFileRoute"];
|
|
9
9
|
function transform({ ctx, source, filename, node }) {
|
|
10
10
|
let ast;
|
|
@@ -315,7 +315,6 @@ function getRemovalEnd(source, end) {
|
|
|
315
315
|
if (source[pos] === "\n" || source[pos] === "\r") return pos + 1;
|
|
316
316
|
return end;
|
|
317
317
|
}
|
|
318
|
-
//#endregion
|
|
319
318
|
exports.transform = transform;
|
|
320
319
|
|
|
321
320
|
//# sourceMappingURL=transform.cjs.map
|
package/dist/cjs/utils.cjs
CHANGED
|
@@ -6,7 +6,7 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
6
6
|
node_fs_promises = require_runtime.__toESM(node_fs_promises, 1);
|
|
7
7
|
let prettier = require("prettier");
|
|
8
8
|
prettier = require_runtime.__toESM(prettier, 1);
|
|
9
|
-
|
|
9
|
+
// src/utils.ts
|
|
10
10
|
/**
|
|
11
11
|
* Prefix map for O(1) parent route lookups.
|
|
12
12
|
* Maps each route path prefix to the route node that owns that prefix.
|
|
@@ -722,7 +722,6 @@ function getImportForRouteNode(node, config, generatedRouteTreePath, root) {
|
|
|
722
722
|
}]
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
//#endregion
|
|
726
725
|
exports.RoutePrefixMap = RoutePrefixMap;
|
|
727
726
|
exports.buildFileRoutesByPathInterface = buildFileRoutesByPathInterface;
|
|
728
727
|
exports.buildImportString = buildImportString;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/validate-route-params.ts
|
|
2
2
|
/**
|
|
3
3
|
* Regex for valid JavaScript identifier (param name)
|
|
4
4
|
* Must start with letter, underscore, or dollar sign
|
|
@@ -67,7 +67,6 @@ function validateRouteParams(routePath, filePath, logger) {
|
|
|
67
67
|
const invalidParams = extractParamsFromPath(routePath).filter((p) => !p.isValid);
|
|
68
68
|
for (const param of invalidParams) logger.warn(`WARNING: Invalid param name "${param.paramName}" in route "${routePath}" (file: ${filePath}). Param names must be valid JavaScript identifiers (match /[a-zA-Z_$][a-zA-Z0-9_$]*/).`);
|
|
69
69
|
}
|
|
70
|
-
//#endregion
|
|
71
70
|
exports.validateRouteParams = validateRouteParams;
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=validate-route-params.cjs.map
|
package/dist/esm/config.js
CHANGED
|
@@ -2,7 +2,7 @@ import { virtualRootRouteSchema } from "./filesystem/virtual/config.js";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// src/config.ts
|
|
6
6
|
var tokenJsonRegexSchema = z.object({
|
|
7
7
|
regex: z.string(),
|
|
8
8
|
flags: z.string().optional()
|
|
@@ -121,7 +121,6 @@ function areTokensEqual(a, b) {
|
|
|
121
121
|
if (typeof a === "object" && "regex" in a && typeof b === "object" && "regex" in b) return a.regex === b.regex && (a.flags ?? "") === (b.flags ?? "");
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
|
-
//#endregion
|
|
125
124
|
export { baseConfigSchema, configSchema, getConfig, resolveConfigPath };
|
|
126
125
|
|
|
127
126
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { logging } from "../../logger.js";
|
|
2
|
-
import "./rootPathId.js";
|
|
3
1
|
import { cleanPath, createRoutePathSegmentMetadata, determineInitialRoutePath, escapeRegExp, hasEscapedLeadingUnderscore, joinRoutePathSegmentMetadata, removeExt, replaceBackslash, routePathToVariable, unwrapBracketWrappedSegment } from "../../utils.js";
|
|
4
|
-
import { loadConfigFile } from "../virtual/loadConfigFile.js";
|
|
5
2
|
import { getRouteNodes as getRouteNodes$1 } from "../virtual/getRouteNodes.js";
|
|
3
|
+
import { loadConfigFile } from "../virtual/loadConfigFile.js";
|
|
4
|
+
import { logging } from "../../logger.js";
|
|
5
|
+
import "./rootPathId.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import * as fsp from "node:fs/promises";
|
|
8
|
-
|
|
8
|
+
// src/filesystem/physical/getRouteNodes.ts
|
|
9
9
|
var disallowedRouteGroupConfiguration = /\(([^)]+)\).(ts|js|tsx|jsx|vue)/;
|
|
10
10
|
var virtualConfigFileRegExp = /__virtual\.[mc]?[jt]s$/;
|
|
11
11
|
function isVirtualConfigFile(fileName) {
|
|
@@ -232,7 +232,6 @@ function isValidPathlessLayoutRoute(normalizedRoutePath, originalRoutePath, rout
|
|
|
232
232
|
if (hasEscapedLeadingUnderscore(lastOriginalSegment)) return false;
|
|
233
233
|
return !indexTokenSegmentRegex.test(lastRouteSegment) && !routeTokenSegmentRegex.test(lastRouteSegment) && lastRouteSegment.startsWith("_");
|
|
234
234
|
}
|
|
235
|
-
//#endregion
|
|
236
235
|
export { getRouteMeta, getRouteNodes, isVirtualConfigFile };
|
|
237
236
|
|
|
238
237
|
//# sourceMappingURL=getRouteNodes.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
// src/filesystem/virtual/config.ts
|
|
3
3
|
var indexRouteSchema = z.object({
|
|
4
4
|
type: z.literal("index"),
|
|
5
5
|
file: z.string()
|
|
@@ -32,7 +32,6 @@ var virtualRootRouteSchema = z.object({
|
|
|
32
32
|
file: z.string(),
|
|
33
33
|
children: z.array(virtualRouteNodeSchema).optional()
|
|
34
34
|
});
|
|
35
|
-
//#endregion
|
|
36
35
|
export { virtualRootRouteSchema };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { virtualRootRouteSchema } from "./config.js";
|
|
2
|
-
import { rootPathId } from "../physical/rootPathId.js";
|
|
3
1
|
import { cleanPath, createLiteralRoutePathSegmentMetadata, createRoutePathSegmentMetadata, determineInitialRoutePathFromExplicitPath, joinRoutePathSegmentMetadata, removeExt, removeLeadingSlash, removeTrailingSlash, replaceBackslash, routePathToVariable } from "../../utils.js";
|
|
4
|
-
import { loadConfigFile } from "./loadConfigFile.js";
|
|
5
2
|
import { getRouteNodes as getRouteNodes$1 } from "../physical/getRouteNodes.js";
|
|
3
|
+
import { rootPathId } from "../physical/rootPathId.js";
|
|
4
|
+
import { virtualRootRouteSchema } from "./config.js";
|
|
5
|
+
import { loadConfigFile } from "./loadConfigFile.js";
|
|
6
6
|
import path, { join, resolve } from "node:path";
|
|
7
|
-
|
|
7
|
+
// src/filesystem/virtual/getRouteNodes.ts
|
|
8
8
|
function ensureLeadingUnderScore(id) {
|
|
9
9
|
if (id.startsWith("_")) return id;
|
|
10
10
|
return `_${id}`;
|
|
@@ -184,7 +184,6 @@ async function getRouteNodesRecursive(tsrConfig, root, fullDir, nodes, tokenRege
|
|
|
184
184
|
physicalDirectories: allPhysicalDirectories
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
|
-
//#endregion
|
|
188
187
|
export { getRouteNodes, getRouteNodesRecursive };
|
|
189
188
|
|
|
190
189
|
//# sourceMappingURL=getRouteNodes.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createJiti } from "jiti";
|
|
2
|
-
|
|
2
|
+
// src/filesystem/virtual/loadConfigFile.ts
|
|
3
3
|
async function loadConfigFile(filePath) {
|
|
4
4
|
return await createJiti(filePath, {
|
|
5
5
|
interopDefault: false,
|
|
6
6
|
tsconfigPaths: true
|
|
7
7
|
}).import(filePath);
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { loadConfigFile };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=loadConfigFile.js.map
|
package/dist/esm/generator.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare class Generator {
|
|
|
50
50
|
config: Config;
|
|
51
51
|
targetTemplate: TargetTemplate;
|
|
52
52
|
private root;
|
|
53
|
+
private writeRouteFiles;
|
|
53
54
|
private routesDirectoryPath;
|
|
54
55
|
private sessionId?;
|
|
55
56
|
private fs;
|
|
@@ -85,6 +86,12 @@ export declare class Generator {
|
|
|
85
86
|
config: Config;
|
|
86
87
|
root: string;
|
|
87
88
|
fs?: fs;
|
|
89
|
+
/**
|
|
90
|
+
* `false` keeps the generator from scaffolding empty route files and from
|
|
91
|
+
* updating the route path or factory in existing ones. Only the route tree
|
|
92
|
+
* is written. A route file that would have been written gets a warning.
|
|
93
|
+
*/
|
|
94
|
+
writeRouteFiles?: boolean;
|
|
88
95
|
});
|
|
89
96
|
private getGeneratedRouteTreePath;
|
|
90
97
|
private getRoutesDirectoryPath;
|
package/dist/esm/generator.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { logging } from "./logger.js";
|
|
2
|
+
import { getRouteNodes, isVirtualConfigFile } from "./filesystem/physical/getRouteNodes.js";
|
|
3
|
+
import { getRouteNodes as getRouteNodes$1 } from "./filesystem/virtual/getRouteNodes.js";
|
|
2
4
|
import { rootPathId } from "./filesystem/physical/rootPathId.js";
|
|
3
5
|
import { RoutePrefixMap, buildFileRoutesByPathInterface, buildImportString, buildRouteTreeConfig, checkFileExists, checkRouteFullPathUniqueness, countRoutePathSegments, countSlashSeparatedParts, createRouteNodesByFullPath, createRouteNodesById, createRouteNodesByTo, createTokenRegex, determineNodePath, findParent, format, getImportForRouteNode, getResolvedRouteNodeVariableName, hasParentRoute, isSegmentPathless, mergeImportDeclarations, multiSortBy, removeExt, removeGroups, removeLastSegmentFromPath, removeLayoutSegmentsAndUnderscoresWithEscape, removeTrailingSlash, replaceBackslash, sortRouteNodes, trimPathLeft } from "./utils.js";
|
|
4
|
-
import { getRouteNodes } from "./filesystem/virtual/getRouteNodes.js";
|
|
5
|
-
import { getRouteNodes as getRouteNodes$1, isVirtualConfigFile } from "./filesystem/physical/getRouteNodes.js";
|
|
6
6
|
import { fillTemplate, getTargetTemplate } from "./template.js";
|
|
7
7
|
import { transform } from "./transform/transform.js";
|
|
8
8
|
import { validateRouteParams } from "./validate-route-params.js";
|
|
@@ -11,7 +11,7 @@ import { existsSync, mkdirSync } from "node:fs";
|
|
|
11
11
|
import * as fsp from "node:fs/promises";
|
|
12
12
|
import crypto from "node:crypto";
|
|
13
13
|
import { rootRouteId } from "@tanstack/router-core";
|
|
14
|
-
|
|
14
|
+
// src/generator.ts
|
|
15
15
|
function getRoutePathSegmentMetadataForPath(node, routePath, parentRoutePath) {
|
|
16
16
|
if (!node._routePathSegmentMetadata) return void 0;
|
|
17
17
|
const segments = routePath.split("/");
|
|
@@ -87,6 +87,7 @@ var Generator = class Generator {
|
|
|
87
87
|
this.config = opts.config;
|
|
88
88
|
this.logger = logging({ disabled: this.config.disableLogging });
|
|
89
89
|
this.root = opts.root;
|
|
90
|
+
this.writeRouteFiles = opts.writeRouteFiles ?? true;
|
|
90
91
|
this.fs = opts.fs || DefaultFileSystem;
|
|
91
92
|
this.generatedRouteTreePath = this.getGeneratedRouteTreePath();
|
|
92
93
|
this.targetTemplate = getTargetTemplate(this.config);
|
|
@@ -151,11 +152,11 @@ var Generator = class Generator {
|
|
|
151
152
|
async generatorInternal() {
|
|
152
153
|
let writeRouteTreeFile = false;
|
|
153
154
|
let getRouteNodesResult;
|
|
154
|
-
if (this.config.virtualRouteConfig) getRouteNodesResult = await getRouteNodes(this.config, this.root, {
|
|
155
|
+
if (this.config.virtualRouteConfig) getRouteNodesResult = await getRouteNodes$1(this.config, this.root, {
|
|
155
156
|
indexTokenSegmentRegex: this.indexTokenSegmentRegex,
|
|
156
157
|
routeTokenSegmentRegex: this.routeTokenSegmentRegex
|
|
157
158
|
});
|
|
158
|
-
else getRouteNodesResult = await getRouteNodes
|
|
159
|
+
else getRouteNodesResult = await getRouteNodes(this.config, this.root, {
|
|
159
160
|
indexTokenSegmentRegex: this.indexTokenSegmentRegex,
|
|
160
161
|
routeTokenSegmentRegex: this.routeTokenSegmentRegex
|
|
161
162
|
});
|
|
@@ -472,6 +473,10 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved
|
|
|
472
473
|
let shouldWriteRouteFile = false;
|
|
473
474
|
let shouldWriteTree = false;
|
|
474
475
|
if (!existingRouteFile.fileContent) {
|
|
476
|
+
if (!this.writeRouteFiles) {
|
|
477
|
+
this.logger.warn(`Warning: Route file "${node.fullPath}" is empty. It is left as it is and is not included in the route tree, because this run does not write route files.`);
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
475
480
|
shouldWriteRouteFile = true;
|
|
476
481
|
shouldWriteTree = true;
|
|
477
482
|
if (node._fsRouteType === "lazy") {
|
|
@@ -528,8 +533,10 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved
|
|
|
528
533
|
}
|
|
529
534
|
if (transformResult.result === "error") throw new Error(`Error transforming route file ${node.fullPath}: ${transformResult.error}`);
|
|
530
535
|
if (transformResult.result === "modified") {
|
|
531
|
-
|
|
532
|
-
|
|
536
|
+
if (this.writeRouteFiles) {
|
|
537
|
+
updatedCacheEntry.fileContent = transformResult.output;
|
|
538
|
+
shouldWriteRouteFile = true;
|
|
539
|
+
} else this.logger.warn(`Warning: Route file "${node.fullPath}" is out of date: its route path or route factory does not match its location. It is left as it is, because this run does not write route files.`);
|
|
533
540
|
}
|
|
534
541
|
}
|
|
535
542
|
for (const plugin of this.plugins) plugin.afterTransform?.({
|
|
@@ -656,6 +663,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved
|
|
|
656
663
|
node
|
|
657
664
|
};
|
|
658
665
|
if (!rootNodeFile.fileContent) {
|
|
666
|
+
if (!this.writeRouteFiles) throw new Error(`The root route file "${node.fullPath}" is empty, and this run does not write route files.`);
|
|
659
667
|
const rootTemplate = this.targetTemplate.rootRoute;
|
|
660
668
|
const rootRouteContent = await fillTemplate(this.config, rootTemplate.template(), {
|
|
661
669
|
tsrImports: rootTemplate.imports.tsrImports(),
|
|
@@ -773,7 +781,6 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved
|
|
|
773
781
|
return false;
|
|
774
782
|
}
|
|
775
783
|
};
|
|
776
|
-
//#endregion
|
|
777
784
|
export { Generator };
|
|
778
785
|
|
|
779
786
|
//# sourceMappingURL=generator.js.map
|