Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tanstack/router-generator

Package Overview
Dependencies
Maintainers
2
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/router-generator - npm Package Compare versions

Comparing version 1.16.5 to 1.18.0

3

dist/esm/config.d.ts

@@ -6,2 +6,3 @@ import { z } from 'zod';

routesDirectory: z.ZodDefault<z.ZodOptional<z.ZodString>>;
routeGroupPattern: z.ZodDefault<z.ZodOptional<z.ZodString>>;
generatedRouteTree: z.ZodDefault<z.ZodOptional<z.ZodString>>;

@@ -14,2 +15,3 @@ quoteStyle: z.ZodDefault<z.ZodOptional<z.ZodEnum<["single", "double"]>>>;

routesDirectory: string;
routeGroupPattern: string;
generatedRouteTree: string;

@@ -24,2 +26,3 @@ quoteStyle: "single" | "double";

routesDirectory?: string | undefined;
routeGroupPattern?: string | undefined;
generatedRouteTree?: string | undefined;

@@ -26,0 +29,0 @@ quoteStyle?: "single" | "double" | undefined;

@@ -8,2 +8,3 @@ import path from "path";

routesDirectory: z.string().optional().default("./src/routes"),
routeGroupPattern: z.string().optional().default("\\(.+\\)"),
generatedRouteTree: z.string().optional().default("./src/routeTree.gen.ts"),

@@ -10,0 +11,0 @@ quoteStyle: z.enum(["single", "double"]).optional().default("single"),

@@ -142,2 +142,3 @@ import path from "path";

let routeNodes = [];
const routeGroupPatternRegex = new RegExp(config.routeGroupPattern, "g");
const handleNode = async (node) => {

@@ -154,3 +155,6 @@ var _a, _b;

node.isNonLayout = first2.endsWith("_");
node.cleanedPath = removeUnderscores(node.path) ?? "";
node.cleanedPath = removeGroups(
removeUnderscores(node.path) ?? "",
routeGroupPatternRegex
);
const routeCode = fs.readFileSync(node.fullPath, "utf-8");

@@ -448,2 +452,5 @@ const escapedRoutePath = removeTrailingUnderscores(

}
function removeGroups(s, rx) {
return s.replaceAll(rx, "").replaceAll("//", "/");
}
function hasParentRoute(routes, routePathToCheck) {

@@ -450,0 +457,0 @@ if (!routePathToCheck || routePathToCheck === "/") {

2

package.json
{
"name": "@tanstack/router-generator",
"version": "1.16.5",
"version": "1.18.0",
"description": "",

@@ -5,0 +5,0 @@ "author": "Tanner Linsley",

@@ -9,2 +9,3 @@ import path from 'path'

routesDirectory: z.string().optional().default('./src/routes'),
routeGroupPattern: z.string().optional().default('\\(.+\\)'),
generatedRouteTree: z.string().optional().default('./src/routeTree.gen.ts'),

@@ -11,0 +12,0 @@ quoteStyle: z.enum(['single', 'double']).optional().default('single'),

@@ -204,2 +204,4 @@ import path from 'path'

const routeGroupPatternRegex = new RegExp(config.routeGroupPattern, 'g')
const handleNode = async (node: RouteNode) => {

@@ -220,3 +222,6 @@ const parentRoute = hasParentRoute(routeNodes, node.routePath)

node.isNonLayout = first.endsWith('_')
node.cleanedPath = removeUnderscores(node.path) ?? ''
node.cleanedPath = removeGroups(
removeUnderscores(node.path) ?? '',
routeGroupPatternRegex,
)

@@ -635,2 +640,6 @@ // Ensure the boilerplate for the route exists

function removeGroups(s: string, rx: RegExp) {
return s.replaceAll(rx, '').replaceAll('//', '/')
}
export function hasParentRoute(

@@ -637,0 +646,0 @@ routes: RouteNode[],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc