@tanstack/router-plugin 1.127.5 → 1.127.9

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.
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const routerGenerator = require("@tanstack/router-generator");
3
4
  const routerGeneratorPlugin = require("./router-generator-plugin.cjs");
4
5
  const routerCodeSplitterPlugin = require("./router-code-splitter-plugin.cjs");
5
6
  const routerHmrPlugin = require("./router-hmr-plugin.cjs");
6
7
  const routeAutoimportPlugin = require("./route-autoimport-plugin.cjs");
7
8
  const unpluginRouterComposedFactory = (options = {}, meta) => {
9
+ const ROOT = process.cwd();
10
+ const userConfig = routerGenerator.getConfig(options, ROOT);
8
11
  const getPlugin = (pluginFactory) => {
9
12
  const plugin = pluginFactory(options, meta);
10
13
  if (!Array.isArray(plugin)) {
@@ -12,18 +15,18 @@ const unpluginRouterComposedFactory = (options = {}, meta) => {
12
15
  }
13
16
  return plugin;
14
17
  };
15
- const routerGenerator = getPlugin(routerGeneratorPlugin.unpluginRouterGeneratorFactory);
18
+ const routerGenerator$1 = getPlugin(routerGeneratorPlugin.unpluginRouterGeneratorFactory);
16
19
  const routerCodeSplitter = getPlugin(routerCodeSplitterPlugin.unpluginRouterCodeSplitterFactory);
17
20
  const routeAutoImport = getPlugin(routeAutoimportPlugin.unpluginRouteAutoImportFactory);
18
- const result = [...routerGenerator];
19
- if (options.autoCodeSplitting) {
21
+ const result = [...routerGenerator$1];
22
+ if (userConfig.autoCodeSplitting) {
20
23
  result.push(...routerCodeSplitter);
21
24
  }
22
- if (options.verboseFileRoutes === false) {
25
+ if (userConfig.verboseFileRoutes === false) {
23
26
  result.push(...routeAutoImport);
24
27
  }
25
28
  const isProduction = process.env.NODE_ENV === "production";
26
- if (!isProduction && !options.autoCodeSplitting) {
29
+ if (!isProduction && !userConfig.autoCodeSplitting) {
27
30
  const routerHmr = getPlugin(routerHmrPlugin.unpluginRouterHmrFactory);
28
31
  result.push(...routerHmr);
29
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router-composed-plugin.cjs","sources":["../../../src/core/router-composed-plugin.ts"],"sourcesContent":["import { unpluginRouterGeneratorFactory } from './router-generator-plugin'\nimport { unpluginRouterCodeSplitterFactory } from './router-code-splitter-plugin'\nimport { unpluginRouterHmrFactory } from './router-hmr-plugin'\nimport { unpluginRouteAutoImportFactory } from './route-autoimport-plugin'\nimport type { Config } from './config'\nimport type { UnpluginFactory } from 'unplugin'\n\nexport const unpluginRouterComposedFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}, meta) => {\n const getPlugin = (pluginFactory: UnpluginFactory<Partial<Config>>) => {\n const plugin = pluginFactory(options, meta)\n if (!Array.isArray(plugin)) {\n return [plugin]\n }\n return plugin\n }\n\n const routerGenerator = getPlugin(unpluginRouterGeneratorFactory)\n const routerCodeSplitter = getPlugin(unpluginRouterCodeSplitterFactory)\n const routeAutoImport = getPlugin(unpluginRouteAutoImportFactory)\n\n const result = [...routerGenerator]\n if (options.autoCodeSplitting) {\n result.push(...routerCodeSplitter)\n }\n if (options.verboseFileRoutes === false) {\n result.push(...routeAutoImport)\n }\n\n const isProduction = process.env.NODE_ENV === 'production'\n\n if (!isProduction && !options.autoCodeSplitting) {\n const routerHmr = getPlugin(unpluginRouterHmrFactory)\n result.push(...routerHmr)\n }\n return result\n}\n"],"names":["unpluginRouterGeneratorFactory","unpluginRouterCodeSplitterFactory","unpluginRouteAutoImportFactory","unpluginRouterHmrFactory"],"mappings":";;;;;;AAOO,MAAM,gCAET,CAAC,UAAU,IAAI,SAAS;AACpB,QAAA,YAAY,CAAC,kBAAoD;AAC/D,UAAA,SAAS,cAAc,SAAS,IAAI;AAC1C,QAAI,CAAC,MAAM,QAAQ,MAAM,GAAG;AAC1B,aAAO,CAAC,MAAM;AAAA,IAAA;AAET,WAAA;AAAA,EACT;AAEM,QAAA,kBAAkB,UAAUA,oDAA8B;AAC1D,QAAA,qBAAqB,UAAUC,0DAAiC;AAChE,QAAA,kBAAkB,UAAUC,oDAA8B;AAE1D,QAAA,SAAS,CAAC,GAAG,eAAe;AAClC,MAAI,QAAQ,mBAAmB;AACtB,WAAA,KAAK,GAAG,kBAAkB;AAAA,EAAA;AAE/B,MAAA,QAAQ,sBAAsB,OAAO;AAChC,WAAA,KAAK,GAAG,eAAe;AAAA,EAAA;AAG1B,QAAA,eAAe,QAAQ,IAAI,aAAa;AAE9C,MAAI,CAAC,gBAAgB,CAAC,QAAQ,mBAAmB;AACzC,UAAA,YAAY,UAAUC,wCAAwB;AAC7C,WAAA,KAAK,GAAG,SAAS;AAAA,EAAA;AAEnB,SAAA;AACT;;"}
1
+ {"version":3,"file":"router-composed-plugin.cjs","sources":["../../../src/core/router-composed-plugin.ts"],"sourcesContent":["import { getConfig } from '@tanstack/router-generator'\nimport { unpluginRouterGeneratorFactory } from './router-generator-plugin'\nimport { unpluginRouterCodeSplitterFactory } from './router-code-splitter-plugin'\nimport { unpluginRouterHmrFactory } from './router-hmr-plugin'\nimport { unpluginRouteAutoImportFactory } from './route-autoimport-plugin'\nimport type { Config } from './config'\nimport type { UnpluginFactory } from 'unplugin'\n\nexport const unpluginRouterComposedFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}, meta) => {\n const ROOT: string = process.cwd()\n const userConfig = getConfig(options, ROOT)\n\n const getPlugin = (pluginFactory: UnpluginFactory<Partial<Config>>) => {\n const plugin = pluginFactory(options, meta)\n if (!Array.isArray(plugin)) {\n return [plugin]\n }\n return plugin\n }\n\n const routerGenerator = getPlugin(unpluginRouterGeneratorFactory)\n const routerCodeSplitter = getPlugin(unpluginRouterCodeSplitterFactory)\n const routeAutoImport = getPlugin(unpluginRouteAutoImportFactory)\n\n const result = [...routerGenerator]\n if (userConfig.autoCodeSplitting) {\n result.push(...routerCodeSplitter)\n }\n if (userConfig.verboseFileRoutes === false) {\n result.push(...routeAutoImport)\n }\n\n const isProduction = process.env.NODE_ENV === 'production'\n\n if (!isProduction && !userConfig.autoCodeSplitting) {\n const routerHmr = getPlugin(unpluginRouterHmrFactory)\n result.push(...routerHmr)\n }\n return result\n}\n"],"names":["getConfig","routerGenerator","unpluginRouterGeneratorFactory","unpluginRouterCodeSplitterFactory","unpluginRouteAutoImportFactory","unpluginRouterHmrFactory"],"mappings":";;;;;;;AAQO,MAAM,gCAET,CAAC,UAAU,IAAI,SAAS;AACpB,QAAA,OAAe,QAAQ,IAAI;AAC3B,QAAA,aAAaA,gBAAAA,UAAU,SAAS,IAAI;AAEpC,QAAA,YAAY,CAAC,kBAAoD;AAC/D,UAAA,SAAS,cAAc,SAAS,IAAI;AAC1C,QAAI,CAAC,MAAM,QAAQ,MAAM,GAAG;AAC1B,aAAO,CAAC,MAAM;AAAA,IAAA;AAET,WAAA;AAAA,EACT;AAEM,QAAAC,oBAAkB,UAAUC,oDAA8B;AAC1D,QAAA,qBAAqB,UAAUC,0DAAiC;AAChE,QAAA,kBAAkB,UAAUC,oDAA8B;AAE1D,QAAA,SAAS,CAAC,GAAGH,iBAAe;AAClC,MAAI,WAAW,mBAAmB;AACzB,WAAA,KAAK,GAAG,kBAAkB;AAAA,EAAA;AAE/B,MAAA,WAAW,sBAAsB,OAAO;AACnC,WAAA,KAAK,GAAG,eAAe;AAAA,EAAA;AAG1B,QAAA,eAAe,QAAQ,IAAI,aAAa;AAE9C,MAAI,CAAC,gBAAgB,CAAC,WAAW,mBAAmB;AAC5C,UAAA,YAAY,UAAUI,wCAAwB;AAC7C,WAAA,KAAK,GAAG,SAAS;AAAA,EAAA;AAEnB,SAAA;AACT;;"}
@@ -1,8 +1,11 @@
1
+ import { getConfig } from "@tanstack/router-generator";
1
2
  import { unpluginRouterGeneratorFactory } from "./router-generator-plugin.js";
2
3
  import { unpluginRouterCodeSplitterFactory } from "./router-code-splitter-plugin.js";
3
4
  import { unpluginRouterHmrFactory } from "./router-hmr-plugin.js";
4
5
  import { unpluginRouteAutoImportFactory } from "./route-autoimport-plugin.js";
5
6
  const unpluginRouterComposedFactory = (options = {}, meta) => {
7
+ const ROOT = process.cwd();
8
+ const userConfig = getConfig(options, ROOT);
6
9
  const getPlugin = (pluginFactory) => {
7
10
  const plugin = pluginFactory(options, meta);
8
11
  if (!Array.isArray(plugin)) {
@@ -14,14 +17,14 @@ const unpluginRouterComposedFactory = (options = {}, meta) => {
14
17
  const routerCodeSplitter = getPlugin(unpluginRouterCodeSplitterFactory);
15
18
  const routeAutoImport = getPlugin(unpluginRouteAutoImportFactory);
16
19
  const result = [...routerGenerator];
17
- if (options.autoCodeSplitting) {
20
+ if (userConfig.autoCodeSplitting) {
18
21
  result.push(...routerCodeSplitter);
19
22
  }
20
- if (options.verboseFileRoutes === false) {
23
+ if (userConfig.verboseFileRoutes === false) {
21
24
  result.push(...routeAutoImport);
22
25
  }
23
26
  const isProduction = process.env.NODE_ENV === "production";
24
- if (!isProduction && !options.autoCodeSplitting) {
27
+ if (!isProduction && !userConfig.autoCodeSplitting) {
25
28
  const routerHmr = getPlugin(unpluginRouterHmrFactory);
26
29
  result.push(...routerHmr);
27
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router-composed-plugin.js","sources":["../../../src/core/router-composed-plugin.ts"],"sourcesContent":["import { unpluginRouterGeneratorFactory } from './router-generator-plugin'\nimport { unpluginRouterCodeSplitterFactory } from './router-code-splitter-plugin'\nimport { unpluginRouterHmrFactory } from './router-hmr-plugin'\nimport { unpluginRouteAutoImportFactory } from './route-autoimport-plugin'\nimport type { Config } from './config'\nimport type { UnpluginFactory } from 'unplugin'\n\nexport const unpluginRouterComposedFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}, meta) => {\n const getPlugin = (pluginFactory: UnpluginFactory<Partial<Config>>) => {\n const plugin = pluginFactory(options, meta)\n if (!Array.isArray(plugin)) {\n return [plugin]\n }\n return plugin\n }\n\n const routerGenerator = getPlugin(unpluginRouterGeneratorFactory)\n const routerCodeSplitter = getPlugin(unpluginRouterCodeSplitterFactory)\n const routeAutoImport = getPlugin(unpluginRouteAutoImportFactory)\n\n const result = [...routerGenerator]\n if (options.autoCodeSplitting) {\n result.push(...routerCodeSplitter)\n }\n if (options.verboseFileRoutes === false) {\n result.push(...routeAutoImport)\n }\n\n const isProduction = process.env.NODE_ENV === 'production'\n\n if (!isProduction && !options.autoCodeSplitting) {\n const routerHmr = getPlugin(unpluginRouterHmrFactory)\n result.push(...routerHmr)\n }\n return result\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,gCAET,CAAC,UAAU,IAAI,SAAS;AACpB,QAAA,YAAY,CAAC,kBAAoD;AAC/D,UAAA,SAAS,cAAc,SAAS,IAAI;AAC1C,QAAI,CAAC,MAAM,QAAQ,MAAM,GAAG;AAC1B,aAAO,CAAC,MAAM;AAAA,IAAA;AAET,WAAA;AAAA,EACT;AAEM,QAAA,kBAAkB,UAAU,8BAA8B;AAC1D,QAAA,qBAAqB,UAAU,iCAAiC;AAChE,QAAA,kBAAkB,UAAU,8BAA8B;AAE1D,QAAA,SAAS,CAAC,GAAG,eAAe;AAClC,MAAI,QAAQ,mBAAmB;AACtB,WAAA,KAAK,GAAG,kBAAkB;AAAA,EAAA;AAE/B,MAAA,QAAQ,sBAAsB,OAAO;AAChC,WAAA,KAAK,GAAG,eAAe;AAAA,EAAA;AAG1B,QAAA,eAAe,QAAQ,IAAI,aAAa;AAE9C,MAAI,CAAC,gBAAgB,CAAC,QAAQ,mBAAmB;AACzC,UAAA,YAAY,UAAU,wBAAwB;AAC7C,WAAA,KAAK,GAAG,SAAS;AAAA,EAAA;AAEnB,SAAA;AACT;"}
1
+ {"version":3,"file":"router-composed-plugin.js","sources":["../../../src/core/router-composed-plugin.ts"],"sourcesContent":["import { getConfig } from '@tanstack/router-generator'\nimport { unpluginRouterGeneratorFactory } from './router-generator-plugin'\nimport { unpluginRouterCodeSplitterFactory } from './router-code-splitter-plugin'\nimport { unpluginRouterHmrFactory } from './router-hmr-plugin'\nimport { unpluginRouteAutoImportFactory } from './route-autoimport-plugin'\nimport type { Config } from './config'\nimport type { UnpluginFactory } from 'unplugin'\n\nexport const unpluginRouterComposedFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}, meta) => {\n const ROOT: string = process.cwd()\n const userConfig = getConfig(options, ROOT)\n\n const getPlugin = (pluginFactory: UnpluginFactory<Partial<Config>>) => {\n const plugin = pluginFactory(options, meta)\n if (!Array.isArray(plugin)) {\n return [plugin]\n }\n return plugin\n }\n\n const routerGenerator = getPlugin(unpluginRouterGeneratorFactory)\n const routerCodeSplitter = getPlugin(unpluginRouterCodeSplitterFactory)\n const routeAutoImport = getPlugin(unpluginRouteAutoImportFactory)\n\n const result = [...routerGenerator]\n if (userConfig.autoCodeSplitting) {\n result.push(...routerCodeSplitter)\n }\n if (userConfig.verboseFileRoutes === false) {\n result.push(...routeAutoImport)\n }\n\n const isProduction = process.env.NODE_ENV === 'production'\n\n if (!isProduction && !userConfig.autoCodeSplitting) {\n const routerHmr = getPlugin(unpluginRouterHmrFactory)\n result.push(...routerHmr)\n }\n return result\n}\n"],"names":[],"mappings":";;;;;AAQO,MAAM,gCAET,CAAC,UAAU,IAAI,SAAS;AACpB,QAAA,OAAe,QAAQ,IAAI;AAC3B,QAAA,aAAa,UAAU,SAAS,IAAI;AAEpC,QAAA,YAAY,CAAC,kBAAoD;AAC/D,UAAA,SAAS,cAAc,SAAS,IAAI;AAC1C,QAAI,CAAC,MAAM,QAAQ,MAAM,GAAG;AAC1B,aAAO,CAAC,MAAM;AAAA,IAAA;AAET,WAAA;AAAA,EACT;AAEM,QAAA,kBAAkB,UAAU,8BAA8B;AAC1D,QAAA,qBAAqB,UAAU,iCAAiC;AAChE,QAAA,kBAAkB,UAAU,8BAA8B;AAE1D,QAAA,SAAS,CAAC,GAAG,eAAe;AAClC,MAAI,WAAW,mBAAmB;AACzB,WAAA,KAAK,GAAG,kBAAkB;AAAA,EAAA;AAE/B,MAAA,WAAW,sBAAsB,OAAO;AACnC,WAAA,KAAK,GAAG,eAAe;AAAA,EAAA;AAG1B,QAAA,eAAe,QAAQ,IAAI,aAAa;AAE9C,MAAI,CAAC,gBAAgB,CAAC,WAAW,mBAAmB;AAC5C,UAAA,YAAY,UAAU,wBAAwB;AAC7C,WAAA,KAAK,GAAG,SAAS;AAAA,EAAA;AAEnB,SAAA;AACT;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-plugin",
3
- "version": "1.127.5",
3
+ "version": "1.127.9",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -97,10 +97,10 @@
97
97
  "chokidar": "^3.6.0",
98
98
  "unplugin": "^2.1.2",
99
99
  "zod": "^3.24.2",
100
- "@tanstack/router-core": "^1.127.3",
101
- "@tanstack/router-generator": "1.127.5",
102
- "@tanstack/virtual-file-routes": "^1.121.21",
103
- "@tanstack/router-utils": "1.121.21"
100
+ "@tanstack/router-core": "^1.127.8",
101
+ "@tanstack/router-utils": "1.121.21",
102
+ "@tanstack/router-generator": "1.127.8",
103
+ "@tanstack/virtual-file-routes": "^1.121.21"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@types/babel__core": "^7.20.5",
@@ -112,7 +112,7 @@
112
112
  "vite": ">=5.0.0 || >=6.0.0",
113
113
  "vite-plugin-solid": "^2.11.2",
114
114
  "webpack": ">=5.92.0",
115
- "@tanstack/react-router": "^1.127.3"
115
+ "@tanstack/react-router": "^1.127.9"
116
116
  },
117
117
  "peerDependenciesMeta": {
118
118
  "@rsbuild/core": {
@@ -1,3 +1,4 @@
1
+ import { getConfig } from '@tanstack/router-generator'
1
2
  import { unpluginRouterGeneratorFactory } from './router-generator-plugin'
2
3
  import { unpluginRouterCodeSplitterFactory } from './router-code-splitter-plugin'
3
4
  import { unpluginRouterHmrFactory } from './router-hmr-plugin'
@@ -8,6 +9,9 @@ import type { UnpluginFactory } from 'unplugin'
8
9
  export const unpluginRouterComposedFactory: UnpluginFactory<
9
10
  Partial<Config> | undefined
10
11
  > = (options = {}, meta) => {
12
+ const ROOT: string = process.cwd()
13
+ const userConfig = getConfig(options, ROOT)
14
+
11
15
  const getPlugin = (pluginFactory: UnpluginFactory<Partial<Config>>) => {
12
16
  const plugin = pluginFactory(options, meta)
13
17
  if (!Array.isArray(plugin)) {
@@ -21,16 +25,16 @@ export const unpluginRouterComposedFactory: UnpluginFactory<
21
25
  const routeAutoImport = getPlugin(unpluginRouteAutoImportFactory)
22
26
 
23
27
  const result = [...routerGenerator]
24
- if (options.autoCodeSplitting) {
28
+ if (userConfig.autoCodeSplitting) {
25
29
  result.push(...routerCodeSplitter)
26
30
  }
27
- if (options.verboseFileRoutes === false) {
31
+ if (userConfig.verboseFileRoutes === false) {
28
32
  result.push(...routeAutoImport)
29
33
  }
30
34
 
31
35
  const isProduction = process.env.NODE_ENV === 'production'
32
36
 
33
- if (!isProduction && !options.autoCodeSplitting) {
37
+ if (!isProduction && !userConfig.autoCodeSplitting) {
34
38
  const routerHmr = getPlugin(unpluginRouterHmrFactory)
35
39
  result.push(...routerHmr)
36
40
  }