reroute-js 0.22.4 → 0.23.0
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/cli/bin.d.ts +1 -1
- package/cli/bin.js +6 -6
- package/cli/bin.js.map +1 -1
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +1 -1
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/index.d.ts +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/tailwind.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +2 -2
- package/core/index.js.map +1 -1
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +1 -1
- package/core/src/ssr/lib/styles.d.ts +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +2 -2
- package/elysia/index.js.map +1 -1
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +368 -34
- package/react/index.js.map +6 -5
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +3 -2
- package/react/src/providers/RerouteProvider.d.ts.map +1 -1
- package/react/src/providers/RouterProvider.d.ts +2 -2
- package/react/src/providers/RouterProvider.d.ts.map +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/browser.d.ts +1 -1
- package/telemetry/browser.js +47 -52
- package/telemetry/browser.js.map +4 -5
- package/telemetry/index.d.ts +1 -1
- package/telemetry/index.js +2 -2
- package/telemetry/index.js.map +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +90 -76
- package/telemetry/react.js.map +4 -4
- package/telemetry/src/browser/index.d.ts +4 -8
- package/telemetry/src/browser/index.d.ts.map +1 -1
- package/telemetry/src/browser/react.d.ts +1 -1
- package/telemetry/src/browser/react.d.ts.map +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
package/elysia/src/types.d.ts
CHANGED
package/package.json
CHANGED
package/react/index.d.ts
CHANGED
package/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.
|
|
2
|
+
* reroute-js v0.23.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2025 stewones <hi@stewan.io>
|
|
@@ -7,24 +7,357 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Built with Bun <3
|
|
9
9
|
*/
|
|
10
|
-
import { createRequire } from "node:module";
|
|
11
|
-
var __create = Object.create;
|
|
12
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
13
10
|
var __defProp = Object.defineProperty;
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
get: () => mod[key],
|
|
23
|
-
enumerable: true
|
|
24
|
-
});
|
|
25
|
-
return to;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, {
|
|
14
|
+
get: all[name],
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
set: (newValue) => all[name] = () => newValue
|
|
18
|
+
});
|
|
26
19
|
};
|
|
27
|
-
var
|
|
20
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
21
|
+
|
|
22
|
+
// node:path
|
|
23
|
+
var exports_path = {};
|
|
24
|
+
__export(exports_path, {
|
|
25
|
+
sep: () => sep,
|
|
26
|
+
resolve: () => resolve,
|
|
27
|
+
relative: () => relative,
|
|
28
|
+
posix: () => posix,
|
|
29
|
+
parse: () => parse,
|
|
30
|
+
normalize: () => normalize,
|
|
31
|
+
join: () => join,
|
|
32
|
+
isAbsolute: () => isAbsolute,
|
|
33
|
+
format: () => format,
|
|
34
|
+
extname: () => extname,
|
|
35
|
+
dirname: () => dirname,
|
|
36
|
+
delimiter: () => delimiter,
|
|
37
|
+
default: () => path_default,
|
|
38
|
+
basename: () => basename,
|
|
39
|
+
_makeLong: () => _makeLong
|
|
40
|
+
});
|
|
41
|
+
function assertPath(path) {
|
|
42
|
+
if (typeof path !== "string")
|
|
43
|
+
throw TypeError("Path must be a string. Received " + JSON.stringify(path));
|
|
44
|
+
}
|
|
45
|
+
function normalizeStringPosix(path, allowAboveRoot) {
|
|
46
|
+
var res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code;
|
|
47
|
+
for (var i = 0;i <= path.length; ++i) {
|
|
48
|
+
if (i < path.length)
|
|
49
|
+
code = path.charCodeAt(i);
|
|
50
|
+
else if (code === 47)
|
|
51
|
+
break;
|
|
52
|
+
else
|
|
53
|
+
code = 47;
|
|
54
|
+
if (code === 47) {
|
|
55
|
+
if (lastSlash === i - 1 || dots === 1)
|
|
56
|
+
;
|
|
57
|
+
else if (lastSlash !== i - 1 && dots === 2) {
|
|
58
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
|
|
59
|
+
if (res.length > 2) {
|
|
60
|
+
var lastSlashIndex = res.lastIndexOf("/");
|
|
61
|
+
if (lastSlashIndex !== res.length - 1) {
|
|
62
|
+
if (lastSlashIndex === -1)
|
|
63
|
+
res = "", lastSegmentLength = 0;
|
|
64
|
+
else
|
|
65
|
+
res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
66
|
+
lastSlash = i, dots = 0;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
} else if (res.length === 2 || res.length === 1) {
|
|
70
|
+
res = "", lastSegmentLength = 0, lastSlash = i, dots = 0;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (allowAboveRoot) {
|
|
75
|
+
if (res.length > 0)
|
|
76
|
+
res += "/..";
|
|
77
|
+
else
|
|
78
|
+
res = "..";
|
|
79
|
+
lastSegmentLength = 2;
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
if (res.length > 0)
|
|
83
|
+
res += "/" + path.slice(lastSlash + 1, i);
|
|
84
|
+
else
|
|
85
|
+
res = path.slice(lastSlash + 1, i);
|
|
86
|
+
lastSegmentLength = i - lastSlash - 1;
|
|
87
|
+
}
|
|
88
|
+
lastSlash = i, dots = 0;
|
|
89
|
+
} else if (code === 46 && dots !== -1)
|
|
90
|
+
++dots;
|
|
91
|
+
else
|
|
92
|
+
dots = -1;
|
|
93
|
+
}
|
|
94
|
+
return res;
|
|
95
|
+
}
|
|
96
|
+
function _format(sep, pathObject) {
|
|
97
|
+
var dir = pathObject.dir || pathObject.root, base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
|
|
98
|
+
if (!dir)
|
|
99
|
+
return base;
|
|
100
|
+
if (dir === pathObject.root)
|
|
101
|
+
return dir + base;
|
|
102
|
+
return dir + sep + base;
|
|
103
|
+
}
|
|
104
|
+
function resolve() {
|
|
105
|
+
var resolvedPath = "", resolvedAbsolute = false, cwd;
|
|
106
|
+
for (var i = arguments.length - 1;i >= -1 && !resolvedAbsolute; i--) {
|
|
107
|
+
var path;
|
|
108
|
+
if (i >= 0)
|
|
109
|
+
path = arguments[i];
|
|
110
|
+
else {
|
|
111
|
+
if (cwd === undefined)
|
|
112
|
+
cwd = process.cwd();
|
|
113
|
+
path = cwd;
|
|
114
|
+
}
|
|
115
|
+
if (assertPath(path), path.length === 0)
|
|
116
|
+
continue;
|
|
117
|
+
resolvedPath = path + "/" + resolvedPath, resolvedAbsolute = path.charCodeAt(0) === 47;
|
|
118
|
+
}
|
|
119
|
+
if (resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute), resolvedAbsolute)
|
|
120
|
+
if (resolvedPath.length > 0)
|
|
121
|
+
return "/" + resolvedPath;
|
|
122
|
+
else
|
|
123
|
+
return "/";
|
|
124
|
+
else if (resolvedPath.length > 0)
|
|
125
|
+
return resolvedPath;
|
|
126
|
+
else
|
|
127
|
+
return ".";
|
|
128
|
+
}
|
|
129
|
+
function normalize(path) {
|
|
130
|
+
if (assertPath(path), path.length === 0)
|
|
131
|
+
return ".";
|
|
132
|
+
var isAbsolute = path.charCodeAt(0) === 47, trailingSeparator = path.charCodeAt(path.length - 1) === 47;
|
|
133
|
+
if (path = normalizeStringPosix(path, !isAbsolute), path.length === 0 && !isAbsolute)
|
|
134
|
+
path = ".";
|
|
135
|
+
if (path.length > 0 && trailingSeparator)
|
|
136
|
+
path += "/";
|
|
137
|
+
if (isAbsolute)
|
|
138
|
+
return "/" + path;
|
|
139
|
+
return path;
|
|
140
|
+
}
|
|
141
|
+
function isAbsolute(path) {
|
|
142
|
+
return assertPath(path), path.length > 0 && path.charCodeAt(0) === 47;
|
|
143
|
+
}
|
|
144
|
+
function join() {
|
|
145
|
+
if (arguments.length === 0)
|
|
146
|
+
return ".";
|
|
147
|
+
var joined;
|
|
148
|
+
for (var i = 0;i < arguments.length; ++i) {
|
|
149
|
+
var arg = arguments[i];
|
|
150
|
+
if (assertPath(arg), arg.length > 0)
|
|
151
|
+
if (joined === undefined)
|
|
152
|
+
joined = arg;
|
|
153
|
+
else
|
|
154
|
+
joined += "/" + arg;
|
|
155
|
+
}
|
|
156
|
+
if (joined === undefined)
|
|
157
|
+
return ".";
|
|
158
|
+
return normalize(joined);
|
|
159
|
+
}
|
|
160
|
+
function relative(from, to) {
|
|
161
|
+
if (assertPath(from), assertPath(to), from === to)
|
|
162
|
+
return "";
|
|
163
|
+
if (from = resolve(from), to = resolve(to), from === to)
|
|
164
|
+
return "";
|
|
165
|
+
var fromStart = 1;
|
|
166
|
+
for (;fromStart < from.length; ++fromStart)
|
|
167
|
+
if (from.charCodeAt(fromStart) !== 47)
|
|
168
|
+
break;
|
|
169
|
+
var fromEnd = from.length, fromLen = fromEnd - fromStart, toStart = 1;
|
|
170
|
+
for (;toStart < to.length; ++toStart)
|
|
171
|
+
if (to.charCodeAt(toStart) !== 47)
|
|
172
|
+
break;
|
|
173
|
+
var toEnd = to.length, toLen = toEnd - toStart, length = fromLen < toLen ? fromLen : toLen, lastCommonSep = -1, i = 0;
|
|
174
|
+
for (;i <= length; ++i) {
|
|
175
|
+
if (i === length) {
|
|
176
|
+
if (toLen > length) {
|
|
177
|
+
if (to.charCodeAt(toStart + i) === 47)
|
|
178
|
+
return to.slice(toStart + i + 1);
|
|
179
|
+
else if (i === 0)
|
|
180
|
+
return to.slice(toStart + i);
|
|
181
|
+
} else if (fromLen > length) {
|
|
182
|
+
if (from.charCodeAt(fromStart + i) === 47)
|
|
183
|
+
lastCommonSep = i;
|
|
184
|
+
else if (i === 0)
|
|
185
|
+
lastCommonSep = 0;
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
var fromCode = from.charCodeAt(fromStart + i), toCode = to.charCodeAt(toStart + i);
|
|
190
|
+
if (fromCode !== toCode)
|
|
191
|
+
break;
|
|
192
|
+
else if (fromCode === 47)
|
|
193
|
+
lastCommonSep = i;
|
|
194
|
+
}
|
|
195
|
+
var out = "";
|
|
196
|
+
for (i = fromStart + lastCommonSep + 1;i <= fromEnd; ++i)
|
|
197
|
+
if (i === fromEnd || from.charCodeAt(i) === 47)
|
|
198
|
+
if (out.length === 0)
|
|
199
|
+
out += "..";
|
|
200
|
+
else
|
|
201
|
+
out += "/..";
|
|
202
|
+
if (out.length > 0)
|
|
203
|
+
return out + to.slice(toStart + lastCommonSep);
|
|
204
|
+
else {
|
|
205
|
+
if (toStart += lastCommonSep, to.charCodeAt(toStart) === 47)
|
|
206
|
+
++toStart;
|
|
207
|
+
return to.slice(toStart);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function _makeLong(path) {
|
|
211
|
+
return path;
|
|
212
|
+
}
|
|
213
|
+
function dirname(path) {
|
|
214
|
+
if (assertPath(path), path.length === 0)
|
|
215
|
+
return ".";
|
|
216
|
+
var code = path.charCodeAt(0), hasRoot = code === 47, end = -1, matchedSlash = true;
|
|
217
|
+
for (var i = path.length - 1;i >= 1; --i)
|
|
218
|
+
if (code = path.charCodeAt(i), code === 47) {
|
|
219
|
+
if (!matchedSlash) {
|
|
220
|
+
end = i;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
} else
|
|
224
|
+
matchedSlash = false;
|
|
225
|
+
if (end === -1)
|
|
226
|
+
return hasRoot ? "/" : ".";
|
|
227
|
+
if (hasRoot && end === 1)
|
|
228
|
+
return "//";
|
|
229
|
+
return path.slice(0, end);
|
|
230
|
+
}
|
|
231
|
+
function basename(path, ext) {
|
|
232
|
+
if (ext !== undefined && typeof ext !== "string")
|
|
233
|
+
throw TypeError('"ext" argument must be a string');
|
|
234
|
+
assertPath(path);
|
|
235
|
+
var start = 0, end = -1, matchedSlash = true, i;
|
|
236
|
+
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
|
|
237
|
+
if (ext.length === path.length && ext === path)
|
|
238
|
+
return "";
|
|
239
|
+
var extIdx = ext.length - 1, firstNonSlashEnd = -1;
|
|
240
|
+
for (i = path.length - 1;i >= 0; --i) {
|
|
241
|
+
var code = path.charCodeAt(i);
|
|
242
|
+
if (code === 47) {
|
|
243
|
+
if (!matchedSlash) {
|
|
244
|
+
start = i + 1;
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
if (firstNonSlashEnd === -1)
|
|
249
|
+
matchedSlash = false, firstNonSlashEnd = i + 1;
|
|
250
|
+
if (extIdx >= 0)
|
|
251
|
+
if (code === ext.charCodeAt(extIdx)) {
|
|
252
|
+
if (--extIdx === -1)
|
|
253
|
+
end = i;
|
|
254
|
+
} else
|
|
255
|
+
extIdx = -1, end = firstNonSlashEnd;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (start === end)
|
|
259
|
+
end = firstNonSlashEnd;
|
|
260
|
+
else if (end === -1)
|
|
261
|
+
end = path.length;
|
|
262
|
+
return path.slice(start, end);
|
|
263
|
+
} else {
|
|
264
|
+
for (i = path.length - 1;i >= 0; --i)
|
|
265
|
+
if (path.charCodeAt(i) === 47) {
|
|
266
|
+
if (!matchedSlash) {
|
|
267
|
+
start = i + 1;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
} else if (end === -1)
|
|
271
|
+
matchedSlash = false, end = i + 1;
|
|
272
|
+
if (end === -1)
|
|
273
|
+
return "";
|
|
274
|
+
return path.slice(start, end);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function extname(path) {
|
|
278
|
+
assertPath(path);
|
|
279
|
+
var startDot = -1, startPart = 0, end = -1, matchedSlash = true, preDotState = 0;
|
|
280
|
+
for (var i = path.length - 1;i >= 0; --i) {
|
|
281
|
+
var code = path.charCodeAt(i);
|
|
282
|
+
if (code === 47) {
|
|
283
|
+
if (!matchedSlash) {
|
|
284
|
+
startPart = i + 1;
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (end === -1)
|
|
290
|
+
matchedSlash = false, end = i + 1;
|
|
291
|
+
if (code === 46) {
|
|
292
|
+
if (startDot === -1)
|
|
293
|
+
startDot = i;
|
|
294
|
+
else if (preDotState !== 1)
|
|
295
|
+
preDotState = 1;
|
|
296
|
+
} else if (startDot !== -1)
|
|
297
|
+
preDotState = -1;
|
|
298
|
+
}
|
|
299
|
+
if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
|
|
300
|
+
return "";
|
|
301
|
+
return path.slice(startDot, end);
|
|
302
|
+
}
|
|
303
|
+
function format(pathObject) {
|
|
304
|
+
if (pathObject === null || typeof pathObject !== "object")
|
|
305
|
+
throw TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
|
|
306
|
+
return _format("/", pathObject);
|
|
307
|
+
}
|
|
308
|
+
function parse(path) {
|
|
309
|
+
assertPath(path);
|
|
310
|
+
var ret = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
311
|
+
if (path.length === 0)
|
|
312
|
+
return ret;
|
|
313
|
+
var code = path.charCodeAt(0), isAbsolute2 = code === 47, start;
|
|
314
|
+
if (isAbsolute2)
|
|
315
|
+
ret.root = "/", start = 1;
|
|
316
|
+
else
|
|
317
|
+
start = 0;
|
|
318
|
+
var startDot = -1, startPart = 0, end = -1, matchedSlash = true, i = path.length - 1, preDotState = 0;
|
|
319
|
+
for (;i >= start; --i) {
|
|
320
|
+
if (code = path.charCodeAt(i), code === 47) {
|
|
321
|
+
if (!matchedSlash) {
|
|
322
|
+
startPart = i + 1;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
if (end === -1)
|
|
328
|
+
matchedSlash = false, end = i + 1;
|
|
329
|
+
if (code === 46) {
|
|
330
|
+
if (startDot === -1)
|
|
331
|
+
startDot = i;
|
|
332
|
+
else if (preDotState !== 1)
|
|
333
|
+
preDotState = 1;
|
|
334
|
+
} else if (startDot !== -1)
|
|
335
|
+
preDotState = -1;
|
|
336
|
+
}
|
|
337
|
+
if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
338
|
+
if (end !== -1)
|
|
339
|
+
if (startPart === 0 && isAbsolute2)
|
|
340
|
+
ret.base = ret.name = path.slice(1, end);
|
|
341
|
+
else
|
|
342
|
+
ret.base = ret.name = path.slice(startPart, end);
|
|
343
|
+
} else {
|
|
344
|
+
if (startPart === 0 && isAbsolute2)
|
|
345
|
+
ret.name = path.slice(1, startDot), ret.base = path.slice(1, end);
|
|
346
|
+
else
|
|
347
|
+
ret.name = path.slice(startPart, startDot), ret.base = path.slice(startPart, end);
|
|
348
|
+
ret.ext = path.slice(startDot, end);
|
|
349
|
+
}
|
|
350
|
+
if (startPart > 0)
|
|
351
|
+
ret.dir = path.slice(0, startPart - 1);
|
|
352
|
+
else if (isAbsolute2)
|
|
353
|
+
ret.dir = "/";
|
|
354
|
+
return ret;
|
|
355
|
+
}
|
|
356
|
+
var sep = "/", delimiter = ":", posix, path_default;
|
|
357
|
+
var init_path = __esm(() => {
|
|
358
|
+
posix = ((p) => (p.posix = p, p))({ resolve, normalize, isAbsolute, join, relative, _makeLong, dirname, basename, extname, format, parse, sep, delimiter, win32: null, posix: null });
|
|
359
|
+
path_default = posix;
|
|
360
|
+
});
|
|
28
361
|
|
|
29
362
|
// packages/react/src/components/ClientOnly.tsx
|
|
30
363
|
import { useEffect, useState } from "react";
|
|
@@ -768,6 +1101,7 @@ function RouterProvider({
|
|
|
768
1101
|
notFoundRoutes = [],
|
|
769
1102
|
notFound: NotFound,
|
|
770
1103
|
pathname = "/",
|
|
1104
|
+
searchParams: ssrSearchParams,
|
|
771
1105
|
viewTransitions = true,
|
|
772
1106
|
scrollRestoration = true
|
|
773
1107
|
}) {
|
|
@@ -780,26 +1114,24 @@ function RouterProvider({
|
|
|
780
1114
|
if (isBrowser2) {
|
|
781
1115
|
serverSnapshotRef.current = currentLocation;
|
|
782
1116
|
} else {
|
|
783
|
-
const qIdx = pathname.indexOf("?");
|
|
784
1117
|
const hIdx = pathname.indexOf("#");
|
|
785
1118
|
let pathOnly = pathname;
|
|
786
|
-
let search = "";
|
|
787
1119
|
let hash = "";
|
|
788
|
-
if (
|
|
789
|
-
pathOnly = pathname.slice(0, qIdx);
|
|
790
|
-
if (hIdx !== -1 && hIdx > qIdx) {
|
|
791
|
-
search = pathname.slice(qIdx, hIdx);
|
|
792
|
-
hash = pathname.slice(hIdx);
|
|
793
|
-
} else if (hIdx !== -1) {
|
|
794
|
-
pathOnly = pathname.slice(0, hIdx);
|
|
795
|
-
hash = pathname.slice(hIdx);
|
|
796
|
-
} else {
|
|
797
|
-
search = pathname.slice(qIdx);
|
|
798
|
-
}
|
|
799
|
-
} else if (hIdx !== -1) {
|
|
1120
|
+
if (hIdx !== -1) {
|
|
800
1121
|
pathOnly = pathname.slice(0, hIdx);
|
|
801
1122
|
hash = pathname.slice(hIdx);
|
|
802
1123
|
}
|
|
1124
|
+
let search = "";
|
|
1125
|
+
if (ssrSearchParams) {
|
|
1126
|
+
const searchString = ssrSearchParams.toString();
|
|
1127
|
+
search = searchString ? `?${searchString}` : "";
|
|
1128
|
+
} else {
|
|
1129
|
+
const qIdx = pathOnly.indexOf("?");
|
|
1130
|
+
if (qIdx !== -1) {
|
|
1131
|
+
search = pathOnly.slice(qIdx);
|
|
1132
|
+
pathOnly = pathOnly.slice(0, qIdx);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
803
1135
|
serverSnapshotRef.current = { pathname: pathOnly, search, hash };
|
|
804
1136
|
}
|
|
805
1137
|
}
|
|
@@ -1092,6 +1424,7 @@ function RerouteProvider({
|
|
|
1092
1424
|
notFoundRoutes,
|
|
1093
1425
|
notFound,
|
|
1094
1426
|
pathname,
|
|
1427
|
+
searchParams,
|
|
1095
1428
|
viewTransitions,
|
|
1096
1429
|
scrollRestoration,
|
|
1097
1430
|
markdownComponents,
|
|
@@ -1109,6 +1442,7 @@ function RerouteProvider({
|
|
|
1109
1442
|
notFoundRoutes,
|
|
1110
1443
|
notFound,
|
|
1111
1444
|
pathname,
|
|
1445
|
+
searchParams,
|
|
1112
1446
|
viewTransitions,
|
|
1113
1447
|
scrollRestoration,
|
|
1114
1448
|
children
|
|
@@ -2425,9 +2759,9 @@ async function collectionSearch(options) {
|
|
|
2425
2759
|
if (!query)
|
|
2426
2760
|
return null;
|
|
2427
2761
|
try {
|
|
2428
|
-
const { join } = await
|
|
2762
|
+
const { join: join2 } = await Promise.resolve().then(() => (init_path(), exports_path));
|
|
2429
2763
|
const cwd = typeof process !== "undefined" && typeof process.cwd === "function" ? process.cwd() : "/";
|
|
2430
|
-
const indexPath =
|
|
2764
|
+
const indexPath = join2(cwd, ".reroute", "search.json");
|
|
2431
2765
|
const file = Bun.file(indexPath);
|
|
2432
2766
|
if (!await file.exists())
|
|
2433
2767
|
return null;
|
|
@@ -2564,4 +2898,4 @@ export {
|
|
|
2564
2898
|
ClientOnly
|
|
2565
2899
|
};
|
|
2566
2900
|
|
|
2567
|
-
//# debugId=
|
|
2901
|
+
//# debugId=15BCBEF306328E8164756E2164756E21
|