@expo/router-server 58.0.12 → 58.0.14
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.
|
@@ -44,6 +44,10 @@ function getTypedRoutesDeclarationFile(ctx, { partialTypedGroups = false, testIg
|
|
|
44
44
|
'Router.RelativePathString',
|
|
45
45
|
'Router.ExternalPathString'
|
|
46
46
|
];
|
|
47
|
+
const staticPathnames = [
|
|
48
|
+
'Router.RelativePathString',
|
|
49
|
+
'Router.ExternalPathString'
|
|
50
|
+
];
|
|
47
51
|
const staticRouteInputObjects = [
|
|
48
52
|
'{ pathname: Router.RelativePathString, params?: Router.UnknownInputParams }',
|
|
49
53
|
'{ pathname: Router.ExternalPathString, params?: Router.UnknownInputParams }'
|
|
@@ -54,6 +58,7 @@ function getTypedRoutesDeclarationFile(ctx, { partialTypedGroups = false, testIg
|
|
|
54
58
|
];
|
|
55
59
|
for (const type of groupedNodes.static){
|
|
56
60
|
staticRoutesStrings.push(contextKeyToType(type + urlParams, partialTypedGroups));
|
|
61
|
+
staticPathnames.push(contextKeyToType(type, partialTypedGroups));
|
|
57
62
|
staticRouteInputObjects.push(`{ pathname: ${contextKeyToType(type, partialTypedGroups)}; params?: Router.UnknownInputParams; }`);
|
|
58
63
|
staticRouteOutputObjects.push(`{ pathname: ${contextKeyToType(type, partialTypedGroups)}; params?: Router.UnknownOutputParams; }`);
|
|
59
64
|
}
|
|
@@ -71,13 +76,17 @@ function getTypedRoutesDeclarationFile(ctx, { partialTypedGroups = false, testIg
|
|
|
71
76
|
const value = param.startsWith('...') ? 'string[]' : 'string';
|
|
72
77
|
return `${contextKeyToProperty(key)}: ${value};`;
|
|
73
78
|
}).join('');
|
|
74
|
-
|
|
79
|
+
// A trailing parameter already accepts a query string or a hash
|
|
80
|
+
const suffix = dynamicRouteTemplate.endsWith(']') ? '' : urlParams;
|
|
81
|
+
dynamicRouteStrings.push(contextKeyToType(dynamicRouteTemplate.replaceAll(CATCH_ALL, '${string}').replaceAll(SLUG, '${Router.SingleRoutePart<T>}') + suffix, partialTypedGroups));
|
|
75
82
|
dynamicRouteInputObjects.push(`{ pathname: ${contextKeyToType(dynamicRouteTemplate, partialTypedGroups)}, params: Router.UnknownInputParams & { ${inputParams} } }`);
|
|
76
83
|
dynamicRouteOutputObjects.push(`{ pathname: ${contextKeyToType(dynamicRouteTemplate, partialTypedGroups)}, params: Router.UnknownOutputParams & { ${outputParams} } }`);
|
|
77
84
|
}
|
|
85
|
+
// One object for all static routes keeps the union small. TypeScript compares every pair of
|
|
86
|
+
// members when it combines two `Href` values and fails with TS2590 on large unions.
|
|
78
87
|
const href = [
|
|
79
88
|
...staticRoutesStrings,
|
|
80
|
-
|
|
89
|
+
`{ pathname: ${staticPathnames.join(' | ')}; params?: Router.UnknownInputParams; }`,
|
|
81
90
|
...dynamicRouteStrings,
|
|
82
91
|
...dynamicRouteInputObjects
|
|
83
92
|
].join(' | ');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["typed-routes/generate.ts"],"sourcesContent":[null],"names":["getTypedRoutesDeclarationFile","CATCH_ALL","SLUG","GROUP","urlParams","ctx","partialTypedGroups","testIgnoreComments","routeNode","getRoutes","ignore","platformRoutes","notFound","ignoreEntryPoints","ignoreRequireErrors","importMode","groupedNodes","groupRouteNodes","staticRoutesStrings","staticRouteInputObjects","staticRouteOutputObjects","type","static","push","contextKeyToType","dynamicRouteStrings","dynamicRouteInputObjects","dynamicRouteOutputObjects","dynamicRouteTemplate","paramsNames","dynamic","inputParams","map","param","key","startsWith","slice","value","contextKeyToProperty","join","outputParams","replaceAll","href","hrefInputParams","hrefOutputParams","tsExpectError","groupedContextKeys","Set","Map","route","child","children","routeKey","generated","removeSupportedExtensions","contextKey","replace","set","split","filter","segment","
|
|
1
|
+
{"version":3,"sources":["typed-routes/generate.ts"],"sourcesContent":[null],"names":["getTypedRoutesDeclarationFile","CATCH_ALL","SLUG","GROUP","urlParams","ctx","partialTypedGroups","testIgnoreComments","routeNode","getRoutes","ignore","platformRoutes","notFound","ignoreEntryPoints","ignoreRequireErrors","importMode","groupedNodes","groupRouteNodes","staticRoutesStrings","staticPathnames","staticRouteInputObjects","staticRouteOutputObjects","type","static","push","contextKeyToType","dynamicRouteStrings","dynamicRouteInputObjects","dynamicRouteOutputObjects","dynamicRouteTemplate","paramsNames","dynamic","inputParams","map","param","key","startsWith","slice","value","contextKeyToProperty","join","outputParams","suffix","endsWith","replaceAll","href","hrefInputParams","hrefOutputParams","tsExpectError","groupedContextKeys","Set","Map","route","child","children","routeKey","generated","removeSupportedExtensions","contextKey","replace","set","split","filter","segment","add","test","JSON","stringify","match","typeWithGroups","groups","length","groupsAsType","group","typeWithoutGroups"],"mappings":";;;;+BAiBgBA;;;eAAAA;;;;yBAhBqD;;;;;;AAErE,oCAAoC;AACpC,MAAMC,YAAY;AAClB,6BAA6B;AAC7B,MAAMC,OAAO;AACb,2DAA2D;AAC3D,MAAMC,QAAQ;AAEd,MAAMC,YAAY;AAOX,SAASJ,8BACdK,GAAmB,EACnB,EACEC,qBAAqB,KAAK,EAC1BC,qBAAqB,KAAK,EACW,GAAG,CAAC,CAAC;IAE5C,IAAIC,YAA8B;IAElC,IAAI;QACFA,YAAYC,IAAAA,oBAAS,EAACJ,KAAK;YACzBK,QAAQ;gBAAC;aAAoB;YAC7BC,gBAAgB;YAChBC,UAAU;YACVC,mBAAmB;YACnBC,qBAAqB;YACrBC,YAAY;QACd;IACF,EAAE,OAAM;IACN,gFAAgF;IAChF,wCAAwC;IAC1C;IAEA,MAAMC,eAAeC,gBAAgBT;IACrC,MAAMU,sBAAgC;QAAC;QAA6B;KAA4B;IAChG,MAAMC,kBAA4B;QAAC;QAA6B;KAA4B;IAC5F,MAAMC,0BAAoC;QACxC;QACA;KACD;IACD,MAAMC,2BAAqC;QACzC;QACA;KACD;IAED,KAAK,MAAMC,QAAQN,aAAaO,MAAM,CAAE;QACtCL,oBAAoBM,IAAI,CAACC,iBAAiBH,OAAO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;YACrE,4CAA4C;YAC5C,IAAInE,oBAAoB;gBACtBkE,aAAahD,IAAI,CAAC;YACpB;YACA,gCAAgC;YAChC,OAAO,CAAC,GAAG,EAAEgD,aAAahC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO;YACL,OAAO4B;QACT;IACF;IAEA,IAAIM,oBAAoBhB,WAAWd,UAAU,CAACzC,OAAO,OAAO;IAE5D;;;;GAIC,GACD,IAAIuE,kBAAkBtC,UAAU,CAAChC,YAAY;QAC3CsE,oBAAoB,CAAC,CAAC,EAAEA,mBAAmB;IAC7C;IAEA,OAAO,CAAC,EAAE,EAAEL,eAAe,OAAO,EAAEK,kBAAkB,EAAE,CAAC;AAC3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/router-server",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.14",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"expo",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"debug": "^4.3.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@expo/internal-scripts": "58.0.
|
|
33
|
+
"@expo/internal-scripts": "58.0.3",
|
|
34
34
|
"@types/debug": "^4.1.7",
|
|
35
35
|
"@types/jest": "^30.0.0",
|
|
36
36
|
"@types/node": "^22.14.0",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"@types/react-dom": "^19.1.7",
|
|
39
39
|
"@typescript/vfs": "^1.6.4",
|
|
40
40
|
"expect-type": "^1.3.0",
|
|
41
|
-
"expo-router": "58.0.
|
|
41
|
+
"expo-router": "58.0.20",
|
|
42
42
|
"node-html-parser": "^6.1.5",
|
|
43
43
|
"react-server-dom-webpack": "~19.0.8"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@expo/metro-runtime": "^58.0.14",
|
|
47
47
|
"expo": "*",
|
|
48
|
-
"expo-constants": "^58.0.
|
|
48
|
+
"expo-constants": "^58.0.12",
|
|
49
49
|
"expo-font": "^58.0.8",
|
|
50
50
|
"expo-router": "*",
|
|
51
51
|
"expo-server": "^58.0.5",
|