@tanstack/router-vite-plugin 1.20.0 → 1.20.3-alpha.1
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/README.md +5 -0
- package/dist/cjs/index.cjs +7 -35
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -3
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +1 -37
- package/dist/esm/index.js.map +1 -1
- package/package.json +16 -21
- package/src/index.ts +2 -41
package/README.md
ADDED
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,38 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
await routerGenerator.generator(userConfig);
|
|
12
|
-
} catch (err) {
|
|
13
|
-
console.error(err);
|
|
14
|
-
console.info();
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
name: "vite-plugin-tanstack-router",
|
|
19
|
-
configResolved: async (vite) => {
|
|
20
|
-
ROOT = vite.root;
|
|
21
|
-
userConfig = await routerGenerator.getConfig(inlineConfig, ROOT);
|
|
22
|
-
await generate();
|
|
23
|
-
},
|
|
24
|
-
handleHotUpdate: async ({ file }) => {
|
|
25
|
-
const filePath = path.normalize(file);
|
|
26
|
-
if (filePath === path.join(ROOT, CONFIG_FILE_NAME)) {
|
|
27
|
-
userConfig = await routerGenerator.getConfig(inlineConfig, ROOT);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const routesDirectoryPath = path.isAbsolute(userConfig.routesDirectory) ? userConfig.routesDirectory : path.join(ROOT, userConfig.routesDirectory);
|
|
31
|
-
if (filePath.startsWith(routesDirectoryPath)) {
|
|
32
|
-
await generate();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
exports.TanStackRouterVite = TanStackRouterVite;
|
|
3
|
+
const vite = require("@tanstack/router-plugin/vite");
|
|
4
|
+
Object.keys(vite).forEach((k) => {
|
|
5
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => vite[k]
|
|
8
|
+
});
|
|
9
|
+
});
|
|
38
10
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function TanStackRouterVite(inlineConfig?: Partial<Config>): Plugin;
|
|
1
|
+
export * from '@tanstack/router-plugin/vite';
|
|
2
|
+
export type * from '@tanstack/router-plugin/vite';
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function TanStackRouterVite(inlineConfig?: Partial<Config>): Plugin;
|
|
1
|
+
export * from '@tanstack/router-plugin/vite';
|
|
2
|
+
export type * from '@tanstack/router-plugin/vite';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { getConfig, generator } from "@tanstack/router-generator";
|
|
3
|
-
const CONFIG_FILE_NAME = "tsr.config.json";
|
|
4
|
-
function TanStackRouterVite(inlineConfig = {}) {
|
|
5
|
-
let ROOT;
|
|
6
|
-
let userConfig;
|
|
7
|
-
const generate = async () => {
|
|
8
|
-
try {
|
|
9
|
-
await generator(userConfig);
|
|
10
|
-
} catch (err) {
|
|
11
|
-
console.error(err);
|
|
12
|
-
console.info();
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
return {
|
|
16
|
-
name: "vite-plugin-tanstack-router",
|
|
17
|
-
configResolved: async (vite) => {
|
|
18
|
-
ROOT = vite.root;
|
|
19
|
-
userConfig = await getConfig(inlineConfig, ROOT);
|
|
20
|
-
await generate();
|
|
21
|
-
},
|
|
22
|
-
handleHotUpdate: async ({ file }) => {
|
|
23
|
-
const filePath = normalize(file);
|
|
24
|
-
if (filePath === join(ROOT, CONFIG_FILE_NAME)) {
|
|
25
|
-
userConfig = await getConfig(inlineConfig, ROOT);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const routesDirectoryPath = isAbsolute(userConfig.routesDirectory) ? userConfig.routesDirectory : join(ROOT, userConfig.routesDirectory);
|
|
29
|
-
if (filePath.startsWith(routesDirectoryPath)) {
|
|
30
|
-
await generate();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
TanStackRouterVite
|
|
37
|
-
};
|
|
1
|
+
export * from "@tanstack/router-plugin/vite";
|
|
38
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/router-vite-plugin",
|
|
3
|
-
"version": "1.20.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.20.3-alpha.1",
|
|
4
|
+
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -14,6 +14,15 @@
|
|
|
14
14
|
"type": "github",
|
|
15
15
|
"url": "https://github.com/sponsors/tannerlinsley"
|
|
16
16
|
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"react",
|
|
19
|
+
"location",
|
|
20
|
+
"router",
|
|
21
|
+
"routing",
|
|
22
|
+
"async",
|
|
23
|
+
"async router",
|
|
24
|
+
"typescript"
|
|
25
|
+
],
|
|
17
26
|
"type": "module",
|
|
18
27
|
"types": "dist/esm/index.d.ts",
|
|
19
28
|
"main": "dist/cjs/index.cjs",
|
|
@@ -32,29 +41,15 @@
|
|
|
32
41
|
"./package.json": "./package.json"
|
|
33
42
|
},
|
|
34
43
|
"sideEffects": false,
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"router",
|
|
39
|
-
"routing",
|
|
40
|
-
"async",
|
|
41
|
-
"async router",
|
|
42
|
-
"typescript"
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"src"
|
|
43
47
|
],
|
|
44
48
|
"engines": {
|
|
45
49
|
"node": ">=12"
|
|
46
50
|
},
|
|
47
|
-
"files": [
|
|
48
|
-
"dist",
|
|
49
|
-
"src/**"
|
|
50
|
-
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@tanstack/router-
|
|
52
|
+
"@tanstack/router-plugin": "^1.20.3-alpha.1"
|
|
53
53
|
},
|
|
54
|
-
"scripts": {
|
|
55
|
-
"clean": "rimraf ./dist && rimraf ./coverage",
|
|
56
|
-
"test:types": "tsc",
|
|
57
|
-
"test:build": "publint --strict",
|
|
58
|
-
"build": "vite build"
|
|
59
|
-
}
|
|
54
|
+
"scripts": {}
|
|
60
55
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { type Config, getConfig, generator } from '@tanstack/router-generator'
|
|
4
|
-
|
|
5
|
-
const CONFIG_FILE_NAME = 'tsr.config.json'
|
|
6
|
-
|
|
7
|
-
export function TanStackRouterVite(inlineConfig: Partial<Config> = {}): Plugin {
|
|
8
|
-
let ROOT: string
|
|
9
|
-
let userConfig: Config
|
|
10
|
-
|
|
11
|
-
const generate = async () => {
|
|
12
|
-
try {
|
|
13
|
-
await generator(userConfig)
|
|
14
|
-
} catch (err) {
|
|
15
|
-
console.error(err)
|
|
16
|
-
console.info()
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
name: 'vite-plugin-tanstack-router',
|
|
22
|
-
configResolved: async (vite) => {
|
|
23
|
-
ROOT = vite.root
|
|
24
|
-
userConfig = await getConfig(inlineConfig, ROOT)
|
|
25
|
-
await generate()
|
|
26
|
-
},
|
|
27
|
-
handleHotUpdate: async ({ file }) => {
|
|
28
|
-
const filePath = normalize(file)
|
|
29
|
-
if (filePath === join(ROOT, CONFIG_FILE_NAME)) {
|
|
30
|
-
userConfig = await getConfig(inlineConfig, ROOT)
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
const routesDirectoryPath = isAbsolute(userConfig.routesDirectory)
|
|
34
|
-
? userConfig.routesDirectory
|
|
35
|
-
: join(ROOT, userConfig.routesDirectory)
|
|
36
|
-
if (filePath.startsWith(routesDirectoryPath)) {
|
|
37
|
-
await generate()
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
export * from '@tanstack/router-plugin/vite'
|
|
2
|
+
export type * from '@tanstack/router-plugin/vite'
|