@tanstack/router-plugin 1.87.6 → 1.87.7
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/constants.cjs +0 -2
- package/dist/cjs/core/constants.cjs.map +1 -1
- package/dist/cjs/core/constants.d.cts +0 -1
- package/dist/cjs/core/router-generator-plugin.cjs +1 -2
- package/dist/cjs/core/router-generator-plugin.cjs.map +1 -1
- package/dist/esm/core/constants.d.ts +0 -1
- package/dist/esm/core/constants.js +0 -2
- package/dist/esm/core/constants.js.map +1 -1
- package/dist/esm/core/router-generator-plugin.js +2 -3
- package/dist/esm/core/router-generator-plugin.js.map +1 -1
- package/package.json +2 -2
- package/src/core/constants.ts +0 -1
- package/src/core/router-generator-plugin.ts +2 -3
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const CONFIG_FILE_NAME = "tsr.config.json";
|
|
4
3
|
const splitPrefix = "tsr-split";
|
|
5
|
-
exports.CONFIG_FILE_NAME = CONFIG_FILE_NAME;
|
|
6
4
|
exports.splitPrefix = splitPrefix;
|
|
7
5
|
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../../src/core/constants.ts"],"sourcesContent":["export const
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../../src/core/constants.ts"],"sourcesContent":["export const splitPrefix = 'tsr-split'\n"],"names":[],"mappings":";;AAAO,MAAM,cAAc;;"}
|
|
@@ -25,7 +25,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
25
25
|
const node_path = require("node:path");
|
|
26
26
|
const routerGenerator = require("@tanstack/router-generator");
|
|
27
27
|
const config = require("./config.cjs");
|
|
28
|
-
const constants = require("./constants.cjs");
|
|
29
28
|
let lock = false;
|
|
30
29
|
const checkLock = () => lock;
|
|
31
30
|
const setLock = (bool) => {
|
|
@@ -54,7 +53,7 @@ const unpluginRouterGeneratorFactory = (options = {}) => {
|
|
|
54
53
|
};
|
|
55
54
|
const handleFile = async (file, event) => {
|
|
56
55
|
const filePath = node_path.normalize(file);
|
|
57
|
-
if (filePath ===
|
|
56
|
+
if (filePath === routerGenerator.resolveConfigPath({ configDirectory: ROOT })) {
|
|
58
57
|
userConfig = config.getConfig(options, ROOT);
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-generator-plugin.cjs","sources":["../../../src/core/router-generator-plugin.ts"],"sourcesContent":["import { isAbsolute, join, normalize, resolve } from 'node:path'\nimport { generator } from '@tanstack/router-generator'\n\nimport { getConfig } from './config'\nimport
|
|
1
|
+
{"version":3,"file":"router-generator-plugin.cjs","sources":["../../../src/core/router-generator-plugin.ts"],"sourcesContent":["import { isAbsolute, join, normalize, resolve } from 'node:path'\nimport { generator, resolveConfigPath } from '@tanstack/router-generator'\n\nimport { getConfig } from './config'\nimport type { UnpluginFactory } from 'unplugin'\nimport type { Config } from './config'\n\nlet lock = false\nconst checkLock = () => lock\nconst setLock = (bool: boolean) => {\n lock = bool\n}\n\nconst PLUGIN_NAME = 'unplugin:router-generator'\n\nexport const unpluginRouterGeneratorFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}) => {\n let ROOT: string = process.cwd()\n let userConfig = options as Config\n\n const getRoutesDirectoryPath = () => {\n return isAbsolute(userConfig.routesDirectory)\n ? userConfig.routesDirectory\n : join(ROOT, userConfig.routesDirectory)\n }\n\n const generate = async () => {\n if (checkLock()) {\n return\n }\n\n setLock(true)\n\n try {\n await generator(userConfig, process.cwd())\n } catch (err) {\n console.error(err)\n console.info()\n } finally {\n setLock(false)\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 userConfig = getConfig(options, ROOT)\n return\n }\n\n if (\n event === 'update' &&\n filePath === resolve(userConfig.generatedRouteTree)\n ) {\n // skip generating routes if the generated route tree is updated\n return\n }\n\n const routesDirectoryPath = getRoutesDirectoryPath()\n if (filePath.startsWith(routesDirectoryPath)) {\n await generate()\n }\n }\n\n const run: (cb: () => Promise<void> | void) => Promise<void> = async (cb) => {\n if (userConfig.enableRouteGeneration ?? true) {\n await cb()\n }\n }\n\n return {\n name: 'router-generator-plugin',\n async watchChange(id, { event }) {\n await run(async () => {\n await handleFile(id, event)\n })\n },\n vite: {\n async configResolved(config) {\n ROOT = config.root\n userConfig = getConfig(options, ROOT)\n\n await run(generate)\n },\n },\n async rspack(compiler) {\n userConfig = getConfig(options, ROOT)\n\n if (compiler.options.mode === 'production') {\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await run(generate)\n })\n } else {\n // rspack watcher doesn't register newly created files\n const routesDirectoryPath = getRoutesDirectoryPath()\n const chokidar = await import('chokidar')\n chokidar\n .watch(routesDirectoryPath, { ignoreInitial: true })\n .on('add', async () => {\n await run(generate)\n })\n\n let generated = false\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {\n if (!generated) {\n generated = true\n return run(generate)\n }\n })\n }\n },\n async webpack(compiler) {\n userConfig = getConfig(options, ROOT)\n\n if (compiler.options.mode === 'production') {\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await run(generate)\n })\n } else {\n // webpack watcher doesn't register newly created files\n const routesDirectoryPath = getRoutesDirectoryPath()\n const chokidar = await import('chokidar')\n chokidar\n .watch(routesDirectoryPath, { ignoreInitial: true })\n .on('add', async () => {\n await run(generate)\n })\n\n let generated = false\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {\n if (!generated) {\n generated = true\n return run(generate)\n }\n })\n }\n\n if (compiler.options.mode === 'production') {\n compiler.hooks.done.tap(PLUGIN_NAME, (stats) => {\n console.info('✅ ' + PLUGIN_NAME + ': route-tree generation done')\n setTimeout(() => {\n process.exit(0)\n })\n })\n }\n },\n }\n}\n"],"names":["isAbsolute","join","generator","normalize","resolveConfigPath","getConfig","resolve","config"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAI,OAAO;AACX,MAAM,YAAY,MAAM;AACxB,MAAM,UAAU,CAAC,SAAkB;AAC1B,SAAA;AACT;AAEA,MAAM,cAAc;AAEb,MAAM,iCAET,CAAC,UAAU,OAAO;AAChB,MAAA,OAAe,QAAQ,IAAI;AAC/B,MAAI,aAAa;AAEjB,QAAM,yBAAyB,MAAM;AAC5B,WAAAA,UAAA,WAAW,WAAW,eAAe,IACxC,WAAW,kBACXC,eAAK,MAAM,WAAW,eAAe;AAAA,EAC3C;AAEA,QAAM,WAAW,YAAY;AAC3B,QAAI,aAAa;AACf;AAAA,IAAA;AAGF,YAAQ,IAAI;AAER,QAAA;AACF,YAAMC,0BAAU,YAAY,QAAQ,IAAA,CAAK;AAAA,aAClC,KAAK;AACZ,cAAQ,MAAM,GAAG;AACjB,cAAQ,KAAK;AAAA,IAAA,UACb;AACA,cAAQ,KAAK;AAAA,IAAA;AAAA,EAEjB;AAEM,QAAA,aAAa,OACjB,MACA,UACG;AACG,UAAA,WAAWC,oBAAU,IAAI;AAE/B,QAAI,aAAaC,gBAAkB,kBAAA,EAAE,iBAAiB,KAAM,CAAA,GAAG;AAChD,mBAAAC,OAAAA,UAAU,SAAS,IAAI;AACpC;AAAA,IAAA;AAGF,QACE,UAAU,YACV,aAAaC,UAAAA,QAAQ,WAAW,kBAAkB,GAClD;AAEA;AAAA,IAAA;AAGF,UAAM,sBAAsB,uBAAuB;AAC/C,QAAA,SAAS,WAAW,mBAAmB,GAAG;AAC5C,YAAM,SAAS;AAAA,IAAA;AAAA,EAEnB;AAEM,QAAA,MAAyD,OAAO,OAAO;AACvE,QAAA,WAAW,yBAAyB,MAAM;AAC5C,YAAM,GAAG;AAAA,IAAA;AAAA,EAEb;AAEO,SAAA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BAAM,IAAI,QAAQ;AAAA,QAAA,CACnB;AAEH,YAAI,YAAY;AAChB,iBAAS,MAAM,SAAS,WAAW,aAAa,YAAY;AAC1D,cAAI,CAAC,WAAW;AACF,wBAAA;AACZ,mBAAO,IAAI,QAAQ;AAAA,UAAA;AAAA,QACrB,CACD;AAAA,MAAA;AAGC,UAAA,SAAS,QAAQ,SAAS,cAAc;AAC1C,iBAAS,MAAM,KAAK,IAAI,aAAa,CAAC,UAAU;AACtC,kBAAA,KAAK,OAAO,cAAc,8BAA8B;AAChE,qBAAW,MAAM;AACf,oBAAQ,KAAK,CAAC;AAAA,UAAA,CACf;AAAA,QAAA,CACF;AAAA,MAAA;AAAA,IACH;AAAA,EAEJ;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/core/constants.ts"],"sourcesContent":["export const
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/core/constants.ts"],"sourcesContent":["export const splitPrefix = 'tsr-split'\n"],"names":[],"mappings":"AAAO,MAAM,cAAc;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isAbsolute, join, normalize, resolve } from "node:path";
|
|
2
|
-
import { generator } from "@tanstack/router-generator";
|
|
2
|
+
import { generator, resolveConfigPath } from "@tanstack/router-generator";
|
|
3
3
|
import { getConfig } from "./config.js";
|
|
4
|
-
import { CONFIG_FILE_NAME } from "./constants.js";
|
|
5
4
|
let lock = false;
|
|
6
5
|
const checkLock = () => lock;
|
|
7
6
|
const setLock = (bool) => {
|
|
@@ -30,7 +29,7 @@ const unpluginRouterGeneratorFactory = (options = {}) => {
|
|
|
30
29
|
};
|
|
31
30
|
const handleFile = async (file, event) => {
|
|
32
31
|
const filePath = normalize(file);
|
|
33
|
-
if (filePath ===
|
|
32
|
+
if (filePath === resolveConfigPath({ configDirectory: ROOT })) {
|
|
34
33
|
userConfig = getConfig(options, ROOT);
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-generator-plugin.js","sources":["../../../src/core/router-generator-plugin.ts"],"sourcesContent":["import { isAbsolute, join, normalize, resolve } from 'node:path'\nimport { generator } from '@tanstack/router-generator'\n\nimport { getConfig } from './config'\nimport
|
|
1
|
+
{"version":3,"file":"router-generator-plugin.js","sources":["../../../src/core/router-generator-plugin.ts"],"sourcesContent":["import { isAbsolute, join, normalize, resolve } from 'node:path'\nimport { generator, resolveConfigPath } from '@tanstack/router-generator'\n\nimport { getConfig } from './config'\nimport type { UnpluginFactory } from 'unplugin'\nimport type { Config } from './config'\n\nlet lock = false\nconst checkLock = () => lock\nconst setLock = (bool: boolean) => {\n lock = bool\n}\n\nconst PLUGIN_NAME = 'unplugin:router-generator'\n\nexport const unpluginRouterGeneratorFactory: UnpluginFactory<\n Partial<Config> | undefined\n> = (options = {}) => {\n let ROOT: string = process.cwd()\n let userConfig = options as Config\n\n const getRoutesDirectoryPath = () => {\n return isAbsolute(userConfig.routesDirectory)\n ? userConfig.routesDirectory\n : join(ROOT, userConfig.routesDirectory)\n }\n\n const generate = async () => {\n if (checkLock()) {\n return\n }\n\n setLock(true)\n\n try {\n await generator(userConfig, process.cwd())\n } catch (err) {\n console.error(err)\n console.info()\n } finally {\n setLock(false)\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 userConfig = getConfig(options, ROOT)\n return\n }\n\n if (\n event === 'update' &&\n filePath === resolve(userConfig.generatedRouteTree)\n ) {\n // skip generating routes if the generated route tree is updated\n return\n }\n\n const routesDirectoryPath = getRoutesDirectoryPath()\n if (filePath.startsWith(routesDirectoryPath)) {\n await generate()\n }\n }\n\n const run: (cb: () => Promise<void> | void) => Promise<void> = async (cb) => {\n if (userConfig.enableRouteGeneration ?? true) {\n await cb()\n }\n }\n\n return {\n name: 'router-generator-plugin',\n async watchChange(id, { event }) {\n await run(async () => {\n await handleFile(id, event)\n })\n },\n vite: {\n async configResolved(config) {\n ROOT = config.root\n userConfig = getConfig(options, ROOT)\n\n await run(generate)\n },\n },\n async rspack(compiler) {\n userConfig = getConfig(options, ROOT)\n\n if (compiler.options.mode === 'production') {\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await run(generate)\n })\n } else {\n // rspack watcher doesn't register newly created files\n const routesDirectoryPath = getRoutesDirectoryPath()\n const chokidar = await import('chokidar')\n chokidar\n .watch(routesDirectoryPath, { ignoreInitial: true })\n .on('add', async () => {\n await run(generate)\n })\n\n let generated = false\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {\n if (!generated) {\n generated = true\n return run(generate)\n }\n })\n }\n },\n async webpack(compiler) {\n userConfig = getConfig(options, ROOT)\n\n if (compiler.options.mode === 'production') {\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await run(generate)\n })\n } else {\n // webpack watcher doesn't register newly created files\n const routesDirectoryPath = getRoutesDirectoryPath()\n const chokidar = await import('chokidar')\n chokidar\n .watch(routesDirectoryPath, { ignoreInitial: true })\n .on('add', async () => {\n await run(generate)\n })\n\n let generated = false\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => {\n if (!generated) {\n generated = true\n return run(generate)\n }\n })\n }\n\n if (compiler.options.mode === 'production') {\n compiler.hooks.done.tap(PLUGIN_NAME, (stats) => {\n console.info('✅ ' + PLUGIN_NAME + ': route-tree generation done')\n setTimeout(() => {\n process.exit(0)\n })\n })\n }\n },\n }\n}\n"],"names":[],"mappings":";;;AAOA,IAAI,OAAO;AACX,MAAM,YAAY,MAAM;AACxB,MAAM,UAAU,CAAC,SAAkB;AAC1B,SAAA;AACT;AAEA,MAAM,cAAc;AAEb,MAAM,iCAET,CAAC,UAAU,OAAO;AAChB,MAAA,OAAe,QAAQ,IAAI;AAC/B,MAAI,aAAa;AAEjB,QAAM,yBAAyB,MAAM;AAC5B,WAAA,WA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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-plugin",
|
|
3
|
-
"version": "1.87.
|
|
3
|
+
"version": "1.87.7",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"chokidar": "^3.6.0",
|
|
103
103
|
"unplugin": "^1.16.0",
|
|
104
104
|
"zod": "^3.23.8",
|
|
105
|
-
"@tanstack/router-generator": "^1.87.
|
|
105
|
+
"@tanstack/router-generator": "^1.87.7",
|
|
106
106
|
"@tanstack/virtual-file-routes": "^1.87.6"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
package/src/core/constants.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { isAbsolute, join, normalize, resolve } from 'node:path'
|
|
2
|
-
import { generator } from '@tanstack/router-generator'
|
|
2
|
+
import { generator, resolveConfigPath } from '@tanstack/router-generator'
|
|
3
3
|
|
|
4
4
|
import { getConfig } from './config'
|
|
5
|
-
import { CONFIG_FILE_NAME } from './constants'
|
|
6
5
|
import type { UnpluginFactory } from 'unplugin'
|
|
7
6
|
import type { Config } from './config'
|
|
8
7
|
|
|
@@ -49,7 +48,7 @@ export const unpluginRouterGeneratorFactory: UnpluginFactory<
|
|
|
49
48
|
) => {
|
|
50
49
|
const filePath = normalize(file)
|
|
51
50
|
|
|
52
|
-
if (filePath ===
|
|
51
|
+
if (filePath === resolveConfigPath({ configDirectory: ROOT })) {
|
|
53
52
|
userConfig = getConfig(options, ROOT)
|
|
54
53
|
return
|
|
55
54
|
}
|