clear-safe-router 0.1.0 → 0.1.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
CHANGED
|
@@ -50,12 +50,12 @@ npm install clear-safe-router
|
|
|
50
50
|
// vite.config.ts
|
|
51
51
|
import { defineConfig } from 'vite';
|
|
52
52
|
import react from '@vitejs/plugin-react';
|
|
53
|
-
import {
|
|
53
|
+
import { clearSafeRouter } from 'clear-safe-router/vite';
|
|
54
54
|
|
|
55
55
|
export default defineConfig({
|
|
56
56
|
plugins: [
|
|
57
57
|
react(),
|
|
58
|
-
|
|
58
|
+
clearSafeRouter(), // scans src/routes, generates src/routeTree.gen.ts
|
|
59
59
|
],
|
|
60
60
|
});
|
|
61
61
|
```
|
|
@@ -3,5 +3,5 @@ export type TypedRouterPluginOptions = {
|
|
|
3
3
|
routesDirectory?: string;
|
|
4
4
|
generatedFile?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const clearSafeRouter: (options?: TypedRouterPluginOptions) => Plugin;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAS,wBAA6B,KAAG,MA2ExE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "clear-safe-router",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "File-based React SPA router with compile-time type-safe navigation",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=18"
|
|
9
|
-
},
|
|
10
|
-
"author": "Andrew Bubnov",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/AndrewBubnov/clear-safe-router.git"
|
|
14
|
-
},
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/AndrewBubnov/clear-safe-router/issues"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://github.com/AndrewBubnov/clear-safe-router#readme",
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public",
|
|
21
|
-
"registry": "https://registry.npmjs.org/"
|
|
22
|
-
},
|
|
23
|
-
"main": "dist/index.js",
|
|
24
|
-
"module": "dist/index.js",
|
|
25
|
-
"types": "dist/types/index.d.ts",
|
|
26
|
-
"exports": {
|
|
27
|
-
".": {
|
|
28
|
-
"import": "./dist/index.js",
|
|
29
|
-
"types": "./dist/types/index.d.ts"
|
|
30
|
-
},
|
|
31
|
-
"./vite": {
|
|
32
|
-
"import": "./dist/vite-plugin/index.js",
|
|
33
|
-
"types": "./dist/types/vite-plugin/index.d.ts"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"files": [
|
|
37
|
-
"dist"
|
|
38
|
-
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"dev": "npm run router:generate && vite",
|
|
41
|
-
"build": "npm run router:generate && vite build && npm run build:lib",
|
|
42
|
-
"build:lib": "npm run clean:dist && vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json",
|
|
43
|
-
"clean:dist": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
44
|
-
"build:playground": "npm run router:generate && vite build",
|
|
45
|
-
"lint": "eslint .",
|
|
46
|
-
"preview": "vite preview",
|
|
47
|
-
"test": "npm run router:generate && vitest run",
|
|
48
|
-
"test:run": "npm test",
|
|
49
|
-
"test:coverage": "npm run router:generate && vitest run --coverage",
|
|
50
|
-
"test:e2e": "playwright test",
|
|
51
|
-
"router:generate": "node scripts/generate-routes.mjs --routes playground/routes --out playground/routeTree.gen.ts",
|
|
52
|
-
"generate": "npm run router:generate",
|
|
53
|
-
"typecheck": "npm run router:generate && tsc -b --force && tsc --noEmit -p tests/types/tsconfig.json",
|
|
54
|
-
"prepublishOnly": "npm run typecheck && npm test && npm run build:lib"
|
|
55
|
-
},
|
|
56
|
-
"keywords": [
|
|
57
|
-
"react",
|
|
58
|
-
"router",
|
|
59
|
-
"routing",
|
|
60
|
-
"file-based",
|
|
61
|
-
"typescript",
|
|
62
|
-
"type-safe",
|
|
63
|
-
"data-loading",
|
|
64
|
-
"navigation-blocker",
|
|
65
|
-
"scroll-restoration",
|
|
66
|
-
"search-params",
|
|
67
|
-
"lazy-loading",
|
|
68
|
-
"prefetching",
|
|
69
|
-
"view-transitions",
|
|
70
|
-
"animations",
|
|
71
|
-
"retry",
|
|
72
|
-
"polling",
|
|
73
|
-
"cache-invalidation"
|
|
74
|
-
],
|
|
75
|
-
"license": "MIT",
|
|
76
|
-
"dependencies": {},
|
|
77
|
-
"devDependencies": {
|
|
78
|
-
"@emotion/react": "^11.14.0",
|
|
79
|
-
"@emotion/styled": "^11.14.1",
|
|
80
|
-
"@mantine/core": "^9.8.0",
|
|
81
|
-
"@mantine/hooks": "^9.8.0",
|
|
82
|
-
"@mui/material": "^9.5.0",
|
|
83
|
-
"@tabler/icons-react": "^3.51.0",
|
|
84
|
-
"motion": "^14.13.0",
|
|
85
|
-
"@fontsource-variable/geist": "^5.3.0",
|
|
86
|
-
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
87
|
-
"@playwright/test": "^1.40.0",
|
|
88
|
-
"@testing-library/react": "^16.0.0",
|
|
89
|
-
"@types/node": "^22.0.0",
|
|
90
|
-
"@types/react": "^19.0.0",
|
|
91
|
-
"@types/react-dom": "^19.0.0",
|
|
92
|
-
"@vitejs/plugin-react": "^4.3.0",
|
|
93
|
-
"eslint": "^9.0.0",
|
|
94
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
95
|
-
"eslint-plugin-react-refresh": "^0.4.0",
|
|
96
|
-
"globals": "^15.0.0",
|
|
97
|
-
"jsdom": "^25.0.0",
|
|
98
|
-
"postcss-preset-mantine": "^1.18.0",
|
|
99
|
-
"postcss-simple-vars": "^7.0.1",
|
|
100
|
-
"typescript": "^5.5.0",
|
|
101
|
-
"vite": "^5.4.0",
|
|
102
|
-
"vitest": "^2.0.0"
|
|
103
|
-
},
|
|
104
|
-
"peerDependencies": {
|
|
105
|
-
"react": ">=18.0.0",
|
|
106
|
-
"react-dom": ">=18.0.0"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "clear-safe-router",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "File-based React SPA router with compile-time type-safe navigation",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18"
|
|
9
|
+
},
|
|
10
|
+
"author": "Andrew Bubnov",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/AndrewBubnov/clear-safe-router.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/AndrewBubnov/clear-safe-router/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/AndrewBubnov/clear-safe-router#readme",
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org/"
|
|
22
|
+
},
|
|
23
|
+
"main": "dist/index.js",
|
|
24
|
+
"module": "dist/index.js",
|
|
25
|
+
"types": "dist/types/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./dist/index.js",
|
|
29
|
+
"types": "./dist/types/index.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./vite": {
|
|
32
|
+
"import": "./dist/vite-plugin/index.js",
|
|
33
|
+
"types": "./dist/types/vite-plugin/index.d.ts"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"dev": "npm run router:generate && vite",
|
|
41
|
+
"build": "npm run router:generate && vite build && npm run build:lib",
|
|
42
|
+
"build:lib": "npm run clean:dist && vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json",
|
|
43
|
+
"clean:dist": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
44
|
+
"build:playground": "npm run router:generate && vite build",
|
|
45
|
+
"lint": "eslint .",
|
|
46
|
+
"preview": "vite preview",
|
|
47
|
+
"test": "npm run router:generate && vitest run",
|
|
48
|
+
"test:run": "npm test",
|
|
49
|
+
"test:coverage": "npm run router:generate && vitest run --coverage",
|
|
50
|
+
"test:e2e": "playwright test",
|
|
51
|
+
"router:generate": "node scripts/generate-routes.mjs --routes playground/routes --out playground/routeTree.gen.ts",
|
|
52
|
+
"generate": "npm run router:generate",
|
|
53
|
+
"typecheck": "npm run router:generate && tsc -b --force && tsc --noEmit -p tests/types/tsconfig.json",
|
|
54
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build:lib"
|
|
55
|
+
},
|
|
56
|
+
"keywords": [
|
|
57
|
+
"react",
|
|
58
|
+
"router",
|
|
59
|
+
"routing",
|
|
60
|
+
"file-based",
|
|
61
|
+
"typescript",
|
|
62
|
+
"type-safe",
|
|
63
|
+
"data-loading",
|
|
64
|
+
"navigation-blocker",
|
|
65
|
+
"scroll-restoration",
|
|
66
|
+
"search-params",
|
|
67
|
+
"lazy-loading",
|
|
68
|
+
"prefetching",
|
|
69
|
+
"view-transitions",
|
|
70
|
+
"animations",
|
|
71
|
+
"retry",
|
|
72
|
+
"polling",
|
|
73
|
+
"cache-invalidation"
|
|
74
|
+
],
|
|
75
|
+
"license": "MIT",
|
|
76
|
+
"dependencies": {},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@emotion/react": "^11.14.0",
|
|
79
|
+
"@emotion/styled": "^11.14.1",
|
|
80
|
+
"@mantine/core": "^9.8.0",
|
|
81
|
+
"@mantine/hooks": "^9.8.0",
|
|
82
|
+
"@mui/material": "^9.5.0",
|
|
83
|
+
"@tabler/icons-react": "^3.51.0",
|
|
84
|
+
"motion": "^14.13.0",
|
|
85
|
+
"@fontsource-variable/geist": "^5.3.0",
|
|
86
|
+
"@fontsource-variable/geist-mono": "^5.3.0",
|
|
87
|
+
"@playwright/test": "^1.40.0",
|
|
88
|
+
"@testing-library/react": "^16.0.0",
|
|
89
|
+
"@types/node": "^22.0.0",
|
|
90
|
+
"@types/react": "^19.0.0",
|
|
91
|
+
"@types/react-dom": "^19.0.0",
|
|
92
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
93
|
+
"eslint": "^9.0.0",
|
|
94
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
95
|
+
"eslint-plugin-react-refresh": "^0.4.0",
|
|
96
|
+
"globals": "^15.0.0",
|
|
97
|
+
"jsdom": "^25.0.0",
|
|
98
|
+
"postcss-preset-mantine": "^1.18.0",
|
|
99
|
+
"postcss-simple-vars": "^7.0.1",
|
|
100
|
+
"typescript": "^5.5.0",
|
|
101
|
+
"vite": "^5.4.0",
|
|
102
|
+
"vitest": "^2.0.0"
|
|
103
|
+
},
|
|
104
|
+
"peerDependencies": {
|
|
105
|
+
"react": ">=18.0.0",
|
|
106
|
+
"react-dom": ">=18.0.0"
|
|
107
|
+
}
|
|
108
|
+
}
|