@react-router/dev 0.0.0-experimental-b2bc694a6 → 0.0.0-experimental-b571356c3
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/cli/index.js +13 -10
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/vite/cloudflare.js +1 -1
- package/dist/vite.js +13 -10
- package/package.json +6 -6
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v0.0.0-experimental-
|
|
3
|
+
* @react-router/dev v0.0.0-experimental-b571356c3
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -933,18 +933,21 @@ function register(ctx) {
|
|
|
933
933
|
}
|
|
934
934
|
`;
|
|
935
935
|
const { t: t2 } = babel_exports;
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
|
|
936
|
+
const fullpaths = {};
|
|
937
|
+
for (const route of Object.values(ctx.config.routes)) {
|
|
938
|
+
if (route.id !== "root" && !route.path) continue;
|
|
939
|
+
const lineage2 = lineage(ctx.config.routes, route);
|
|
940
|
+
const fullpath2 = fullpath(lineage2);
|
|
941
|
+
const existing = fullpaths[fullpath2];
|
|
942
|
+
if (!existing || existing.length < lineage2.length) {
|
|
943
|
+
fullpaths[fullpath2] = lineage2;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
939
946
|
const typeParams = t2.tsTypeAliasDeclaration(
|
|
940
947
|
t2.identifier("Params"),
|
|
941
948
|
null,
|
|
942
949
|
t2.tsTypeLiteral(
|
|
943
|
-
Object.
|
|
944
|
-
if (route.id !== "root" && !route.path) return void 0;
|
|
945
|
-
if (!route.index && indexPaths.has(route.path)) return void 0;
|
|
946
|
-
const lineage2 = lineage(ctx.config.routes, route);
|
|
947
|
-
const fullpath2 = fullpath(lineage2);
|
|
950
|
+
Object.keys(fullpaths).map((fullpath2) => {
|
|
948
951
|
const params = parse2(fullpath2);
|
|
949
952
|
return t2.tsPropertySignature(
|
|
950
953
|
t2.stringLiteral(fullpath2),
|
|
@@ -961,7 +964,7 @@ function register(ctx) {
|
|
|
961
964
|
)
|
|
962
965
|
)
|
|
963
966
|
);
|
|
964
|
-
})
|
|
967
|
+
})
|
|
965
968
|
)
|
|
966
969
|
);
|
|
967
970
|
return [register2, generate(typeParams).code].join("\n\n");
|
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
package/dist/vite/cloudflare.js
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-b571356c3
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -906,18 +906,21 @@ function register(ctx) {
|
|
|
906
906
|
}
|
|
907
907
|
`;
|
|
908
908
|
const { t: t2 } = babel_exports;
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
909
|
+
const fullpaths = {};
|
|
910
|
+
for (const route of Object.values(ctx.config.routes)) {
|
|
911
|
+
if (route.id !== "root" && !route.path) continue;
|
|
912
|
+
const lineage2 = lineage(ctx.config.routes, route);
|
|
913
|
+
const fullpath2 = fullpath(lineage2);
|
|
914
|
+
const existing = fullpaths[fullpath2];
|
|
915
|
+
if (!existing || existing.length < lineage2.length) {
|
|
916
|
+
fullpaths[fullpath2] = lineage2;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
912
919
|
const typeParams = t2.tsTypeAliasDeclaration(
|
|
913
920
|
t2.identifier("Params"),
|
|
914
921
|
null,
|
|
915
922
|
t2.tsTypeLiteral(
|
|
916
|
-
Object.
|
|
917
|
-
if (route.id !== "root" && !route.path) return void 0;
|
|
918
|
-
if (!route.index && indexPaths.has(route.path)) return void 0;
|
|
919
|
-
const lineage2 = lineage(ctx.config.routes, route);
|
|
920
|
-
const fullpath2 = fullpath(lineage2);
|
|
923
|
+
Object.keys(fullpaths).map((fullpath2) => {
|
|
921
924
|
const params = parse2(fullpath2);
|
|
922
925
|
return t2.tsPropertySignature(
|
|
923
926
|
t2.stringLiteral(fullpath2),
|
|
@@ -934,7 +937,7 @@ function register(ctx) {
|
|
|
934
937
|
)
|
|
935
938
|
)
|
|
936
939
|
);
|
|
937
|
-
})
|
|
940
|
+
})
|
|
938
941
|
)
|
|
939
942
|
);
|
|
940
943
|
return [register2, generate(typeParams).code].join("\n\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-b571356c3",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"set-cookie-parser": "^2.6.0",
|
|
87
87
|
"valibot": "^0.41.0",
|
|
88
88
|
"vite-node": "3.0.0-beta.2",
|
|
89
|
-
"@react-router/node": "0.0.0-experimental-
|
|
89
|
+
"@react-router/node": "0.0.0-experimental-b571356c3"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/babel__core": "^7.20.5",
|
|
@@ -110,15 +110,15 @@
|
|
|
110
110
|
"vite": "^6.1.0",
|
|
111
111
|
"wireit": "0.14.9",
|
|
112
112
|
"wrangler": "^4.2.0",
|
|
113
|
-
"react-router": "
|
|
114
|
-
"
|
|
113
|
+
"@react-router/serve": "0.0.0-experimental-b571356c3",
|
|
114
|
+
"react-router": "^0.0.0-experimental-b571356c3"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"typescript": "^5.1.0",
|
|
118
118
|
"vite": "^5.1.0 || ^6.0.0",
|
|
119
119
|
"wrangler": "^3.28.2 || ^4.0.0",
|
|
120
|
-
"@react-router/serve": "^0.0.0-experimental-
|
|
121
|
-
"react-router": "^0.0.0-experimental-
|
|
120
|
+
"@react-router/serve": "^0.0.0-experimental-b571356c3",
|
|
121
|
+
"react-router": "^0.0.0-experimental-b571356c3"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
124
124
|
"@react-router/serve": {
|