@tanstack/router-cli 1.87.3 → 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/watch.cjs +4 -2
- package/dist/cjs/watch.cjs.map +1 -1
- package/dist/esm/watch.js +5 -3
- package/dist/esm/watch.js.map +1 -1
- package/package.json +2 -2
- package/src/watch.ts +9 -3
package/dist/cjs/watch.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const path = require("node:path");
|
|
4
3
|
const chokidar = require("chokidar");
|
|
5
4
|
const routerGenerator = require("@tanstack/router-generator");
|
|
6
5
|
function watch(root) {
|
|
7
|
-
const
|
|
6
|
+
const configPath = routerGenerator.resolveConfigPath({
|
|
7
|
+
configDirectory: root
|
|
8
|
+
});
|
|
9
|
+
const configWatcher = chokidar.watch(configPath);
|
|
8
10
|
let watcher = new chokidar.FSWatcher({});
|
|
9
11
|
const generatorWatcher = () => {
|
|
10
12
|
const config = routerGenerator.getConfig();
|
package/dist/cjs/watch.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.cjs","sources":["../../src/watch.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"watch.cjs","sources":["../../src/watch.ts"],"sourcesContent":["import chokidar from 'chokidar'\nimport {\n generator,\n getConfig,\n resolveConfigPath,\n} from '@tanstack/router-generator'\n\nexport function watch(root: string) {\n const configPath = resolveConfigPath({\n configDirectory: root,\n })\n const configWatcher = chokidar.watch(configPath)\n\n let watcher = new chokidar.FSWatcher({})\n\n const generatorWatcher = () => {\n const config = getConfig()\n\n watcher.close()\n\n console.info(`TSR: Watching routes (${config.routesDirectory})...`)\n watcher = chokidar.watch(config.routesDirectory)\n\n watcher.on('ready', async () => {\n const handle = async () => {\n try {\n await generator(config, root)\n } catch (err) {\n console.error(err)\n console.info()\n }\n }\n\n await handle()\n\n let timeout: ReturnType<typeof setTimeout> | undefined\n\n const deduped = (_file: string) => {\n if (timeout) {\n clearTimeout(timeout)\n }\n\n timeout = setTimeout(handle, 10)\n }\n\n watcher.on('change', deduped)\n watcher.on('add', deduped)\n watcher.on('unlink', deduped)\n })\n }\n\n configWatcher.on('ready', generatorWatcher)\n configWatcher.on('change', generatorWatcher)\n}\n"],"names":["resolveConfigPath","getConfig","generator"],"mappings":";;;;AAOO,SAAS,MAAM,MAAc;AAClC,QAAM,aAAaA,gBAAAA,kBAAkB;AAAA,IACnC,iBAAiB;AAAA,EAAA,CAClB;AACK,QAAA,gBAAgB,SAAS,MAAM,UAAU;AAE/C,MAAI,UAAU,IAAI,SAAS,UAAU,CAAA,CAAE;AAEvC,QAAM,mBAAmB,MAAM;AAC7B,UAAM,SAASC,gBAAAA,UAAU;AAEzB,YAAQ,MAAM;AAEd,YAAQ,KAAK,yBAAyB,OAAO,eAAe,MAAM;AACxD,cAAA,SAAS,MAAM,OAAO,eAAe;AAEvC,YAAA,GAAG,SAAS,YAAY;AAC9B,YAAM,SAAS,YAAY;AACrB,YAAA;AACI,gBAAAC,gBAAA,UAAU,QAAQ,IAAI;AAAA,iBACrB,KAAK;AACZ,kBAAQ,MAAM,GAAG;AACjB,kBAAQ,KAAK;AAAA,QAAA;AAAA,MAEjB;AAEA,YAAM,OAAO;AAET,UAAA;AAEE,YAAA,UAAU,CAAC,UAAkB;AACjC,YAAI,SAAS;AACX,uBAAa,OAAO;AAAA,QAAA;AAGZ,kBAAA,WAAW,QAAQ,EAAE;AAAA,MACjC;AAEQ,cAAA,GAAG,UAAU,OAAO;AACpB,cAAA,GAAG,OAAO,OAAO;AACjB,cAAA,GAAG,UAAU,OAAO;AAAA,IAAA,CAC7B;AAAA,EACH;AAEc,gBAAA,GAAG,SAAS,gBAAgB;AAC5B,gBAAA,GAAG,UAAU,gBAAgB;AAC7C;;"}
|
package/dist/esm/watch.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import chokidar from "chokidar";
|
|
3
|
-
import { getConfig, generator } from "@tanstack/router-generator";
|
|
2
|
+
import { resolveConfigPath, getConfig, generator } from "@tanstack/router-generator";
|
|
4
3
|
function watch(root) {
|
|
5
|
-
const
|
|
4
|
+
const configPath = resolveConfigPath({
|
|
5
|
+
configDirectory: root
|
|
6
|
+
});
|
|
7
|
+
const configWatcher = chokidar.watch(configPath);
|
|
6
8
|
let watcher = new chokidar.FSWatcher({});
|
|
7
9
|
const generatorWatcher = () => {
|
|
8
10
|
const config = getConfig();
|
package/dist/esm/watch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sources":["../../src/watch.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"watch.js","sources":["../../src/watch.ts"],"sourcesContent":["import chokidar from 'chokidar'\nimport {\n generator,\n getConfig,\n resolveConfigPath,\n} from '@tanstack/router-generator'\n\nexport function watch(root: string) {\n const configPath = resolveConfigPath({\n configDirectory: root,\n })\n const configWatcher = chokidar.watch(configPath)\n\n let watcher = new chokidar.FSWatcher({})\n\n const generatorWatcher = () => {\n const config = getConfig()\n\n watcher.close()\n\n console.info(`TSR: Watching routes (${config.routesDirectory})...`)\n watcher = chokidar.watch(config.routesDirectory)\n\n watcher.on('ready', async () => {\n const handle = async () => {\n try {\n await generator(config, root)\n } catch (err) {\n console.error(err)\n console.info()\n }\n }\n\n await handle()\n\n let timeout: ReturnType<typeof setTimeout> | undefined\n\n const deduped = (_file: string) => {\n if (timeout) {\n clearTimeout(timeout)\n }\n\n timeout = setTimeout(handle, 10)\n }\n\n watcher.on('change', deduped)\n watcher.on('add', deduped)\n watcher.on('unlink', deduped)\n })\n }\n\n configWatcher.on('ready', generatorWatcher)\n configWatcher.on('change', generatorWatcher)\n}\n"],"names":[],"mappings":";;AAOO,SAAS,MAAM,MAAc;AAClC,QAAM,aAAa,kBAAkB;AAAA,IACnC,iBAAiB;AAAA,EAAA,CAClB;AACK,QAAA,gBAAgB,SAAS,MAAM,UAAU;AAE/C,MAAI,UAAU,IAAI,SAAS,UAAU,CAAA,CAAE;AAEvC,QAAM,mBAAmB,MAAM;AAC7B,UAAM,SAAS,UAAU;AAEzB,YAAQ,MAAM;AAEd,YAAQ,KAAK,yBAAyB,OAAO,eAAe,MAAM;AACxD,cAAA,SAAS,MAAM,OAAO,eAAe;AAEvC,YAAA,GAAG,SAAS,YAAY;AAC9B,YAAM,SAAS,YAAY;AACrB,YAAA;AACI,gBAAA,UAAU,QAAQ,IAAI;AAAA,iBACrB,KAAK;AACZ,kBAAQ,MAAM,GAAG;AACjB,kBAAQ,KAAK;AAAA,QAAA;AAAA,MAEjB;AAEA,YAAM,OAAO;AAET,UAAA;AAEE,YAAA,UAAU,CAAC,UAAkB;AACjC,YAAI,SAAS;AACX,uBAAa,OAAO;AAAA,QAAA;AAGZ,kBAAA,WAAW,QAAQ,EAAE;AAAA,MACjC;AAEQ,cAAA,GAAG,UAAU,OAAO;AACpB,cAAA,GAAG,OAAO,OAAO;AACjB,cAAA,GAAG,UAAU,OAAO;AAAA,IAAA,CAC7B;AAAA,EACH;AAEc,gBAAA,GAAG,SAAS,gBAAgB;AAC5B,gBAAA,GAAG,UAAU,gBAAgB;AAC7C;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-cli",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"chokidar": "^3.6.0",
|
|
56
56
|
"yargs": "^17.7.2",
|
|
57
|
-
"@tanstack/router-generator": "^1.87.
|
|
57
|
+
"@tanstack/router-generator": "^1.87.7"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/yargs": "^17.0.33"
|
package/src/watch.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
1
|
import chokidar from 'chokidar'
|
|
3
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
generator,
|
|
4
|
+
getConfig,
|
|
5
|
+
resolveConfigPath,
|
|
6
|
+
} from '@tanstack/router-generator'
|
|
4
7
|
|
|
5
8
|
export function watch(root: string) {
|
|
6
|
-
const
|
|
9
|
+
const configPath = resolveConfigPath({
|
|
10
|
+
configDirectory: root,
|
|
11
|
+
})
|
|
12
|
+
const configWatcher = chokidar.watch(configPath)
|
|
7
13
|
|
|
8
14
|
let watcher = new chokidar.FSWatcher({})
|
|
9
15
|
|