@tanstack/router-plugin 1.139.3 → 1.139.4
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
CHANGED
|
@@ -45,7 +45,7 @@ const configSchema = routerGenerator.configSchema.extend({
|
|
|
45
45
|
});
|
|
46
46
|
const getConfig = (inlineConfig, root) => {
|
|
47
47
|
const config = routerGenerator.getConfig(inlineConfig, root);
|
|
48
|
-
return configSchema.parse({ ...
|
|
48
|
+
return configSchema.parse({ ...inlineConfig, ...config });
|
|
49
49
|
};
|
|
50
50
|
exports.configSchema = configSchema;
|
|
51
51
|
exports.getConfig = getConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","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 {\n CreateFileRoute,\n RegisteredRouter,\n RouteIds,\n} 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 /**\n * The nodes that shall be deleted from the route.\n * @default undefined\n */\n deleteNodes?: Array<DeletableNodes>\n\n /**\n * @default true\n */\n addHmr?: boolean\n}\n\nconst codeSplittingOptionsSchema = z.object({\n splitBehavior: z.function().optional(),\n defaultBehavior: splitGroupingsSchema.optional(),\n deleteNodes: z.array(z.string()).optional(),\n addHmr: z.boolean().optional().default(true),\n})\n\ntype FileRouteKeys = keyof (Parameters<\n CreateFileRoute<any, any, any, any, any>\n>[0] & {})\nexport type DeletableNodes = FileRouteKeys | (string & {})\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 plugin: z\n .object({\n vite: z\n .object({\n environmentName: z.string().optional(),\n })\n .optional(),\n })\n .optional(),\n})\n\nexport const getConfig = (inlineConfig: Partial<Config>, root: string) => {\n const config = getGeneratorConfig(inlineConfig, root)\n\n return configSchema.parse({ ...
|
|
1
|
+
{"version":3,"file":"config.cjs","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 {\n CreateFileRoute,\n RegisteredRouter,\n RouteIds,\n} 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 /**\n * The nodes that shall be deleted from the route.\n * @default undefined\n */\n deleteNodes?: Array<DeletableNodes>\n\n /**\n * @default true\n */\n addHmr?: boolean\n}\n\nconst codeSplittingOptionsSchema = z.object({\n splitBehavior: z.function().optional(),\n defaultBehavior: splitGroupingsSchema.optional(),\n deleteNodes: z.array(z.string()).optional(),\n addHmr: z.boolean().optional().default(true),\n})\n\ntype FileRouteKeys = keyof (Parameters<\n CreateFileRoute<any, any, any, any, any>\n>[0] & {})\nexport type DeletableNodes = FileRouteKeys | (string & {})\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 plugin: z\n .object({\n vite: z\n .object({\n environmentName: z.string().optional(),\n })\n .optional(),\n })\n .optional(),\n})\n\nexport const getConfig = (inlineConfig: Partial<Config>, root: string) => {\n const config = getGeneratorConfig(inlineConfig, root)\n\n return configSchema.parse({ ...inlineConfig, ...config })\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":["z","generatorConfigSchema","getGeneratorConfig"],"mappings":";;;;AAYO,MAAM,uBAAuBA,IAAAA,EACjC;AAAA,EACCA,IAAAA,EAAE;AAAA,IACAA,IAAAA,EAAE,MAAM;AAAA,MACNA,IAAAA,EAAE,QAAQ,QAAQ;AAAA,MAClBA,IAAAA,EAAE,QAAQ,WAAW;AAAA,MACrBA,IAAAA,EAAE,QAAQ,kBAAkB;AAAA,MAC5BA,IAAAA,EAAE,QAAQ,gBAAgB;AAAA,MAC1BA,IAAAA,EAAE,QAAQ,mBAAmB;AAAA,IAAA,CAC9B;AAAA,EAAA;AAAA,EAEH;AAAA,IACE,SACE;AAAA,EAAA;AAEN,EACC,YAAY,CAAC,KAAK,QAAQ;AACzB,QAAM,YAAY,IAAI,KAAA;AACtB,QAAM,SAAS,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC;AAIrC,MAAI,OAAO,WAAW,UAAU,QAAQ;AACtC,QAAI,SAAS;AAAA,MACX,MAAM;AAAA,MACN,SACE;AAAA,mBACsB,KAAK,UAAU,GAAG,CAAC;AAAA,IAAA,CAC5C;AAAA,EACH;AACF,CAAC;AAgCH,MAAM,6BAA6BA,IAAAA,EAAE,OAAO;AAAA,EAC1C,eAAeA,IAAAA,EAAE,SAAA,EAAW,SAAA;AAAA,EAC5B,iBAAiB,qBAAqB,SAAA;AAAA,EACtC,aAAaA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAA,CAAQ,EAAE,SAAA;AAAA,EACjC,QAAQA,IAAAA,EAAE,QAAA,EAAU,SAAA,EAAW,QAAQ,IAAI;AAC7C,CAAC;AAOM,MAAM,eAAeC,gBAAAA,aAAsB,OAAO;AAAA,EACvD,uBAAuBD,IAAAA,EAAE,QAAA,EAAU,SAAA;AAAA,EACnC,sBAAsBA,IAAAA,EACnB,OAA6B,CAAC,MAAM;AACnC,WAAO,2BAA2B,MAAM,CAAC;AAAA,EAC3C,CAAC,EACA,SAAA;AAAA,EACH,QAAQA,IAAAA,EACL,OAAO;AAAA,IACN,MAAMA,IAAAA,EACH,OAAO;AAAA,MACN,iBAAiBA,IAAAA,EAAE,OAAA,EAAS,SAAA;AAAA,IAAS,CACtC,EACA,SAAA;AAAA,EAAS,CACb,EACA,SAAA;AACL,CAAC;AAEM,MAAM,YAAY,CAAC,cAA+B,SAAiB;AACxE,QAAM,SAASE,gBAAAA,UAAmB,cAAc,IAAI;AAEpD,SAAO,aAAa,MAAM,EAAE,GAAG,cAAc,GAAG,QAAQ;AAC1D;;;;"}
|
package/dist/esm/core/config.js
CHANGED
|
@@ -43,7 +43,7 @@ const configSchema = configSchema$1.extend({
|
|
|
43
43
|
});
|
|
44
44
|
const getConfig = (inlineConfig, root) => {
|
|
45
45
|
const config = getConfig$1(inlineConfig, root);
|
|
46
|
-
return configSchema.parse({ ...
|
|
46
|
+
return configSchema.parse({ ...inlineConfig, ...config });
|
|
47
47
|
};
|
|
48
48
|
export {
|
|
49
49
|
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 {\n CreateFileRoute,\n RegisteredRouter,\n RouteIds,\n} 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 /**\n * The nodes that shall be deleted from the route.\n * @default undefined\n */\n deleteNodes?: Array<DeletableNodes>\n\n /**\n * @default true\n */\n addHmr?: boolean\n}\n\nconst codeSplittingOptionsSchema = z.object({\n splitBehavior: z.function().optional(),\n defaultBehavior: splitGroupingsSchema.optional(),\n deleteNodes: z.array(z.string()).optional(),\n addHmr: z.boolean().optional().default(true),\n})\n\ntype FileRouteKeys = keyof (Parameters<\n CreateFileRoute<any, any, any, any, any>\n>[0] & {})\nexport type DeletableNodes = FileRouteKeys | (string & {})\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 plugin: z\n .object({\n vite: z\n .object({\n environmentName: z.string().optional(),\n })\n .optional(),\n })\n .optional(),\n})\n\nexport const getConfig = (inlineConfig: Partial<Config>, root: string) => {\n const config = getGeneratorConfig(inlineConfig, root)\n\n return configSchema.parse({ ...
|
|
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 {\n CreateFileRoute,\n RegisteredRouter,\n RouteIds,\n} 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 /**\n * The nodes that shall be deleted from the route.\n * @default undefined\n */\n deleteNodes?: Array<DeletableNodes>\n\n /**\n * @default true\n */\n addHmr?: boolean\n}\n\nconst codeSplittingOptionsSchema = z.object({\n splitBehavior: z.function().optional(),\n defaultBehavior: splitGroupingsSchema.optional(),\n deleteNodes: z.array(z.string()).optional(),\n addHmr: z.boolean().optional().default(true),\n})\n\ntype FileRouteKeys = keyof (Parameters<\n CreateFileRoute<any, any, any, any, any>\n>[0] & {})\nexport type DeletableNodes = FileRouteKeys | (string & {})\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 plugin: z\n .object({\n vite: z\n .object({\n environmentName: z.string().optional(),\n })\n .optional(),\n })\n .optional(),\n})\n\nexport const getConfig = (inlineConfig: Partial<Config>, root: string) => {\n const config = getGeneratorConfig(inlineConfig, root)\n\n return configSchema.parse({ ...inlineConfig, ...config })\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":";;AAYO,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,IAAA,CAC9B;AAAA,EAAA;AAAA,EAEH;AAAA,IACE,SACE;AAAA,EAAA;AAEN,EACC,YAAY,CAAC,KAAK,QAAQ;AACzB,QAAM,YAAY,IAAI,KAAA;AACtB,QAAM,SAAS,CAAC,GAAG,IAAI,IAAI,SAAS,CAAC;AAIrC,MAAI,OAAO,WAAW,UAAU,QAAQ;AACtC,QAAI,SAAS;AAAA,MACX,MAAM;AAAA,MACN,SACE;AAAA,mBACsB,KAAK,UAAU,GAAG,CAAC;AAAA,IAAA,CAC5C;AAAA,EACH;AACF,CAAC;AAgCH,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,eAAe,EAAE,SAAA,EAAW,SAAA;AAAA,EAC5B,iBAAiB,qBAAqB,SAAA;AAAA,EACtC,aAAa,EAAE,MAAM,EAAE,OAAA,CAAQ,EAAE,SAAA;AAAA,EACjC,QAAQ,EAAE,QAAA,EAAU,SAAA,EAAW,QAAQ,IAAI;AAC7C,CAAC;AAOM,MAAM,eAAeA,eAAsB,OAAO;AAAA,EACvD,uBAAuB,EAAE,QAAA,EAAU,SAAA;AAAA,EACnC,sBAAsB,EACnB,OAA6B,CAAC,MAAM;AACnC,WAAO,2BAA2B,MAAM,CAAC;AAAA,EAC3C,CAAC,EACA,SAAA;AAAA,EACH,QAAQ,EACL,OAAO;AAAA,IACN,MAAM,EACH,OAAO;AAAA,MACN,iBAAiB,EAAE,OAAA,EAAS,SAAA;AAAA,IAAS,CACtC,EACA,SAAA;AAAA,EAAS,CACb,EACA,SAAA;AACL,CAAC;AAEM,MAAM,YAAY,CAAC,cAA+B,SAAiB;AACxE,QAAM,SAASC,YAAmB,cAAc,IAAI;AAEpD,SAAO,aAAa,MAAM,EAAE,GAAG,cAAc,GAAG,QAAQ;AAC1D;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-plugin",
|
|
3
|
-
"version": "1.139.
|
|
3
|
+
"version": "1.139.4",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"unplugin": "^2.1.2",
|
|
99
99
|
"zod": "^3.24.2",
|
|
100
100
|
"@tanstack/router-core": "1.139.3",
|
|
101
|
-
"@tanstack/router-utils": "1.139.0",
|
|
102
101
|
"@tanstack/router-generator": "1.139.3",
|
|
102
|
+
"@tanstack/router-utils": "1.139.0",
|
|
103
103
|
"@tanstack/virtual-file-routes": "1.139.0"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
package/src/core/config.ts
CHANGED
|
@@ -105,7 +105,7 @@ export const configSchema = generatorConfigSchema.extend({
|
|
|
105
105
|
export const getConfig = (inlineConfig: Partial<Config>, root: string) => {
|
|
106
106
|
const config = getGeneratorConfig(inlineConfig, root)
|
|
107
107
|
|
|
108
|
-
return configSchema.parse({ ...
|
|
108
|
+
return configSchema.parse({ ...inlineConfig, ...config })
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export type Config = z.infer<typeof configSchema>
|