@rangojs/router 0.0.0-experimental.138 → 0.0.0-experimental.139
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 +273 -924
- package/dist/bin/rango.js +28 -14
- package/dist/vite/index.js +472 -77
- package/package.json +33 -19
- package/skills/comparison/SKILL.md +50 -0
- package/skills/comparison/agents/openai.yaml +4 -0
- package/skills/comparison/references/framework-comparison.md +837 -0
- package/skills/host-router/SKILL.md +45 -3
- package/skills/layout/SKILL.md +26 -9
- package/skills/middleware/SKILL.md +6 -2
- package/skills/observability/SKILL.md +23 -1
- package/skills/parallel/SKILL.md +11 -3
- package/skills/rango/SKILL.md +71 -23
- package/skills/route/SKILL.md +19 -3
- package/skills/router-setup/SKILL.md +1 -0
- package/skills/shell-manifest/SKILL.md +185 -0
- package/skills/vercel/SKILL.md +128 -0
- package/src/build/generate-route-types.ts +1 -0
- package/src/build/route-types/router-processing.ts +77 -27
- package/src/cache/index.ts +12 -0
- package/src/cache/vercel/index.ts +11 -0
- package/src/cache/vercel/vercel-cache-store.ts +948 -0
- package/src/host/errors.ts +15 -0
- package/src/host/index.ts +1 -0
- package/src/vercel/index.ts +11 -0
- package/src/vercel/tracing.ts +88 -0
- package/src/vite/discovery/state.ts +1 -1
- package/src/vite/index.ts +2 -0
- package/src/vite/plugin-types.ts +84 -2
- package/src/vite/plugins/vercel-output.ts +384 -0
- package/src/vite/plugins/virtual-entries.ts +72 -0
- package/src/vite/rango.ts +128 -21
- package/src/vite/utils/shared-utils.ts +52 -2
package/dist/bin/rango.js
CHANGED
|
@@ -982,7 +982,10 @@ function countPublicRouteEntries(source) {
|
|
|
982
982
|
function isRoutableSourceFile(name) {
|
|
983
983
|
return (name.endsWith(".ts") || name.endsWith(".tsx") || name.endsWith(".js") || name.endsWith(".jsx")) && !name.includes(".gen.") && !name.includes(".test.") && !name.includes(".spec.");
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function isExcludedScanDir(name) {
|
|
986
|
+
return name === "node_modules" || name === "dist" || name === "coverage" || name === "__tests__" || name === "__mocks__" || name.startsWith(".");
|
|
987
|
+
}
|
|
988
|
+
function findCallSiteFilesRecursive(dir, pattern, patternG, stopAtMatchDir, filter, results) {
|
|
986
989
|
let entries;
|
|
987
990
|
try {
|
|
988
991
|
entries = readdirSync2(dir, { withFileTypes: true });
|
|
@@ -993,32 +996,36 @@ function findRouterFilesRecursive(dir, filter, results) {
|
|
|
993
996
|
return;
|
|
994
997
|
}
|
|
995
998
|
const childDirs = [];
|
|
996
|
-
const
|
|
999
|
+
const matchesInDir = [];
|
|
997
1000
|
for (const entry of entries) {
|
|
998
1001
|
const fullPath = join2(dir, entry.name);
|
|
999
1002
|
if (entry.isDirectory()) {
|
|
1000
|
-
if (entry.name
|
|
1001
|
-
continue;
|
|
1002
|
-
childDirs.push(fullPath);
|
|
1003
|
+
if (!isExcludedScanDir(entry.name)) childDirs.push(fullPath);
|
|
1003
1004
|
continue;
|
|
1004
1005
|
}
|
|
1005
1006
|
if (!isRoutableSourceFile(entry.name)) continue;
|
|
1006
1007
|
if (filter && !filter(fullPath)) continue;
|
|
1007
1008
|
try {
|
|
1008
1009
|
const source = readFileSync3(fullPath, "utf-8");
|
|
1009
|
-
if (
|
|
1010
|
-
|
|
1010
|
+
if (pattern.test(source) && firstCodeMatchIndex(source, patternG) >= 0) {
|
|
1011
|
+
matchesInDir.push(fullPath);
|
|
1011
1012
|
}
|
|
1012
1013
|
} catch {
|
|
1013
1014
|
continue;
|
|
1014
1015
|
}
|
|
1015
1016
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1017
|
+
results.push(...matchesInDir);
|
|
1018
|
+
if (!stopAtMatchDir || matchesInDir.length === 0) {
|
|
1019
|
+
for (const childDir of childDirs) {
|
|
1020
|
+
findCallSiteFilesRecursive(
|
|
1021
|
+
childDir,
|
|
1022
|
+
pattern,
|
|
1023
|
+
patternG,
|
|
1024
|
+
stopAtMatchDir,
|
|
1025
|
+
filter,
|
|
1026
|
+
results
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1022
1029
|
}
|
|
1023
1030
|
}
|
|
1024
1031
|
function findNestedRouterConflict(routerFiles) {
|
|
@@ -1283,7 +1290,14 @@ function detectUnresolvableIncludesForUrlsFile(filePath) {
|
|
|
1283
1290
|
}
|
|
1284
1291
|
function findRouterFiles(root, filter) {
|
|
1285
1292
|
const result = [];
|
|
1286
|
-
|
|
1293
|
+
findCallSiteFilesRecursive(
|
|
1294
|
+
root,
|
|
1295
|
+
ROUTER_CALL_PATTERN,
|
|
1296
|
+
ROUTER_CALL_PATTERN_G,
|
|
1297
|
+
true,
|
|
1298
|
+
filter,
|
|
1299
|
+
result
|
|
1300
|
+
);
|
|
1287
1301
|
return result;
|
|
1288
1302
|
}
|
|
1289
1303
|
function writeCombinedRouteTypes(root, knownRouterFiles, opts) {
|