reroute-js 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +7 -3
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +1253 -781
- package/cli/bin.js.map +25 -24
- package/cli/index.d.ts +1 -1
- package/cli/index.js +93 -28
- package/cli/index.js.map +4 -4
- 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 +5 -6
- package/cli/src/commands/dev.d.ts.map +1 -1
- package/cli/src/commands/gen.d.ts +4 -1
- package/cli/src/commands/gen.d.ts.map +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 +7 -1
- package/cli/src/commands/lib/bundler.d.ts.map +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 +2 -1
- package/cli/src/commands/lib/server.d.ts.map +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/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +17 -3
- package/cli/src/commands/lib/theme.d.ts.map +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 +594 -228
- package/core/index.js.map +19 -18
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +32 -2
- package/core/src/config.d.ts.map +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/i18n/catalog.d.ts +1 -1
- package/core/src/i18n/discover.d.ts +1 -1
- package/core/src/i18n/index.d.ts +1 -1
- package/core/src/i18n/messages.d.ts +1 -1
- package/core/src/i18n/negotiate.d.ts +1 -1
- package/core/src/i18n/pathname.d.ts +1 -1
- package/core/src/i18n/resolve.d.ts +4 -3
- package/core/src/i18n/resolve.d.ts.map +1 -1
- package/core/src/i18n/types.d.ts +5 -1
- package/core/src/i18n/types.d.ts.map +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/discovery.d.ts +35 -0
- package/core/src/llms/discovery.d.ts.map +1 -0
- 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 +3 -1
- package/core/src/llms/full-generator.d.ts.map +1 -1
- package/core/src/llms/index-generator.d.ts +5 -2
- package/core/src/llms/index-generator.d.ts.map +1 -1
- package/core/src/llms/index.d.ts +4 -1
- package/core/src/llms/index.d.ts.map +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/generator.d.ts.map +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 +7 -2
- package/core/src/sitemap/discovery.d.ts.map +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/cleanup.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +17 -1
- package/core/src/ssr/lib/collections.d.ts.map +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/content-path.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 +8 -3
- package/core/src/ssr/lib/imports.d.ts.map +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/route-match.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +2 -2
- package/core/src/ssr/lib/scripts/collections.d.ts.map +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 +6 -1
- package/core/src/ssr/lib/seed.d.ts.map +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +2 -2
- package/core/src/ssr/lib/setup.d.ts.map +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 +15 -1
- package/core/src/ssr/lib/types.d.ts.map +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/render.d.ts.map +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +826 -328
- package/elysia/index.js.map +28 -26
- 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/i18n.d.ts +2 -2
- package/elysia/src/libs/i18n.d.ts.map +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/plugin.d.ts.map +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +2 -2
- package/elysia/src/routes/content.d.ts.map +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 +3 -2
- package/elysia/src/routes/internal.d.ts.map +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts.map +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 +3 -1
- package/elysia/src/routes/robots.d.ts.map +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 +3 -1
- package/elysia/src/routes/sitemap.d.ts.map +1 -1
- package/elysia/src/routes/ssr.d.ts +4 -2
- package/elysia/src/routes/ssr.d.ts.map +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/routes/themeCssRefresh.d.ts +17 -0
- package/elysia/src/routes/themeCssRefresh.d.ts.map +1 -0
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +82 -96
- package/react/index.js.map +4 -4
- 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/useContent.d.ts.map +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/i18n/LocaleProvider.d.ts +1 -1
- package/react/src/i18n/LocaleProvider.d.ts.map +1 -1
- package/react/src/i18n/helpers.d.ts +1 -1
- package/react/src/i18n/index.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 +1 -1
- package/react/src/providers/RouterProvider.d.ts +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/react.d.ts +1 -1
- package/telemetry/react.js +16 -16
- package/telemetry/react.js.map +2 -2
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +51 -228
- package/telemetry/server.js.map +16 -13
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
package/cli/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
/**
|
|
4
|
-
* reroute-js v1.0.0-alpha.
|
|
4
|
+
* reroute-js v1.0.0-alpha.11
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -30,12 +30,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
30
30
|
}
|
|
31
31
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
32
32
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
34
|
+
for (let key of __getOwnPropNames(mod))
|
|
35
|
+
if (!__hasOwnProp.call(to, key))
|
|
36
|
+
__defProp(to, key, {
|
|
37
|
+
get: __accessProp.bind(mod, key),
|
|
38
|
+
enumerable: true
|
|
39
|
+
});
|
|
40
|
+
}
|
|
39
41
|
if (canCache)
|
|
40
42
|
cache.set(mod, to);
|
|
41
43
|
return to;
|
|
@@ -66,7 +68,7 @@ async function getVersionString() {
|
|
|
66
68
|
}
|
|
67
69
|
async function getVersion() {
|
|
68
70
|
if (true) {
|
|
69
|
-
return "1.0.0-alpha.
|
|
71
|
+
return "1.0.0-alpha.11";
|
|
70
72
|
}
|
|
71
73
|
const possiblePaths = [
|
|
72
74
|
path.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -84,7 +86,7 @@ async function getVersion() {
|
|
|
84
86
|
}
|
|
85
87
|
async function getCommit() {
|
|
86
88
|
if (true) {
|
|
87
|
-
return "
|
|
89
|
+
return "560df44";
|
|
88
90
|
}
|
|
89
91
|
return "dev";
|
|
90
92
|
}
|
|
@@ -726,14 +728,14 @@ var init_negotiate = () => {};
|
|
|
726
728
|
// packages/core/src/i18n/pathname.ts
|
|
727
729
|
var exports_pathname = {};
|
|
728
730
|
__export(exports_pathname, {
|
|
729
|
-
|
|
730
|
-
parseContentPath: () => parseContentPath,
|
|
731
|
-
normalizePathname: () => normalizePathname,
|
|
732
|
-
looksLikeLocale: () => looksLikeLocale,
|
|
733
|
-
localizeHref: () => localizeHref,
|
|
734
|
-
localizeContentHref: () => localizeContentHref,
|
|
731
|
+
contentKey: () => contentKey,
|
|
735
732
|
hreflangTags: () => hreflangTags,
|
|
736
|
-
|
|
733
|
+
localizeContentHref: () => localizeContentHref,
|
|
734
|
+
localizeHref: () => localizeHref,
|
|
735
|
+
looksLikeLocale: () => looksLikeLocale,
|
|
736
|
+
normalizePathname: () => normalizePathname,
|
|
737
|
+
parseContentPath: () => parseContentPath,
|
|
738
|
+
toOgLocale: () => toOgLocale
|
|
737
739
|
});
|
|
738
740
|
function looksLikeLocale(segment) {
|
|
739
741
|
return /^[a-z]{2}(?:-[A-Za-z0-9]{2,8})*$/i.test(segment);
|
|
@@ -816,9 +818,30 @@ function hreflangTags(baseUrl, collection, name, locales, defaultLocale) {
|
|
|
816
818
|
var init_pathname = () => {};
|
|
817
819
|
|
|
818
820
|
// packages/core/src/i18n/resolve.ts
|
|
821
|
+
function canonicalLocale(value, availableLocales) {
|
|
822
|
+
return availableLocales.find((l) => l.toLowerCase() === value.toLowerCase()) || value;
|
|
823
|
+
}
|
|
824
|
+
function parseLangParam(search, isAvailable, availableLocales) {
|
|
825
|
+
if (!search)
|
|
826
|
+
return;
|
|
827
|
+
const params = new URLSearchParams(search.startsWith("?") ? search.slice(1) : search);
|
|
828
|
+
const raw = params.get("lang") ?? undefined;
|
|
829
|
+
if (!isAvailable(raw))
|
|
830
|
+
return;
|
|
831
|
+
return canonicalLocale(raw, availableLocales);
|
|
832
|
+
}
|
|
833
|
+
function stripLangParam(search) {
|
|
834
|
+
if (!search)
|
|
835
|
+
return "";
|
|
836
|
+
const params = new URLSearchParams(search.startsWith("?") ? search.slice(1) : search);
|
|
837
|
+
params.delete("lang");
|
|
838
|
+
const rest = params.toString();
|
|
839
|
+
return rest ? `?${rest}` : "";
|
|
840
|
+
}
|
|
819
841
|
function resolveLocale(input) {
|
|
820
842
|
const {
|
|
821
843
|
pathname,
|
|
844
|
+
search,
|
|
822
845
|
cookieHeader,
|
|
823
846
|
acceptLanguage,
|
|
824
847
|
availableLocales,
|
|
@@ -829,14 +852,32 @@ function resolveLocale(input) {
|
|
|
829
852
|
const parsed = parseContentPath(pathname, availableLocales, collections);
|
|
830
853
|
const availableLower = new Set(availableLocales.map((l) => l.toLowerCase()));
|
|
831
854
|
const isAvailable = (locale) => !!locale && availableLower.has(locale.toLowerCase());
|
|
855
|
+
const routingPathname = parsed?.routingPathname ?? pathname.split("?")[0];
|
|
856
|
+
const restSearch = stripLangParam(search);
|
|
857
|
+
const queryLocale = parseLangParam(search, isAvailable, availableLocales);
|
|
858
|
+
if (queryLocale) {
|
|
859
|
+
const target = parsed ? localizeContentHref(parsed.collection, parsed.name, queryLocale, defaultLocale) : routingPathname;
|
|
860
|
+
return {
|
|
861
|
+
locale: queryLocale,
|
|
862
|
+
routingPathname,
|
|
863
|
+
fromPath: false,
|
|
864
|
+
fromQuery: true,
|
|
865
|
+
redirectTo: `${target}${restSearch}`,
|
|
866
|
+
parsed: parsed ? {
|
|
867
|
+
...parsed,
|
|
868
|
+
locale: queryLocale === defaultLocale ? undefined : queryLocale
|
|
869
|
+
} : undefined
|
|
870
|
+
};
|
|
871
|
+
}
|
|
832
872
|
if (parsed?.locale && isAvailable(parsed.locale)) {
|
|
833
|
-
const locale =
|
|
873
|
+
const locale = canonicalLocale(parsed.locale, availableLocales);
|
|
834
874
|
if (locale === defaultLocale && parsed.pathname !== parsed.routingPathname) {
|
|
835
875
|
return {
|
|
836
876
|
locale,
|
|
837
877
|
routingPathname: parsed.routingPathname,
|
|
838
878
|
fromPath: true,
|
|
839
|
-
|
|
879
|
+
fromQuery: false,
|
|
880
|
+
redirectTo: `${parsed.routingPathname}${restSearch}`,
|
|
840
881
|
parsed: { ...parsed, locale }
|
|
841
882
|
};
|
|
842
883
|
}
|
|
@@ -844,17 +885,18 @@ function resolveLocale(input) {
|
|
|
844
885
|
locale,
|
|
845
886
|
routingPathname: parsed.routingPathname,
|
|
846
887
|
fromPath: true,
|
|
888
|
+
fromQuery: false,
|
|
847
889
|
parsed: { ...parsed, locale }
|
|
848
890
|
};
|
|
849
891
|
}
|
|
850
|
-
const routingPathname = parsed?.routingPathname ?? pathname.split("?")[0];
|
|
851
892
|
const cookieLocale = parseCookieValue(cookieHeader, cookieName);
|
|
852
893
|
if (isAvailable(cookieLocale)) {
|
|
853
|
-
const locale =
|
|
894
|
+
const locale = canonicalLocale(cookieLocale, availableLocales);
|
|
854
895
|
return {
|
|
855
896
|
locale,
|
|
856
897
|
routingPathname,
|
|
857
898
|
fromPath: false,
|
|
899
|
+
fromQuery: false,
|
|
858
900
|
parsed: parsed ? { ...parsed, locale: undefined } : undefined
|
|
859
901
|
};
|
|
860
902
|
}
|
|
@@ -863,13 +905,14 @@ function resolveLocale(input) {
|
|
|
863
905
|
locale: negotiated,
|
|
864
906
|
routingPathname,
|
|
865
907
|
fromPath: false,
|
|
908
|
+
fromQuery: false,
|
|
866
909
|
parsed: parsed ? { ...parsed, locale: undefined } : undefined
|
|
867
910
|
};
|
|
868
911
|
}
|
|
869
912
|
function contentNegotiateRedirect(resolution, defaultLocale, enabled) {
|
|
870
913
|
if (!enabled)
|
|
871
914
|
return;
|
|
872
|
-
if (resolution.fromPath)
|
|
915
|
+
if (resolution.fromPath || resolution.fromQuery)
|
|
873
916
|
return;
|
|
874
917
|
if (resolution.locale === defaultLocale)
|
|
875
918
|
return;
|
|
@@ -1385,11 +1428,39 @@ function cleanupPathScopedSSRData(pathname) {
|
|
|
1385
1428
|
}
|
|
1386
1429
|
|
|
1387
1430
|
// packages/core/src/ssr/lib/imports.ts
|
|
1431
|
+
import { copyFile, realpath, stat as stat3, unlink } from "node:fs/promises";
|
|
1432
|
+
import { basename as basename2, dirname, extname as extname2, join as join4 } from "node:path";
|
|
1388
1433
|
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
1434
|
+
function clearWatchImportCache() {
|
|
1435
|
+
watchImportCache.clear();
|
|
1436
|
+
}
|
|
1437
|
+
function bustCopyPath(absolutePath) {
|
|
1438
|
+
const dir = dirname(absolutePath);
|
|
1439
|
+
const ext = extname2(absolutePath);
|
|
1440
|
+
const base = basename2(absolutePath, ext);
|
|
1441
|
+
const token = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
1442
|
+
return join4(dir, `${base}.bust-${token}${ext}`);
|
|
1443
|
+
}
|
|
1389
1444
|
async function dynamicImport(absolutePath, isWatchMode) {
|
|
1390
1445
|
const href = pathToFileURL3(absolutePath).href;
|
|
1391
|
-
|
|
1392
|
-
|
|
1446
|
+
if (!isWatchMode) {
|
|
1447
|
+
return await import(href);
|
|
1448
|
+
}
|
|
1449
|
+
const resolved = await realpath(absolutePath);
|
|
1450
|
+
const mtimeMs = (await stat3(resolved)).mtimeMs;
|
|
1451
|
+
const cached = watchImportCache.get(resolved);
|
|
1452
|
+
if (cached && cached.mtimeMs === mtimeMs) {
|
|
1453
|
+
return cached.mod;
|
|
1454
|
+
}
|
|
1455
|
+
const tmp = bustCopyPath(resolved);
|
|
1456
|
+
await copyFile(resolved, tmp);
|
|
1457
|
+
try {
|
|
1458
|
+
const mod = await import(pathToFileURL3(tmp).href);
|
|
1459
|
+
watchImportCache.set(resolved, { mtimeMs, mod });
|
|
1460
|
+
return mod;
|
|
1461
|
+
} finally {
|
|
1462
|
+
await unlink(tmp).catch(() => {});
|
|
1463
|
+
}
|
|
1393
1464
|
}
|
|
1394
1465
|
function isThenable(value) {
|
|
1395
1466
|
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
@@ -1397,7 +1468,10 @@ function isThenable(value) {
|
|
|
1397
1468
|
function toPromise(input) {
|
|
1398
1469
|
return input instanceof Promise ? input : Promise.resolve(input);
|
|
1399
1470
|
}
|
|
1400
|
-
var
|
|
1471
|
+
var watchImportCache;
|
|
1472
|
+
var init_imports = __esm(() => {
|
|
1473
|
+
watchImportCache = new Map;
|
|
1474
|
+
});
|
|
1401
1475
|
|
|
1402
1476
|
// packages/core/src/ssr/lib/collections.ts
|
|
1403
1477
|
async function loadCollections(cwd, isWatchMode) {
|
|
@@ -1414,6 +1488,21 @@ function setGlobalCollections(byCollectionForSSR) {
|
|
|
1414
1488
|
globalThis.__REROUTE_COLLECTIONS__ = byCollectionForSSR;
|
|
1415
1489
|
} catch {}
|
|
1416
1490
|
}
|
|
1491
|
+
function resetSSRContentResults() {
|
|
1492
|
+
try {
|
|
1493
|
+
globalThis.__REROUTE_SSR_RESULTS__ = {};
|
|
1494
|
+
} catch {}
|
|
1495
|
+
}
|
|
1496
|
+
function takeSSRContentResults() {
|
|
1497
|
+
try {
|
|
1498
|
+
const g = globalThis;
|
|
1499
|
+
const results = g.__REROUTE_SSR_RESULTS__;
|
|
1500
|
+
g.__REROUTE_SSR_RESULTS__ = {};
|
|
1501
|
+
return results;
|
|
1502
|
+
} catch {
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1417
1506
|
var init_collections = __esm(() => {
|
|
1418
1507
|
init_imports();
|
|
1419
1508
|
});
|
|
@@ -2187,7 +2276,7 @@ var init_compute = __esm(() => {
|
|
|
2187
2276
|
});
|
|
2188
2277
|
|
|
2189
2278
|
// packages/core/src/ssr/lib/modules.ts
|
|
2190
|
-
import { readdir as readdir4, stat as
|
|
2279
|
+
import { readdir as readdir4, stat as stat4 } from "node:fs/promises";
|
|
2191
2280
|
async function importContentModuleForPath(pathname, clientDir, cwd, isWatchMode) {
|
|
2192
2281
|
try {
|
|
2193
2282
|
const resolved = resolveContentPathParts(pathname);
|
|
@@ -2245,7 +2334,7 @@ async function tryChunkImport(collection, name, cwd, isWatchMode) {
|
|
|
2245
2334
|
let latestM = 0;
|
|
2246
2335
|
for (const f of matches) {
|
|
2247
2336
|
try {
|
|
2248
|
-
const s = await
|
|
2337
|
+
const s = await stat4(join2(chunkDir, f));
|
|
2249
2338
|
if (s.mtimeMs >= latestM) {
|
|
2250
2339
|
latestM = s.mtimeMs;
|
|
2251
2340
|
latest = f;
|
|
@@ -2302,6 +2391,16 @@ function touchModule(key) {
|
|
|
2302
2391
|
evictLRUModule();
|
|
2303
2392
|
}
|
|
2304
2393
|
}
|
|
2394
|
+
function clearSSRModuleStores() {
|
|
2395
|
+
const g = globalThis;
|
|
2396
|
+
if (g.__REROUTE_SSR_MODULES__) {
|
|
2397
|
+
g.__REROUTE_SSR_MODULES__ = {};
|
|
2398
|
+
}
|
|
2399
|
+
if (g.__REROUTE_SSR_EXPORTS__) {
|
|
2400
|
+
g.__REROUTE_SSR_EXPORTS__ = {};
|
|
2401
|
+
}
|
|
2402
|
+
moduleAccessOrder.length = 0;
|
|
2403
|
+
}
|
|
2305
2404
|
async function seedSSRModuleForPath(pathname, clientDir, cwd, isWatchMode) {
|
|
2306
2405
|
try {
|
|
2307
2406
|
const resolved = resolveContentPathParts(pathname);
|
|
@@ -3286,7 +3385,7 @@ var init_metadata2 = __esm(() => {
|
|
|
3286
3385
|
});
|
|
3287
3386
|
|
|
3288
3387
|
// packages/core/src/ssr/lib/preload.ts
|
|
3289
|
-
import { readdir as readdir6, stat as
|
|
3388
|
+
import { readdir as readdir6, stat as stat5 } from "node:fs/promises";
|
|
3290
3389
|
async function preloadContentModule(pathname, clientDir, cwd, isWatchMode) {
|
|
3291
3390
|
let extraHead = "";
|
|
3292
3391
|
let hydrationScript = "";
|
|
@@ -3320,14 +3419,14 @@ async function isContentCollection(clientDir, collection) {
|
|
|
3320
3419
|
if (isProduction) {
|
|
3321
3420
|
const collectionFile = join2(clientDir, "collections", `${collection}.js`);
|
|
3322
3421
|
try {
|
|
3323
|
-
const s2 = await
|
|
3422
|
+
const s2 = await stat5(collectionFile);
|
|
3324
3423
|
return s2?.isFile() ?? false;
|
|
3325
3424
|
} catch {
|
|
3326
3425
|
return false;
|
|
3327
3426
|
}
|
|
3328
3427
|
}
|
|
3329
3428
|
const maybeDir = join2(clientDir, "routes", collection, "content");
|
|
3330
|
-
const s = await
|
|
3429
|
+
const s = await stat5(maybeDir);
|
|
3331
3430
|
return typeof s?.isDirectory === "function" ? s.isDirectory() : true;
|
|
3332
3431
|
} catch {
|
|
3333
3432
|
return false;
|
|
@@ -3338,7 +3437,7 @@ async function findLatestCandidate(chunkDir, candidates) {
|
|
|
3338
3437
|
let latestM = 0;
|
|
3339
3438
|
for (const candidateName of candidates) {
|
|
3340
3439
|
try {
|
|
3341
|
-
const s = await
|
|
3440
|
+
const s = await stat5(join2(chunkDir, candidateName));
|
|
3342
3441
|
if (s.mtimeMs >= latestM) {
|
|
3343
3442
|
latestM = s.mtimeMs;
|
|
3344
3443
|
latest = candidateName;
|
|
@@ -3524,23 +3623,34 @@ function parseAccessTracking(accessedCollections) {
|
|
|
3524
3623
|
}
|
|
3525
3624
|
return usage;
|
|
3526
3625
|
}
|
|
3527
|
-
function
|
|
3626
|
+
function processCapturedResults(capturedResults, byCollectionForSSR) {
|
|
3528
3627
|
const subset = {};
|
|
3529
3628
|
const partial = {};
|
|
3530
3629
|
try {
|
|
3531
3630
|
const g = globalThis;
|
|
3532
|
-
const ssrResults = g.__REROUTE_SSR_RESULTS__;
|
|
3533
|
-
if (ssrResults
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3631
|
+
const ssrResults = capturedResults ?? g.__REROUTE_SSR_RESULTS__;
|
|
3632
|
+
if (!ssrResults || typeof ssrResults !== "object")
|
|
3633
|
+
return;
|
|
3634
|
+
for (const [collection, items] of Object.entries(ssrResults)) {
|
|
3635
|
+
if (Array.isArray(items) && items.length > 0) {
|
|
3636
|
+
subset[collection] = items;
|
|
3637
|
+
const full = byCollectionForSSR?.[collection] || [];
|
|
3638
|
+
partial[collection] = items.length < full.length;
|
|
3540
3639
|
}
|
|
3541
|
-
return { subset, partial };
|
|
3542
3640
|
}
|
|
3543
|
-
} catch {
|
|
3641
|
+
} catch {
|
|
3642
|
+
return;
|
|
3643
|
+
}
|
|
3644
|
+
if (Object.keys(subset).length === 0)
|
|
3645
|
+
return;
|
|
3646
|
+
return { subset, partial };
|
|
3647
|
+
}
|
|
3648
|
+
function processCollections(accessedCollections, byCollectionForSSR, capturedResults) {
|
|
3649
|
+
const captured = processCapturedResults(capturedResults, byCollectionForSSR);
|
|
3650
|
+
if (captured)
|
|
3651
|
+
return captured;
|
|
3652
|
+
const subset = {};
|
|
3653
|
+
const partial = {};
|
|
3544
3654
|
const sortByDate = (order) => (a, b) => {
|
|
3545
3655
|
const da = a?.meta?.date ? Date.parse(String(a.meta.date)) : 0;
|
|
3546
3656
|
const db = b?.meta?.date ? Date.parse(String(b.meta.date)) : 0;
|
|
@@ -3726,15 +3836,15 @@ var init_scripts = __esm(() => {
|
|
|
3726
3836
|
// packages/core/src/ssr/lib/styles.ts
|
|
3727
3837
|
async function inlineThemeCSS(clientDir, minify = false, isWatchMode = false) {
|
|
3728
3838
|
try {
|
|
3839
|
+
if (isWatchMode) {
|
|
3840
|
+
const timestamp = Date.now();
|
|
3841
|
+
return `<link rel="stylesheet" href="/.reroute/index.css?t=${timestamp}" data-reroute="theme">`;
|
|
3842
|
+
}
|
|
3729
3843
|
const bundledCss = globalThis.__REROUTE_THEME_CSS__;
|
|
3730
3844
|
if (bundledCss) {
|
|
3731
3845
|
const css2 = minify ? minifyCSS(bundledCss) : bundledCss;
|
|
3732
3846
|
return `<style data-reroute="theme">${css2}</style>`;
|
|
3733
3847
|
}
|
|
3734
|
-
if (isWatchMode) {
|
|
3735
|
-
const timestamp = Date.now();
|
|
3736
|
-
return `<link rel="stylesheet" href="/.reroute/index.css?t=${timestamp}" data-reroute="theme">`;
|
|
3737
|
-
}
|
|
3738
3848
|
const candidates = [
|
|
3739
3849
|
join2(clientDir, "..", ".reroute", "index.css"),
|
|
3740
3850
|
join2(clientDir, "..", "..", ".reroute", "index.css"),
|
|
@@ -3829,6 +3939,7 @@ async function performSSRSetupInternal(options, streaming, timeoutState) {
|
|
|
3829
3939
|
});
|
|
3830
3940
|
assertNotTimedOut();
|
|
3831
3941
|
resetSSRAccessTracking();
|
|
3942
|
+
resetSSRContentResults();
|
|
3832
3943
|
const bundlePreload = createBundlePreload(bundleUrl);
|
|
3833
3944
|
const preloadResult = await withSpan("ssr.preload", async (span) => {
|
|
3834
3945
|
span.setAttribute("pathname", pathname);
|
|
@@ -3904,12 +4015,12 @@ async function performSSRSetupInternal(options, streaming, timeoutState) {
|
|
|
3904
4015
|
pending: computeResult.pending
|
|
3905
4016
|
};
|
|
3906
4017
|
}
|
|
3907
|
-
function generateCollectionScripts(byCollectionForSSR) {
|
|
4018
|
+
function generateCollectionScripts(byCollectionForSSR, capturedResults) {
|
|
3908
4019
|
try {
|
|
3909
4020
|
const g = globalThis;
|
|
3910
4021
|
const acc = g.__REROUTE_SSR_ACCESSED__;
|
|
3911
4022
|
if (acc) {
|
|
3912
|
-
const { subset, partial } = processCollections(acc, byCollectionForSSR);
|
|
4023
|
+
const { subset, partial } = processCollections(acc, byCollectionForSSR, capturedResults);
|
|
3913
4024
|
if (Object.keys(subset).length > 0) {
|
|
3914
4025
|
return createCollectionScript(subset, partial);
|
|
3915
4026
|
}
|
|
@@ -4061,13 +4172,16 @@ async function renderSSRDocument(options) {
|
|
|
4061
4172
|
}, false);
|
|
4062
4173
|
const duplicatedData = duplicateQueryParamData(setup2.ssrData);
|
|
4063
4174
|
setGlobalSSRData(duplicatedData);
|
|
4175
|
+
let capturedResults;
|
|
4064
4176
|
const appHtml = await withSpan("ssr.render.react", async (span) => {
|
|
4065
4177
|
const componentWithPathname = cloneElement(rootComponent, {
|
|
4066
4178
|
pathname,
|
|
4067
4179
|
searchParams
|
|
4068
4180
|
});
|
|
4069
4181
|
span.setAttribute("reroute.pathname", pathname);
|
|
4182
|
+
resetSSRContentResults();
|
|
4070
4183
|
const html3 = renderToString(componentWithPathname);
|
|
4184
|
+
capturedResults = takeSSRContentResults();
|
|
4071
4185
|
span.setAttribute("reroute.html.final.size", html3.length);
|
|
4072
4186
|
return html3;
|
|
4073
4187
|
});
|
|
@@ -4076,7 +4190,7 @@ async function renderSSRDocument(options) {
|
|
|
4076
4190
|
span.setAttribute("reroute.template.size", template2.length);
|
|
4077
4191
|
return template2;
|
|
4078
4192
|
});
|
|
4079
|
-
const collectionScripts = generateCollectionScripts(setup2.byCollectionForSSR);
|
|
4193
|
+
const collectionScripts = generateCollectionScripts(setup2.byCollectionForSSR, capturedResults);
|
|
4080
4194
|
const config = await loadConfig(cwd);
|
|
4081
4195
|
const browserTelemetryConfigRaw = config.telemetry?.browser;
|
|
4082
4196
|
const { serializeBrowserTelemetryConfig: serializeBrowserTelemetryConfig2 } = await Promise.resolve().then(() => exports_serialize);
|
|
@@ -4094,7 +4208,7 @@ async function renderSSRDocument(options) {
|
|
|
4094
4208
|
if (setup2.metadataResult.statusOverride !== undefined) {
|
|
4095
4209
|
statusOverride = setup2.metadataResult.statusOverride;
|
|
4096
4210
|
}
|
|
4097
|
-
const extraHead = setup2.bundlePreload + setup2.preloadExtraHead;
|
|
4211
|
+
const extraHead = appendLlmsAlternateHead(setup2.bundlePreload + setup2.preloadExtraHead, pathname, statusOverride || 200, config.llms);
|
|
4098
4212
|
const combinedHead = dedent([
|
|
4099
4213
|
dedent(head) || "",
|
|
4100
4214
|
dedent(extraHead),
|
|
@@ -4124,6 +4238,7 @@ async function renderSSRDocument(options) {
|
|
|
4124
4238
|
var init_render = __esm(() => {
|
|
4125
4239
|
init_server2();
|
|
4126
4240
|
init_config();
|
|
4241
|
+
init_discovery3();
|
|
4127
4242
|
init_lib();
|
|
4128
4243
|
init_html();
|
|
4129
4244
|
});
|
|
@@ -4450,15 +4565,140 @@ var init_extractor = __esm(() => {
|
|
|
4450
4565
|
init_render();
|
|
4451
4566
|
});
|
|
4452
4567
|
|
|
4568
|
+
// packages/core/src/llms/discovery.ts
|
|
4569
|
+
function yesNo(value) {
|
|
4570
|
+
return value === false ? "no" : "yes";
|
|
4571
|
+
}
|
|
4572
|
+
function formatContentSignal(policy, whenUndefined = "omit") {
|
|
4573
|
+
if (policy === false)
|
|
4574
|
+
return;
|
|
4575
|
+
if (policy === undefined && whenUndefined === "omit")
|
|
4576
|
+
return;
|
|
4577
|
+
const resolved = {
|
|
4578
|
+
search: true,
|
|
4579
|
+
aiInput: true,
|
|
4580
|
+
aiTrain: true,
|
|
4581
|
+
...policy
|
|
4582
|
+
};
|
|
4583
|
+
return `ai-train=${yesNo(resolved.aiTrain)}, search=${yesNo(resolved.search)}, ai-input=${yesNo(resolved.aiInput)}`;
|
|
4584
|
+
}
|
|
4585
|
+
function markdownTwinPath(pathname) {
|
|
4586
|
+
const path3 = pathname.split("?")[0];
|
|
4587
|
+
if (path3 === "/" || path3 === "")
|
|
4588
|
+
return "/index.md";
|
|
4589
|
+
return `${path3.replace(/\/$/, "")}.md`;
|
|
4590
|
+
}
|
|
4591
|
+
function shouldAdvertiseMarkdownTwin(pathname, llmsConfig) {
|
|
4592
|
+
if (!llmsConfig?.enabled)
|
|
4593
|
+
return false;
|
|
4594
|
+
if (llmsConfig.enableMarkdownExtension === false)
|
|
4595
|
+
return false;
|
|
4596
|
+
if (shouldExcludeRoute(pathname, llmsConfig.excludeRoutes))
|
|
4597
|
+
return false;
|
|
4598
|
+
return true;
|
|
4599
|
+
}
|
|
4600
|
+
function llmsAlternateLinkTag(pathname, llmsConfig) {
|
|
4601
|
+
if (!shouldAdvertiseMarkdownTwin(pathname, llmsConfig))
|
|
4602
|
+
return "";
|
|
4603
|
+
return `<link rel="alternate" type="text/markdown" href="${markdownTwinPath(pathname)}" />`;
|
|
4604
|
+
}
|
|
4605
|
+
function mergeVary(existing, token) {
|
|
4606
|
+
const parts = (existing ?? "").split(",").map((part) => part.trim()).filter(Boolean);
|
|
4607
|
+
if (!parts.some((part) => part.toLowerCase() === token.toLowerCase())) {
|
|
4608
|
+
parts.push(token);
|
|
4609
|
+
}
|
|
4610
|
+
return parts.join(", ");
|
|
4611
|
+
}
|
|
4612
|
+
function appendLinkValues(existing, values) {
|
|
4613
|
+
const current = (existing ?? "").split(",").map((part) => part.trim()).filter(Boolean);
|
|
4614
|
+
for (const value of values) {
|
|
4615
|
+
if (!current.includes(value))
|
|
4616
|
+
current.push(value);
|
|
4617
|
+
}
|
|
4618
|
+
return current.join(", ");
|
|
4619
|
+
}
|
|
4620
|
+
function buildLlmsDiscovery(pathname, llmsConfig) {
|
|
4621
|
+
if (!llmsConfig?.enabled)
|
|
4622
|
+
return null;
|
|
4623
|
+
const linkValues = [];
|
|
4624
|
+
if (shouldAdvertiseMarkdownTwin(pathname, llmsConfig)) {
|
|
4625
|
+
linkValues.push(`<${markdownTwinPath(pathname)}>; rel="alternate"; type="text/markdown"`);
|
|
4626
|
+
}
|
|
4627
|
+
if (llmsConfig.enableIndex !== false) {
|
|
4628
|
+
linkValues.push('</llms.txt>; rel="llms-txt"');
|
|
4629
|
+
}
|
|
4630
|
+
const contentSignal = formatContentSignal(llmsConfig.contentSignal, "default");
|
|
4631
|
+
const vary = llmsConfig.enableContentNegotiation !== false ? "Accept" : undefined;
|
|
4632
|
+
if (linkValues.length === 0 && !contentSignal && !vary)
|
|
4633
|
+
return null;
|
|
4634
|
+
return { linkValues, contentSignal, vary };
|
|
4635
|
+
}
|
|
4636
|
+
function writeHeader(headers2, canonical, value) {
|
|
4637
|
+
const lower = canonical.toLowerCase();
|
|
4638
|
+
if (headers2[lower] !== undefined)
|
|
4639
|
+
headers2[lower] = value;
|
|
4640
|
+
if (headers2[canonical] !== undefined || headers2[lower] === undefined) {
|
|
4641
|
+
headers2[canonical] = value;
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
function readHeader(headers2, canonical) {
|
|
4645
|
+
return headers2[canonical] ?? headers2[canonical.toLowerCase()];
|
|
4646
|
+
}
|
|
4647
|
+
function applyLlmsDiscoveryHeaders(headers2, pathname, llmsConfig, status = 200) {
|
|
4648
|
+
if (status < 200 || status >= 300)
|
|
4649
|
+
return;
|
|
4650
|
+
const discovery2 = buildLlmsDiscovery(pathname, llmsConfig);
|
|
4651
|
+
if (!discovery2)
|
|
4652
|
+
return;
|
|
4653
|
+
if (discovery2.linkValues.length > 0) {
|
|
4654
|
+
writeHeader(headers2, "Link", appendLinkValues(readHeader(headers2, "Link"), discovery2.linkValues));
|
|
4655
|
+
}
|
|
4656
|
+
if (discovery2.contentSignal) {
|
|
4657
|
+
writeHeader(headers2, "Content-Signal", discovery2.contentSignal);
|
|
4658
|
+
}
|
|
4659
|
+
if (discovery2.vary) {
|
|
4660
|
+
writeHeader(headers2, "Vary", mergeVary(readHeader(headers2, "Vary"), discovery2.vary));
|
|
4661
|
+
}
|
|
4662
|
+
}
|
|
4663
|
+
function appendLlmsAlternateHead(extraHead, pathname, status, llmsConfig) {
|
|
4664
|
+
if (status !== 200)
|
|
4665
|
+
return extraHead;
|
|
4666
|
+
const tag = llmsAlternateLinkTag(pathname, llmsConfig);
|
|
4667
|
+
return tag ? `${extraHead}
|
|
4668
|
+
${tag}` : extraHead;
|
|
4669
|
+
}
|
|
4670
|
+
var init_discovery3 = __esm(() => {
|
|
4671
|
+
init_extractor();
|
|
4672
|
+
});
|
|
4673
|
+
|
|
4453
4674
|
// packages/core/src/llms/index-generator.ts
|
|
4454
4675
|
var exports_index_generator = {};
|
|
4455
4676
|
__export(exports_index_generator, {
|
|
4456
|
-
|
|
4457
|
-
discoverStaticRoutes: () => discoverStaticRoutes,
|
|
4677
|
+
discoverCollectionRoutes: () => discoverCollectionRoutes,
|
|
4458
4678
|
discoverSSRDataRoutes: () => discoverSSRDataRoutes,
|
|
4459
|
-
|
|
4679
|
+
discoverStaticRoutes: () => discoverStaticRoutes,
|
|
4680
|
+
generateLLMsIndex: () => generateLLMsIndex
|
|
4460
4681
|
});
|
|
4461
4682
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
4683
|
+
function oneLine(value) {
|
|
4684
|
+
return value.replace(/\s+/g, " ").trim();
|
|
4685
|
+
}
|
|
4686
|
+
function stringField(record, key) {
|
|
4687
|
+
const value = record?.[key];
|
|
4688
|
+
if (typeof value !== "string")
|
|
4689
|
+
return;
|
|
4690
|
+
const trimmed = oneLine(value);
|
|
4691
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
4692
|
+
}
|
|
4693
|
+
function metaFromUnknown(meta) {
|
|
4694
|
+
if (!meta || typeof meta !== "object")
|
|
4695
|
+
return {};
|
|
4696
|
+
const record = meta;
|
|
4697
|
+
return {
|
|
4698
|
+
title: stringField(record, "title") ?? stringField(record, "name"),
|
|
4699
|
+
description: stringField(record, "description") ?? stringField(record, "excerpt")
|
|
4700
|
+
};
|
|
4701
|
+
}
|
|
4462
4702
|
async function discoverStaticRoutes(cwd, isWatchMode) {
|
|
4463
4703
|
const routes = [];
|
|
4464
4704
|
try {
|
|
@@ -4475,8 +4715,11 @@ async function discoverStaticRoutes(cwd, isWatchMode) {
|
|
|
4475
4715
|
if (pattern.includes("[404]") || pattern.includes("[layout]") || pattern.includes("[skeleton]") || pattern.includes(":")) {
|
|
4476
4716
|
continue;
|
|
4477
4717
|
}
|
|
4718
|
+
const { title, description } = metaFromUnknown(route?.meta);
|
|
4478
4719
|
routes.push({
|
|
4479
|
-
path: pattern
|
|
4720
|
+
path: pattern,
|
|
4721
|
+
title,
|
|
4722
|
+
description
|
|
4480
4723
|
});
|
|
4481
4724
|
}
|
|
4482
4725
|
}
|
|
@@ -4499,11 +4742,13 @@ function createRouteEntriesFromItems(items, collection) {
|
|
|
4499
4742
|
for (const item of items) {
|
|
4500
4743
|
const href = String(item.href || "");
|
|
4501
4744
|
if (href) {
|
|
4502
|
-
const
|
|
4745
|
+
const fromMeta = metaFromUnknown(item.meta);
|
|
4746
|
+
const title = fromMeta.title || (typeof item.name === "string" ? item.name : undefined);
|
|
4503
4747
|
routes.push({
|
|
4504
4748
|
path: href,
|
|
4505
4749
|
section: collection,
|
|
4506
|
-
title
|
|
4750
|
+
title,
|
|
4751
|
+
description: fromMeta.description
|
|
4507
4752
|
});
|
|
4508
4753
|
}
|
|
4509
4754
|
}
|
|
@@ -4569,9 +4814,13 @@ function createEntriesFromArray(array, routePath) {
|
|
|
4569
4814
|
continue;
|
|
4570
4815
|
const identifier = extractIdentifier(item);
|
|
4571
4816
|
if (identifier) {
|
|
4817
|
+
const fromItem = metaFromUnknown(item);
|
|
4818
|
+
const fromMeta = metaFromUnknown(item.meta);
|
|
4572
4819
|
entries.push({
|
|
4573
4820
|
path: `${routePath}/${identifier}`,
|
|
4574
|
-
section: routePath.split("/").filter(Boolean)[0]
|
|
4821
|
+
section: routePath.split("/").filter(Boolean)[0],
|
|
4822
|
+
title: fromItem.title ?? fromMeta.title,
|
|
4823
|
+
description: fromItem.description ?? fromMeta.description
|
|
4575
4824
|
});
|
|
4576
4825
|
}
|
|
4577
4826
|
}
|
|
@@ -4677,13 +4926,21 @@ function formatRouteUrl(routePath, baseUrl) {
|
|
|
4677
4926
|
function getRouteTitle(route) {
|
|
4678
4927
|
return route.title || (route.path === "/" ? "Home" : route.path.split("/").pop() || "Page");
|
|
4679
4928
|
}
|
|
4680
|
-
function
|
|
4681
|
-
|
|
4929
|
+
function formatIndexLine(route, url, summaries) {
|
|
4930
|
+
const link = `- [${getRouteTitle(route)}](${url})`;
|
|
4931
|
+
if (!(summaries && route.description))
|
|
4932
|
+
return link;
|
|
4933
|
+
return `${link}: ${route.description}`;
|
|
4934
|
+
}
|
|
4935
|
+
function summariesEnabled(llmsConfig) {
|
|
4936
|
+
return llmsConfig?.indexSummaries !== false;
|
|
4937
|
+
}
|
|
4938
|
+
function addRootRoutes(parts, rootRoutes, baseUrl, isScoped, llmsConfig) {
|
|
4939
|
+
if (isScoped || rootRoutes.length === 0)
|
|
4682
4940
|
return;
|
|
4941
|
+
const summaries = summariesEnabled(llmsConfig);
|
|
4683
4942
|
for (const route of rootRoutes) {
|
|
4684
|
-
|
|
4685
|
-
const url = formatRouteUrl(route.path, baseUrl);
|
|
4686
|
-
parts.push(`- [${title}](${url})`);
|
|
4943
|
+
parts.push(formatIndexLine(route, formatRouteUrl(route.path, baseUrl), summaries));
|
|
4687
4944
|
}
|
|
4688
4945
|
parts.push("");
|
|
4689
4946
|
}
|
|
@@ -4694,19 +4951,18 @@ function addCollectionSection(parts, collection, routes, baseUrl, llmsConfig) {
|
|
|
4694
4951
|
const sectionName = collection.charAt(0).toUpperCase() + collection.slice(1);
|
|
4695
4952
|
parts.push(`## ${sectionName}`);
|
|
4696
4953
|
parts.push("");
|
|
4954
|
+
const summaries = summariesEnabled(llmsConfig);
|
|
4697
4955
|
for (const route of filteredRoutes) {
|
|
4698
|
-
|
|
4699
|
-
const url = `${baseUrl}${route.path}.txt`;
|
|
4700
|
-
parts.push(`- [${title}](${url})`);
|
|
4956
|
+
parts.push(formatIndexLine(route, `${baseUrl}${route.path}.txt`, summaries));
|
|
4701
4957
|
}
|
|
4702
4958
|
parts.push("");
|
|
4703
4959
|
}
|
|
4704
|
-
function shouldIncludeSection(section,
|
|
4705
|
-
return !
|
|
4960
|
+
function shouldIncludeSection(section, isScoped, targetCollection) {
|
|
4961
|
+
return !isScoped || section === targetCollection;
|
|
4706
4962
|
}
|
|
4707
|
-
function addSSRDataSection(parts, routePattern, routes, baseUrl,
|
|
4963
|
+
function addSSRDataSection(parts, routePattern, routes, baseUrl, isScoped, targetCollection, llmsConfig) {
|
|
4708
4964
|
const routeSection = routePattern.split("/").filter(Boolean)[0];
|
|
4709
|
-
if (!shouldIncludeSection(routeSection,
|
|
4965
|
+
if (!shouldIncludeSection(routeSection, isScoped, targetCollection)) {
|
|
4710
4966
|
return;
|
|
4711
4967
|
}
|
|
4712
4968
|
const filteredRoutes = routes.filter((r) => !shouldExcludeRoute(r.path, llmsConfig?.excludeRoutes));
|
|
@@ -4715,15 +4971,14 @@ function addSSRDataSection(parts, routePattern, routes, baseUrl, isSingleCollect
|
|
|
4715
4971
|
const sectionName = routeSection?.charAt(0).toUpperCase() + routeSection?.slice(1) || "Content";
|
|
4716
4972
|
parts.push(`## ${sectionName}`);
|
|
4717
4973
|
parts.push("");
|
|
4974
|
+
const summaries = summariesEnabled(llmsConfig);
|
|
4718
4975
|
for (const route of filteredRoutes) {
|
|
4719
|
-
|
|
4720
|
-
const url = `${baseUrl}${route.path}.txt`;
|
|
4721
|
-
parts.push(`- [${title}](${url})`);
|
|
4976
|
+
parts.push(formatIndexLine(route, `${baseUrl}${route.path}.txt`, summaries));
|
|
4722
4977
|
}
|
|
4723
4978
|
parts.push("");
|
|
4724
4979
|
}
|
|
4725
|
-
function addStaticSection(parts, section, routes, baseUrl,
|
|
4726
|
-
if (!shouldIncludeSection(section,
|
|
4980
|
+
function addStaticSection(parts, section, routes, baseUrl, isScoped, targetCollection, collectionsMap, llmsConfig) {
|
|
4981
|
+
if (!shouldIncludeSection(section, isScoped, targetCollection)) {
|
|
4727
4982
|
return;
|
|
4728
4983
|
}
|
|
4729
4984
|
const filteredRoutes = routes.filter((r) => !shouldExcludeRoute(r.path, llmsConfig?.excludeRoutes));
|
|
@@ -4732,24 +4987,23 @@ function addStaticSection(parts, section, routes, baseUrl, isSingleCollection, t
|
|
|
4732
4987
|
const sectionName = section.charAt(0).toUpperCase() + section.slice(1);
|
|
4733
4988
|
parts.push(`## ${sectionName}`);
|
|
4734
4989
|
parts.push("");
|
|
4990
|
+
const summaries = summariesEnabled(llmsConfig);
|
|
4735
4991
|
for (const route of filteredRoutes) {
|
|
4736
|
-
|
|
4737
|
-
const url = `${baseUrl}${route.path}.txt`;
|
|
4738
|
-
parts.push(`- [${title}](${url})`);
|
|
4992
|
+
parts.push(formatIndexLine(route, `${baseUrl}${route.path}.txt`, summaries));
|
|
4739
4993
|
}
|
|
4740
4994
|
parts.push("");
|
|
4741
4995
|
}
|
|
4742
4996
|
async function generateLLMsIndex(options) {
|
|
4743
4997
|
const { cwd, collections: collections2, baseUrl, isWatchMode, llmsConfig } = options;
|
|
4998
|
+
const targetCollection = options.targetCollection ?? null;
|
|
4999
|
+
const isScoped = targetCollection !== null;
|
|
4744
5000
|
const parts = [];
|
|
4745
5001
|
addIndexHeader(parts, llmsConfig);
|
|
4746
5002
|
const staticRoutes = await discoverStaticRoutes(cwd, isWatchMode);
|
|
4747
5003
|
const collectionsMap = await discoverCollectionRoutes(cwd, collections2, isWatchMode, llmsConfig);
|
|
4748
5004
|
const ssrDataRoutes = await discoverSSRDataRoutes(cwd, staticRoutes, isWatchMode);
|
|
4749
|
-
const isSingleCollection = collections2.length === 1;
|
|
4750
|
-
const targetCollection = isSingleCollection ? collections2[0] : null;
|
|
4751
5005
|
const { sections, rootRoutes } = groupStaticRoutes(staticRoutes, llmsConfig);
|
|
4752
|
-
addRootRoutes(parts, rootRoutes, baseUrl,
|
|
5006
|
+
addRootRoutes(parts, rootRoutes, baseUrl, isScoped, llmsConfig);
|
|
4753
5007
|
for (const [collection, routes] of collectionsMap.entries()) {
|
|
4754
5008
|
if (routes.length > 0) {
|
|
4755
5009
|
addCollectionSection(parts, collection, routes, baseUrl, llmsConfig);
|
|
@@ -4757,12 +5011,12 @@ async function generateLLMsIndex(options) {
|
|
|
4757
5011
|
}
|
|
4758
5012
|
for (const [routePattern, routes] of ssrDataRoutes.entries()) {
|
|
4759
5013
|
if (routes.length > 0) {
|
|
4760
|
-
addSSRDataSection(parts, routePattern, routes, baseUrl,
|
|
5014
|
+
addSSRDataSection(parts, routePattern, routes, baseUrl, isScoped, targetCollection, llmsConfig);
|
|
4761
5015
|
}
|
|
4762
5016
|
}
|
|
4763
5017
|
for (const [section, routes] of sections.entries()) {
|
|
4764
5018
|
if (routes.length > 0) {
|
|
4765
|
-
addStaticSection(parts, section, routes, baseUrl,
|
|
5019
|
+
addStaticSection(parts, section, routes, baseUrl, isScoped, targetCollection, collectionsMap, llmsConfig);
|
|
4766
5020
|
}
|
|
4767
5021
|
}
|
|
4768
5022
|
parts.push("---");
|
|
@@ -4825,6 +5079,9 @@ async function discoverAllRoutes(cwd, collections2, isWatchMode, llmsConfig) {
|
|
|
4825
5079
|
}
|
|
4826
5080
|
return allRoutes;
|
|
4827
5081
|
}
|
|
5082
|
+
function routeBelongsToCollection(path3, collection) {
|
|
5083
|
+
return path3 === `/${collection}` || path3.startsWith(`/${collection}/`);
|
|
5084
|
+
}
|
|
4828
5085
|
function formatContentBlock(content, routePath, baseUrl) {
|
|
4829
5086
|
const parts = [];
|
|
4830
5087
|
const lines = content.split(`
|
|
@@ -4894,7 +5151,9 @@ function buildFooter(parts) {
|
|
|
4894
5151
|
async function generateLLMsFullContent(options) {
|
|
4895
5152
|
const { cwd, collections: collections2, baseUrl, isWatchMode, llmsConfig } = options;
|
|
4896
5153
|
const parts = buildHeader(baseUrl, llmsConfig);
|
|
4897
|
-
const
|
|
5154
|
+
const discovered = await discoverAllRoutes(cwd, collections2, isWatchMode, llmsConfig);
|
|
5155
|
+
const targetCollection = options.targetCollection;
|
|
5156
|
+
const allRoutes = targetCollection ? discovered.filter((route) => routeBelongsToCollection(route.path, targetCollection)) : discovered;
|
|
4898
5157
|
const maxItems = llmsConfig?.maxItems || 1e4;
|
|
4899
5158
|
const routesToProcess = allRoutes.slice(0, maxItems);
|
|
4900
5159
|
const extracted = await extractRouteContents(routesToProcess, options);
|
|
@@ -4914,6 +5173,7 @@ var init_full_generator = __esm(() => {
|
|
|
4914
5173
|
|
|
4915
5174
|
// packages/core/src/llms/index.ts
|
|
4916
5175
|
var init_llms = __esm(() => {
|
|
5176
|
+
init_discovery3();
|
|
4917
5177
|
init_extractor();
|
|
4918
5178
|
init_full_generator();
|
|
4919
5179
|
init_index_generator();
|
|
@@ -5080,7 +5340,7 @@ async function discoverRobotsData(cwd, isWatchMode, robotsConfig, sitemapConfig,
|
|
|
5080
5340
|
redirectSourcePaths
|
|
5081
5341
|
};
|
|
5082
5342
|
}
|
|
5083
|
-
var
|
|
5343
|
+
var init_discovery4 = () => {};
|
|
5084
5344
|
|
|
5085
5345
|
// packages/core/src/robots/generator.ts
|
|
5086
5346
|
function getEffectivePolicies(policies) {
|
|
@@ -5093,10 +5353,13 @@ function getEffectivePolicies(policies) {
|
|
|
5093
5353
|
}
|
|
5094
5354
|
];
|
|
5095
5355
|
}
|
|
5356
|
+
function robotsDisallowPath(path3) {
|
|
5357
|
+
return path3 === "/" ? "/$" : path3;
|
|
5358
|
+
}
|
|
5096
5359
|
function getAutoDisallows(discovery2) {
|
|
5097
5360
|
return new Set([
|
|
5098
|
-
...discovery2.sitemapExcludedRoutes,
|
|
5099
|
-
...discovery2.redirectSourcePaths
|
|
5361
|
+
...discovery2.sitemapExcludedRoutes.map(robotsDisallowPath),
|
|
5362
|
+
...discovery2.redirectSourcePaths.map(robotsDisallowPath)
|
|
5100
5363
|
]);
|
|
5101
5364
|
}
|
|
5102
5365
|
function addAllowDirectives(lines, policy) {
|
|
@@ -5123,8 +5386,16 @@ function addDisallowDirectives(lines, policy, autoDisallows) {
|
|
|
5123
5386
|
}
|
|
5124
5387
|
}
|
|
5125
5388
|
}
|
|
5126
|
-
function
|
|
5389
|
+
function addContentSignalLine(lines, policy, robotsConfig) {
|
|
5390
|
+
if (policy.userAgent !== "*")
|
|
5391
|
+
return;
|
|
5392
|
+
const value = formatContentSignal(robotsConfig.contentSignal);
|
|
5393
|
+
if (value)
|
|
5394
|
+
lines.push(`Content-Signal: ${value}`);
|
|
5395
|
+
}
|
|
5396
|
+
function addPolicyBlock(lines, policy, autoDisallows, robotsConfig) {
|
|
5127
5397
|
lines.push(`User-agent: ${policy.userAgent}`);
|
|
5398
|
+
addContentSignalLine(lines, policy, robotsConfig);
|
|
5128
5399
|
addAllowDirectives(lines, policy);
|
|
5129
5400
|
addDisallowDirectives(lines, policy, autoDisallows);
|
|
5130
5401
|
if (policy.crawlDelay !== undefined) {
|
|
@@ -5150,7 +5421,7 @@ function generateRobots(discovery2, robotsConfig, sitemapEnabled) {
|
|
|
5150
5421
|
const effectivePolicies = getEffectivePolicies(policies);
|
|
5151
5422
|
const autoDisallows = getAutoDisallows(discovery2);
|
|
5152
5423
|
for (const policy of effectivePolicies) {
|
|
5153
|
-
addPolicyBlock(lines, policy, autoDisallows);
|
|
5424
|
+
addPolicyBlock(lines, policy, autoDisallows, robotsConfig);
|
|
5154
5425
|
}
|
|
5155
5426
|
addGlobalCrawlDelay(lines, crawlDelay, effectivePolicies);
|
|
5156
5427
|
if (customRules) {
|
|
@@ -5162,6 +5433,9 @@ function generateRobots(discovery2, robotsConfig, sitemapEnabled) {
|
|
|
5162
5433
|
`).trim()}
|
|
5163
5434
|
`;
|
|
5164
5435
|
}
|
|
5436
|
+
var init_generator = __esm(() => {
|
|
5437
|
+
init_discovery3();
|
|
5438
|
+
});
|
|
5165
5439
|
|
|
5166
5440
|
// packages/core/src/robots/policies.ts
|
|
5167
5441
|
function blockAICrawlers(crawlers) {
|
|
@@ -5232,17 +5506,20 @@ var init_policies = __esm(() => {
|
|
|
5232
5506
|
|
|
5233
5507
|
// packages/core/src/robots/index.ts
|
|
5234
5508
|
var init_robots = __esm(() => {
|
|
5235
|
-
|
|
5509
|
+
init_discovery4();
|
|
5510
|
+
init_generator();
|
|
5236
5511
|
init_policies();
|
|
5237
5512
|
});
|
|
5238
5513
|
|
|
5239
5514
|
// packages/core/src/sitemap/discovery.ts
|
|
5240
5515
|
var exports_discovery = {};
|
|
5241
5516
|
__export(exports_discovery, {
|
|
5242
|
-
|
|
5243
|
-
|
|
5517
|
+
buildSitemapLoc: () => buildSitemapLoc,
|
|
5518
|
+
discoverCollectionContent: () => discoverCollectionContent,
|
|
5519
|
+
discoverDynamicSitemapRoutes: () => discoverDynamicSitemapRoutes,
|
|
5244
5520
|
discoverRoutes: () => discoverRoutes,
|
|
5245
|
-
|
|
5521
|
+
discoverSSRDataRoutes: () => discoverSSRDataRoutes2,
|
|
5522
|
+
discoverSitemapData: () => discoverSitemapData
|
|
5246
5523
|
});
|
|
5247
5524
|
async function loadRoutesModule2(cwd, isWatchMode) {
|
|
5248
5525
|
let routes = globalThis.__REROUTE_ROUTES__;
|
|
@@ -5506,7 +5783,7 @@ function extractIdentifierFromItem(item, routePattern, sitemapConfig) {
|
|
|
5506
5783
|
console.warn("[reroute/sitemap] extractUrl failed:", error);
|
|
5507
5784
|
}
|
|
5508
5785
|
}
|
|
5509
|
-
const identifier = item.version || item.slug || item.id || item.name || item.key;
|
|
5786
|
+
const identifier = item.version || item.slug || item.id || item.name || item.key || item.username;
|
|
5510
5787
|
return identifier ? identifier : null;
|
|
5511
5788
|
}
|
|
5512
5789
|
function extractLastmodFromItem(item, sitemapConfig) {
|
|
@@ -5531,14 +5808,41 @@ function extractLastmodFromItem(item, sitemapConfig) {
|
|
|
5531
5808
|
}
|
|
5532
5809
|
return;
|
|
5533
5810
|
}
|
|
5811
|
+
function buildSitemapLoc(baseUrl, routePattern, identifier) {
|
|
5812
|
+
const base = baseUrl.replace(/\/$/, "");
|
|
5813
|
+
const dynamicParams = routePattern.match(/:[^/]+/g) ?? [];
|
|
5814
|
+
if (dynamicParams.length === 0) {
|
|
5815
|
+
return `${base}${routePattern}/${identifier}`;
|
|
5816
|
+
}
|
|
5817
|
+
if (identifier.startsWith("/")) {
|
|
5818
|
+
return `${base}${identifier}`;
|
|
5819
|
+
}
|
|
5820
|
+
if (dynamicParams.length === 1) {
|
|
5821
|
+
return `${base}${routePattern.replace(/:[^/]+/, identifier)}`;
|
|
5822
|
+
}
|
|
5823
|
+
return `${base}${routePattern.replace(/:[^/]+/, identifier)}`;
|
|
5824
|
+
}
|
|
5825
|
+
function resolveItemLoc(item, baseUrl, routePattern, identifier) {
|
|
5826
|
+
if (typeof item.loc === "string") {
|
|
5827
|
+
if (item.loc.startsWith("http://") || item.loc.startsWith("https://")) {
|
|
5828
|
+
return item.loc;
|
|
5829
|
+
}
|
|
5830
|
+
if (item.loc.startsWith("/")) {
|
|
5831
|
+
return `${baseUrl.replace(/\/$/, "")}${item.loc}`;
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
if (typeof item.href === "string" && item.href.startsWith("/")) {
|
|
5835
|
+
return `${baseUrl.replace(/\/$/, "")}${item.href}`;
|
|
5836
|
+
}
|
|
5837
|
+
return buildSitemapLoc(baseUrl, routePattern, identifier);
|
|
5838
|
+
}
|
|
5534
5839
|
function createEntryFromItem(item, routePattern, baseUrl, sitemapConfig) {
|
|
5535
5840
|
const identifier = extractIdentifierFromItem(item, routePattern, sitemapConfig);
|
|
5536
5841
|
if (!identifier) {
|
|
5537
5842
|
return null;
|
|
5538
5843
|
}
|
|
5539
|
-
const url = `${baseUrl}${routePattern}/${identifier}`;
|
|
5540
5844
|
const entry = {
|
|
5541
|
-
loc:
|
|
5845
|
+
loc: resolveItemLoc(item, baseUrl, routePattern, identifier),
|
|
5542
5846
|
changefreq: sitemapConfig?.changefreq || "weekly",
|
|
5543
5847
|
priority: sitemapConfig?.priority !== undefined ? sitemapConfig.priority : 0.6
|
|
5544
5848
|
};
|
|
@@ -5548,6 +5852,50 @@ function createEntryFromItem(item, routePattern, baseUrl, sitemapConfig) {
|
|
|
5548
5852
|
}
|
|
5549
5853
|
return entry;
|
|
5550
5854
|
}
|
|
5855
|
+
async function loadRouteSitemapFn(cwd, route, isWatchMode) {
|
|
5856
|
+
const bundledRoutes = globalThis.__REROUTE_ROUTES__;
|
|
5857
|
+
if (bundledRoutes && Array.isArray(bundledRoutes)) {
|
|
5858
|
+
const bundledRoute = bundledRoutes.find((r) => r?.pattern === route.pattern);
|
|
5859
|
+
const sitemapFn = bundledRoute?.ssr?.sitemap;
|
|
5860
|
+
return typeof sitemapFn === "function" ? sitemapFn : null;
|
|
5861
|
+
}
|
|
5862
|
+
try {
|
|
5863
|
+
const routeModulePath = join2(cwd, "src", "client", "routes", route.path);
|
|
5864
|
+
const mod = await import(Bun.pathToFileURL(routeModulePath).href + (isWatchMode ? `?t=${Date.now()}` : ""));
|
|
5865
|
+
const sitemapFn = mod?.ssr?.sitemap;
|
|
5866
|
+
return typeof sitemapFn === "function" ? sitemapFn : null;
|
|
5867
|
+
} catch {
|
|
5868
|
+
return null;
|
|
5869
|
+
}
|
|
5870
|
+
}
|
|
5871
|
+
async function discoverDynamicSitemapRoutes(cwd, dynamicRoutes, isWatchMode, baseUrl, sitemapConfig) {
|
|
5872
|
+
const sitemapRoutes = new Map;
|
|
5873
|
+
const routePromises = dynamicRoutes.map(async (route) => {
|
|
5874
|
+
if (sitemapConfig?.excludeDiscovery?.some((excluded) => route.pattern.startsWith(excluded))) {
|
|
5875
|
+
return null;
|
|
5876
|
+
}
|
|
5877
|
+
const sitemapFn = await loadRouteSitemapFn(cwd, route, isWatchMode);
|
|
5878
|
+
if (!sitemapFn)
|
|
5879
|
+
return null;
|
|
5880
|
+
try {
|
|
5881
|
+
const result = await sitemapFn();
|
|
5882
|
+
const entries = extractEntriesFromData(result, route.pattern, baseUrl, sitemapConfig);
|
|
5883
|
+
if (entries.length > 0) {
|
|
5884
|
+
return { pattern: route.pattern, entries };
|
|
5885
|
+
}
|
|
5886
|
+
} catch (error) {
|
|
5887
|
+
console.warn(`[reroute/sitemap] ssr.sitemap failed for ${route.pattern}:`, error);
|
|
5888
|
+
}
|
|
5889
|
+
return null;
|
|
5890
|
+
});
|
|
5891
|
+
const results = await Promise.all(routePromises);
|
|
5892
|
+
for (const result of results) {
|
|
5893
|
+
if (result) {
|
|
5894
|
+
sitemapRoutes.set(result.pattern, result.entries);
|
|
5895
|
+
}
|
|
5896
|
+
}
|
|
5897
|
+
return sitemapRoutes;
|
|
5898
|
+
}
|
|
5551
5899
|
async function discoverSitemapData(cwd, collections2, baseUrl, isWatchMode, sitemapConfig) {
|
|
5552
5900
|
const { staticRoutes, dynamicRoutes } = await discoverRoutes(cwd, isWatchMode);
|
|
5553
5901
|
const collectionsMap = new Map;
|
|
@@ -5558,6 +5906,10 @@ async function discoverSitemapData(cwd, collections2, baseUrl, isWatchMode, site
|
|
|
5558
5906
|
}
|
|
5559
5907
|
}
|
|
5560
5908
|
const ssrDataRoutes = await discoverSSRDataRoutes2(cwd, staticRoutes, isWatchMode, baseUrl, sitemapConfig);
|
|
5909
|
+
const dynamicSitemapRoutes = await discoverDynamicSitemapRoutes(cwd, dynamicRoutes, isWatchMode, baseUrl, sitemapConfig);
|
|
5910
|
+
for (const [pattern, entries] of dynamicSitemapRoutes.entries()) {
|
|
5911
|
+
ssrDataRoutes.set(pattern, entries);
|
|
5912
|
+
}
|
|
5561
5913
|
return {
|
|
5562
5914
|
staticRoutes,
|
|
5563
5915
|
dynamicRoutes,
|
|
@@ -5565,7 +5917,7 @@ async function discoverSitemapData(cwd, collections2, baseUrl, isWatchMode, site
|
|
|
5565
5917
|
ssrDataRoutes
|
|
5566
5918
|
};
|
|
5567
5919
|
}
|
|
5568
|
-
var
|
|
5920
|
+
var init_discovery5 = () => {};
|
|
5569
5921
|
|
|
5570
5922
|
// packages/core/src/rss/discovery.ts
|
|
5571
5923
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
@@ -5833,7 +6185,7 @@ async function discoverRSSData(cwd, collections2, baseUrl, isWatchMode, rssConfi
|
|
|
5833
6185
|
}
|
|
5834
6186
|
const ssrDataFeeds = new Map;
|
|
5835
6187
|
const bundledRoutes = globalThis.__REROUTE_ROUTES__;
|
|
5836
|
-
const { discoverRoutes: discoverRoutes2 } = await Promise.resolve().then(() => (
|
|
6188
|
+
const { discoverRoutes: discoverRoutes2 } = await Promise.resolve().then(() => (init_discovery5(), exports_discovery));
|
|
5837
6189
|
const { staticRoutes } = await discoverRoutes2(cwd, isWatchMode);
|
|
5838
6190
|
if (bundledRoutes && Array.isArray(bundledRoutes)) {
|
|
5839
6191
|
const routePromises = staticRoutes.map(async (route) => {
|
|
@@ -5890,7 +6242,7 @@ async function discoverRSSData(cwd, collections2, baseUrl, isWatchMode, rssConfi
|
|
|
5890
6242
|
ssrDataFeeds
|
|
5891
6243
|
};
|
|
5892
6244
|
}
|
|
5893
|
-
var
|
|
6245
|
+
var init_discovery6 = () => {};
|
|
5894
6246
|
|
|
5895
6247
|
// packages/core/src/rss/generator.ts
|
|
5896
6248
|
function generateRSSXML(feed, options = {}) {
|
|
@@ -6003,7 +6355,7 @@ function escapeXml(unsafe) {
|
|
|
6003
6355
|
|
|
6004
6356
|
// packages/core/src/rss/index.ts
|
|
6005
6357
|
var init_rss = __esm(() => {
|
|
6006
|
-
|
|
6358
|
+
init_discovery6();
|
|
6007
6359
|
});
|
|
6008
6360
|
|
|
6009
6361
|
// packages/core/src/sitemap/generator.ts
|
|
@@ -6148,12 +6500,12 @@ function escapeXml2(unsafe) {
|
|
|
6148
6500
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
6149
6501
|
}
|
|
6150
6502
|
var DEFAULT_MAX_URLS = 50000;
|
|
6151
|
-
var
|
|
6503
|
+
var init_generator2 = () => {};
|
|
6152
6504
|
|
|
6153
6505
|
// packages/core/src/sitemap/index.ts
|
|
6154
6506
|
var init_sitemap = __esm(() => {
|
|
6155
|
-
|
|
6156
|
-
|
|
6507
|
+
init_discovery5();
|
|
6508
|
+
init_generator2();
|
|
6157
6509
|
});
|
|
6158
6510
|
|
|
6159
6511
|
// packages/core/src/ssr/stream.ts
|
|
@@ -6231,15 +6583,16 @@ async function renderSSRDocumentStream(options) {
|
|
|
6231
6583
|
const newAttrs = hasLang ? attrs.replace(/lang\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/i, `lang="${pageLang}"`) : `${attrs} lang="${pageLang}"`;
|
|
6232
6584
|
return `<html${newAttrs}>`;
|
|
6233
6585
|
});
|
|
6234
|
-
const
|
|
6235
|
-
if (/<title[\s\S]*?<\/title>/i.test(
|
|
6586
|
+
const extraHeadBase = setup2.bundlePreload + setup2.preloadExtraHead + setup2.metadataResult.perPageHead;
|
|
6587
|
+
if (/<title[\s\S]*?<\/title>/i.test(extraHeadBase)) {
|
|
6236
6588
|
headWithLang = headWithLang.replace(/<title[\s\S]*?<\/title>/i, "");
|
|
6237
6589
|
}
|
|
6238
|
-
if (/<meta\s+name\s*=\s*['"]description['"][^>]*>/i.test(
|
|
6590
|
+
if (/<meta\s+name\s*=\s*['"]description['"][^>]*>/i.test(extraHeadBase)) {
|
|
6239
6591
|
headWithLang = headWithLang.replace(/<meta\s+name\s*=\s*['"]description['"][^>]*>/i, "");
|
|
6240
6592
|
}
|
|
6241
|
-
headWithLang = removeOverriddenMetaTags(headWithLang,
|
|
6593
|
+
headWithLang = removeOverriddenMetaTags(headWithLang, extraHeadBase);
|
|
6242
6594
|
const config = await loadConfig(cwd);
|
|
6595
|
+
const extraHead = appendLlmsAlternateHead(extraHeadBase, pathname, statusOverride || 200, config.llms);
|
|
6243
6596
|
const browserTelemetryConfigRaw = config.telemetry?.browser;
|
|
6244
6597
|
const { serializeBrowserTelemetryConfig: serializeBrowserTelemetryConfig2 } = await Promise.resolve().then(() => exports_serialize);
|
|
6245
6598
|
const browserTelemetryConfig = serializeBrowserTelemetryConfig2(browserTelemetryConfigRaw);
|
|
@@ -6497,6 +6850,7 @@ function unescapeHtmlEntities(str) {
|
|
|
6497
6850
|
var init_stream = __esm(() => {
|
|
6498
6851
|
init_server2();
|
|
6499
6852
|
init_config();
|
|
6853
|
+
init_discovery3();
|
|
6500
6854
|
init_lib();
|
|
6501
6855
|
init_html();
|
|
6502
6856
|
init_imports();
|
|
@@ -6526,137 +6880,151 @@ var init_src = __esm(() => {
|
|
|
6526
6880
|
// packages/core/index.ts
|
|
6527
6881
|
var exports_core = {};
|
|
6528
6882
|
__export(exports_core, {
|
|
6529
|
-
|
|
6530
|
-
toOgLocale: () => toOgLocale,
|
|
6531
|
-
toBytes: () => toBytes,
|
|
6532
|
-
stripStart: () => stripStart,
|
|
6533
|
-
stripHtmlTags: () => stripHtmlTags,
|
|
6534
|
-
stripEnd: () => stripEnd,
|
|
6535
|
-
statusCache: () => statusCache,
|
|
6536
|
-
ssrCache: () => ssrCache,
|
|
6537
|
-
splitTemplate: () => splitTemplate,
|
|
6538
|
-
shouldExcludeRoute: () => shouldExcludeRoute,
|
|
6539
|
-
setGlobalSSRData: () => setGlobalSSRData,
|
|
6540
|
-
setGlobalCollections: () => setGlobalCollections,
|
|
6541
|
-
seedSSRModuleForPath: () => seedSSRModuleForPath,
|
|
6542
|
-
resolveLocale: () => resolveLocale,
|
|
6543
|
-
resetSSRAccessTracking: () => resetSSRAccessTracking,
|
|
6544
|
-
renderSSRDocumentStream: () => renderSSRDocumentStream,
|
|
6545
|
-
renderSSRDocument: () => renderSSRDocument,
|
|
6546
|
-
renderOGImageToPNG: () => renderOGImageToPNG,
|
|
6547
|
-
removeOverriddenMetaTags: () => removeOverriddenMetaTags,
|
|
6548
|
-
processCollections: () => processCollections,
|
|
6549
|
-
preloadContentModule: () => preloadContentModule,
|
|
6550
|
-
performSSRSetup: () => performSSRSetup,
|
|
6551
|
-
parseCookieValue: () => parseCookieValue,
|
|
6552
|
-
parseContentPath: () => parseContentPath,
|
|
6553
|
-
normalizePathname: () => normalizePathname,
|
|
6554
|
-
negotiateLocale: () => negotiateLocale,
|
|
6555
|
-
mergeLayoutData: () => mergeLayoutData,
|
|
6556
|
-
matchRoutes: () => matchRoutes,
|
|
6557
|
-
matchRoutePattern: () => matchRoutePattern,
|
|
6558
|
-
lookupMessage: () => lookupMessage,
|
|
6559
|
-
looksLikeLocale: () => looksLikeLocale,
|
|
6560
|
-
localizeHref: () => localizeHref,
|
|
6561
|
-
localizeContentHref: () => localizeContentHref,
|
|
6562
|
-
loadRoutesModule: () => loadRoutesModule,
|
|
6563
|
-
loadOGImageComponent: () => loadOGImageComponent,
|
|
6564
|
-
loadIndexHtml: () => loadIndexHtml,
|
|
6565
|
-
loadConfig: () => loadConfig,
|
|
6566
|
-
loadCollections: () => loadCollections,
|
|
6567
|
-
listContentFiles: () => listContentFiles,
|
|
6568
|
-
join: () => join2,
|
|
6569
|
-
isThenable: () => isThenable,
|
|
6570
|
-
isCompressible: () => isCompressible,
|
|
6571
|
-
inlineThemeCSS: () => inlineThemeCSS,
|
|
6572
|
-
importContentModuleForPath: () => importContentModuleForPath,
|
|
6573
|
-
htmlToMarkdown: () => htmlToMarkdown,
|
|
6574
|
-
hreflangTags: () => hreflangTags,
|
|
6575
|
-
gzipIfAccepted: () => gzipIfAccepted,
|
|
6576
|
-
getSitemapExcludedRoutes: () => getSitemapExcludedRoutes,
|
|
6577
|
-
getRedirectSourcePaths: () => getRedirectSourcePaths,
|
|
6578
|
-
getPatternDepth: () => getPatternDepth,
|
|
6579
|
-
getMimeType: () => getMimeType,
|
|
6580
|
-
getMessage: () => getMessage,
|
|
6581
|
-
getMatchingLayouts: () => getMatchingLayouts,
|
|
6582
|
-
getContentMeta: () => getContentMeta,
|
|
6583
|
-
generateSitemapXML: () => generateSitemapXML,
|
|
6584
|
-
generateSitemapIndexXML: () => generateSitemapIndexXML,
|
|
6585
|
-
generateSitemap: () => generateSitemap,
|
|
6586
|
-
generateRobots: () => generateRobots,
|
|
6587
|
-
generateRSSXML: () => generateRSSXML,
|
|
6588
|
-
generateOGImageMetaTags: () => generateOGImageMetaTags,
|
|
6589
|
-
generateLLMsIndex: () => generateLLMsIndex,
|
|
6590
|
-
generateLLMsFullContent: () => generateLLMsFullContent,
|
|
6591
|
-
generateLLMsFooter: () => generateLLMsFooter,
|
|
6592
|
-
generateHydrationScripts: () => generateHydrationScripts,
|
|
6593
|
-
generateFeed: () => generateFeed,
|
|
6594
|
-
generateContentHash: () => generateContentHash,
|
|
6595
|
-
generateCollectionScripts: () => generateCollectionScripts,
|
|
6596
|
-
generateAtomXML: () => generateAtomXML,
|
|
6597
|
-
formatMessage: () => formatMessage,
|
|
6598
|
-
formatAsText: () => formatAsText,
|
|
6599
|
-
formatAsMarkdown: () => formatAsMarkdown,
|
|
6600
|
-
findOGImageForPath: () => findOGImageForPath,
|
|
6601
|
-
extractTitle: () => extractTitle,
|
|
6602
|
-
extractParamsFromPath: () => extractParamsFromPath,
|
|
6603
|
-
extractPageMetadata: () => extractPageMetadata,
|
|
6604
|
-
extractContentForLLMs: () => extractContentForLLMs,
|
|
6605
|
-
extname: () => extname,
|
|
6606
|
-
escapeXml: () => escapeXml2,
|
|
6607
|
-
escapeJsonForScript: () => escapeJsonForScript,
|
|
6608
|
-
dynamicImport: () => dynamicImport,
|
|
6609
|
-
duplicateQueryParamData: () => duplicateQueryParamData,
|
|
6610
|
-
discoverSitemapData: () => discoverSitemapData,
|
|
6611
|
-
discoverSSRDataRoutes: () => discoverSSRDataRoutes2,
|
|
6612
|
-
discoverSSRDataFeedItems: () => discoverSSRDataFeedItems,
|
|
6613
|
-
discoverRoutesForRobots: () => discoverRoutesForRobots,
|
|
6614
|
-
discoverRoutes: () => discoverRoutes,
|
|
6615
|
-
discoverRobotsData: () => discoverRobotsData,
|
|
6616
|
-
discoverRSSData: () => discoverRSSData,
|
|
6617
|
-
discoverI18n: () => discoverI18n,
|
|
6618
|
-
discoverCollections: () => discoverCollections,
|
|
6619
|
-
discoverCollectionContent: () => discoverCollectionContent,
|
|
6620
|
-
defineConfig: () => defineConfig,
|
|
6621
|
-
deduplicateMetaTags: () => deduplicateMetaTags,
|
|
6622
|
-
createTranslator: () => createTranslator,
|
|
6623
|
-
createLlmsScript: () => createLlmsScript,
|
|
6624
|
-
createLayoutDataKey: () => createLayoutDataKey,
|
|
6625
|
-
createLayoutCacheKey: () => createLayoutCacheKey,
|
|
6626
|
-
createFeedsScript: () => createFeedsScript,
|
|
6627
|
-
createDataScript: () => createDataScript,
|
|
6628
|
-
createCollectionScript: () => createCollectionScript,
|
|
6629
|
-
createBundlePreload: () => createBundlePreload,
|
|
6630
|
-
contentNegotiateRedirect: () => contentNegotiateRedirect,
|
|
6631
|
-
contentKey: () => contentKey,
|
|
6632
|
-
computeSSRDataForPath: () => computeSSRDataForPath,
|
|
6633
|
-
computeSSRData: () => computeSSRData,
|
|
6634
|
-
computeRouteData: () => computeRouteData,
|
|
6635
|
-
computeLayoutData: () => computeLayoutData,
|
|
6636
|
-
computeContentData: () => computeContentData,
|
|
6637
|
-
compressStreamIfAccepted: () => compressStreamIfAccepted,
|
|
6638
|
-
compareRouteSpecificity: () => compareRouteSpecificity,
|
|
6639
|
-
cleanupPathScopedSSRData: () => cleanupPathScopedSSRData,
|
|
6640
|
-
buildLocaleCookie: () => buildLocaleCookie,
|
|
6641
|
-
buildHeadFromMeta: () => buildHeadFromMeta,
|
|
6642
|
-
blockSearchCrawlers: () => blockSearchCrawlers,
|
|
6643
|
-
blockAITrainingCrawlers: () => blockAITrainingCrawlers,
|
|
6644
|
-
blockAICrawlers: () => blockAICrawlers,
|
|
6645
|
-
basename: () => basename,
|
|
6646
|
-
applyIndexTemplate: () => applyIndexTemplate,
|
|
6647
|
-
allowSearchCrawlers: () => allowSearchCrawlers,
|
|
6648
|
-
allowAICrawlers: () => allowAICrawlers,
|
|
6649
|
-
acceptsGzip: () => acceptsGzip,
|
|
6650
|
-
acceptsBrotli: () => acceptsBrotli,
|
|
6651
|
-
TTLCache: () => TTLCache,
|
|
6652
|
-
SSRDataCache: () => SSRDataCache,
|
|
6653
|
-
SEARCH_CRAWLERS: () => SEARCH_CRAWLERS,
|
|
6654
|
-
LRUCache: () => LRUCache,
|
|
6655
|
-
DefaultOGTemplate: () => DefaultOGTemplate,
|
|
6656
|
-
DEFAULT_LOCALES_DIR: () => DEFAULT_LOCALES_DIR,
|
|
6657
|
-
DEFAULT_LOCALE: () => DEFAULT_LOCALE,
|
|
6883
|
+
AI_CRAWLERS: () => AI_CRAWLERS,
|
|
6658
6884
|
DEFAULT_COOKIE: () => DEFAULT_COOKIE,
|
|
6659
|
-
|
|
6885
|
+
DEFAULT_LOCALE: () => DEFAULT_LOCALE,
|
|
6886
|
+
DEFAULT_LOCALES_DIR: () => DEFAULT_LOCALES_DIR,
|
|
6887
|
+
DefaultOGTemplate: () => DefaultOGTemplate,
|
|
6888
|
+
LRUCache: () => LRUCache,
|
|
6889
|
+
SEARCH_CRAWLERS: () => SEARCH_CRAWLERS,
|
|
6890
|
+
SSRDataCache: () => SSRDataCache,
|
|
6891
|
+
TTLCache: () => TTLCache,
|
|
6892
|
+
acceptsBrotli: () => acceptsBrotli,
|
|
6893
|
+
acceptsGzip: () => acceptsGzip,
|
|
6894
|
+
allowAICrawlers: () => allowAICrawlers,
|
|
6895
|
+
allowSearchCrawlers: () => allowSearchCrawlers,
|
|
6896
|
+
appendLlmsAlternateHead: () => appendLlmsAlternateHead,
|
|
6897
|
+
applyIndexTemplate: () => applyIndexTemplate,
|
|
6898
|
+
applyLlmsDiscoveryHeaders: () => applyLlmsDiscoveryHeaders,
|
|
6899
|
+
basename: () => basename,
|
|
6900
|
+
blockAICrawlers: () => blockAICrawlers,
|
|
6901
|
+
blockAITrainingCrawlers: () => blockAITrainingCrawlers,
|
|
6902
|
+
blockSearchCrawlers: () => blockSearchCrawlers,
|
|
6903
|
+
buildHeadFromMeta: () => buildHeadFromMeta,
|
|
6904
|
+
buildLlmsDiscovery: () => buildLlmsDiscovery,
|
|
6905
|
+
buildLocaleCookie: () => buildLocaleCookie,
|
|
6906
|
+
buildSitemapLoc: () => buildSitemapLoc,
|
|
6907
|
+
cleanupPathScopedSSRData: () => cleanupPathScopedSSRData,
|
|
6908
|
+
clearSSRModuleStores: () => clearSSRModuleStores,
|
|
6909
|
+
clearWatchImportCache: () => clearWatchImportCache,
|
|
6910
|
+
compareRouteSpecificity: () => compareRouteSpecificity,
|
|
6911
|
+
compressStreamIfAccepted: () => compressStreamIfAccepted,
|
|
6912
|
+
computeContentData: () => computeContentData,
|
|
6913
|
+
computeLayoutData: () => computeLayoutData,
|
|
6914
|
+
computeRouteData: () => computeRouteData,
|
|
6915
|
+
computeSSRData: () => computeSSRData,
|
|
6916
|
+
computeSSRDataForPath: () => computeSSRDataForPath,
|
|
6917
|
+
contentKey: () => contentKey,
|
|
6918
|
+
contentNegotiateRedirect: () => contentNegotiateRedirect,
|
|
6919
|
+
createBundlePreload: () => createBundlePreload,
|
|
6920
|
+
createCollectionScript: () => createCollectionScript,
|
|
6921
|
+
createDataScript: () => createDataScript,
|
|
6922
|
+
createFeedsScript: () => createFeedsScript,
|
|
6923
|
+
createLayoutCacheKey: () => createLayoutCacheKey,
|
|
6924
|
+
createLayoutDataKey: () => createLayoutDataKey,
|
|
6925
|
+
createLlmsScript: () => createLlmsScript,
|
|
6926
|
+
createTranslator: () => createTranslator,
|
|
6927
|
+
deduplicateMetaTags: () => deduplicateMetaTags,
|
|
6928
|
+
defineConfig: () => defineConfig,
|
|
6929
|
+
discoverCollectionContent: () => discoverCollectionContent,
|
|
6930
|
+
discoverCollections: () => discoverCollections,
|
|
6931
|
+
discoverDynamicSitemapRoutes: () => discoverDynamicSitemapRoutes,
|
|
6932
|
+
discoverI18n: () => discoverI18n,
|
|
6933
|
+
discoverRSSData: () => discoverRSSData,
|
|
6934
|
+
discoverRobotsData: () => discoverRobotsData,
|
|
6935
|
+
discoverRoutes: () => discoverRoutes,
|
|
6936
|
+
discoverRoutesForRobots: () => discoverRoutesForRobots,
|
|
6937
|
+
discoverSSRDataFeedItems: () => discoverSSRDataFeedItems,
|
|
6938
|
+
discoverSSRDataRoutes: () => discoverSSRDataRoutes2,
|
|
6939
|
+
discoverSitemapData: () => discoverSitemapData,
|
|
6940
|
+
duplicateQueryParamData: () => duplicateQueryParamData,
|
|
6941
|
+
dynamicImport: () => dynamicImport,
|
|
6942
|
+
escapeJsonForScript: () => escapeJsonForScript,
|
|
6943
|
+
escapeXml: () => escapeXml2,
|
|
6944
|
+
extname: () => extname,
|
|
6945
|
+
extractContentForLLMs: () => extractContentForLLMs,
|
|
6946
|
+
extractPageMetadata: () => extractPageMetadata,
|
|
6947
|
+
extractParamsFromPath: () => extractParamsFromPath,
|
|
6948
|
+
extractTitle: () => extractTitle,
|
|
6949
|
+
findOGImageForPath: () => findOGImageForPath,
|
|
6950
|
+
formatAsMarkdown: () => formatAsMarkdown,
|
|
6951
|
+
formatAsText: () => formatAsText,
|
|
6952
|
+
formatContentSignal: () => formatContentSignal,
|
|
6953
|
+
formatMessage: () => formatMessage,
|
|
6954
|
+
generateAtomXML: () => generateAtomXML,
|
|
6955
|
+
generateCollectionScripts: () => generateCollectionScripts,
|
|
6956
|
+
generateContentHash: () => generateContentHash,
|
|
6957
|
+
generateFeed: () => generateFeed,
|
|
6958
|
+
generateHydrationScripts: () => generateHydrationScripts,
|
|
6959
|
+
generateLLMsFooter: () => generateLLMsFooter,
|
|
6960
|
+
generateLLMsFullContent: () => generateLLMsFullContent,
|
|
6961
|
+
generateLLMsIndex: () => generateLLMsIndex,
|
|
6962
|
+
generateOGImageMetaTags: () => generateOGImageMetaTags,
|
|
6963
|
+
generateRSSXML: () => generateRSSXML,
|
|
6964
|
+
generateRobots: () => generateRobots,
|
|
6965
|
+
generateSitemap: () => generateSitemap,
|
|
6966
|
+
generateSitemapIndexXML: () => generateSitemapIndexXML,
|
|
6967
|
+
generateSitemapXML: () => generateSitemapXML,
|
|
6968
|
+
getContentMeta: () => getContentMeta,
|
|
6969
|
+
getMatchingLayouts: () => getMatchingLayouts,
|
|
6970
|
+
getMessage: () => getMessage,
|
|
6971
|
+
getMimeType: () => getMimeType,
|
|
6972
|
+
getPatternDepth: () => getPatternDepth,
|
|
6973
|
+
getRedirectSourcePaths: () => getRedirectSourcePaths,
|
|
6974
|
+
getSitemapExcludedRoutes: () => getSitemapExcludedRoutes,
|
|
6975
|
+
gzipIfAccepted: () => gzipIfAccepted,
|
|
6976
|
+
hreflangTags: () => hreflangTags,
|
|
6977
|
+
htmlToMarkdown: () => htmlToMarkdown,
|
|
6978
|
+
importContentModuleForPath: () => importContentModuleForPath,
|
|
6979
|
+
inlineThemeCSS: () => inlineThemeCSS,
|
|
6980
|
+
isCompressible: () => isCompressible,
|
|
6981
|
+
isThenable: () => isThenable,
|
|
6982
|
+
join: () => join2,
|
|
6983
|
+
listContentFiles: () => listContentFiles,
|
|
6984
|
+
llmsAlternateLinkTag: () => llmsAlternateLinkTag,
|
|
6985
|
+
loadCollections: () => loadCollections,
|
|
6986
|
+
loadConfig: () => loadConfig,
|
|
6987
|
+
loadIndexHtml: () => loadIndexHtml,
|
|
6988
|
+
loadOGImageComponent: () => loadOGImageComponent,
|
|
6989
|
+
loadRoutesModule: () => loadRoutesModule,
|
|
6990
|
+
localizeContentHref: () => localizeContentHref,
|
|
6991
|
+
localizeHref: () => localizeHref,
|
|
6992
|
+
looksLikeLocale: () => looksLikeLocale,
|
|
6993
|
+
lookupMessage: () => lookupMessage,
|
|
6994
|
+
markdownTwinPath: () => markdownTwinPath,
|
|
6995
|
+
matchRoutePattern: () => matchRoutePattern,
|
|
6996
|
+
matchRoutes: () => matchRoutes,
|
|
6997
|
+
mergeLayoutData: () => mergeLayoutData,
|
|
6998
|
+
mergeVary: () => mergeVary,
|
|
6999
|
+
negotiateLocale: () => negotiateLocale,
|
|
7000
|
+
normalizePathname: () => normalizePathname,
|
|
7001
|
+
parseContentPath: () => parseContentPath,
|
|
7002
|
+
parseCookieValue: () => parseCookieValue,
|
|
7003
|
+
performSSRSetup: () => performSSRSetup,
|
|
7004
|
+
preloadContentModule: () => preloadContentModule,
|
|
7005
|
+
processCollections: () => processCollections,
|
|
7006
|
+
removeOverriddenMetaTags: () => removeOverriddenMetaTags,
|
|
7007
|
+
renderOGImageToPNG: () => renderOGImageToPNG,
|
|
7008
|
+
renderSSRDocument: () => renderSSRDocument,
|
|
7009
|
+
renderSSRDocumentStream: () => renderSSRDocumentStream,
|
|
7010
|
+
resetSSRAccessTracking: () => resetSSRAccessTracking,
|
|
7011
|
+
resetSSRContentResults: () => resetSSRContentResults,
|
|
7012
|
+
resolveLocale: () => resolveLocale,
|
|
7013
|
+
seedSSRModuleForPath: () => seedSSRModuleForPath,
|
|
7014
|
+
setGlobalCollections: () => setGlobalCollections,
|
|
7015
|
+
setGlobalSSRData: () => setGlobalSSRData,
|
|
7016
|
+
shouldAdvertiseMarkdownTwin: () => shouldAdvertiseMarkdownTwin,
|
|
7017
|
+
shouldExcludeRoute: () => shouldExcludeRoute,
|
|
7018
|
+
splitTemplate: () => splitTemplate,
|
|
7019
|
+
ssrCache: () => ssrCache,
|
|
7020
|
+
statusCache: () => statusCache,
|
|
7021
|
+
stripEnd: () => stripEnd,
|
|
7022
|
+
stripHtmlTags: () => stripHtmlTags,
|
|
7023
|
+
stripStart: () => stripStart,
|
|
7024
|
+
takeSSRContentResults: () => takeSSRContentResults,
|
|
7025
|
+
toBytes: () => toBytes,
|
|
7026
|
+
toOgLocale: () => toOgLocale,
|
|
7027
|
+
toPromise: () => toPromise
|
|
6660
7028
|
});
|
|
6661
7029
|
var init_core = __esm(() => {
|
|
6662
7030
|
init_src();
|
|
@@ -6666,7 +7034,9 @@ var init_core = __esm(() => {
|
|
|
6666
7034
|
function getCommonBuildOptions() {
|
|
6667
7035
|
return {
|
|
6668
7036
|
loader: {
|
|
6669
|
-
".css": "text"
|
|
7037
|
+
".css": "text",
|
|
7038
|
+
".md": "text",
|
|
7039
|
+
".mdx": "text"
|
|
6670
7040
|
}
|
|
6671
7041
|
};
|
|
6672
7042
|
}
|
|
@@ -6677,10 +7047,13 @@ function getNamingConfig(options) {
|
|
|
6677
7047
|
asset: options?.asset || "asset.[hash].[ext]"
|
|
6678
7048
|
};
|
|
6679
7049
|
}
|
|
7050
|
+
function shouldRebuildClientBundle(filename) {
|
|
7051
|
+
return filename.endsWith(".ts") || filename.endsWith(".tsx") || filename.endsWith(".md") || filename.endsWith(".mdx");
|
|
7052
|
+
}
|
|
6680
7053
|
|
|
6681
7054
|
// packages/cli/src/commands/lib/env.ts
|
|
6682
7055
|
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
6683
|
-
import { join as
|
|
7056
|
+
import { join as join5 } from "node:path";
|
|
6684
7057
|
function parseEnvFile(content2) {
|
|
6685
7058
|
const env = {};
|
|
6686
7059
|
const lines = content2.split(`
|
|
@@ -6706,7 +7079,7 @@ function loadEnvFiles(cwd, mode = "development") {
|
|
|
6706
7079
|
const env = {};
|
|
6707
7080
|
const loadedFiles = [];
|
|
6708
7081
|
for (const file of envFiles) {
|
|
6709
|
-
const filePath =
|
|
7082
|
+
const filePath = join5(cwd, file);
|
|
6710
7083
|
if (existsSync2(filePath)) {
|
|
6711
7084
|
try {
|
|
6712
7085
|
const content2 = readFileSync(filePath, "utf-8");
|
|
@@ -6750,11 +7123,11 @@ var init_env = () => {};
|
|
|
6750
7123
|
|
|
6751
7124
|
// packages/cli/src/commands/lib/markdown/availability.ts
|
|
6752
7125
|
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
6753
|
-
import { dirname, join as
|
|
7126
|
+
import { dirname as dirname2, join as join6 } from "node:path";
|
|
6754
7127
|
function isPackageAvailable(cwd, packageName) {
|
|
6755
7128
|
let currentDir = cwd;
|
|
6756
7129
|
for (let i = 0;i < 5; i++) {
|
|
6757
|
-
const packageJsonPath =
|
|
7130
|
+
const packageJsonPath = join6(currentDir, "package.json");
|
|
6758
7131
|
if (existsSync3(packageJsonPath)) {
|
|
6759
7132
|
try {
|
|
6760
7133
|
const packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf-8"));
|
|
@@ -6768,7 +7141,7 @@ function isPackageAvailable(cwd, packageName) {
|
|
|
6768
7141
|
}
|
|
6769
7142
|
} catch {}
|
|
6770
7143
|
}
|
|
6771
|
-
const parentDir =
|
|
7144
|
+
const parentDir = dirname2(currentDir);
|
|
6772
7145
|
if (parentDir === currentDir) {
|
|
6773
7146
|
break;
|
|
6774
7147
|
}
|
|
@@ -6826,7 +7199,7 @@ var init_availability = () => {};
|
|
|
6826
7199
|
|
|
6827
7200
|
// packages/cli/src/commands/lib/markdown/processor.ts
|
|
6828
7201
|
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
|
|
6829
|
-
import { basename as
|
|
7202
|
+
import { basename as basename3, dirname as dirname3, extname as extname3, join as join7, relative, resolve } from "node:path";
|
|
6830
7203
|
import matter from "gray-matter";
|
|
6831
7204
|
function convertPropertiesToJsx(properties) {
|
|
6832
7205
|
const newProperties = {};
|
|
@@ -6885,7 +7258,7 @@ function processMarkdownFile(filePath) {
|
|
|
6885
7258
|
function isMdxAvailable2(cwd) {
|
|
6886
7259
|
let currentDir = cwd;
|
|
6887
7260
|
for (let i = 0;i < 5; i++) {
|
|
6888
|
-
const packageJsonPath =
|
|
7261
|
+
const packageJsonPath = join7(currentDir, "package.json");
|
|
6889
7262
|
if (existsSync4(packageJsonPath)) {
|
|
6890
7263
|
try {
|
|
6891
7264
|
const packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
|
|
@@ -6899,7 +7272,7 @@ function isMdxAvailable2(cwd) {
|
|
|
6899
7272
|
}
|
|
6900
7273
|
} catch {}
|
|
6901
7274
|
}
|
|
6902
|
-
const parentDir =
|
|
7275
|
+
const parentDir = dirname3(currentDir);
|
|
6903
7276
|
if (parentDir === currentDir) {
|
|
6904
7277
|
break;
|
|
6905
7278
|
}
|
|
@@ -6909,10 +7282,10 @@ function isMdxAvailable2(cwd) {
|
|
|
6909
7282
|
}
|
|
6910
7283
|
function tryLoadModule(cwd, moduleName) {
|
|
6911
7284
|
const pathsToTry = [
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
7285
|
+
join7(cwd, `node_modules/${moduleName}`),
|
|
7286
|
+
join7(cwd, `../node_modules/${moduleName}`),
|
|
7287
|
+
join7(cwd, `../../node_modules/${moduleName}`),
|
|
7288
|
+
join7(cwd, `../../../node_modules/${moduleName}`)
|
|
6916
7289
|
];
|
|
6917
7290
|
for (const modulePath of pathsToTry) {
|
|
6918
7291
|
try {
|
|
@@ -7001,9 +7374,9 @@ async function compileMdx(content2, cwd, options = {}) {
|
|
|
7001
7374
|
function rewriteImportPaths(code, sourcePath, targetPath) {
|
|
7002
7375
|
const importRegex = /import\s+(?:{[^}]+}|[\w\s,]+)\s+from\s+['"](\.[^'"]+)['"]/g;
|
|
7003
7376
|
return code.replace(importRegex, (match, importPath) => {
|
|
7004
|
-
const sourceDir =
|
|
7377
|
+
const sourceDir = dirname3(sourcePath);
|
|
7005
7378
|
const absoluteImportPath = resolve(sourceDir, importPath);
|
|
7006
|
-
const targetDir =
|
|
7379
|
+
const targetDir = dirname3(targetPath);
|
|
7007
7380
|
let newRelativePath = relative(targetDir, absoluteImportPath);
|
|
7008
7381
|
if (!newRelativePath.startsWith(".")) {
|
|
7009
7382
|
newRelativePath = `./${newRelativePath}`;
|
|
@@ -7161,7 +7534,7 @@ export default function MarkdownFallback() {
|
|
|
7161
7534
|
`;
|
|
7162
7535
|
}
|
|
7163
7536
|
function isMarkdownFile(filePath) {
|
|
7164
|
-
const ext =
|
|
7537
|
+
const ext = extname3(filePath).toLowerCase();
|
|
7165
7538
|
return ext === ".md" || ext === ".mdx";
|
|
7166
7539
|
}
|
|
7167
7540
|
function extractHeadings(content2, options = {}) {
|
|
@@ -7242,7 +7615,7 @@ function isProductionMode(args = []) {
|
|
|
7242
7615
|
}
|
|
7243
7616
|
|
|
7244
7617
|
// packages/cli/src/commands/lib/streaming/analyzer.ts
|
|
7245
|
-
import { dirname as
|
|
7618
|
+
import { dirname as dirname4, join as join8 } from "node:path";
|
|
7246
7619
|
function hasSSRDataExport(source) {
|
|
7247
7620
|
if (SSR_DATA_INLINE_EXPORT_REGEX.test(source)) {
|
|
7248
7621
|
return true;
|
|
@@ -7269,11 +7642,11 @@ async function analyzeRouteForStreaming(options) {
|
|
|
7269
7642
|
};
|
|
7270
7643
|
}
|
|
7271
7644
|
async function findSkeletonForTarget(routesDir, relativePath, type) {
|
|
7272
|
-
const dirName = normalizeRelativePath(
|
|
7273
|
-
const baseDir = dirName === "." ? routesDir :
|
|
7645
|
+
const dirName = normalizeRelativePath(dirname4(relativePath));
|
|
7646
|
+
const baseDir = dirName === "." ? routesDir : join8(routesDir, dirName).replace(/\\/g, "/");
|
|
7274
7647
|
const candidates = type === "layout" ? ["[layout+skeleton].tsx", "[layout+skeleton].ts"] : ["[skeleton].tsx", "[skeleton].ts"];
|
|
7275
7648
|
for (const candidate of candidates) {
|
|
7276
|
-
const candidatePath =
|
|
7649
|
+
const candidatePath = join8(baseDir, candidate);
|
|
7277
7650
|
try {
|
|
7278
7651
|
const file = Bun.file(candidatePath);
|
|
7279
7652
|
if (await file.exists()) {
|
|
@@ -7294,12 +7667,12 @@ var init_analyzer = __esm(() => {
|
|
|
7294
7667
|
});
|
|
7295
7668
|
|
|
7296
7669
|
// packages/cli/src/commands/lib/streaming/suspense.ts
|
|
7297
|
-
import { dirname as
|
|
7670
|
+
import { dirname as dirname5, join as join9, relative as relative2 } from "node:path";
|
|
7298
7671
|
async function generateStreamingWrapper(options) {
|
|
7299
7672
|
const { cwd, relativeFilePath, analysis, config: config2 } = options;
|
|
7300
|
-
const streamingModulePath =
|
|
7301
|
-
const wrapperDir =
|
|
7302
|
-
const originalModuleWithoutExt = removeExtension(
|
|
7673
|
+
const streamingModulePath = join9(cwd, ".reroute", "streaming", relativeFilePath).replace(/\.(tsx|ts)$/, ".tsx");
|
|
7674
|
+
const wrapperDir = dirname5(streamingModulePath);
|
|
7675
|
+
const originalModuleWithoutExt = removeExtension(join9(cwd, "src", "client", "routes", relativeFilePath));
|
|
7303
7676
|
const originalImportPath = toImportPath(wrapperDir, originalModuleWithoutExt);
|
|
7304
7677
|
const skeletonImportBlock = await resolveSkeletonBlock({
|
|
7305
7678
|
analysis,
|
|
@@ -7341,7 +7714,7 @@ async function resolveSkeletonBlock(args) {
|
|
|
7341
7714
|
}
|
|
7342
7715
|
function resolveConfiguredSkeletonPath(value, cwd) {
|
|
7343
7716
|
if (typeof value === "string" && value.trim().length > 0) {
|
|
7344
|
-
return value.startsWith("/") ? value :
|
|
7717
|
+
return value.startsWith("/") ? value : join9(cwd, value);
|
|
7345
7718
|
}
|
|
7346
7719
|
if (value && !warnedSkeletonType) {
|
|
7347
7720
|
console.warn("[reroute/streaming] default skeletons must be provided as string module paths in reroute.config.ts");
|
|
@@ -7376,38 +7749,96 @@ var AUTO_HEADER = `// \uD83D\uDEA8 Auto-generated streaming wrapper by Reroute -
|
|
|
7376
7749
|
var init_suspense = () => {};
|
|
7377
7750
|
|
|
7378
7751
|
// packages/cli/src/commands/lib/theme.ts
|
|
7379
|
-
import { existsSync as existsSync5 } from "node:fs";
|
|
7380
|
-
import { mkdir as mkdir2 } from "node:fs/promises";
|
|
7381
|
-
import { dirname as
|
|
7752
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
|
|
7753
|
+
import { mkdir as mkdir2, writeFile } from "node:fs/promises";
|
|
7754
|
+
import { dirname as dirname6, isAbsolute, join as join10, resolve as resolve2 } from "node:path";
|
|
7382
7755
|
function getCssPaths(cwd) {
|
|
7383
|
-
const input =
|
|
7384
|
-
const output =
|
|
7756
|
+
const input = join10(cwd, "src/client/index.css");
|
|
7757
|
+
const output = join10(cwd, ".reroute/index.css");
|
|
7385
7758
|
return { input, output };
|
|
7386
7759
|
}
|
|
7760
|
+
function isFileImport(specifier) {
|
|
7761
|
+
if (specifier.startsWith("http://") || specifier.startsWith("https://") || specifier.startsWith("data:") || specifier.startsWith("/")) {
|
|
7762
|
+
return false;
|
|
7763
|
+
}
|
|
7764
|
+
return true;
|
|
7765
|
+
}
|
|
7766
|
+
function bundleCssEntrypoint(entryPath) {
|
|
7767
|
+
const absEntry = resolve2(entryPath);
|
|
7768
|
+
const stack = new Set;
|
|
7769
|
+
const completed = new Set;
|
|
7770
|
+
function bundleFile(filePath) {
|
|
7771
|
+
const absPath = resolve2(filePath);
|
|
7772
|
+
if (completed.has(absPath)) {
|
|
7773
|
+
return "";
|
|
7774
|
+
}
|
|
7775
|
+
if (stack.has(absPath)) {
|
|
7776
|
+
throw new Error(`[reroute/theme] Circular @import detected: ${absPath}`);
|
|
7777
|
+
}
|
|
7778
|
+
if (!existsSync5(absPath)) {
|
|
7779
|
+
throw new Error(`[reroute/theme] Missing CSS import: ${absPath}`);
|
|
7780
|
+
}
|
|
7781
|
+
stack.add(absPath);
|
|
7782
|
+
const source = readFileSync4(absPath, "utf-8");
|
|
7783
|
+
const baseDir = dirname6(absPath);
|
|
7784
|
+
const bundled = source.replace(IMPORT_RE, (full, single, double, bare, rest) => {
|
|
7785
|
+
const specifier = single || double || bare;
|
|
7786
|
+
const condition = (rest ?? "").trim();
|
|
7787
|
+
if (condition || !isFileImport(specifier)) {
|
|
7788
|
+
return full;
|
|
7789
|
+
}
|
|
7790
|
+
const importedPath = isAbsolute(specifier) ? specifier : resolve2(baseDir, specifier);
|
|
7791
|
+
return `/* ${specifier} */
|
|
7792
|
+
${bundleFile(importedPath)}
|
|
7793
|
+
`;
|
|
7794
|
+
});
|
|
7795
|
+
stack.delete(absPath);
|
|
7796
|
+
completed.add(absPath);
|
|
7797
|
+
return bundled;
|
|
7798
|
+
}
|
|
7799
|
+
return bundleFile(absEntry);
|
|
7800
|
+
}
|
|
7387
7801
|
async function syncThemeCss(cwd) {
|
|
7388
7802
|
const { input, output } = getCssPaths(cwd);
|
|
7389
7803
|
if (!existsSync5(input)) {
|
|
7390
7804
|
return false;
|
|
7391
7805
|
}
|
|
7392
|
-
await mkdir2(
|
|
7393
|
-
|
|
7806
|
+
await mkdir2(dirname6(output), { recursive: true });
|
|
7807
|
+
try {
|
|
7808
|
+
const css = bundleCssEntrypoint(input);
|
|
7809
|
+
await writeFile(output, css, "utf-8");
|
|
7810
|
+
} catch (err) {
|
|
7811
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
7812
|
+
if (message.startsWith("[reroute/theme]")) {
|
|
7813
|
+
throw err;
|
|
7814
|
+
}
|
|
7815
|
+
throw new Error(`[reroute/theme] Failed to bundle index.css:
|
|
7816
|
+
${message}`);
|
|
7817
|
+
}
|
|
7394
7818
|
console.log("[reroute/theme] synced index.css");
|
|
7395
7819
|
return true;
|
|
7396
7820
|
}
|
|
7397
|
-
var
|
|
7821
|
+
var IMPORT_RE;
|
|
7822
|
+
var init_theme = __esm(() => {
|
|
7823
|
+
IMPORT_RE = /@import\s+(?:url\(\s*)?(?:'([^']+)'|"([^"]+)"|([^'")\s]+))\s*\)?\s*([^;]*);/g;
|
|
7824
|
+
});
|
|
7398
7825
|
|
|
7399
7826
|
// packages/cli/src/commands/gen.ts
|
|
7400
7827
|
var exports_gen = {};
|
|
7401
7828
|
__export(exports_gen, {
|
|
7402
|
-
default: () => gen
|
|
7829
|
+
default: () => gen,
|
|
7830
|
+
startGenWatch: () => startGenWatch
|
|
7403
7831
|
});
|
|
7404
7832
|
import { watch } from "node:fs";
|
|
7405
|
-
import { mkdir as mkdir3, readdir as readdir7, rm } from "node:fs/promises";
|
|
7406
|
-
import { dirname as
|
|
7833
|
+
import { copyFile as copyFile2, mkdir as mkdir3, readdir as readdir7, rm, unlink as unlink2 } from "node:fs/promises";
|
|
7834
|
+
import { dirname as dirname7, extname as extname4, join as join11 } from "node:path";
|
|
7407
7835
|
import { pathToFileURL as pathToFileURL8 } from "node:url";
|
|
7836
|
+
function isWatchNoise(name) {
|
|
7837
|
+
return name.split(/[/\\]/).some((part) => part.startsWith(".")) || /\.bust-[^/\\]+$/.test(name);
|
|
7838
|
+
}
|
|
7408
7839
|
async function bundleThemeCssIntoArtifacts(cwd) {
|
|
7409
|
-
const cssPath =
|
|
7410
|
-
const artifactsPath =
|
|
7840
|
+
const cssPath = join11(cwd, ".reroute", "index.css");
|
|
7841
|
+
const artifactsPath = join11(cwd, OUTPUT_ARTIFACTS);
|
|
7411
7842
|
try {
|
|
7412
7843
|
const cssContent = await Bun.file(cssPath).text();
|
|
7413
7844
|
if (!cssContent)
|
|
@@ -7433,7 +7864,7 @@ async function bundleThemeCssIntoArtifacts(cwd) {
|
|
|
7433
7864
|
async function ensureOutputDir(cwd, options = {}) {
|
|
7434
7865
|
const { clean = true } = options;
|
|
7435
7866
|
try {
|
|
7436
|
-
const outputPath =
|
|
7867
|
+
const outputPath = join11(cwd, OUTPUT_DIR);
|
|
7437
7868
|
if (clean) {
|
|
7438
7869
|
let needsCleanup = false;
|
|
7439
7870
|
try {
|
|
@@ -7446,9 +7877,9 @@ async function ensureOutputDir(cwd, options = {}) {
|
|
|
7446
7877
|
}
|
|
7447
7878
|
}
|
|
7448
7879
|
await mkdir3(outputPath, { recursive: true });
|
|
7449
|
-
await mkdir3(
|
|
7450
|
-
await mkdir3(
|
|
7451
|
-
await mkdir3(
|
|
7880
|
+
await mkdir3(join11(cwd, OUTPUT_COLLECTIONS_DIR), { recursive: true });
|
|
7881
|
+
await mkdir3(join11(cwd, ".reroute/bundles"), { recursive: true });
|
|
7882
|
+
await mkdir3(join11(cwd, ".reroute/streaming"), { recursive: true });
|
|
7452
7883
|
} catch {}
|
|
7453
7884
|
}
|
|
7454
7885
|
async function writeStubFiles(cwd) {
|
|
@@ -7506,11 +7937,11 @@ import './artifacts';
|
|
|
7506
7937
|
import './routes'; // Import routes (bundles all route components)
|
|
7507
7938
|
import '../src/index';
|
|
7508
7939
|
`;
|
|
7509
|
-
await Bun.write(
|
|
7510
|
-
await Bun.write(
|
|
7511
|
-
await Bun.write(
|
|
7512
|
-
await Bun.write(
|
|
7513
|
-
await Bun.write(
|
|
7940
|
+
await Bun.write(join11(cwd, OUTPUT_ROUTES), STUB_ROUTES);
|
|
7941
|
+
await Bun.write(join11(cwd, OUTPUT_CONTENT_TS), STUB_CONTENT);
|
|
7942
|
+
await Bun.write(join11(cwd, OUTPUT_ARTIFACTS), STUB_ARTIFACTS);
|
|
7943
|
+
await Bun.write(join11(cwd, OUTPUT_INDEX), STUB_INDEX);
|
|
7944
|
+
await Bun.write(join11(cwd, ".reroute/entry.ts"), STUB_ENTRY);
|
|
7514
7945
|
console.log("[reroute/gen] Initialized stub files");
|
|
7515
7946
|
}
|
|
7516
7947
|
function shouldSkipFile(relativePath, entryName) {
|
|
@@ -7532,8 +7963,8 @@ async function scanDirectory(dir, base = "") {
|
|
|
7532
7963
|
const files = [];
|
|
7533
7964
|
const entries = await readdir7(dir, { withFileTypes: true });
|
|
7534
7965
|
for (const entry of entries) {
|
|
7535
|
-
const fullPath =
|
|
7536
|
-
const relativePath =
|
|
7966
|
+
const fullPath = join11(dir, entry.name);
|
|
7967
|
+
const relativePath = join11(base, entry.name);
|
|
7537
7968
|
if (entry.isDirectory()) {
|
|
7538
7969
|
if (entry.name === "content")
|
|
7539
7970
|
continue;
|
|
@@ -7551,8 +7982,8 @@ async function scan404Files(dir, base = "") {
|
|
|
7551
7982
|
const files = [];
|
|
7552
7983
|
const entries = await readdir7(dir, { withFileTypes: true });
|
|
7553
7984
|
for (const entry of entries) {
|
|
7554
|
-
const fullPath =
|
|
7555
|
-
const relativePath =
|
|
7985
|
+
const fullPath = join11(dir, entry.name);
|
|
7986
|
+
const relativePath = join11(base, entry.name);
|
|
7556
7987
|
if (entry.isDirectory()) {
|
|
7557
7988
|
const nested = await scan404Files(fullPath, relativePath);
|
|
7558
7989
|
files.push(...nested);
|
|
@@ -7567,8 +7998,8 @@ async function scanOgFiles(dir, base = "") {
|
|
|
7567
7998
|
const files = [];
|
|
7568
7999
|
const entries = await readdir7(dir, { withFileTypes: true });
|
|
7569
8000
|
for (const entry of entries) {
|
|
7570
|
-
const fullPath =
|
|
7571
|
-
const relativePath =
|
|
8001
|
+
const fullPath = join11(dir, entry.name);
|
|
8002
|
+
const relativePath = join11(base, entry.name);
|
|
7572
8003
|
if (entry.isDirectory()) {
|
|
7573
8004
|
if (entry.name === "content")
|
|
7574
8005
|
continue;
|
|
@@ -7822,7 +8253,7 @@ function matchPattern(route: Route, pathname: string): Record<string, string> |
|
|
|
7822
8253
|
`;
|
|
7823
8254
|
}
|
|
7824
8255
|
async function buildStreamingWrappersForTree(cwd, routesPath, tree, config2) {
|
|
7825
|
-
const streamingDir =
|
|
8256
|
+
const streamingDir = join11(cwd, ".reroute", "streaming");
|
|
7826
8257
|
const analyses = new Map;
|
|
7827
8258
|
const candidates = [
|
|
7828
8259
|
...tree.routes.map((route) => ({
|
|
@@ -7841,7 +8272,7 @@ async function buildStreamingWrappersForTree(cwd, routesPath, tree, config2) {
|
|
|
7841
8272
|
for (const candidate of candidates) {
|
|
7842
8273
|
if (!/\.(tsx|ts)$/.test(candidate.filePath))
|
|
7843
8274
|
continue;
|
|
7844
|
-
const absolutePath =
|
|
8275
|
+
const absolutePath = join11(routesPath, candidate.filePath);
|
|
7845
8276
|
const analysis = await analyzeRouteForStreaming({
|
|
7846
8277
|
absolutePath,
|
|
7847
8278
|
relativePath: candidate.filePath,
|
|
@@ -7850,8 +8281,8 @@ async function buildStreamingWrappersForTree(cwd, routesPath, tree, config2) {
|
|
|
7850
8281
|
});
|
|
7851
8282
|
if (!analysis.needsStreaming)
|
|
7852
8283
|
continue;
|
|
7853
|
-
const wrapperPath =
|
|
7854
|
-
await mkdir3(
|
|
8284
|
+
const wrapperPath = join11(streamingDir, candidate.filePath).replace(/\.(tsx|ts)$/, ".tsx");
|
|
8285
|
+
await mkdir3(dirname7(wrapperPath), { recursive: true });
|
|
7855
8286
|
const code = await generateStreamingWrapper({
|
|
7856
8287
|
cwd,
|
|
7857
8288
|
relativeFilePath: candidate.filePath,
|
|
@@ -7875,13 +8306,13 @@ function isContentFileName(name) {
|
|
|
7875
8306
|
}
|
|
7876
8307
|
async function listLocaleContentFiles(collectionDir, locale) {
|
|
7877
8308
|
try {
|
|
7878
|
-
const nested = await readdir7(
|
|
8309
|
+
const nested = await readdir7(join11(collectionDir, locale), {
|
|
7879
8310
|
withFileTypes: true
|
|
7880
8311
|
});
|
|
7881
8312
|
const files = [];
|
|
7882
8313
|
for (const n of nested) {
|
|
7883
8314
|
if (n.isFile() && isContentFileName(n.name)) {
|
|
7884
|
-
files.push({ relativePath:
|
|
8315
|
+
files.push({ relativePath: join11(locale, n.name), locale });
|
|
7885
8316
|
}
|
|
7886
8317
|
}
|
|
7887
8318
|
return files;
|
|
@@ -7915,6 +8346,19 @@ async function sha8(text) {
|
|
|
7915
8346
|
hex += b.toString(16).padStart(2, "0");
|
|
7916
8347
|
return hex.slice(0, 8);
|
|
7917
8348
|
}
|
|
8349
|
+
async function loadContentMeta(absSrc, buildSrc, isMarkdown) {
|
|
8350
|
+
if (isMarkdown) {
|
|
8351
|
+
return processMarkdownFile(absSrc).frontmatter || {};
|
|
8352
|
+
}
|
|
8353
|
+
const tmp = join11(dirname7(buildSrc), `.meta-${Date.now()}-${Math.random().toString(36).slice(2)}${extname4(buildSrc)}`);
|
|
8354
|
+
try {
|
|
8355
|
+
await copyFile2(buildSrc, tmp);
|
|
8356
|
+
const m = await import(pathToFileURL8(tmp).href);
|
|
8357
|
+
return m.meta || {};
|
|
8358
|
+
} finally {
|
|
8359
|
+
await unlink2(tmp).catch(() => {});
|
|
8360
|
+
}
|
|
8361
|
+
}
|
|
7918
8362
|
function serializeConfig(config2) {
|
|
7919
8363
|
function serializeValue(value, indent = 0) {
|
|
7920
8364
|
const spaces = " ".repeat(indent);
|
|
@@ -7964,9 +8408,9 @@ async function buildSingleContentChunk(cwd, collection, fileRef, contentDir, arg
|
|
|
7964
8408
|
const locale = fileRef.locale || defaultLocale;
|
|
7965
8409
|
const baseName = file.split("/").pop() || file;
|
|
7966
8410
|
const name = baseName.replace(/\.(tsx|ts|md|mdx)$/, "");
|
|
7967
|
-
const absSrc =
|
|
8411
|
+
const absSrc = join11(contentDir, file);
|
|
7968
8412
|
const isMarkdown = /\.(md|mdx)$/.test(file);
|
|
7969
|
-
const buildSrc = isMarkdown ?
|
|
8413
|
+
const buildSrc = isMarkdown ? join11(cwd, ".reroute", "markdown", collection, "content", file.replace(/\.(md|mdx)$/, ".tsx")) : absSrc;
|
|
7970
8414
|
if (isMarkdown) {
|
|
7971
8415
|
try {
|
|
7972
8416
|
const exists = await Bun.file(buildSrc).exists();
|
|
@@ -8012,11 +8456,11 @@ async function buildSingleContentChunk(cwd, collection, fileRef, contentDir, arg
|
|
|
8012
8456
|
return null;
|
|
8013
8457
|
}
|
|
8014
8458
|
const hash2 = await sha8(code);
|
|
8015
|
-
const chunkRelDir =
|
|
8016
|
-
const chunkAbsDir =
|
|
8459
|
+
const chunkRelDir = join11(".reroute", "bundles");
|
|
8460
|
+
const chunkAbsDir = join11(cwd, chunkRelDir);
|
|
8017
8461
|
const localeSuffix = locale !== defaultLocale ? `${locale}-` : "";
|
|
8018
8462
|
const outFile = `${collection}-${localeSuffix}${name}.${hash2}.js`;
|
|
8019
|
-
const absOut =
|
|
8463
|
+
const absOut = join11(chunkAbsDir, outFile);
|
|
8020
8464
|
if (sourcemapContent) {
|
|
8021
8465
|
code = code.replace(/\/\/# sourceMappingURL=.*\.js\.map/, `//# sourceMappingURL=${outFile}.map`);
|
|
8022
8466
|
}
|
|
@@ -8031,9 +8475,7 @@ async function buildSingleContentChunk(cwd, collection, fileRef, contentDir, arg
|
|
|
8031
8475
|
} catch {}
|
|
8032
8476
|
let meta = {};
|
|
8033
8477
|
try {
|
|
8034
|
-
|
|
8035
|
-
const m = await import(url);
|
|
8036
|
-
meta = m.meta || {};
|
|
8478
|
+
meta = await loadContentMeta(absSrc, buildSrc, isMarkdown);
|
|
8037
8479
|
} catch {}
|
|
8038
8480
|
const isProd = isProductionMode(args);
|
|
8039
8481
|
if (isProd && meta.draft === true) {
|
|
@@ -8051,7 +8493,7 @@ async function buildSingleContentChunk(cwd, collection, fileRef, contentDir, arg
|
|
|
8051
8493
|
};
|
|
8052
8494
|
}
|
|
8053
8495
|
async function buildContentChunks(cwd, args = [], defaultLocale = "en-US") {
|
|
8054
|
-
const routesRoot =
|
|
8496
|
+
const routesRoot = join11(cwd, ROUTES_DIR);
|
|
8055
8497
|
console.log(`[reroute/content] scan ${routesRoot}`);
|
|
8056
8498
|
const collections2 = await readdir7(routesRoot, { withFileTypes: true });
|
|
8057
8499
|
const results = [];
|
|
@@ -8059,7 +8501,7 @@ async function buildContentChunks(cwd, args = [], defaultLocale = "en-US") {
|
|
|
8059
8501
|
if (!c.isDirectory())
|
|
8060
8502
|
continue;
|
|
8061
8503
|
const collection = c.name;
|
|
8062
|
-
const contentDir =
|
|
8504
|
+
const contentDir = join11(routesRoot, collection, "content");
|
|
8063
8505
|
console.log(`[reroute/content] collection ${collection} dir ${contentDir}`);
|
|
8064
8506
|
const files = await listContentFiles2(contentDir);
|
|
8065
8507
|
console.log(`[reroute/content] files ${files.length}`);
|
|
@@ -8111,7 +8553,7 @@ async function buildContentChunks(cwd, args = [], defaultLocale = "en-US") {
|
|
|
8111
8553
|
lines.push("");
|
|
8112
8554
|
const writes = [];
|
|
8113
8555
|
writes.push({
|
|
8114
|
-
path:
|
|
8556
|
+
path: join11(cwd, OUTPUT_CONTENT_TS),
|
|
8115
8557
|
content: lines.join(`
|
|
8116
8558
|
`)
|
|
8117
8559
|
});
|
|
@@ -8145,7 +8587,7 @@ async function buildContentChunks(cwd, args = [], defaultLocale = "en-US") {
|
|
|
8145
8587
|
js.push("}");
|
|
8146
8588
|
js.push("");
|
|
8147
8589
|
writes.push({
|
|
8148
|
-
path:
|
|
8590
|
+
path: join11(cwd, OUTPUT_COLLECTIONS_DIR, `${collection}.js`),
|
|
8149
8591
|
content: js.join(`
|
|
8150
8592
|
`)
|
|
8151
8593
|
});
|
|
@@ -8169,7 +8611,7 @@ async function buildSearchIndex(cwd, config2, args = []) {
|
|
|
8169
8611
|
minHeadingLevel = 1,
|
|
8170
8612
|
maxHeadingLevel = 6
|
|
8171
8613
|
} = searchConfig;
|
|
8172
|
-
const routesRoot =
|
|
8614
|
+
const routesRoot = join11(cwd, ROUTES_DIR);
|
|
8173
8615
|
const collections2 = await readdir7(routesRoot, { withFileTypes: true });
|
|
8174
8616
|
const i18n2 = await discoverI18n(cwd, config2.i18n);
|
|
8175
8617
|
const defaultLocale = i18n2.defaultLocale;
|
|
@@ -8181,7 +8623,7 @@ async function buildSearchIndex(cwd, config2, args = []) {
|
|
|
8181
8623
|
if (targetCollections.length > 0 && !targetCollections.includes(collection)) {
|
|
8182
8624
|
continue;
|
|
8183
8625
|
}
|
|
8184
|
-
const contentDir =
|
|
8626
|
+
const contentDir = join11(routesRoot, collection, "content");
|
|
8185
8627
|
try {
|
|
8186
8628
|
const files = await listContentFiles2(contentDir);
|
|
8187
8629
|
for (const fileRef of files) {
|
|
@@ -8191,7 +8633,7 @@ async function buildSearchIndex(cwd, config2, args = []) {
|
|
|
8191
8633
|
const baseName = file.split("/").pop() || file;
|
|
8192
8634
|
const name = baseName.replace(/\.(md|mdx)$/, "");
|
|
8193
8635
|
const locale = fileRef.locale || defaultLocale;
|
|
8194
|
-
const filePath =
|
|
8636
|
+
const filePath = join11(contentDir, file);
|
|
8195
8637
|
try {
|
|
8196
8638
|
const processed = processMarkdownFile(filePath);
|
|
8197
8639
|
const { frontmatter, content: content2 } = processed;
|
|
@@ -8239,13 +8681,13 @@ async function buildSearchIndex(cwd, config2, args = []) {
|
|
|
8239
8681
|
generated: new Date().toISOString(),
|
|
8240
8682
|
entries: searchIndex
|
|
8241
8683
|
};
|
|
8242
|
-
await Bun.write(
|
|
8243
|
-
console.log(`[reroute/search] Generated search index with ${searchIndex.length} entries: ${
|
|
8684
|
+
await Bun.write(join11(cwd, OUTPUT_SEARCH_INDEX), JSON.stringify(indexData, null, 2));
|
|
8685
|
+
console.log(`[reroute/search] Generated search index with ${searchIndex.length} entries: ${join11(cwd, OUTPUT_SEARCH_INDEX)}`);
|
|
8244
8686
|
}
|
|
8245
8687
|
async function preprocessMarkdownFiles(cwd, config2) {
|
|
8246
8688
|
console.log("[reroute/markdown] Starting markdown preprocessing...");
|
|
8247
|
-
const routesPath =
|
|
8248
|
-
const markdownDir =
|
|
8689
|
+
const routesPath = join11(cwd, ROUTES_DIR);
|
|
8690
|
+
const markdownDir = join11(cwd, ".reroute", "markdown");
|
|
8249
8691
|
try {
|
|
8250
8692
|
await rm(markdownDir, { force: true, recursive: true });
|
|
8251
8693
|
} catch {}
|
|
@@ -8255,8 +8697,8 @@ async function preprocessMarkdownFiles(cwd, config2) {
|
|
|
8255
8697
|
try {
|
|
8256
8698
|
const entries = await readdir7(dir, { withFileTypes: true });
|
|
8257
8699
|
for (const entry of entries) {
|
|
8258
|
-
const fullPath =
|
|
8259
|
-
const relativePath =
|
|
8700
|
+
const fullPath = join11(dir, entry.name);
|
|
8701
|
+
const relativePath = join11(base, entry.name);
|
|
8260
8702
|
if (entry.isDirectory()) {
|
|
8261
8703
|
const nested = await scanMarkdown(fullPath, relativePath);
|
|
8262
8704
|
files.push(...nested);
|
|
@@ -8278,8 +8720,8 @@ async function preprocessMarkdownFiles(cwd, config2) {
|
|
|
8278
8720
|
}
|
|
8279
8721
|
console.log(`[reroute/markdown] Found ${markdownFiles.length} markdown file(s)`);
|
|
8280
8722
|
for (const file of markdownFiles) {
|
|
8281
|
-
const sourcePath =
|
|
8282
|
-
const targetPath =
|
|
8723
|
+
const sourcePath = join11(routesPath, file);
|
|
8724
|
+
const targetPath = join11(markdownDir, file.replace(/\.mdx?$/, ".tsx"));
|
|
8283
8725
|
try {
|
|
8284
8726
|
const processed = processMarkdownFile(sourcePath);
|
|
8285
8727
|
const isMdx = file.endsWith(".mdx");
|
|
@@ -8305,8 +8747,8 @@ async function preprocessMarkdownFiles(cwd, config2) {
|
|
|
8305
8747
|
}
|
|
8306
8748
|
async function buildEntrypointBundle(cwd, args = []) {
|
|
8307
8749
|
const buildStartTime = performance.now();
|
|
8308
|
-
const clientDir =
|
|
8309
|
-
const entrypoint =
|
|
8750
|
+
const clientDir = join11(cwd, "src", "client");
|
|
8751
|
+
const entrypoint = join11(clientDir, "index.tsx");
|
|
8310
8752
|
const exists = await Bun.file(entrypoint).exists();
|
|
8311
8753
|
if (!exists) {
|
|
8312
8754
|
console.log("[reroute/gen] No index.tsx found, skipping bundle build");
|
|
@@ -8314,7 +8756,7 @@ async function buildEntrypointBundle(cwd, args = []) {
|
|
|
8314
8756
|
}
|
|
8315
8757
|
console.log("[reroute/gen] Building entrypoint bundle...");
|
|
8316
8758
|
const isProd = args.includes("--prod");
|
|
8317
|
-
const bundlesDir =
|
|
8759
|
+
const bundlesDir = join11(cwd, ".reroute", "bundles");
|
|
8318
8760
|
await mkdir3(bundlesDir, { recursive: true });
|
|
8319
8761
|
const mode = isProd ? "production" : "development";
|
|
8320
8762
|
const publicEnv = getPublicEnvVars(cwd, mode);
|
|
@@ -8416,7 +8858,7 @@ async function buildEntrypointBundle(cwd, args = []) {
|
|
|
8416
8858
|
const existingFiles = await readdir7(bundlesDir);
|
|
8417
8859
|
for (const file of existingFiles) {
|
|
8418
8860
|
if (/^(index|chunk|asset)\.[a-z0-9]+\.(js|css|js\.map|css\.map)(\.gz|\.br)?$/i.test(file) && !newFiles.has(file.replace(/\.(gz|br)$/, ""))) {
|
|
8419
|
-
await rm(
|
|
8861
|
+
await rm(join11(bundlesDir, file), { force: true });
|
|
8420
8862
|
}
|
|
8421
8863
|
}
|
|
8422
8864
|
} catch (_error) {}
|
|
@@ -8432,7 +8874,7 @@ async function buildEntrypointBundle(cwd, args = []) {
|
|
|
8432
8874
|
}
|
|
8433
8875
|
}
|
|
8434
8876
|
await Promise.all(outputs.map(async (output) => {
|
|
8435
|
-
const destPath =
|
|
8877
|
+
const destPath = join11(bundlesDir, output.fileName);
|
|
8436
8878
|
await Bun.write(destPath, output.content);
|
|
8437
8879
|
if (shouldPreCompress) {
|
|
8438
8880
|
const shouldCompress = /\.(js|css)$/i.test(output.fileName) && !output.fileName.endsWith(".map");
|
|
@@ -8501,7 +8943,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8501
8943
|
await writeStubFiles(cwd);
|
|
8502
8944
|
}
|
|
8503
8945
|
await perfTrack("Markdown preprocessing", () => preprocessMarkdownFiles(cwd, config2));
|
|
8504
|
-
const routesPath =
|
|
8946
|
+
const routesPath = join11(cwd, ROUTES_DIR);
|
|
8505
8947
|
try {
|
|
8506
8948
|
await perfTrack("Routes generation", async () => {
|
|
8507
8949
|
const files = await scanDirectory(routesPath);
|
|
@@ -8510,10 +8952,10 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8510
8952
|
const tree = generateRouteTree(all.map((f) => f.replace(/\\/g, "/")));
|
|
8511
8953
|
const streamingAnalyses = streamingEnabled ? await buildStreamingWrappersForTree(cwd, routesPath, tree, config2) : new Map;
|
|
8512
8954
|
const ts = generateTypeScript(tree, streamingAnalyses);
|
|
8513
|
-
await Bun.write(
|
|
8955
|
+
await Bun.write(join11(cwd, OUTPUT_ROUTES), ts);
|
|
8514
8956
|
});
|
|
8515
8957
|
if (!showPerformance) {
|
|
8516
|
-
console.log(`[reroute/gen] Generated routes: ${
|
|
8958
|
+
console.log(`[reroute/gen] Generated routes: ${join11(cwd, OUTPUT_ROUTES)}`);
|
|
8517
8959
|
}
|
|
8518
8960
|
} catch (error) {
|
|
8519
8961
|
console.error("[reroute/gen] Failed to generate routes:", error);
|
|
@@ -8522,7 +8964,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8522
8964
|
const i18n2 = await discoverI18n(cwd, config2.i18n);
|
|
8523
8965
|
const defaultLocale = i18n2.defaultLocale;
|
|
8524
8966
|
try {
|
|
8525
|
-
await Bun.write(
|
|
8967
|
+
await Bun.write(join11(cwd, ".reroute", "i18n.json"), JSON.stringify({
|
|
8526
8968
|
enabled: i18n2.enabled,
|
|
8527
8969
|
defaultLocale: i18n2.defaultLocale,
|
|
8528
8970
|
locales: i18n2.locales,
|
|
@@ -8539,7 +8981,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8539
8981
|
try {
|
|
8540
8982
|
await perfTrack("Content building", () => buildContentChunks(cwd, args, defaultLocale));
|
|
8541
8983
|
if (!showPerformance) {
|
|
8542
|
-
console.log(`[reroute/gen] Generated content: ${
|
|
8984
|
+
console.log(`[reroute/gen] Generated content: ${join11(cwd, OUTPUT_CONTENT_TS)} + collections/*.js`);
|
|
8543
8985
|
}
|
|
8544
8986
|
} catch (error) {
|
|
8545
8987
|
console.error("[reroute/gen] Failed to generate content:", error);
|
|
@@ -8547,17 +8989,17 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8547
8989
|
}
|
|
8548
8990
|
try {
|
|
8549
8991
|
await perfTrack("Manifest generation", async () => {
|
|
8550
|
-
const routesPath2 =
|
|
8992
|
+
const routesPath2 = join11(cwd, OUTPUT_ROUTES);
|
|
8551
8993
|
const routesModule = await import(`file://${routesPath2}?t=${Date.now()}`);
|
|
8552
8994
|
const routes = routesModule.routes || [];
|
|
8553
8995
|
const staticRoutes = routes.filter((r) => !r.params || r.params.length === 0).map((r) => r.pattern);
|
|
8554
8996
|
const contentRoutes = [];
|
|
8555
|
-
const collectionsDir =
|
|
8997
|
+
const collectionsDir = join11(cwd, ".reroute", "collections");
|
|
8556
8998
|
try {
|
|
8557
8999
|
const collectionFiles = await readdir7(collectionsDir);
|
|
8558
9000
|
for (const file of collectionFiles) {
|
|
8559
9001
|
if (file.endsWith(".js")) {
|
|
8560
|
-
const collectionPath =
|
|
9002
|
+
const collectionPath = join11(collectionsDir, file);
|
|
8561
9003
|
const collectionModule = await import(`file://${collectionPath}?t=${Date.now()}`);
|
|
8562
9004
|
const items = collectionModule.items || [];
|
|
8563
9005
|
for (const item of items) {
|
|
@@ -8582,7 +9024,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8582
9024
|
dynamicRoutes,
|
|
8583
9025
|
version: 1
|
|
8584
9026
|
};
|
|
8585
|
-
await Bun.write(
|
|
9027
|
+
await Bun.write(join11(cwd, ".reroute", "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
8586
9028
|
});
|
|
8587
9029
|
} catch (error) {
|
|
8588
9030
|
console.error("[reroute/gen] Failed to generate manifest:", error);
|
|
@@ -8603,7 +9045,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8603
9045
|
mdComponentsLines.push("");
|
|
8604
9046
|
mdComponentsLines.push(`import markdownComponents from '${componentsPath}';`);
|
|
8605
9047
|
mdComponentsLines.push("export { markdownComponents };");
|
|
8606
|
-
await Bun.write(
|
|
9048
|
+
await Bun.write(join11(cwd, ".reroute/markdown-components.ts"), mdComponentsLines.join(`
|
|
8607
9049
|
`));
|
|
8608
9050
|
}
|
|
8609
9051
|
const indexLines = [];
|
|
@@ -8623,7 +9065,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8623
9065
|
const ogTemplatePath = config2.ogImage.defaultTemplate.startsWith(".") ? `../${config2.ogImage.defaultTemplate}` : config2.ogImage.defaultTemplate;
|
|
8624
9066
|
indexLines.push(`import OGTemplate from '${ogTemplatePath}';`);
|
|
8625
9067
|
}
|
|
8626
|
-
const ogFiles = await scanOgFiles(
|
|
9068
|
+
const ogFiles = await scanOgFiles(join11(cwd, ROUTES_DIR));
|
|
8627
9069
|
const ogImports = [];
|
|
8628
9070
|
for (let i = 0;i < ogFiles.length; i++) {
|
|
8629
9071
|
const ogFile = ogFiles[i];
|
|
@@ -8669,7 +9111,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8669
9111
|
}
|
|
8670
9112
|
indexLines.push("};");
|
|
8671
9113
|
}
|
|
8672
|
-
const templatePath =
|
|
9114
|
+
const templatePath = join11(cwd, "src", "client", "index.html");
|
|
8673
9115
|
try {
|
|
8674
9116
|
const templateContent = await Bun.file(templatePath).text();
|
|
8675
9117
|
indexLines.push("");
|
|
@@ -8681,7 +9123,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8681
9123
|
indexLines.push(`(globalThis as any).__REROUTE_CONFIG__ = ${serializeConfig(config2)};`);
|
|
8682
9124
|
indexLines.push("");
|
|
8683
9125
|
indexLines.push("export type RerouteBundle = typeof bundle;");
|
|
8684
|
-
await Bun.write(
|
|
9126
|
+
await Bun.write(join11(cwd, OUTPUT_ARTIFACTS), indexLines.join(`
|
|
8685
9127
|
`));
|
|
8686
9128
|
const barrelLines = [
|
|
8687
9129
|
"// \uD83D\uDEA8 Auto-generated by Reroute - DO NOT EDIT \uD83D\uDEA8",
|
|
@@ -8691,7 +9133,7 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8691
9133
|
"",
|
|
8692
9134
|
"export * from './artifacts';"
|
|
8693
9135
|
];
|
|
8694
|
-
await Bun.write(
|
|
9136
|
+
await Bun.write(join11(cwd, OUTPUT_INDEX), barrelLines.join(`
|
|
8695
9137
|
`));
|
|
8696
9138
|
const entryLines = [
|
|
8697
9139
|
"// \uD83D\uDEA8 Auto-generated by Reroute - DO NOT EDIT \uD83D\uDEA8",
|
|
@@ -8707,10 +9149,10 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8707
9149
|
"import './routes'; // Import routes (bundles all route components)",
|
|
8708
9150
|
"import '../src/index'; // Import user's server entry"
|
|
8709
9151
|
];
|
|
8710
|
-
await Bun.write(
|
|
9152
|
+
await Bun.write(join11(cwd, ".reroute/entry.ts"), entryLines.join(`
|
|
8711
9153
|
`));
|
|
8712
9154
|
if (!showPerformance) {
|
|
8713
|
-
console.log(`[reroute/gen] Generated artifacts: ${
|
|
9155
|
+
console.log(`[reroute/gen] Generated artifacts: ${join11(cwd, OUTPUT_ARTIFACTS)}`);
|
|
8714
9156
|
}
|
|
8715
9157
|
await perfTrack("Bundle building", () => buildEntrypointBundle(cwd, args));
|
|
8716
9158
|
const endTime = performance.now();
|
|
@@ -8721,22 +9163,8 @@ async function generate(cwd, args = [], options = {}) {
|
|
|
8721
9163
|
console.log(`[reroute/gen] Generation complete in ${duration}s`);
|
|
8722
9164
|
}
|
|
8723
9165
|
}
|
|
8724
|
-
async function
|
|
9166
|
+
async function startGenWatch(cwd, args) {
|
|
8725
9167
|
const genStartTime = performance.now();
|
|
8726
|
-
const cwd = process.cwd();
|
|
8727
|
-
const watchMode = args.includes("--watch") || args.includes("-w");
|
|
8728
|
-
if (!watchMode) {
|
|
8729
|
-
await generate(cwd, args);
|
|
8730
|
-
await syncThemeCss(cwd);
|
|
8731
|
-
await bundleThemeCssIntoArtifacts(cwd);
|
|
8732
|
-
checkMarkdownIfConfigured(cwd);
|
|
8733
|
-
const genEndTime2 = performance.now();
|
|
8734
|
-
const totalDuration2 = ((genEndTime2 - genStartTime) / 1000).toFixed(2);
|
|
8735
|
-
console.log(`
|
|
8736
|
-
[reroute/gen] ✓ Build complete in ${totalDuration2}s
|
|
8737
|
-
`);
|
|
8738
|
-
process.exit(0);
|
|
8739
|
-
}
|
|
8740
9168
|
console.log("[reroute/gen] Watch mode enabled");
|
|
8741
9169
|
console.log("[reroute/gen] Initial generation...");
|
|
8742
9170
|
await generate(cwd, args);
|
|
@@ -8759,14 +9187,16 @@ async function gen(args) {
|
|
|
8759
9187
|
console.log(`[reroute/gen] rebuilding notified (port ${port}, ${data.clients} browser(s))`);
|
|
8760
9188
|
} catch (_err) {}
|
|
8761
9189
|
};
|
|
8762
|
-
const notifyReload = async (reason) => {
|
|
9190
|
+
const notifyReload = async (reason, mode = "full") => {
|
|
8763
9191
|
const port = getPort();
|
|
8764
9192
|
try {
|
|
8765
9193
|
const response = await fetch(`http://localhost:${port}/__reroute_reload`, {
|
|
8766
|
-
method: "POST"
|
|
9194
|
+
method: "POST",
|
|
9195
|
+
headers: { "content-type": "application/json" },
|
|
9196
|
+
body: JSON.stringify({ mode })
|
|
8767
9197
|
});
|
|
8768
9198
|
const data = await response.json();
|
|
8769
|
-
console.log(`[reroute/gen] reload notified (port ${port}, ${data.clients} browser(s))${reason ? `: ${reason}` : ""}`);
|
|
9199
|
+
console.log(`[reroute/gen] reload notified (port ${port}, ${data.clients} browser(s), ${mode})${reason ? `: ${reason}` : ""}`);
|
|
8770
9200
|
} catch {}
|
|
8771
9201
|
};
|
|
8772
9202
|
await notifyReload("initial generation");
|
|
@@ -8775,30 +9205,35 @@ async function gen(args) {
|
|
|
8775
9205
|
let isBuilding = false;
|
|
8776
9206
|
let pendingBuild = null;
|
|
8777
9207
|
let skipCurrentBuild = false;
|
|
8778
|
-
function scheduleBuild(buildFn, reason) {
|
|
9208
|
+
function scheduleBuild(buildFn, reason, reloadMode = "full") {
|
|
8779
9209
|
if (isBuilding) {
|
|
8780
9210
|
if (!skipCurrentBuild) {
|
|
8781
9211
|
skipCurrentBuild = true;
|
|
8782
9212
|
console.log(`[reroute/watch] ⏭️ Superseding current build with: ${reason}`);
|
|
8783
9213
|
}
|
|
8784
|
-
pendingBuild = { fn: buildFn, reason };
|
|
9214
|
+
pendingBuild = { fn: buildFn, reason, reloadMode };
|
|
8785
9215
|
return;
|
|
8786
9216
|
}
|
|
8787
9217
|
if (pendingBuild) {
|
|
8788
9218
|
console.log(`[reroute/watch] ⏭️ Replacing queued build with: ${reason}`);
|
|
9219
|
+
const mergedMode = pendingBuild.reloadMode === "css" && reloadMode === "css" ? "css" : "full";
|
|
9220
|
+
pendingBuild = { fn: buildFn, reason, reloadMode: mergedMode };
|
|
9221
|
+
} else {
|
|
9222
|
+
pendingBuild = { fn: buildFn, reason, reloadMode };
|
|
8789
9223
|
}
|
|
8790
|
-
pendingBuild = { fn: buildFn, reason };
|
|
8791
9224
|
processPendingBuild();
|
|
8792
9225
|
}
|
|
8793
9226
|
async function processPendingBuild() {
|
|
8794
9227
|
if (!pendingBuild || isBuilding)
|
|
8795
9228
|
return;
|
|
8796
|
-
const { fn: buildFn, reason } = pendingBuild;
|
|
9229
|
+
const { fn: buildFn, reason, reloadMode } = pendingBuild;
|
|
8797
9230
|
pendingBuild = null;
|
|
8798
9231
|
skipCurrentBuild = false;
|
|
8799
9232
|
isBuilding = true;
|
|
8800
9233
|
const startTime = performance.now();
|
|
8801
|
-
|
|
9234
|
+
if (reloadMode !== "css") {
|
|
9235
|
+
await notifyRebuilding();
|
|
9236
|
+
}
|
|
8802
9237
|
try {
|
|
8803
9238
|
await buildFn();
|
|
8804
9239
|
if (skipCurrentBuild) {
|
|
@@ -8807,12 +9242,14 @@ async function gen(args) {
|
|
|
8807
9242
|
}
|
|
8808
9243
|
const duration = ((performance.now() - startTime) / 1000).toFixed(2);
|
|
8809
9244
|
console.log(`[reroute/watch] ✓ Rebuild complete in ${duration}s (${reason})`);
|
|
8810
|
-
|
|
9245
|
+
if (reloadMode !== "css") {
|
|
9246
|
+
await Bun.sleep(200);
|
|
9247
|
+
}
|
|
8811
9248
|
if (skipCurrentBuild || pendingBuild) {
|
|
8812
9249
|
console.log(`[reroute/watch] ⏭️ Skipping reload, new build pending`);
|
|
8813
9250
|
return;
|
|
8814
9251
|
}
|
|
8815
|
-
await notifyReload(reason);
|
|
9252
|
+
await notifyReload(reason, reloadMode);
|
|
8816
9253
|
} catch (err) {
|
|
8817
9254
|
if (!skipCurrentBuild) {
|
|
8818
9255
|
console.error(`[reroute/watch] ✗ Build failed (${reason}):`, err);
|
|
@@ -8836,7 +9273,7 @@ async function gen(args) {
|
|
|
8836
9273
|
const mediumDebounce = createDebouncer(150);
|
|
8837
9274
|
const slowDebounce = createDebouncer(300);
|
|
8838
9275
|
const loadedConfig = await loadConfig(cwd);
|
|
8839
|
-
const configPath =
|
|
9276
|
+
const configPath = join11(cwd, "reroute.config.ts");
|
|
8840
9277
|
let configWatcher = null;
|
|
8841
9278
|
try {
|
|
8842
9279
|
configWatcher = watch(configPath, () => {
|
|
@@ -8858,7 +9295,7 @@ async function gen(args) {
|
|
|
8858
9295
|
];
|
|
8859
9296
|
const envWatchers = [];
|
|
8860
9297
|
for (const envFile of envFiles) {
|
|
8861
|
-
const envPath =
|
|
9298
|
+
const envPath = join11(cwd, envFile);
|
|
8862
9299
|
try {
|
|
8863
9300
|
const envWatcher = watch(envPath, () => {
|
|
8864
9301
|
mediumDebounce(() => {
|
|
@@ -8877,21 +9314,23 @@ async function gen(args) {
|
|
|
8877
9314
|
let packagesWatcher = null;
|
|
8878
9315
|
const isRerouteWorkspace = async () => {
|
|
8879
9316
|
try {
|
|
8880
|
-
const packagesPath =
|
|
8881
|
-
const exists = await Bun.file(
|
|
9317
|
+
const packagesPath = join11(cwd, "..", "..", "packages");
|
|
9318
|
+
const exists = await Bun.file(join11(packagesPath, "core", "index.ts")).exists();
|
|
8882
9319
|
return exists;
|
|
8883
9320
|
} catch {
|
|
8884
9321
|
return false;
|
|
8885
9322
|
}
|
|
8886
9323
|
};
|
|
8887
9324
|
if (await isRerouteWorkspace()) {
|
|
8888
|
-
const packagesPath =
|
|
9325
|
+
const packagesPath = join11(cwd, "..", "..", "packages");
|
|
8889
9326
|
console.log("[reroute/watch] \uD83D\uDD27 Workspace development mode enabled");
|
|
8890
9327
|
console.log(`[reroute/watch] \uD83D\uDD27 Watching ${packagesPath}...`);
|
|
8891
9328
|
packagesWatcher = watch(packagesPath, { recursive: true }, (_ev, filename) => {
|
|
8892
9329
|
if (!filename)
|
|
8893
9330
|
return;
|
|
8894
9331
|
const name = String(filename);
|
|
9332
|
+
if (isWatchNoise(name))
|
|
9333
|
+
return;
|
|
8895
9334
|
if (name.includes("dist/") || name.includes("node_modules/"))
|
|
8896
9335
|
return;
|
|
8897
9336
|
if (!/\.(tsx|ts|jsx|js)$/.test(name))
|
|
@@ -8908,12 +9347,14 @@ async function gen(args) {
|
|
|
8908
9347
|
});
|
|
8909
9348
|
});
|
|
8910
9349
|
}
|
|
8911
|
-
const routesPath =
|
|
9350
|
+
const routesPath = join11(cwd, ROUTES_DIR);
|
|
8912
9351
|
console.log(`[reroute/watch] \uD83D\uDCC1 Watching ${routesPath}...`);
|
|
8913
9352
|
const routesWatcher = watch(routesPath, { recursive: true }, (_ev, filename) => {
|
|
8914
9353
|
if (!filename)
|
|
8915
9354
|
return;
|
|
8916
9355
|
const name = String(filename);
|
|
9356
|
+
if (isWatchNoise(name))
|
|
9357
|
+
return;
|
|
8917
9358
|
quickDebounce(() => {
|
|
8918
9359
|
scheduleBuild(async () => {
|
|
8919
9360
|
const isContentFile = name.includes("/content/") || name.includes("\\content\\");
|
|
@@ -8931,7 +9372,7 @@ async function gen(args) {
|
|
|
8931
9372
|
console.log("[reroute/watch] ├─ Building content chunks...");
|
|
8932
9373
|
const contentStart = performance.now();
|
|
8933
9374
|
const watchI18n = await discoverI18n(cwd, loadedConfig.i18n);
|
|
8934
|
-
await Bun.write(
|
|
9375
|
+
await Bun.write(join11(cwd, ".reroute", "i18n.json"), JSON.stringify({
|
|
8935
9376
|
enabled: watchI18n.enabled,
|
|
8936
9377
|
defaultLocale: watchI18n.defaultLocale,
|
|
8937
9378
|
locales: watchI18n.locales,
|
|
@@ -8968,22 +9409,30 @@ async function gen(args) {
|
|
|
8968
9409
|
}, "routes change");
|
|
8969
9410
|
});
|
|
8970
9411
|
});
|
|
8971
|
-
const clientPath =
|
|
9412
|
+
const clientPath = join11(cwd, "src", "client");
|
|
8972
9413
|
console.log(`[reroute/watch] \uD83D\uDCE6 Watching ${clientPath}...`);
|
|
9414
|
+
let pendingClientFiles = new Set;
|
|
8973
9415
|
const clientWatcher = watch(clientPath, { recursive: true }, (_ev, filename) => {
|
|
8974
9416
|
if (!filename)
|
|
8975
9417
|
return;
|
|
8976
9418
|
const name = String(filename);
|
|
9419
|
+
if (isWatchNoise(name))
|
|
9420
|
+
return;
|
|
8977
9421
|
if (name.includes(".reroute") || name.includes("node_modules"))
|
|
8978
9422
|
return;
|
|
8979
9423
|
if (name.includes("routes/") || name.includes("routes\\"))
|
|
8980
9424
|
return;
|
|
8981
9425
|
if (!/\.(tsx|ts|jsx|js|html|md|mdx|css)$/.test(name))
|
|
8982
9426
|
return;
|
|
9427
|
+
pendingClientFiles.add(name);
|
|
8983
9428
|
mediumDebounce(() => {
|
|
9429
|
+
const names = [...pendingClientFiles];
|
|
9430
|
+
pendingClientFiles = new Set;
|
|
9431
|
+
const reloadMode = names.every((n) => n.endsWith(".css")) ? "css" : "full";
|
|
9432
|
+
const label = names.length === 1 ? names[0] : `${names.length} files`;
|
|
8984
9433
|
scheduleBuild(async () => {
|
|
8985
|
-
console.log(`[reroute/watch] \uD83D\uDCE6 Client changed: ${
|
|
8986
|
-
if (
|
|
9434
|
+
console.log(`[reroute/watch] \uD83D\uDCE6 Client changed: ${label}`);
|
|
9435
|
+
if (names.some((n) => shouldRebuildClientBundle(n))) {
|
|
8987
9436
|
console.log("[reroute/watch] ├─ Rebuilding bundle...");
|
|
8988
9437
|
const bundleStart = performance.now();
|
|
8989
9438
|
try {
|
|
@@ -8999,7 +9448,7 @@ async function gen(args) {
|
|
|
8999
9448
|
if (themeSynced) {
|
|
9000
9449
|
console.log("[reroute/watch] ├─ index.css synced");
|
|
9001
9450
|
}
|
|
9002
|
-
}, "client change");
|
|
9451
|
+
}, "client change", reloadMode);
|
|
9003
9452
|
});
|
|
9004
9453
|
});
|
|
9005
9454
|
console.log(`[reroute/watch] ✓ Watch mode active - ready for changes!
|
|
@@ -9011,16 +9460,42 @@ async function gen(args) {
|
|
|
9011
9460
|
configWatcher,
|
|
9012
9461
|
...envWatchers
|
|
9013
9462
|
].filter(Boolean);
|
|
9014
|
-
|
|
9015
|
-
|
|
9463
|
+
return {
|
|
9464
|
+
close() {
|
|
9465
|
+
console.log(`
|
|
9016
9466
|
[reroute/watch] \uD83D\uDED1 Stopping watch mode...`);
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9467
|
+
for (const watcher of watchers) {
|
|
9468
|
+
try {
|
|
9469
|
+
watcher?.close();
|
|
9470
|
+
} catch {}
|
|
9471
|
+
}
|
|
9021
9472
|
}
|
|
9473
|
+
};
|
|
9474
|
+
}
|
|
9475
|
+
async function gen(args) {
|
|
9476
|
+
const cwd = process.cwd();
|
|
9477
|
+
const watchMode = args.includes("--watch") || args.includes("-w");
|
|
9478
|
+
if (!watchMode) {
|
|
9479
|
+
const genStartTime = performance.now();
|
|
9480
|
+
await generate(cwd, args);
|
|
9481
|
+
await syncThemeCss(cwd);
|
|
9482
|
+
await bundleThemeCssIntoArtifacts(cwd);
|
|
9483
|
+
checkMarkdownIfConfigured(cwd);
|
|
9484
|
+
const genEndTime = performance.now();
|
|
9485
|
+
const totalDuration = ((genEndTime - genStartTime) / 1000).toFixed(2);
|
|
9486
|
+
console.log(`
|
|
9487
|
+
[reroute/gen] ✓ Build complete in ${totalDuration}s
|
|
9488
|
+
`);
|
|
9022
9489
|
process.exit(0);
|
|
9490
|
+
}
|
|
9491
|
+
const session = await startGenWatch(cwd, args);
|
|
9492
|
+
await new Promise((resolve3) => {
|
|
9493
|
+
process.on("SIGINT", () => {
|
|
9494
|
+
session.close();
|
|
9495
|
+
resolve3();
|
|
9496
|
+
});
|
|
9023
9497
|
});
|
|
9498
|
+
process.exit(0);
|
|
9024
9499
|
}
|
|
9025
9500
|
var ROUTES_DIR = "src/client/routes", OUTPUT_DIR = ".reroute", OUTPUT_ROUTES = ".reroute/routes.ts", OUTPUT_CONTENT_TS = ".reroute/content.ts", OUTPUT_COLLECTIONS_DIR = ".reroute/collections", OUTPUT_SEARCH_INDEX = ".reroute/search.json", OUTPUT_ARTIFACTS = ".reroute/artifacts.ts", OUTPUT_INDEX = ".reroute/index.ts";
|
|
9026
9501
|
var init_gen = __esm(() => {
|
|
@@ -9032,6 +9507,35 @@ var init_gen = __esm(() => {
|
|
|
9032
9507
|
init_theme();
|
|
9033
9508
|
});
|
|
9034
9509
|
|
|
9510
|
+
// packages/cli/src/commands/lib/command.ts
|
|
9511
|
+
var exports_command = {};
|
|
9512
|
+
__export(exports_command, {
|
|
9513
|
+
getRerouteCommand: () => getRerouteCommand
|
|
9514
|
+
});
|
|
9515
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
9516
|
+
import { join as join12 } from "node:path";
|
|
9517
|
+
function getRerouteCommand() {
|
|
9518
|
+
const binPath = join12(import.meta.dir, "..", "..", "bin.ts");
|
|
9519
|
+
const isBunDev = existsSync6(binPath);
|
|
9520
|
+
if (isBunDev) {
|
|
9521
|
+
return `bun ${binPath}`;
|
|
9522
|
+
}
|
|
9523
|
+
const cwd = process.cwd();
|
|
9524
|
+
const nodeModulesPaths = [
|
|
9525
|
+
join12(cwd, "node_modules", ".bin", "reroute"),
|
|
9526
|
+
join12(cwd, "..", "node_modules", ".bin", "reroute"),
|
|
9527
|
+
join12(cwd, "..", "..", "node_modules", ".bin", "reroute"),
|
|
9528
|
+
join12(cwd, "..", "..", "..", "node_modules", ".bin", "reroute")
|
|
9529
|
+
];
|
|
9530
|
+
for (const binPath2 of nodeModulesPaths) {
|
|
9531
|
+
if (existsSync6(binPath2)) {
|
|
9532
|
+
return binPath2;
|
|
9533
|
+
}
|
|
9534
|
+
}
|
|
9535
|
+
return "reroute";
|
|
9536
|
+
}
|
|
9537
|
+
var init_command = () => {};
|
|
9538
|
+
|
|
9035
9539
|
// packages/cli/src/commands/lib/log.ts
|
|
9036
9540
|
function colorizeLogPrefix(text) {
|
|
9037
9541
|
let colored = text;
|
|
@@ -9082,6 +9586,17 @@ var init_log = __esm(() => {
|
|
|
9082
9586
|
});
|
|
9083
9587
|
|
|
9084
9588
|
// packages/cli/src/commands/lib/server.ts
|
|
9589
|
+
async function isServerRunning(port, timeout = 1000) {
|
|
9590
|
+
try {
|
|
9591
|
+
const response = await fetch(`http://localhost:${port}/`, {
|
|
9592
|
+
method: "GET",
|
|
9593
|
+
signal: AbortSignal.timeout(timeout)
|
|
9594
|
+
});
|
|
9595
|
+
return response.status < 500;
|
|
9596
|
+
} catch {
|
|
9597
|
+
return false;
|
|
9598
|
+
}
|
|
9599
|
+
}
|
|
9085
9600
|
async function waitForServerReady(port = 3000, timeout = 30000) {
|
|
9086
9601
|
const startTime = Date.now();
|
|
9087
9602
|
let checkInterval = 50;
|
|
@@ -9096,14 +9611,14 @@ async function waitForServerReady(port = 3000, timeout = 30000) {
|
|
|
9096
9611
|
return;
|
|
9097
9612
|
}
|
|
9098
9613
|
} catch {}
|
|
9099
|
-
await new Promise((
|
|
9614
|
+
await new Promise((resolve3) => setTimeout(resolve3, checkInterval));
|
|
9100
9615
|
checkInterval = Math.min(checkInterval * 1.5, maxInterval);
|
|
9101
9616
|
}
|
|
9102
9617
|
throw new Error(`Timeout waiting for server to respond after ${timeout}ms. ` + `Make sure your server is starting correctly on port ${port}.`);
|
|
9103
9618
|
}
|
|
9104
9619
|
|
|
9105
9620
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/alias.js
|
|
9106
|
-
var require_alias = __commonJS((exports)
|
|
9621
|
+
var require_alias = __commonJS(function(exports) {
|
|
9107
9622
|
var alias = exports;
|
|
9108
9623
|
alias.bools = {
|
|
9109
9624
|
auto_left_margin: ["bw", "bw"],
|
|
@@ -9578,7 +10093,7 @@ var require_alias = __commonJS((exports) => {
|
|
|
9578
10093
|
});
|
|
9579
10094
|
|
|
9580
10095
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/tput.js
|
|
9581
|
-
var require_tput = __commonJS((exports, module)
|
|
10096
|
+
var require_tput = __commonJS(function(exports, module) {
|
|
9582
10097
|
var __dirname = "/Users/stewan/dev/reroute/node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib";
|
|
9583
10098
|
var assert = __require("assert");
|
|
9584
10099
|
var path3 = __require("path");
|
|
@@ -11676,7 +12191,7 @@ var require_tput = __commonJS((exports, module) => {
|
|
|
11676
12191
|
});
|
|
11677
12192
|
|
|
11678
12193
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/colors.js
|
|
11679
|
-
var require_colors = __commonJS((exports)
|
|
12194
|
+
var require_colors = __commonJS(function(exports) {
|
|
11680
12195
|
exports.match = function(r1, g1, b1) {
|
|
11681
12196
|
if (typeof r1 === "string") {
|
|
11682
12197
|
var hex = r1;
|
|
@@ -12096,7 +12611,7 @@ var require_colors = __commonJS((exports) => {
|
|
|
12096
12611
|
});
|
|
12097
12612
|
|
|
12098
12613
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/keys.js
|
|
12099
|
-
var require_keys = __commonJS((exports)
|
|
12614
|
+
var require_keys = __commonJS(function(exports) {
|
|
12100
12615
|
var EventEmitter = __require("events").EventEmitter;
|
|
12101
12616
|
function listenerCount(stream2, event) {
|
|
12102
12617
|
return EventEmitter.listenerCount ? EventEmitter.listenerCount(stream2, event) : stream2.listeners(event).length;
|
|
@@ -12453,7 +12968,7 @@ var require_keys = __commonJS((exports) => {
|
|
|
12453
12968
|
});
|
|
12454
12969
|
|
|
12455
12970
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/gpmclient.js
|
|
12456
|
-
var require_gpmclient = __commonJS((exports, module)
|
|
12971
|
+
var require_gpmclient = __commonJS(function(exports, module) {
|
|
12457
12972
|
var net = __require("net");
|
|
12458
12973
|
var fs = __require("fs");
|
|
12459
12974
|
var EventEmitter = __require("events").EventEmitter;
|
|
@@ -12528,8 +13043,8 @@ var require_gpmclient = __commonJS((exports, module) => {
|
|
|
12528
13043
|
}
|
|
12529
13044
|
var self2 = this;
|
|
12530
13045
|
if (tty) {
|
|
12531
|
-
fs.stat(GPM_SOCKET, function(err,
|
|
12532
|
-
if (err || !
|
|
13046
|
+
fs.stat(GPM_SOCKET, function(err, stat6) {
|
|
13047
|
+
if (err || !stat6.isSocket()) {
|
|
12533
13048
|
return;
|
|
12534
13049
|
}
|
|
12535
13050
|
var conf = {
|
|
@@ -12616,7 +13131,7 @@ var require_gpmclient = __commonJS((exports, module) => {
|
|
|
12616
13131
|
});
|
|
12617
13132
|
|
|
12618
13133
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/program.js
|
|
12619
|
-
var require_program = __commonJS((exports, module)
|
|
13134
|
+
var require_program = __commonJS(function(exports, module) {
|
|
12620
13135
|
var EventEmitter = __require("events").EventEmitter;
|
|
12621
13136
|
var StringDecoder = __require("string_decoder").StringDecoder;
|
|
12622
13137
|
var cp = __require("child_process");
|
|
@@ -15157,7 +15672,7 @@ var require_program = __commonJS((exports, module) => {
|
|
|
15157
15672
|
});
|
|
15158
15673
|
|
|
15159
15674
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widget.js
|
|
15160
|
-
var require_widget = __commonJS((exports)
|
|
15675
|
+
var require_widget = __commonJS(function(exports) {
|
|
15161
15676
|
var widget = exports;
|
|
15162
15677
|
widget.classes = [
|
|
15163
15678
|
"Node",
|
|
@@ -15211,7 +15726,7 @@ var require_widget = __commonJS((exports) => {
|
|
|
15211
15726
|
});
|
|
15212
15727
|
|
|
15213
15728
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/unicode.js
|
|
15214
|
-
var require_unicode = __commonJS((exports)
|
|
15729
|
+
var require_unicode = __commonJS(function(exports) {
|
|
15215
15730
|
var stringFromCharCode = String.fromCharCode;
|
|
15216
15731
|
var floor = Math.floor;
|
|
15217
15732
|
exports.charWidth = function(str, i) {
|
|
@@ -15511,7 +16026,7 @@ var require_unicode = __commonJS((exports) => {
|
|
|
15511
16026
|
});
|
|
15512
16027
|
|
|
15513
16028
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/events.js
|
|
15514
|
-
var require_events = __commonJS((exports, module)
|
|
16029
|
+
var require_events = __commonJS(function(exports, module) {
|
|
15515
16030
|
var slice = Array.prototype.slice;
|
|
15516
16031
|
function EventEmitter() {
|
|
15517
16032
|
if (!this._events)
|
|
@@ -15611,7 +16126,7 @@ var require_events = __commonJS((exports, module) => {
|
|
|
15611
16126
|
});
|
|
15612
16127
|
|
|
15613
16128
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/node.js
|
|
15614
|
-
var require_node = __commonJS((exports, module)
|
|
16129
|
+
var require_node = __commonJS(function(exports, module) {
|
|
15615
16130
|
var EventEmitter = require_events().EventEmitter;
|
|
15616
16131
|
function Node(options) {
|
|
15617
16132
|
var self2 = this;
|
|
@@ -15833,7 +16348,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
15833
16348
|
});
|
|
15834
16349
|
|
|
15835
16350
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/element.js
|
|
15836
|
-
var require_element = __commonJS((exports, module)
|
|
16351
|
+
var require_element = __commonJS(function(exports, module) {
|
|
15837
16352
|
var assert = __require("assert");
|
|
15838
16353
|
var colors = require_colors();
|
|
15839
16354
|
var unicode = require_unicode();
|
|
@@ -17746,7 +18261,7 @@ var require_element = __commonJS((exports, module) => {
|
|
|
17746
18261
|
});
|
|
17747
18262
|
|
|
17748
18263
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/box.js
|
|
17749
|
-
var require_box = __commonJS((exports, module)
|
|
18264
|
+
var require_box = __commonJS(function(exports, module) {
|
|
17750
18265
|
var Node = require_node();
|
|
17751
18266
|
var Element = require_element();
|
|
17752
18267
|
function Box(options) {
|
|
@@ -17762,7 +18277,7 @@ var require_box = __commonJS((exports, module) => {
|
|
|
17762
18277
|
});
|
|
17763
18278
|
|
|
17764
18279
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/scrollablebox.js
|
|
17765
|
-
var require_scrollablebox = __commonJS((exports, module)
|
|
18280
|
+
var require_scrollablebox = __commonJS(function(exports, module) {
|
|
17766
18281
|
var Node = require_node();
|
|
17767
18282
|
var Box = require_box();
|
|
17768
18283
|
function ScrollableBox(options) {
|
|
@@ -18042,7 +18557,7 @@ var require_scrollablebox = __commonJS((exports, module) => {
|
|
|
18042
18557
|
});
|
|
18043
18558
|
|
|
18044
18559
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/scrollabletext.js
|
|
18045
|
-
var require_scrollabletext = __commonJS((exports, module)
|
|
18560
|
+
var require_scrollabletext = __commonJS(function(exports, module) {
|
|
18046
18561
|
var Node = require_node();
|
|
18047
18562
|
var ScrollableBox = require_scrollablebox();
|
|
18048
18563
|
function ScrollableText(options) {
|
|
@@ -18059,7 +18574,7 @@ var require_scrollabletext = __commonJS((exports, module) => {
|
|
|
18059
18574
|
});
|
|
18060
18575
|
|
|
18061
18576
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/log.js
|
|
18062
|
-
var require_log = __commonJS((exports, module)
|
|
18577
|
+
var require_log = __commonJS(function(exports, module) {
|
|
18063
18578
|
var util = __require("util");
|
|
18064
18579
|
var nextTick = global.setImmediate || process.nextTick.bind(process);
|
|
18065
18580
|
var Node = require_node();
|
|
@@ -18113,7 +18628,7 @@ var require_log = __commonJS((exports, module) => {
|
|
|
18113
18628
|
});
|
|
18114
18629
|
|
|
18115
18630
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/widgets/screen.js
|
|
18116
|
-
var require_screen = __commonJS((exports, module)
|
|
18631
|
+
var require_screen = __commonJS(function(exports, module) {
|
|
18117
18632
|
var path3 = __require("path");
|
|
18118
18633
|
var fs = __require("fs");
|
|
18119
18634
|
var cp = __require("child_process");
|
|
@@ -19437,12 +19952,12 @@ var require_screen = __commonJS((exports, module) => {
|
|
|
19437
19952
|
env: process.env,
|
|
19438
19953
|
cwd: process.env.HOME
|
|
19439
19954
|
};
|
|
19440
|
-
function
|
|
19955
|
+
function writeFile2(callback2) {
|
|
19441
19956
|
if (!options.value)
|
|
19442
19957
|
return callback2();
|
|
19443
19958
|
return fs.writeFile(file, options.value, callback2);
|
|
19444
19959
|
}
|
|
19445
|
-
return
|
|
19960
|
+
return writeFile2(function(err) {
|
|
19446
19961
|
if (err)
|
|
19447
19962
|
return callback(err);
|
|
19448
19963
|
return self2.exec(editor, args, opt, function(err2, success) {
|
|
@@ -19822,7 +20337,7 @@ var require_screen = __commonJS((exports, module) => {
|
|
|
19822
20337
|
});
|
|
19823
20338
|
|
|
19824
20339
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/helpers.js
|
|
19825
|
-
var require_helpers = __commonJS((exports)
|
|
20340
|
+
var require_helpers = __commonJS(function(exports) {
|
|
19826
20341
|
var fs = __require("fs");
|
|
19827
20342
|
var unicode = require_unicode();
|
|
19828
20343
|
var helpers = exports;
|
|
@@ -19853,7 +20368,7 @@ var require_helpers = __commonJS((exports) => {
|
|
|
19853
20368
|
};
|
|
19854
20369
|
helpers.findFile = function(start, target) {
|
|
19855
20370
|
return function read(dir) {
|
|
19856
|
-
var files, file,
|
|
20371
|
+
var files, file, stat6, out;
|
|
19857
20372
|
if (dir === "/dev" || dir === "/sys" || dir === "/proc" || dir === "/net") {
|
|
19858
20373
|
return null;
|
|
19859
20374
|
}
|
|
@@ -19868,11 +20383,11 @@ var require_helpers = __commonJS((exports) => {
|
|
|
19868
20383
|
return (dir === "/" ? "" : dir) + "/" + file;
|
|
19869
20384
|
}
|
|
19870
20385
|
try {
|
|
19871
|
-
|
|
20386
|
+
stat6 = fs.lstatSync((dir === "/" ? "" : dir) + "/" + file);
|
|
19872
20387
|
} catch (e) {
|
|
19873
|
-
|
|
20388
|
+
stat6 = null;
|
|
19874
20389
|
}
|
|
19875
|
-
if (
|
|
20390
|
+
if (stat6 && stat6.isDirectory() && !stat6.isSymbolicLink()) {
|
|
19876
20391
|
out = read((dir === "/" ? "" : dir) + "/" + file);
|
|
19877
20392
|
if (out)
|
|
19878
20393
|
return out;
|
|
@@ -19944,7 +20459,7 @@ var require_helpers = __commonJS((exports) => {
|
|
|
19944
20459
|
});
|
|
19945
20460
|
|
|
19946
20461
|
// node_modules/.bun/blessed@0.1.81/node_modules/blessed/lib/blessed.js
|
|
19947
|
-
var require_blessed = __commonJS((exports, module)
|
|
20462
|
+
var require_blessed = __commonJS(function(exports, module) {
|
|
19948
20463
|
function blessed() {
|
|
19949
20464
|
return blessed.program.apply(null, arguments);
|
|
19950
20465
|
}
|
|
@@ -19962,7 +20477,7 @@ var require_blessed = __commonJS((exports, module) => {
|
|
|
19962
20477
|
});
|
|
19963
20478
|
|
|
19964
20479
|
// node_modules/.bun/x256@0.0.2/node_modules/x256/colors.json
|
|
19965
|
-
var require_colors2 = __commonJS((exports, module)
|
|
20480
|
+
var require_colors2 = __commonJS(function(exports, module) {
|
|
19966
20481
|
module.exports = [
|
|
19967
20482
|
"000000",
|
|
19968
20483
|
"800000",
|
|
@@ -20224,7 +20739,7 @@ var require_colors2 = __commonJS((exports, module) => {
|
|
|
20224
20739
|
});
|
|
20225
20740
|
|
|
20226
20741
|
// node_modules/.bun/x256@0.0.2/node_modules/x256/index.js
|
|
20227
|
-
var require_x256 = __commonJS((exports, module)
|
|
20742
|
+
var require_x256 = __commonJS(function(exports, module) {
|
|
20228
20743
|
var colors = require_colors2().map(function(hex) {
|
|
20229
20744
|
var r = parseInt(hex.slice(0, 2), 16);
|
|
20230
20745
|
var g = parseInt(hex.slice(2, 4), 16);
|
|
@@ -20249,7 +20764,7 @@ var require_x256 = __commonJS((exports, module) => {
|
|
|
20249
20764
|
});
|
|
20250
20765
|
|
|
20251
20766
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/utils.js
|
|
20252
|
-
var require_utils = __commonJS((exports)
|
|
20767
|
+
var require_utils = __commonJS(function(exports) {
|
|
20253
20768
|
var x256 = require_x256();
|
|
20254
20769
|
function MergeRecursive(obj1, obj2) {
|
|
20255
20770
|
if (obj1 == null) {
|
|
@@ -20307,7 +20822,7 @@ var require_utils = __commonJS((exports) => {
|
|
|
20307
20822
|
});
|
|
20308
20823
|
|
|
20309
20824
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/layout/grid.js
|
|
20310
|
-
var require_grid = __commonJS((exports, module)
|
|
20825
|
+
var require_grid = __commonJS(function(exports, module) {
|
|
20311
20826
|
var utils = require_utils();
|
|
20312
20827
|
var widgetSpacing = 0;
|
|
20313
20828
|
function Grid(options) {
|
|
@@ -20342,7 +20857,7 @@ var require_grid = __commonJS((exports, module) => {
|
|
|
20342
20857
|
});
|
|
20343
20858
|
|
|
20344
20859
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/layout/carousel.js
|
|
20345
|
-
var require_carousel = __commonJS((exports, module)
|
|
20860
|
+
var require_carousel = __commonJS(function(exports, module) {
|
|
20346
20861
|
function Carousel(pages, options) {
|
|
20347
20862
|
this.currPage = 0;
|
|
20348
20863
|
this.pages = pages;
|
|
@@ -20411,7 +20926,7 @@ var require_carousel = __commonJS((exports, module) => {
|
|
|
20411
20926
|
});
|
|
20412
20927
|
|
|
20413
20928
|
// node_modules/.bun/drawille-blessed-contrib@1.0.0/node_modules/drawille-blessed-contrib/index.js
|
|
20414
|
-
var require_drawille_blessed_contrib = __commonJS((exports, module)
|
|
20929
|
+
var require_drawille_blessed_contrib = __commonJS(function(exports, module) {
|
|
20415
20930
|
var map = [
|
|
20416
20931
|
[1, 8],
|
|
20417
20932
|
[2, 16],
|
|
@@ -20521,7 +21036,7 @@ var require_drawille_blessed_contrib = __commonJS((exports, module) => {
|
|
|
20521
21036
|
});
|
|
20522
21037
|
|
|
20523
21038
|
// node_modules/.bun/bresenham@0.0.3/node_modules/bresenham/index.js
|
|
20524
|
-
var require_bresenham = __commonJS((exports, module)
|
|
21039
|
+
var require_bresenham = __commonJS(function(exports, module) {
|
|
20525
21040
|
module.exports = function(x0, y0, x1, y1, fn) {
|
|
20526
21041
|
if (!fn) {
|
|
20527
21042
|
var arr = [];
|
|
@@ -20560,7 +21075,7 @@ var require_bresenham = __commonJS((exports, module) => {
|
|
|
20560
21075
|
});
|
|
20561
21076
|
|
|
20562
21077
|
// node_modules/.bun/gl-matrix@2.8.1/node_modules/gl-matrix/dist/gl-matrix.js
|
|
20563
|
-
var require_gl_matrix = __commonJS((exports, module)
|
|
21078
|
+
var require_gl_matrix = __commonJS(function(exports, module) {
|
|
20564
21079
|
/*!
|
|
20565
21080
|
@fileoverview gl-matrix - High performance matrix and vector operations
|
|
20566
21081
|
@author Brandon Jones
|
|
@@ -21661,7 +22176,7 @@ var require_gl_matrix = __commonJS((exports, module) => {
|
|
|
21661
22176
|
});
|
|
21662
22177
|
|
|
21663
22178
|
// node_modules/.bun/drawille-canvas-blessed-contrib@0.1.3/node_modules/drawille-canvas-blessed-contrib/index.js
|
|
21664
|
-
var require_drawille_canvas_blessed_contrib = __commonJS((exports, module)
|
|
22179
|
+
var require_drawille_canvas_blessed_contrib = __commonJS(function(exports, module) {
|
|
21665
22180
|
var Canvas = require_drawille_blessed_contrib();
|
|
21666
22181
|
var bresenham = require_bresenham();
|
|
21667
22182
|
var glMatrix = require_gl_matrix();
|
|
@@ -21868,7 +22383,7 @@ var require_drawille_canvas_blessed_contrib = __commonJS((exports, module) => {
|
|
|
21868
22383
|
});
|
|
21869
22384
|
|
|
21870
22385
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/canvas.js
|
|
21871
|
-
var require_canvas = __commonJS((exports, module)
|
|
22386
|
+
var require_canvas = __commonJS(function(exports, module) {
|
|
21872
22387
|
var blessed = require_blessed();
|
|
21873
22388
|
var Node = blessed.Node;
|
|
21874
22389
|
var Box = blessed.Box;
|
|
@@ -21908,7 +22423,7 @@ var require_canvas = __commonJS((exports, module) => {
|
|
|
21908
22423
|
});
|
|
21909
22424
|
|
|
21910
22425
|
// node_modules/.bun/map-canvas@0.1.5/node_modules/map-canvas/map.js
|
|
21911
|
-
var require_map = __commonJS((exports, module)
|
|
22426
|
+
var require_map = __commonJS(function(exports, module) {
|
|
21912
22427
|
(function() {})();
|
|
21913
22428
|
Map2.prototype.drawBackground = function() {
|
|
21914
22429
|
this.ctx.fillStyle = "rgb(0,0,0)";
|
|
@@ -81904,7 +82419,7 @@ var require_map = __commonJS((exports, module) => {
|
|
|
81904
82419
|
});
|
|
81905
82420
|
|
|
81906
82421
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/map.js
|
|
81907
|
-
var require_map2 = __commonJS((exports, module)
|
|
82422
|
+
var require_map2 = __commonJS(function(exports, module) {
|
|
81908
82423
|
var blessed = require_blessed();
|
|
81909
82424
|
var Node = blessed.Node;
|
|
81910
82425
|
var Canvas = require_canvas();
|
|
@@ -81975,7 +82490,7 @@ var require_map2 = __commonJS((exports, module) => {
|
|
|
81975
82490
|
});
|
|
81976
82491
|
|
|
81977
82492
|
// node_modules/.bun/ansi-term@0.0.2/node_modules/ansi-term/index.js
|
|
81978
|
-
var require_ansi_term = __commonJS((exports, module)
|
|
82493
|
+
var require_ansi_term = __commonJS(function(exports, module) {
|
|
81979
82494
|
var x256 = require_x256();
|
|
81980
82495
|
function AnsiTerminal(width, height) {
|
|
81981
82496
|
this.width = width;
|
|
@@ -82081,7 +82596,7 @@ var require_ansi_term = __commonJS((exports, module) => {
|
|
|
82081
82596
|
});
|
|
82082
82597
|
|
|
82083
82598
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/gauge.js
|
|
82084
|
-
var require_gauge = __commonJS((exports, module)
|
|
82599
|
+
var require_gauge = __commonJS(function(exports, module) {
|
|
82085
82600
|
var blessed = require_blessed();
|
|
82086
82601
|
var Node = blessed.Node;
|
|
82087
82602
|
var Canvas = require_canvas();
|
|
@@ -82113,7 +82628,7 @@ var require_gauge = __commonJS((exports, module) => {
|
|
|
82113
82628
|
};
|
|
82114
82629
|
Gauge.prototype.type = "gauge";
|
|
82115
82630
|
Gauge.prototype.setData = function(data) {
|
|
82116
|
-
if (typeof data ==
|
|
82631
|
+
if (typeof data == typeof [] && data.length > 0) {
|
|
82117
82632
|
this.setStack(data);
|
|
82118
82633
|
} else if (typeof data == "number") {
|
|
82119
82634
|
this.setPercent(data);
|
|
@@ -82151,7 +82666,7 @@ var require_gauge = __commonJS((exports, module) => {
|
|
|
82151
82666
|
for (var i = 0;i < stack.length; i++) {
|
|
82152
82667
|
var currentStack = stack[i];
|
|
82153
82668
|
let percent;
|
|
82154
|
-
if (typeof currentStack ==
|
|
82669
|
+
if (typeof currentStack == typeof {})
|
|
82155
82670
|
percent = currentStack.percent;
|
|
82156
82671
|
else
|
|
82157
82672
|
percent = currentStack;
|
|
@@ -82180,7 +82695,7 @@ var require_gauge = __commonJS((exports, module) => {
|
|
|
82180
82695
|
});
|
|
82181
82696
|
|
|
82182
82697
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/gauge-list.js
|
|
82183
|
-
var require_gauge_list = __commonJS((exports, module)
|
|
82698
|
+
var require_gauge_list = __commonJS(function(exports, module) {
|
|
82184
82699
|
var blessed = require_blessed();
|
|
82185
82700
|
var Node = blessed.Node;
|
|
82186
82701
|
var Canvas = require_canvas();
|
|
@@ -82231,7 +82746,7 @@ var require_gauge_list = __commonJS((exports, module) => {
|
|
|
82231
82746
|
for (var i = 0;i < stack.length; i++) {
|
|
82232
82747
|
var currentStack = stack[i];
|
|
82233
82748
|
var percent;
|
|
82234
|
-
if (typeof currentStack ==
|
|
82749
|
+
if (typeof currentStack == typeof {}) {
|
|
82235
82750
|
percent = currentStack.percent;
|
|
82236
82751
|
} else {
|
|
82237
82752
|
percent = currentStack;
|
|
@@ -82258,7 +82773,7 @@ var require_gauge_list = __commonJS((exports, module) => {
|
|
|
82258
82773
|
});
|
|
82259
82774
|
|
|
82260
82775
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/lcd.js
|
|
82261
|
-
var require_lcd = __commonJS((exports, module)
|
|
82776
|
+
var require_lcd = __commonJS(function(exports, module) {
|
|
82262
82777
|
var blessed = require_blessed();
|
|
82263
82778
|
var Node = blessed.Node;
|
|
82264
82779
|
var Canvas = require_canvas();
|
|
@@ -82615,7 +83130,7 @@ var require_lcd = __commonJS((exports, module) => {
|
|
|
82615
83130
|
});
|
|
82616
83131
|
|
|
82617
83132
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/donut.js
|
|
82618
|
-
var require_donut = __commonJS((exports, module)
|
|
83133
|
+
var require_donut = __commonJS(function(exports, module) {
|
|
82619
83134
|
var blessed = require_blessed();
|
|
82620
83135
|
var Node = blessed.Node;
|
|
82621
83136
|
var Canvas = require_canvas();
|
|
@@ -82703,15 +83218,15 @@ var require_donut = __commonJS((exports, module) => {
|
|
|
82703
83218
|
c.fillText(ptext, cxx - Math.round(parseFloat(c.measureText(ptext).width / 2)) + 3, middle2);
|
|
82704
83219
|
c.fillText(label, cxx - Math.round(parseFloat(c.measureText(label).width / 2)) + 3, middle2 + radius2 + 5);
|
|
82705
83220
|
}
|
|
82706
|
-
function makeDonut(
|
|
83221
|
+
function makeDonut(stat6, which) {
|
|
82707
83222
|
var left = radius + spacing * which + radius * 2 * (which - 1);
|
|
82708
|
-
var percent =
|
|
83223
|
+
var percent = stat6.percent;
|
|
82709
83224
|
if (percent > 1.001) {
|
|
82710
83225
|
percent = parseFloat(percent / 100).toFixed(2);
|
|
82711
83226
|
}
|
|
82712
|
-
var label =
|
|
82713
|
-
var percentAltNumber =
|
|
82714
|
-
var color =
|
|
83227
|
+
var label = stat6.label;
|
|
83228
|
+
var percentAltNumber = stat6.percentAltNumber;
|
|
83229
|
+
var color = stat6.color || "green";
|
|
82715
83230
|
var cxx = left;
|
|
82716
83231
|
drawDonut(label, percent, radius, width, cxx, middle, color, percentAltNumber);
|
|
82717
83232
|
}
|
|
@@ -82745,7 +83260,7 @@ var require_donut = __commonJS((exports, module) => {
|
|
|
82745
83260
|
});
|
|
82746
83261
|
|
|
82747
83262
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/log.js
|
|
82748
|
-
var require_log2 = __commonJS((exports, module)
|
|
83263
|
+
var require_log2 = __commonJS(function(exports, module) {
|
|
82749
83264
|
var blessed = require_blessed();
|
|
82750
83265
|
var Node = blessed.Node;
|
|
82751
83266
|
var List = blessed.List;
|
|
@@ -82774,7 +83289,7 @@ var require_log2 = __commonJS((exports, module) => {
|
|
|
82774
83289
|
});
|
|
82775
83290
|
|
|
82776
83291
|
// node_modules/.bun/png-js@0.1.1/node_modules/png-js/png-node.js
|
|
82777
|
-
var require_png_node = __commonJS((exports, module)
|
|
83292
|
+
var require_png_node = __commonJS(function(exports, module) {
|
|
82778
83293
|
(function() {
|
|
82779
83294
|
var PNG, fs, zlib;
|
|
82780
83295
|
fs = __require("fs");
|
|
@@ -83055,7 +83570,7 @@ var require_png_node = __commonJS((exports, module) => {
|
|
|
83055
83570
|
});
|
|
83056
83571
|
|
|
83057
83572
|
// node_modules/.bun/charm@0.1.2/node_modules/charm/lib/encode.js
|
|
83058
|
-
var require_encode = __commonJS((exports, module)
|
|
83573
|
+
var require_encode = __commonJS(function(exports, module) {
|
|
83059
83574
|
var encode = module.exports = function(xs) {
|
|
83060
83575
|
function bytes(s) {
|
|
83061
83576
|
if (typeof s === "string") {
|
|
@@ -83074,7 +83589,7 @@ var require_encode = __commonJS((exports, module) => {
|
|
|
83074
83589
|
});
|
|
83075
83590
|
|
|
83076
83591
|
// node_modules/.bun/charm@0.1.2/node_modules/charm/index.js
|
|
83077
|
-
var require_charm = __commonJS((exports, module)
|
|
83592
|
+
var require_charm = __commonJS(function(exports, module) {
|
|
83078
83593
|
var tty = __require("tty");
|
|
83079
83594
|
var encode = require_encode();
|
|
83080
83595
|
var Stream = __require("stream").Stream;
|
|
@@ -83343,7 +83858,7 @@ var require_charm = __commonJS((exports, module) => {
|
|
|
83343
83858
|
});
|
|
83344
83859
|
|
|
83345
83860
|
// node_modules/.bun/buffers@0.1.1/node_modules/buffers/index.js
|
|
83346
|
-
var require_buffers = __commonJS((exports, module)
|
|
83861
|
+
var require_buffers = __commonJS(function(exports, module) {
|
|
83347
83862
|
module.exports = Buffers;
|
|
83348
83863
|
function Buffers(bufs) {
|
|
83349
83864
|
if (!(this instanceof Buffers))
|
|
@@ -83553,7 +84068,7 @@ var require_buffers = __commonJS((exports, module) => {
|
|
|
83553
84068
|
});
|
|
83554
84069
|
|
|
83555
84070
|
// node_modules/.bun/wordwrap@0.0.3/node_modules/wordwrap/index.js
|
|
83556
|
-
var require_wordwrap = __commonJS((exports, module)
|
|
84071
|
+
var require_wordwrap = __commonJS(function(exports, module) {
|
|
83557
84072
|
var wordwrap = module.exports = function(start, stop, params) {
|
|
83558
84073
|
if (typeof start === "object") {
|
|
83559
84074
|
params = start;
|
|
@@ -83614,7 +84129,7 @@ var require_wordwrap = __commonJS((exports, module) => {
|
|
|
83614
84129
|
});
|
|
83615
84130
|
|
|
83616
84131
|
// node_modules/.bun/optimist@0.2.8/node_modules/optimist/index.js
|
|
83617
|
-
var require_optimist = __commonJS((exports, module)
|
|
84132
|
+
var require_optimist = __commonJS(function(exports, module) {
|
|
83618
84133
|
var path3 = __require("path");
|
|
83619
84134
|
var wordwrap = require_wordwrap();
|
|
83620
84135
|
var inst = Argv(process.argv.slice(2));
|
|
@@ -83956,7 +84471,7 @@ var require_optimist = __commonJS((exports, module) => {
|
|
|
83956
84471
|
});
|
|
83957
84472
|
|
|
83958
84473
|
// node_modules/.bun/event-stream@0.9.8/node_modules/event-stream/index.js
|
|
83959
|
-
var require_event_stream = __commonJS((exports)
|
|
84474
|
+
var require_event_stream = __commonJS(function(exports) {
|
|
83960
84475
|
var Stream = __require("stream").Stream;
|
|
83961
84476
|
var es = exports;
|
|
83962
84477
|
es.Stream = Stream;
|
|
@@ -84381,7 +84896,7 @@ var require_event_stream = __commonJS((exports) => {
|
|
|
84381
84896
|
});
|
|
84382
84897
|
|
|
84383
84898
|
// node_modules/.bun/picture-tuber@1.0.2/node_modules/picture-tuber/index.js
|
|
84384
|
-
var require_picture_tuber = __commonJS((exports, module)
|
|
84899
|
+
var require_picture_tuber = __commonJS(function(exports, module) {
|
|
84385
84900
|
var PNG = require_png_node();
|
|
84386
84901
|
var charm = require_charm();
|
|
84387
84902
|
var x256 = require_x256();
|
|
@@ -84422,14 +84937,14 @@ var require_picture_tuber = __commonJS((exports, module) => {
|
|
|
84422
84937
|
});
|
|
84423
84938
|
|
|
84424
84939
|
// node_modules/.bun/isarray@0.0.1/node_modules/isarray/index.js
|
|
84425
|
-
var require_isarray = __commonJS((exports, module)
|
|
84940
|
+
var require_isarray = __commonJS(function(exports, module) {
|
|
84426
84941
|
module.exports = Array.isArray || function(arr) {
|
|
84427
84942
|
return Object.prototype.toString.call(arr) == "[object Array]";
|
|
84428
84943
|
};
|
|
84429
84944
|
});
|
|
84430
84945
|
|
|
84431
84946
|
// node_modules/.bun/core-util-is@1.0.3/node_modules/core-util-is/lib/util.js
|
|
84432
|
-
var require_util = __commonJS((exports)
|
|
84947
|
+
var require_util = __commonJS(function(exports) {
|
|
84433
84948
|
function isArray(arg) {
|
|
84434
84949
|
if (Array.isArray) {
|
|
84435
84950
|
return Array.isArray(arg);
|
|
@@ -84496,7 +85011,7 @@ var require_util = __commonJS((exports) => {
|
|
|
84496
85011
|
});
|
|
84497
85012
|
|
|
84498
85013
|
// node_modules/.bun/inherits@2.0.4/node_modules/inherits/inherits_browser.js
|
|
84499
|
-
var require_inherits_browser = __commonJS((exports, module)
|
|
85014
|
+
var require_inherits_browser = __commonJS(function(exports, module) {
|
|
84500
85015
|
if (typeof Object.create === "function") {
|
|
84501
85016
|
module.exports = function inherits(ctor, superCtor) {
|
|
84502
85017
|
if (superCtor) {
|
|
@@ -84525,7 +85040,7 @@ var require_inherits_browser = __commonJS((exports, module) => {
|
|
|
84525
85040
|
});
|
|
84526
85041
|
|
|
84527
85042
|
// node_modules/.bun/inherits@2.0.4/node_modules/inherits/inherits.js
|
|
84528
|
-
var require_inherits = __commonJS((exports, module)
|
|
85043
|
+
var require_inherits = __commonJS(function(exports, module) {
|
|
84529
85044
|
try {
|
|
84530
85045
|
util = __require("util");
|
|
84531
85046
|
if (typeof util.inherits !== "function")
|
|
@@ -84538,7 +85053,7 @@ var require_inherits = __commonJS((exports, module) => {
|
|
|
84538
85053
|
});
|
|
84539
85054
|
|
|
84540
85055
|
// node_modules/.bun/string_decoder@0.10.31/node_modules/string_decoder/index.js
|
|
84541
|
-
var require_string_decoder = __commonJS((exports)
|
|
85056
|
+
var require_string_decoder = __commonJS(function(exports) {
|
|
84542
85057
|
var Buffer2 = __require("buffer").Buffer;
|
|
84543
85058
|
var isBufferEncoding = Buffer2.isEncoding || function(encoding) {
|
|
84544
85059
|
switch (encoding && encoding.toLowerCase()) {
|
|
@@ -84674,7 +85189,7 @@ var require_string_decoder = __commonJS((exports) => {
|
|
|
84674
85189
|
});
|
|
84675
85190
|
|
|
84676
85191
|
// node_modules/.bun/readable-stream@1.0.34/node_modules/readable-stream/lib/_stream_readable.js
|
|
84677
|
-
var require__stream_readable = __commonJS((exports, module)
|
|
85192
|
+
var require__stream_readable = __commonJS(function(exports, module) {
|
|
84678
85193
|
module.exports = Readable;
|
|
84679
85194
|
var isArray = require_isarray();
|
|
84680
85195
|
var Buffer2 = __require("buffer").Buffer;
|
|
@@ -85281,7 +85796,7 @@ var require__stream_readable = __commonJS((exports, module) => {
|
|
|
85281
85796
|
});
|
|
85282
85797
|
|
|
85283
85798
|
// node_modules/.bun/readable-stream@1.0.34/node_modules/readable-stream/lib/_stream_duplex.js
|
|
85284
|
-
var require__stream_duplex = __commonJS((exports, module)
|
|
85799
|
+
var require__stream_duplex = __commonJS(function(exports, module) {
|
|
85285
85800
|
module.exports = Duplex;
|
|
85286
85801
|
var objectKeys = Object.keys || function(obj) {
|
|
85287
85802
|
var keys = [];
|
|
@@ -85325,7 +85840,7 @@ var require__stream_duplex = __commonJS((exports, module) => {
|
|
|
85325
85840
|
});
|
|
85326
85841
|
|
|
85327
85842
|
// node_modules/.bun/readable-stream@1.0.34/node_modules/readable-stream/lib/_stream_writable.js
|
|
85328
|
-
var require__stream_writable = __commonJS((exports, module)
|
|
85843
|
+
var require__stream_writable = __commonJS(function(exports, module) {
|
|
85329
85844
|
module.exports = Writable;
|
|
85330
85845
|
var Buffer2 = __require("buffer").Buffer;
|
|
85331
85846
|
Writable.WritableState = WritableState;
|
|
@@ -85553,7 +86068,7 @@ var require__stream_writable = __commonJS((exports, module) => {
|
|
|
85553
86068
|
});
|
|
85554
86069
|
|
|
85555
86070
|
// node_modules/.bun/readable-stream@1.0.34/node_modules/readable-stream/lib/_stream_transform.js
|
|
85556
|
-
var require__stream_transform = __commonJS((exports, module)
|
|
86071
|
+
var require__stream_transform = __commonJS(function(exports, module) {
|
|
85557
86072
|
module.exports = Transform;
|
|
85558
86073
|
var Duplex = require__stream_duplex();
|
|
85559
86074
|
var util = require_util();
|
|
@@ -85645,7 +86160,7 @@ var require__stream_transform = __commonJS((exports, module) => {
|
|
|
85645
86160
|
});
|
|
85646
86161
|
|
|
85647
86162
|
// node_modules/.bun/readable-stream@1.0.34/node_modules/readable-stream/lib/_stream_passthrough.js
|
|
85648
|
-
var require__stream_passthrough = __commonJS((exports, module)
|
|
86163
|
+
var require__stream_passthrough = __commonJS(function(exports, module) {
|
|
85649
86164
|
module.exports = PassThrough;
|
|
85650
86165
|
var Transform = require__stream_transform();
|
|
85651
86166
|
var util = require_util();
|
|
@@ -85662,7 +86177,7 @@ var require__stream_passthrough = __commonJS((exports, module) => {
|
|
|
85662
86177
|
});
|
|
85663
86178
|
|
|
85664
86179
|
// node_modules/.bun/readable-stream@1.0.34/node_modules/readable-stream/readable.js
|
|
85665
|
-
var require_readable = __commonJS((exports, module)
|
|
86180
|
+
var require_readable = __commonJS(function(exports, module) {
|
|
85666
86181
|
var Stream = __require("stream");
|
|
85667
86182
|
exports = module.exports = require__stream_readable();
|
|
85668
86183
|
exports.Stream = Stream;
|
|
@@ -85677,7 +86192,7 @@ var require_readable = __commonJS((exports, module) => {
|
|
|
85677
86192
|
});
|
|
85678
86193
|
|
|
85679
86194
|
// node_modules/.bun/memory-streams@0.1.3/node_modules/memory-streams/lib/ReadableStream.js
|
|
85680
|
-
var require_ReadableStream = __commonJS((exports, module)
|
|
86195
|
+
var require_ReadableStream = __commonJS(function(exports, module) {
|
|
85681
86196
|
var Stream = require_readable();
|
|
85682
86197
|
var util = __require("util");
|
|
85683
86198
|
module.exports = ReadableStream;
|
|
@@ -85696,7 +86211,7 @@ var require_ReadableStream = __commonJS((exports, module) => {
|
|
|
85696
86211
|
});
|
|
85697
86212
|
|
|
85698
86213
|
// node_modules/.bun/memory-streams@0.1.3/node_modules/memory-streams/lib/WritableStream.js
|
|
85699
|
-
var require_WritableStream = __commonJS((exports, module)
|
|
86214
|
+
var require_WritableStream = __commonJS(function(exports, module) {
|
|
85700
86215
|
var Stream = require_readable();
|
|
85701
86216
|
var util = __require("util");
|
|
85702
86217
|
module.exports = WritableStream;
|
|
@@ -85731,13 +86246,13 @@ var require_WritableStream = __commonJS((exports, module) => {
|
|
|
85731
86246
|
});
|
|
85732
86247
|
|
|
85733
86248
|
// node_modules/.bun/memory-streams@0.1.3/node_modules/memory-streams/index.js
|
|
85734
|
-
var require_memory_streams = __commonJS((exports, module)
|
|
86249
|
+
var require_memory_streams = __commonJS(function(exports, module) {
|
|
85735
86250
|
exports.ReadableStream = require_ReadableStream();
|
|
85736
86251
|
exports.WritableStream = require_WritableStream();
|
|
85737
86252
|
});
|
|
85738
86253
|
|
|
85739
86254
|
// node_modules/.bun/memorystream@0.3.1/node_modules/memorystream/index.js
|
|
85740
|
-
var require_memorystream = __commonJS((exports, module)
|
|
86255
|
+
var require_memorystream = __commonJS(function(exports, module) {
|
|
85741
86256
|
var STREAM = __require("stream");
|
|
85742
86257
|
var UTIL = __require("util");
|
|
85743
86258
|
var StringDecoder = __require("string_decoder").StringDecoder;
|
|
@@ -85885,7 +86400,7 @@ var require_memorystream = __commonJS((exports, module) => {
|
|
|
85885
86400
|
});
|
|
85886
86401
|
|
|
85887
86402
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/picture.js
|
|
85888
|
-
var require_picture = __commonJS((exports, module)
|
|
86403
|
+
var require_picture = __commonJS(function(exports, module) {
|
|
85889
86404
|
var blessed = require_blessed();
|
|
85890
86405
|
var Node = blessed.Node;
|
|
85891
86406
|
var Box = blessed.Box;
|
|
@@ -85940,7 +86455,7 @@ var require_picture = __commonJS((exports, module) => {
|
|
|
85940
86455
|
});
|
|
85941
86456
|
|
|
85942
86457
|
// node_modules/.bun/sparkline@0.1.2/node_modules/sparkline/lib/sparkline.js
|
|
85943
|
-
var require_sparkline = __commonJS((exports, module)
|
|
86458
|
+
var require_sparkline = __commonJS(function(exports, module) {
|
|
85944
86459
|
(function(window2) {
|
|
85945
86460
|
var sparkline, ticks = ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"];
|
|
85946
86461
|
sparkline = function(numbers, options) {
|
|
@@ -85969,7 +86484,7 @@ var require_sparkline = __commonJS((exports, module) => {
|
|
|
85969
86484
|
});
|
|
85970
86485
|
|
|
85971
86486
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/sparkline.js
|
|
85972
|
-
var require_sparkline2 = __commonJS((exports, module)
|
|
86487
|
+
var require_sparkline2 = __commonJS(function(exports, module) {
|
|
85973
86488
|
var blessed = require_blessed();
|
|
85974
86489
|
var Node = blessed.Node;
|
|
85975
86490
|
var Box = blessed.Box;
|
|
@@ -86026,14 +86541,14 @@ var require_sparkline2 = __commonJS((exports, module) => {
|
|
|
86026
86541
|
});
|
|
86027
86542
|
|
|
86028
86543
|
// node_modules/.bun/ansi-regex@2.1.1/node_modules/ansi-regex/index.js
|
|
86029
|
-
var require_ansi_regex = __commonJS((exports, module)
|
|
86544
|
+
var require_ansi_regex = __commonJS(function(exports, module) {
|
|
86030
86545
|
module.exports = function() {
|
|
86031
86546
|
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
|
|
86032
86547
|
};
|
|
86033
86548
|
});
|
|
86034
86549
|
|
|
86035
86550
|
// node_modules/.bun/strip-ansi@3.0.1/node_modules/strip-ansi/index.js
|
|
86036
|
-
var require_strip_ansi = __commonJS((exports, module)
|
|
86551
|
+
var require_strip_ansi = __commonJS(function(exports, module) {
|
|
86037
86552
|
var ansiRegex = require_ansi_regex()();
|
|
86038
86553
|
module.exports = function(str) {
|
|
86039
86554
|
return typeof str === "string" ? str.replace(ansiRegex, "") : str;
|
|
@@ -86041,7 +86556,7 @@ var require_strip_ansi = __commonJS((exports, module) => {
|
|
|
86041
86556
|
});
|
|
86042
86557
|
|
|
86043
86558
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/table.js
|
|
86044
|
-
var require_table = __commonJS((exports, module)
|
|
86559
|
+
var require_table = __commonJS(function(exports, module) {
|
|
86045
86560
|
var blessed = require_blessed();
|
|
86046
86561
|
var Node = blessed.Node;
|
|
86047
86562
|
var Box = blessed.Box;
|
|
@@ -86157,7 +86672,7 @@ var require_table = __commonJS((exports, module) => {
|
|
|
86157
86672
|
});
|
|
86158
86673
|
|
|
86159
86674
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/tree.js
|
|
86160
|
-
var require_tree = __commonJS((exports, module)
|
|
86675
|
+
var require_tree = __commonJS(function(exports, module) {
|
|
86161
86676
|
var blessed = require_blessed();
|
|
86162
86677
|
var Node = blessed.Node;
|
|
86163
86678
|
var Box = blessed.Box;
|
|
@@ -86290,7 +86805,7 @@ var require_tree = __commonJS((exports, module) => {
|
|
|
86290
86805
|
});
|
|
86291
86806
|
|
|
86292
86807
|
// node_modules/.bun/marked@4.3.0/node_modules/marked/lib/marked.cjs
|
|
86293
|
-
var require_marked = __commonJS((exports)
|
|
86808
|
+
var require_marked = __commonJS(function(exports) {
|
|
86294
86809
|
function _defineProperties(target, props) {
|
|
86295
86810
|
for (var i = 0;i < props.length; i++) {
|
|
86296
86811
|
var descriptor = props[i];
|
|
@@ -88604,7 +89119,7 @@ Please report this to https://github.com/markedjs/marked.`;
|
|
|
88604
89119
|
});
|
|
88605
89120
|
|
|
88606
89121
|
// node_modules/.bun/esprima@4.0.1/node_modules/esprima/dist/esprima.js
|
|
88607
|
-
var require_esprima = __commonJS((exports, module)
|
|
89122
|
+
var require_esprima = __commonJS(function(exports, module) {
|
|
88608
89123
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
88609
89124
|
if (typeof exports === "object" && typeof module === "object")
|
|
88610
89125
|
module.exports = factory();
|
|
@@ -94744,7 +95259,7 @@ var require_esprima = __commonJS((exports, module) => {
|
|
|
94744
95259
|
});
|
|
94745
95260
|
|
|
94746
95261
|
// node_modules/.bun/redeyed@2.1.1/node_modules/redeyed/redeyed.js
|
|
94747
|
-
var require_redeyed = __commonJS((exports, module)
|
|
95262
|
+
var require_redeyed = __commonJS(function(exports, module) {
|
|
94748
95263
|
(function() {
|
|
94749
95264
|
var esprima;
|
|
94750
95265
|
var exportFn;
|
|
@@ -94793,7 +95308,7 @@ Should be of format "before:after"`);
|
|
|
94793
95308
|
}
|
|
94794
95309
|
}
|
|
94795
95310
|
function objectize(node) {
|
|
94796
|
-
function
|
|
95311
|
+
function resolve3(value, key) {
|
|
94797
95312
|
if (!value._parent)
|
|
94798
95313
|
return;
|
|
94799
95314
|
if (value._parent._default && value._parent._default[key])
|
|
@@ -94816,8 +95331,8 @@ Should be of format "before:after"`);
|
|
|
94816
95331
|
if (isObject(value)) {
|
|
94817
95332
|
if (!value._before && !value._after)
|
|
94818
95333
|
return objectize(value);
|
|
94819
|
-
value._before = value._before ||
|
|
94820
|
-
value._after = value._after ||
|
|
95334
|
+
value._before = value._before || resolve3(value, "_before");
|
|
95335
|
+
value._after = value._after || resolve3(value, "_after");
|
|
94821
95336
|
return;
|
|
94822
95337
|
}
|
|
94823
95338
|
throw new Error("nodes need to be either {String}, {Object} or {Function}." + value + " is neither.");
|
|
@@ -94984,7 +95499,7 @@ Should be of format "before:after"`);
|
|
|
94984
95499
|
});
|
|
94985
95500
|
|
|
94986
95501
|
// node_modules/.bun/ansicolors@0.3.2/node_modules/ansicolors/ansicolors.js
|
|
94987
|
-
var require_ansicolors = __commonJS((exports, module)
|
|
95502
|
+
var require_ansicolors = __commonJS(function(exports, module) {
|
|
94988
95503
|
var colorNums = {
|
|
94989
95504
|
white: 37,
|
|
94990
95505
|
black: 30,
|
|
@@ -95044,7 +95559,7 @@ var require_ansicolors = __commonJS((exports, module) => {
|
|
|
95044
95559
|
});
|
|
95045
95560
|
|
|
95046
95561
|
// node_modules/.bun/cardinal@2.1.1/node_modules/cardinal/themes/default.js
|
|
95047
|
-
var require_default = __commonJS((exports, module)
|
|
95562
|
+
var require_default = __commonJS(function(exports, module) {
|
|
95048
95563
|
var colors = require_ansicolors();
|
|
95049
95564
|
module.exports = {
|
|
95050
95565
|
Boolean: {
|
|
@@ -95216,7 +95731,7 @@ var require_default = __commonJS((exports, module) => {
|
|
|
95216
95731
|
});
|
|
95217
95732
|
|
|
95218
95733
|
// node_modules/.bun/cardinal@2.1.1/node_modules/cardinal/lib/highlight.js
|
|
95219
|
-
var require_highlight = __commonJS((exports, module)
|
|
95734
|
+
var require_highlight = __commonJS(function(exports, module) {
|
|
95220
95735
|
var redeyed = require_redeyed();
|
|
95221
95736
|
var theme = require_default();
|
|
95222
95737
|
var colors = require_ansicolors();
|
|
@@ -95288,7 +95803,7 @@ var require_highlight = __commonJS((exports, module) => {
|
|
|
95288
95803
|
});
|
|
95289
95804
|
|
|
95290
95805
|
// node_modules/.bun/cardinal@2.1.1/node_modules/cardinal/lib/highlightFile.js
|
|
95291
|
-
var require_highlightFile = __commonJS((exports, module)
|
|
95806
|
+
var require_highlightFile = __commonJS(function(exports, module) {
|
|
95292
95807
|
var fs = __require("fs");
|
|
95293
95808
|
var highlight = require_highlight();
|
|
95294
95809
|
function isFunction(obj) {
|
|
@@ -95313,7 +95828,7 @@ var require_highlightFile = __commonJS((exports, module) => {
|
|
|
95313
95828
|
});
|
|
95314
95829
|
|
|
95315
95830
|
// node_modules/.bun/cardinal@2.1.1/node_modules/cardinal/lib/highlightFileSync.js
|
|
95316
|
-
var require_highlightFileSync = __commonJS((exports, module)
|
|
95831
|
+
var require_highlightFileSync = __commonJS(function(exports, module) {
|
|
95317
95832
|
var fs = __require("fs");
|
|
95318
95833
|
var highlight = require_highlight();
|
|
95319
95834
|
module.exports = function highlightFileSync(fullPath, opts) {
|
|
@@ -95324,7 +95839,7 @@ var require_highlightFileSync = __commonJS((exports, module) => {
|
|
|
95324
95839
|
});
|
|
95325
95840
|
|
|
95326
95841
|
// node_modules/.bun/cardinal@2.1.1/node_modules/cardinal/cardinal.js
|
|
95327
|
-
var require_cardinal = __commonJS((exports, module)
|
|
95842
|
+
var require_cardinal = __commonJS(function(exports, module) {
|
|
95328
95843
|
module.exports = {
|
|
95329
95844
|
highlight: require_highlight(),
|
|
95330
95845
|
highlightFile: require_highlightFile(),
|
|
@@ -95333,13 +95848,13 @@ var require_cardinal = __commonJS((exports, module) => {
|
|
|
95333
95848
|
});
|
|
95334
95849
|
|
|
95335
95850
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_freeGlobal.js
|
|
95336
|
-
var require__freeGlobal = __commonJS((exports, module)
|
|
95851
|
+
var require__freeGlobal = __commonJS(function(exports, module) {
|
|
95337
95852
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
95338
95853
|
module.exports = freeGlobal;
|
|
95339
95854
|
});
|
|
95340
95855
|
|
|
95341
95856
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_root.js
|
|
95342
|
-
var require__root = __commonJS((exports, module)
|
|
95857
|
+
var require__root = __commonJS(function(exports, module) {
|
|
95343
95858
|
var freeGlobal = require__freeGlobal();
|
|
95344
95859
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
95345
95860
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
@@ -95347,14 +95862,14 @@ var require__root = __commonJS((exports, module) => {
|
|
|
95347
95862
|
});
|
|
95348
95863
|
|
|
95349
95864
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Symbol.js
|
|
95350
|
-
var require__Symbol = __commonJS((exports, module)
|
|
95865
|
+
var require__Symbol = __commonJS(function(exports, module) {
|
|
95351
95866
|
var root = require__root();
|
|
95352
95867
|
var Symbol2 = root.Symbol;
|
|
95353
95868
|
module.exports = Symbol2;
|
|
95354
95869
|
});
|
|
95355
95870
|
|
|
95356
95871
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_copyArray.js
|
|
95357
|
-
var require__copyArray = __commonJS((exports, module)
|
|
95872
|
+
var require__copyArray = __commonJS(function(exports, module) {
|
|
95358
95873
|
function copyArray(source, array) {
|
|
95359
95874
|
var index = -1, length = source.length;
|
|
95360
95875
|
array || (array = Array(length));
|
|
@@ -95367,7 +95882,7 @@ var require__copyArray = __commonJS((exports, module) => {
|
|
|
95367
95882
|
});
|
|
95368
95883
|
|
|
95369
95884
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getRawTag.js
|
|
95370
|
-
var require__getRawTag = __commonJS((exports, module)
|
|
95885
|
+
var require__getRawTag = __commonJS(function(exports, module) {
|
|
95371
95886
|
var Symbol2 = require__Symbol();
|
|
95372
95887
|
var objectProto = Object.prototype;
|
|
95373
95888
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
@@ -95393,7 +95908,7 @@ var require__getRawTag = __commonJS((exports, module) => {
|
|
|
95393
95908
|
});
|
|
95394
95909
|
|
|
95395
95910
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_objectToString.js
|
|
95396
|
-
var require__objectToString = __commonJS((exports, module)
|
|
95911
|
+
var require__objectToString = __commonJS(function(exports, module) {
|
|
95397
95912
|
var objectProto = Object.prototype;
|
|
95398
95913
|
var nativeObjectToString = objectProto.toString;
|
|
95399
95914
|
function objectToString(value) {
|
|
@@ -95403,7 +95918,7 @@ var require__objectToString = __commonJS((exports, module) => {
|
|
|
95403
95918
|
});
|
|
95404
95919
|
|
|
95405
95920
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
|
|
95406
|
-
var require__baseGetTag = __commonJS((exports, module)
|
|
95921
|
+
var require__baseGetTag = __commonJS(function(exports, module) {
|
|
95407
95922
|
var Symbol2 = require__Symbol();
|
|
95408
95923
|
var getRawTag = require__getRawTag();
|
|
95409
95924
|
var objectToString = require__objectToString();
|
|
@@ -95420,7 +95935,7 @@ var require__baseGetTag = __commonJS((exports, module) => {
|
|
|
95420
95935
|
});
|
|
95421
95936
|
|
|
95422
95937
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObject.js
|
|
95423
|
-
var require_isObject = __commonJS((exports, module)
|
|
95938
|
+
var require_isObject = __commonJS(function(exports, module) {
|
|
95424
95939
|
function isObject(value) {
|
|
95425
95940
|
var type = typeof value;
|
|
95426
95941
|
return value != null && (type == "object" || type == "function");
|
|
@@ -95429,7 +95944,7 @@ var require_isObject = __commonJS((exports, module) => {
|
|
|
95429
95944
|
});
|
|
95430
95945
|
|
|
95431
95946
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isFunction.js
|
|
95432
|
-
var require_isFunction = __commonJS((exports, module)
|
|
95947
|
+
var require_isFunction = __commonJS(function(exports, module) {
|
|
95433
95948
|
var baseGetTag = require__baseGetTag();
|
|
95434
95949
|
var isObject = require_isObject();
|
|
95435
95950
|
var asyncTag = "[object AsyncFunction]";
|
|
@@ -95447,14 +95962,14 @@ var require_isFunction = __commonJS((exports, module) => {
|
|
|
95447
95962
|
});
|
|
95448
95963
|
|
|
95449
95964
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_coreJsData.js
|
|
95450
|
-
var require__coreJsData = __commonJS((exports, module)
|
|
95965
|
+
var require__coreJsData = __commonJS(function(exports, module) {
|
|
95451
95966
|
var root = require__root();
|
|
95452
95967
|
var coreJsData = root["__core-js_shared__"];
|
|
95453
95968
|
module.exports = coreJsData;
|
|
95454
95969
|
});
|
|
95455
95970
|
|
|
95456
95971
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isMasked.js
|
|
95457
|
-
var require__isMasked = __commonJS((exports, module)
|
|
95972
|
+
var require__isMasked = __commonJS(function(exports, module) {
|
|
95458
95973
|
var coreJsData = require__coreJsData();
|
|
95459
95974
|
var maskSrcKey = function() {
|
|
95460
95975
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
@@ -95467,7 +95982,7 @@ var require__isMasked = __commonJS((exports, module) => {
|
|
|
95467
95982
|
});
|
|
95468
95983
|
|
|
95469
95984
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_toSource.js
|
|
95470
|
-
var require__toSource = __commonJS((exports, module)
|
|
95985
|
+
var require__toSource = __commonJS(function(exports, module) {
|
|
95471
95986
|
var funcProto = Function.prototype;
|
|
95472
95987
|
var funcToString = funcProto.toString;
|
|
95473
95988
|
function toSource(func) {
|
|
@@ -95485,7 +96000,7 @@ var require__toSource = __commonJS((exports, module) => {
|
|
|
95485
96000
|
});
|
|
95486
96001
|
|
|
95487
96002
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsNative.js
|
|
95488
|
-
var require__baseIsNative = __commonJS((exports, module)
|
|
96003
|
+
var require__baseIsNative = __commonJS(function(exports, module) {
|
|
95489
96004
|
var isFunction = require_isFunction();
|
|
95490
96005
|
var isMasked = require__isMasked();
|
|
95491
96006
|
var isObject = require_isObject();
|
|
@@ -95508,7 +96023,7 @@ var require__baseIsNative = __commonJS((exports, module) => {
|
|
|
95508
96023
|
});
|
|
95509
96024
|
|
|
95510
96025
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getValue.js
|
|
95511
|
-
var require__getValue = __commonJS((exports, module)
|
|
96026
|
+
var require__getValue = __commonJS(function(exports, module) {
|
|
95512
96027
|
function getValue(object, key) {
|
|
95513
96028
|
return object == null ? undefined : object[key];
|
|
95514
96029
|
}
|
|
@@ -95516,7 +96031,7 @@ var require__getValue = __commonJS((exports, module) => {
|
|
|
95516
96031
|
});
|
|
95517
96032
|
|
|
95518
96033
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getNative.js
|
|
95519
|
-
var require__getNative = __commonJS((exports, module)
|
|
96034
|
+
var require__getNative = __commonJS(function(exports, module) {
|
|
95520
96035
|
var baseIsNative = require__baseIsNative();
|
|
95521
96036
|
var getValue = require__getValue();
|
|
95522
96037
|
function getNative(object, key) {
|
|
@@ -95527,7 +96042,7 @@ var require__getNative = __commonJS((exports, module) => {
|
|
|
95527
96042
|
});
|
|
95528
96043
|
|
|
95529
96044
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_DataView.js
|
|
95530
|
-
var require__DataView = __commonJS((exports, module)
|
|
96045
|
+
var require__DataView = __commonJS(function(exports, module) {
|
|
95531
96046
|
var getNative = require__getNative();
|
|
95532
96047
|
var root = require__root();
|
|
95533
96048
|
var DataView = getNative(root, "DataView");
|
|
@@ -95535,7 +96050,7 @@ var require__DataView = __commonJS((exports, module) => {
|
|
|
95535
96050
|
});
|
|
95536
96051
|
|
|
95537
96052
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Map.js
|
|
95538
|
-
var require__Map = __commonJS((exports, module)
|
|
96053
|
+
var require__Map = __commonJS(function(exports, module) {
|
|
95539
96054
|
var getNative = require__getNative();
|
|
95540
96055
|
var root = require__root();
|
|
95541
96056
|
var Map2 = getNative(root, "Map");
|
|
@@ -95543,7 +96058,7 @@ var require__Map = __commonJS((exports, module) => {
|
|
|
95543
96058
|
});
|
|
95544
96059
|
|
|
95545
96060
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Promise.js
|
|
95546
|
-
var require__Promise = __commonJS((exports, module)
|
|
96061
|
+
var require__Promise = __commonJS(function(exports, module) {
|
|
95547
96062
|
var getNative = require__getNative();
|
|
95548
96063
|
var root = require__root();
|
|
95549
96064
|
var Promise2 = getNative(root, "Promise");
|
|
@@ -95551,7 +96066,7 @@ var require__Promise = __commonJS((exports, module) => {
|
|
|
95551
96066
|
});
|
|
95552
96067
|
|
|
95553
96068
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_Set.js
|
|
95554
|
-
var require__Set = __commonJS((exports, module)
|
|
96069
|
+
var require__Set = __commonJS(function(exports, module) {
|
|
95555
96070
|
var getNative = require__getNative();
|
|
95556
96071
|
var root = require__root();
|
|
95557
96072
|
var Set2 = getNative(root, "Set");
|
|
@@ -95559,7 +96074,7 @@ var require__Set = __commonJS((exports, module) => {
|
|
|
95559
96074
|
});
|
|
95560
96075
|
|
|
95561
96076
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_WeakMap.js
|
|
95562
|
-
var require__WeakMap = __commonJS((exports, module)
|
|
96077
|
+
var require__WeakMap = __commonJS(function(exports, module) {
|
|
95563
96078
|
var getNative = require__getNative();
|
|
95564
96079
|
var root = require__root();
|
|
95565
96080
|
var WeakMap2 = getNative(root, "WeakMap");
|
|
@@ -95567,7 +96082,7 @@ var require__WeakMap = __commonJS((exports, module) => {
|
|
|
95567
96082
|
});
|
|
95568
96083
|
|
|
95569
96084
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_getTag.js
|
|
95570
|
-
var require__getTag = __commonJS((exports, module)
|
|
96085
|
+
var require__getTag = __commonJS(function(exports, module) {
|
|
95571
96086
|
var DataView = require__DataView();
|
|
95572
96087
|
var Map2 = require__Map();
|
|
95573
96088
|
var Promise2 = require__Promise();
|
|
@@ -95611,7 +96126,7 @@ var require__getTag = __commonJS((exports, module) => {
|
|
|
95611
96126
|
});
|
|
95612
96127
|
|
|
95613
96128
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isLength.js
|
|
95614
|
-
var require_isLength = __commonJS((exports, module)
|
|
96129
|
+
var require_isLength = __commonJS(function(exports, module) {
|
|
95615
96130
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
95616
96131
|
function isLength(value) {
|
|
95617
96132
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
@@ -95620,7 +96135,7 @@ var require_isLength = __commonJS((exports, module) => {
|
|
|
95620
96135
|
});
|
|
95621
96136
|
|
|
95622
96137
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArrayLike.js
|
|
95623
|
-
var require_isArrayLike = __commonJS((exports, module)
|
|
96138
|
+
var require_isArrayLike = __commonJS(function(exports, module) {
|
|
95624
96139
|
var isFunction = require_isFunction();
|
|
95625
96140
|
var isLength = require_isLength();
|
|
95626
96141
|
function isArrayLike(value) {
|
|
@@ -95630,13 +96145,13 @@ var require_isArrayLike = __commonJS((exports, module) => {
|
|
|
95630
96145
|
});
|
|
95631
96146
|
|
|
95632
96147
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArray.js
|
|
95633
|
-
var require_isArray = __commonJS((exports, module)
|
|
96148
|
+
var require_isArray = __commonJS(function(exports, module) {
|
|
95634
96149
|
var isArray = Array.isArray;
|
|
95635
96150
|
module.exports = isArray;
|
|
95636
96151
|
});
|
|
95637
96152
|
|
|
95638
96153
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isObjectLike.js
|
|
95639
|
-
var require_isObjectLike = __commonJS((exports, module)
|
|
96154
|
+
var require_isObjectLike = __commonJS(function(exports, module) {
|
|
95640
96155
|
function isObjectLike(value) {
|
|
95641
96156
|
return value != null && typeof value == "object";
|
|
95642
96157
|
}
|
|
@@ -95644,7 +96159,7 @@ var require_isObjectLike = __commonJS((exports, module) => {
|
|
|
95644
96159
|
});
|
|
95645
96160
|
|
|
95646
96161
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isString.js
|
|
95647
|
-
var require_isString = __commonJS((exports, module)
|
|
96162
|
+
var require_isString = __commonJS(function(exports, module) {
|
|
95648
96163
|
var baseGetTag = require__baseGetTag();
|
|
95649
96164
|
var isArray = require_isArray();
|
|
95650
96165
|
var isObjectLike = require_isObjectLike();
|
|
@@ -95656,7 +96171,7 @@ var require_isString = __commonJS((exports, module) => {
|
|
|
95656
96171
|
});
|
|
95657
96172
|
|
|
95658
96173
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_iteratorToArray.js
|
|
95659
|
-
var require__iteratorToArray = __commonJS((exports, module)
|
|
96174
|
+
var require__iteratorToArray = __commonJS(function(exports, module) {
|
|
95660
96175
|
function iteratorToArray(iterator) {
|
|
95661
96176
|
var data, result = [];
|
|
95662
96177
|
while (!(data = iterator.next()).done) {
|
|
@@ -95668,7 +96183,7 @@ var require__iteratorToArray = __commonJS((exports, module) => {
|
|
|
95668
96183
|
});
|
|
95669
96184
|
|
|
95670
96185
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_mapToArray.js
|
|
95671
|
-
var require__mapToArray = __commonJS((exports, module)
|
|
96186
|
+
var require__mapToArray = __commonJS(function(exports, module) {
|
|
95672
96187
|
function mapToArray(map) {
|
|
95673
96188
|
var index = -1, result = Array(map.size);
|
|
95674
96189
|
map.forEach(function(value, key) {
|
|
@@ -95680,7 +96195,7 @@ var require__mapToArray = __commonJS((exports, module) => {
|
|
|
95680
96195
|
});
|
|
95681
96196
|
|
|
95682
96197
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_setToArray.js
|
|
95683
|
-
var require__setToArray = __commonJS((exports, module)
|
|
96198
|
+
var require__setToArray = __commonJS(function(exports, module) {
|
|
95684
96199
|
function setToArray(set) {
|
|
95685
96200
|
var index = -1, result = Array(set.size);
|
|
95686
96201
|
set.forEach(function(value) {
|
|
@@ -95692,7 +96207,7 @@ var require__setToArray = __commonJS((exports, module) => {
|
|
|
95692
96207
|
});
|
|
95693
96208
|
|
|
95694
96209
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_asciiToArray.js
|
|
95695
|
-
var require__asciiToArray = __commonJS((exports, module)
|
|
96210
|
+
var require__asciiToArray = __commonJS(function(exports, module) {
|
|
95696
96211
|
function asciiToArray(string) {
|
|
95697
96212
|
return string.split("");
|
|
95698
96213
|
}
|
|
@@ -95700,7 +96215,7 @@ var require__asciiToArray = __commonJS((exports, module) => {
|
|
|
95700
96215
|
});
|
|
95701
96216
|
|
|
95702
96217
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_hasUnicode.js
|
|
95703
|
-
var require__hasUnicode = __commonJS((exports, module)
|
|
96218
|
+
var require__hasUnicode = __commonJS(function(exports, module) {
|
|
95704
96219
|
var rsAstralRange = "\\ud800-\\udfff";
|
|
95705
96220
|
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
95706
96221
|
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
@@ -95716,7 +96231,7 @@ var require__hasUnicode = __commonJS((exports, module) => {
|
|
|
95716
96231
|
});
|
|
95717
96232
|
|
|
95718
96233
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_unicodeToArray.js
|
|
95719
|
-
var require__unicodeToArray = __commonJS((exports, module)
|
|
96234
|
+
var require__unicodeToArray = __commonJS(function(exports, module) {
|
|
95720
96235
|
var rsAstralRange = "\\ud800-\\udfff";
|
|
95721
96236
|
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
95722
96237
|
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
@@ -95744,7 +96259,7 @@ var require__unicodeToArray = __commonJS((exports, module) => {
|
|
|
95744
96259
|
});
|
|
95745
96260
|
|
|
95746
96261
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_stringToArray.js
|
|
95747
|
-
var require__stringToArray = __commonJS((exports, module)
|
|
96262
|
+
var require__stringToArray = __commonJS(function(exports, module) {
|
|
95748
96263
|
var asciiToArray = require__asciiToArray();
|
|
95749
96264
|
var hasUnicode = require__hasUnicode();
|
|
95750
96265
|
var unicodeToArray = require__unicodeToArray();
|
|
@@ -95755,7 +96270,7 @@ var require__stringToArray = __commonJS((exports, module) => {
|
|
|
95755
96270
|
});
|
|
95756
96271
|
|
|
95757
96272
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayMap.js
|
|
95758
|
-
var require__arrayMap = __commonJS((exports, module)
|
|
96273
|
+
var require__arrayMap = __commonJS(function(exports, module) {
|
|
95759
96274
|
function arrayMap(array, iteratee) {
|
|
95760
96275
|
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
95761
96276
|
while (++index < length) {
|
|
@@ -95767,7 +96282,7 @@ var require__arrayMap = __commonJS((exports, module) => {
|
|
|
95767
96282
|
});
|
|
95768
96283
|
|
|
95769
96284
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseValues.js
|
|
95770
|
-
var require__baseValues = __commonJS((exports, module)
|
|
96285
|
+
var require__baseValues = __commonJS(function(exports, module) {
|
|
95771
96286
|
var arrayMap = require__arrayMap();
|
|
95772
96287
|
function baseValues(object, props) {
|
|
95773
96288
|
return arrayMap(props, function(key) {
|
|
@@ -95778,7 +96293,7 @@ var require__baseValues = __commonJS((exports, module) => {
|
|
|
95778
96293
|
});
|
|
95779
96294
|
|
|
95780
96295
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseTimes.js
|
|
95781
|
-
var require__baseTimes = __commonJS((exports, module)
|
|
96296
|
+
var require__baseTimes = __commonJS(function(exports, module) {
|
|
95782
96297
|
function baseTimes(n, iteratee) {
|
|
95783
96298
|
var index = -1, result = Array(n);
|
|
95784
96299
|
while (++index < n) {
|
|
@@ -95790,7 +96305,7 @@ var require__baseTimes = __commonJS((exports, module) => {
|
|
|
95790
96305
|
});
|
|
95791
96306
|
|
|
95792
96307
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js
|
|
95793
|
-
var require__baseIsArguments = __commonJS((exports, module)
|
|
96308
|
+
var require__baseIsArguments = __commonJS(function(exports, module) {
|
|
95794
96309
|
var baseGetTag = require__baseGetTag();
|
|
95795
96310
|
var isObjectLike = require_isObjectLike();
|
|
95796
96311
|
var argsTag = "[object Arguments]";
|
|
@@ -95801,7 +96316,7 @@ var require__baseIsArguments = __commonJS((exports, module) => {
|
|
|
95801
96316
|
});
|
|
95802
96317
|
|
|
95803
96318
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isArguments.js
|
|
95804
|
-
var require_isArguments = __commonJS((exports, module)
|
|
96319
|
+
var require_isArguments = __commonJS(function(exports, module) {
|
|
95805
96320
|
var baseIsArguments = require__baseIsArguments();
|
|
95806
96321
|
var isObjectLike = require_isObjectLike();
|
|
95807
96322
|
var objectProto = Object.prototype;
|
|
@@ -95816,7 +96331,7 @@ var require_isArguments = __commonJS((exports, module) => {
|
|
|
95816
96331
|
});
|
|
95817
96332
|
|
|
95818
96333
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/stubFalse.js
|
|
95819
|
-
var require_stubFalse = __commonJS((exports, module)
|
|
96334
|
+
var require_stubFalse = __commonJS(function(exports, module) {
|
|
95820
96335
|
function stubFalse() {
|
|
95821
96336
|
return false;
|
|
95822
96337
|
}
|
|
@@ -95824,7 +96339,7 @@ var require_stubFalse = __commonJS((exports, module) => {
|
|
|
95824
96339
|
});
|
|
95825
96340
|
|
|
95826
96341
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isBuffer.js
|
|
95827
|
-
var require_isBuffer = __commonJS((exports, module)
|
|
96342
|
+
var require_isBuffer = __commonJS(function(exports, module) {
|
|
95828
96343
|
var root = require__root();
|
|
95829
96344
|
var stubFalse = require_stubFalse();
|
|
95830
96345
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
@@ -95837,7 +96352,7 @@ var require_isBuffer = __commonJS((exports, module) => {
|
|
|
95837
96352
|
});
|
|
95838
96353
|
|
|
95839
96354
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isIndex.js
|
|
95840
|
-
var require__isIndex = __commonJS((exports, module)
|
|
96355
|
+
var require__isIndex = __commonJS(function(exports, module) {
|
|
95841
96356
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
95842
96357
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
95843
96358
|
function isIndex(value, length) {
|
|
@@ -95849,7 +96364,7 @@ var require__isIndex = __commonJS((exports, module) => {
|
|
|
95849
96364
|
});
|
|
95850
96365
|
|
|
95851
96366
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseIsTypedArray.js
|
|
95852
|
-
var require__baseIsTypedArray = __commonJS((exports, module)
|
|
96367
|
+
var require__baseIsTypedArray = __commonJS(function(exports, module) {
|
|
95853
96368
|
var baseGetTag = require__baseGetTag();
|
|
95854
96369
|
var isLength = require_isLength();
|
|
95855
96370
|
var isObjectLike = require_isObjectLike();
|
|
@@ -95887,7 +96402,7 @@ var require__baseIsTypedArray = __commonJS((exports, module) => {
|
|
|
95887
96402
|
});
|
|
95888
96403
|
|
|
95889
96404
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseUnary.js
|
|
95890
|
-
var require__baseUnary = __commonJS((exports, module)
|
|
96405
|
+
var require__baseUnary = __commonJS(function(exports, module) {
|
|
95891
96406
|
function baseUnary(func) {
|
|
95892
96407
|
return function(value) {
|
|
95893
96408
|
return func(value);
|
|
@@ -95897,7 +96412,7 @@ var require__baseUnary = __commonJS((exports, module) => {
|
|
|
95897
96412
|
});
|
|
95898
96413
|
|
|
95899
96414
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nodeUtil.js
|
|
95900
|
-
var require__nodeUtil = __commonJS((exports, module)
|
|
96415
|
+
var require__nodeUtil = __commonJS(function(exports, module) {
|
|
95901
96416
|
var freeGlobal = require__freeGlobal();
|
|
95902
96417
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
95903
96418
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
@@ -95916,7 +96431,7 @@ var require__nodeUtil = __commonJS((exports, module) => {
|
|
|
95916
96431
|
});
|
|
95917
96432
|
|
|
95918
96433
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/isTypedArray.js
|
|
95919
|
-
var require_isTypedArray = __commonJS((exports, module)
|
|
96434
|
+
var require_isTypedArray = __commonJS(function(exports, module) {
|
|
95920
96435
|
var baseIsTypedArray = require__baseIsTypedArray();
|
|
95921
96436
|
var baseUnary = require__baseUnary();
|
|
95922
96437
|
var nodeUtil = require__nodeUtil();
|
|
@@ -95926,7 +96441,7 @@ var require_isTypedArray = __commonJS((exports, module) => {
|
|
|
95926
96441
|
});
|
|
95927
96442
|
|
|
95928
96443
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_arrayLikeKeys.js
|
|
95929
|
-
var require__arrayLikeKeys = __commonJS((exports, module)
|
|
96444
|
+
var require__arrayLikeKeys = __commonJS(function(exports, module) {
|
|
95930
96445
|
var baseTimes = require__baseTimes();
|
|
95931
96446
|
var isArguments = require_isArguments();
|
|
95932
96447
|
var isArray = require_isArray();
|
|
@@ -95948,7 +96463,7 @@ var require__arrayLikeKeys = __commonJS((exports, module) => {
|
|
|
95948
96463
|
});
|
|
95949
96464
|
|
|
95950
96465
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_isPrototype.js
|
|
95951
|
-
var require__isPrototype = __commonJS((exports, module)
|
|
96466
|
+
var require__isPrototype = __commonJS(function(exports, module) {
|
|
95952
96467
|
var objectProto = Object.prototype;
|
|
95953
96468
|
function isPrototype(value) {
|
|
95954
96469
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
@@ -95958,7 +96473,7 @@ var require__isPrototype = __commonJS((exports, module) => {
|
|
|
95958
96473
|
});
|
|
95959
96474
|
|
|
95960
96475
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_overArg.js
|
|
95961
|
-
var require__overArg = __commonJS((exports, module)
|
|
96476
|
+
var require__overArg = __commonJS(function(exports, module) {
|
|
95962
96477
|
function overArg(func, transform) {
|
|
95963
96478
|
return function(arg) {
|
|
95964
96479
|
return func(transform(arg));
|
|
@@ -95968,14 +96483,14 @@ var require__overArg = __commonJS((exports, module) => {
|
|
|
95968
96483
|
});
|
|
95969
96484
|
|
|
95970
96485
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_nativeKeys.js
|
|
95971
|
-
var require__nativeKeys = __commonJS((exports, module)
|
|
96486
|
+
var require__nativeKeys = __commonJS(function(exports, module) {
|
|
95972
96487
|
var overArg = require__overArg();
|
|
95973
96488
|
var nativeKeys = overArg(Object.keys, Object);
|
|
95974
96489
|
module.exports = nativeKeys;
|
|
95975
96490
|
});
|
|
95976
96491
|
|
|
95977
96492
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/_baseKeys.js
|
|
95978
|
-
var require__baseKeys = __commonJS((exports, module)
|
|
96493
|
+
var require__baseKeys = __commonJS(function(exports, module) {
|
|
95979
96494
|
var isPrototype = require__isPrototype();
|
|
95980
96495
|
var nativeKeys = require__nativeKeys();
|
|
95981
96496
|
var objectProto = Object.prototype;
|
|
@@ -95996,7 +96511,7 @@ var require__baseKeys = __commonJS((exports, module) => {
|
|
|
95996
96511
|
});
|
|
95997
96512
|
|
|
95998
96513
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/keys.js
|
|
95999
|
-
var require_keys2 = __commonJS((exports, module)
|
|
96514
|
+
var require_keys2 = __commonJS(function(exports, module) {
|
|
96000
96515
|
var arrayLikeKeys = require__arrayLikeKeys();
|
|
96001
96516
|
var baseKeys = require__baseKeys();
|
|
96002
96517
|
var isArrayLike = require_isArrayLike();
|
|
@@ -96007,7 +96522,7 @@ var require_keys2 = __commonJS((exports, module) => {
|
|
|
96007
96522
|
});
|
|
96008
96523
|
|
|
96009
96524
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/values.js
|
|
96010
|
-
var require_values = __commonJS((exports, module)
|
|
96525
|
+
var require_values = __commonJS(function(exports, module) {
|
|
96011
96526
|
var baseValues = require__baseValues();
|
|
96012
96527
|
var keys = require_keys2();
|
|
96013
96528
|
function values(object) {
|
|
@@ -96017,7 +96532,7 @@ var require_values = __commonJS((exports, module) => {
|
|
|
96017
96532
|
});
|
|
96018
96533
|
|
|
96019
96534
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/toArray.js
|
|
96020
|
-
var require_toArray = __commonJS((exports, module)
|
|
96535
|
+
var require_toArray = __commonJS(function(exports, module) {
|
|
96021
96536
|
var Symbol2 = require__Symbol();
|
|
96022
96537
|
var copyArray = require__copyArray();
|
|
96023
96538
|
var getTag = require__getTag();
|
|
@@ -96048,12 +96563,12 @@ var require_toArray = __commonJS((exports, module) => {
|
|
|
96048
96563
|
});
|
|
96049
96564
|
|
|
96050
96565
|
// node_modules/.bun/node-emoji@1.11.0/node_modules/node-emoji/lib/emoji.json
|
|
96051
|
-
var require_emoji = __commonJS((exports, module)
|
|
96566
|
+
var require_emoji = __commonJS(function(exports, module) {
|
|
96052
96567
|
module.exports = { "100": "💯", "1234": "🔢", umbrella_with_rain_drops: "☔", coffee: "☕", aries: "♈", taurus: "♉", sagittarius: "♐", capricorn: "♑", aquarius: "♒", pisces: "♓", anchor: "⚓", white_check_mark: "✅", sparkles: "✨", question: "❓", grey_question: "❔", grey_exclamation: "❕", exclamation: "❗", heavy_exclamation_mark: "❗", heavy_plus_sign: "➕", heavy_minus_sign: "➖", heavy_division_sign: "➗", hash: "#️⃣", keycap_star: "*️⃣", zero: "0️⃣", one: "1️⃣", two: "2️⃣", three: "3️⃣", four: "4️⃣", five: "5️⃣", six: "6️⃣", seven: "7️⃣", eight: "8️⃣", nine: "9️⃣", copyright: "©️", registered: "®️", mahjong: "🀄", black_joker: "🃏", a: "🅰️", b: "🅱️", o2: "🅾️", parking: "🅿️", ab: "🆎", cl: "🆑", cool: "🆒", free: "🆓", id: "🆔", new: "🆕", ng: "🆖", ok: "🆗", sos: "🆘", up: "🆙", vs: "🆚", "flag-ac": "🇦🇨", "flag-ad": "🇦🇩", "flag-ae": "🇦🇪", "flag-af": "🇦🇫", "flag-ag": "🇦🇬", "flag-ai": "🇦🇮", "flag-al": "🇦🇱", "flag-am": "🇦🇲", "flag-ao": "🇦🇴", "flag-aq": "🇦🇶", "flag-ar": "🇦🇷", "flag-as": "🇦🇸", "flag-at": "🇦🇹", "flag-au": "🇦🇺", "flag-aw": "🇦🇼", "flag-ax": "🇦🇽", "flag-az": "🇦🇿", "flag-ba": "🇧🇦", "flag-bb": "🇧🇧", "flag-bd": "🇧🇩", "flag-be": "🇧🇪", "flag-bf": "🇧🇫", "flag-bg": "🇧🇬", "flag-bh": "🇧🇭", "flag-bi": "🇧🇮", "flag-bj": "🇧🇯", "flag-bl": "🇧🇱", "flag-bm": "🇧🇲", "flag-bn": "🇧🇳", "flag-bo": "🇧🇴", "flag-bq": "🇧🇶", "flag-br": "🇧🇷", "flag-bs": "🇧🇸", "flag-bt": "🇧🇹", "flag-bv": "🇧🇻", "flag-bw": "🇧🇼", "flag-by": "🇧🇾", "flag-bz": "🇧🇿", "flag-ca": "🇨🇦", "flag-cc": "🇨🇨", "flag-cd": "🇨🇩", "flag-cf": "🇨🇫", "flag-cg": "🇨🇬", "flag-ch": "🇨🇭", "flag-ci": "🇨🇮", "flag-ck": "🇨🇰", "flag-cl": "🇨🇱", "flag-cm": "🇨🇲", cn: "🇨🇳", "flag-cn": "🇨🇳", "flag-co": "🇨🇴", "flag-cp": "🇨🇵", "flag-cr": "🇨🇷", "flag-cu": "🇨🇺", "flag-cv": "🇨🇻", "flag-cw": "🇨🇼", "flag-cx": "🇨🇽", "flag-cy": "🇨🇾", "flag-cz": "🇨🇿", de: "🇩🇪", "flag-de": "🇩🇪", "flag-dg": "🇩🇬", "flag-dj": "🇩🇯", "flag-dk": "🇩🇰", "flag-dm": "🇩🇲", "flag-do": "🇩🇴", "flag-dz": "🇩🇿", "flag-ea": "🇪🇦", "flag-ec": "🇪🇨", "flag-ee": "🇪🇪", "flag-eg": "🇪🇬", "flag-eh": "🇪🇭", "flag-er": "🇪🇷", es: "🇪🇸", "flag-es": "🇪🇸", "flag-et": "🇪🇹", "flag-eu": "🇪🇺", "flag-fi": "🇫🇮", "flag-fj": "🇫🇯", "flag-fk": "🇫🇰", "flag-fm": "🇫🇲", "flag-fo": "🇫🇴", fr: "🇫🇷", "flag-fr": "🇫🇷", "flag-ga": "🇬🇦", gb: "🇬🇧", uk: "🇬🇧", "flag-gb": "🇬🇧", "flag-gd": "🇬🇩", "flag-ge": "🇬🇪", "flag-gf": "🇬🇫", "flag-gg": "🇬🇬", "flag-gh": "🇬🇭", "flag-gi": "🇬🇮", "flag-gl": "🇬🇱", "flag-gm": "🇬🇲", "flag-gn": "🇬🇳", "flag-gp": "🇬🇵", "flag-gq": "🇬🇶", "flag-gr": "🇬🇷", "flag-gs": "🇬🇸", "flag-gt": "🇬🇹", "flag-gu": "🇬🇺", "flag-gw": "🇬🇼", "flag-gy": "🇬🇾", "flag-hk": "🇭🇰", "flag-hm": "🇭🇲", "flag-hn": "🇭🇳", "flag-hr": "🇭🇷", "flag-ht": "🇭🇹", "flag-hu": "🇭🇺", "flag-ic": "🇮🇨", "flag-id": "🇮🇩", "flag-ie": "🇮🇪", "flag-il": "🇮🇱", "flag-im": "🇮🇲", "flag-in": "🇮🇳", "flag-io": "🇮🇴", "flag-iq": "🇮🇶", "flag-ir": "🇮🇷", "flag-is": "🇮🇸", it: "🇮🇹", "flag-it": "🇮🇹", "flag-je": "🇯🇪", "flag-jm": "🇯🇲", "flag-jo": "🇯🇴", jp: "🇯🇵", "flag-jp": "🇯🇵", "flag-ke": "🇰🇪", "flag-kg": "🇰🇬", "flag-kh": "🇰🇭", "flag-ki": "🇰🇮", "flag-km": "🇰🇲", "flag-kn": "🇰🇳", "flag-kp": "🇰🇵", kr: "🇰🇷", "flag-kr": "🇰🇷", "flag-kw": "🇰🇼", "flag-ky": "🇰🇾", "flag-kz": "🇰🇿", "flag-la": "🇱🇦", "flag-lb": "🇱🇧", "flag-lc": "🇱🇨", "flag-li": "🇱🇮", "flag-lk": "🇱🇰", "flag-lr": "🇱🇷", "flag-ls": "🇱🇸", "flag-lt": "🇱🇹", "flag-lu": "🇱🇺", "flag-lv": "🇱🇻", "flag-ly": "🇱🇾", "flag-ma": "🇲🇦", "flag-mc": "🇲🇨", "flag-md": "🇲🇩", "flag-me": "🇲🇪", "flag-mf": "🇲🇫", "flag-mg": "🇲🇬", "flag-mh": "🇲🇭", "flag-mk": "🇲🇰", "flag-ml": "🇲🇱", "flag-mm": "🇲🇲", "flag-mn": "🇲🇳", "flag-mo": "🇲🇴", "flag-mp": "🇲🇵", "flag-mq": "🇲🇶", "flag-mr": "🇲🇷", "flag-ms": "🇲🇸", "flag-mt": "🇲🇹", "flag-mu": "🇲🇺", "flag-mv": "🇲🇻", "flag-mw": "🇲🇼", "flag-mx": "🇲🇽", "flag-my": "🇲🇾", "flag-mz": "🇲🇿", "flag-na": "🇳🇦", "flag-nc": "🇳🇨", "flag-ne": "🇳🇪", "flag-nf": "🇳🇫", "flag-ng": "🇳🇬", "flag-ni": "🇳🇮", "flag-nl": "🇳🇱", "flag-no": "🇳🇴", "flag-np": "🇳🇵", "flag-nr": "🇳🇷", "flag-nu": "🇳🇺", "flag-nz": "🇳🇿", "flag-om": "🇴🇲", "flag-pa": "🇵🇦", "flag-pe": "🇵🇪", "flag-pf": "🇵🇫", "flag-pg": "🇵🇬", "flag-ph": "🇵🇭", "flag-pk": "🇵🇰", "flag-pl": "🇵🇱", "flag-pm": "🇵🇲", "flag-pn": "🇵🇳", "flag-pr": "🇵🇷", "flag-ps": "🇵🇸", "flag-pt": "🇵🇹", "flag-pw": "🇵🇼", "flag-py": "🇵🇾", "flag-qa": "🇶🇦", "flag-re": "🇷🇪", "flag-ro": "🇷🇴", "flag-rs": "🇷🇸", ru: "🇷🇺", "flag-ru": "🇷🇺", "flag-rw": "🇷🇼", "flag-sa": "🇸🇦", "flag-sb": "🇸🇧", "flag-sc": "🇸🇨", "flag-sd": "🇸🇩", "flag-se": "🇸🇪", "flag-sg": "🇸🇬", "flag-sh": "🇸🇭", "flag-si": "🇸🇮", "flag-sj": "🇸🇯", "flag-sk": "🇸🇰", "flag-sl": "🇸🇱", "flag-sm": "🇸🇲", "flag-sn": "🇸🇳", "flag-so": "🇸🇴", "flag-sr": "🇸🇷", "flag-ss": "🇸🇸", "flag-st": "🇸🇹", "flag-sv": "🇸🇻", "flag-sx": "🇸🇽", "flag-sy": "🇸🇾", "flag-sz": "🇸🇿", "flag-ta": "🇹🇦", "flag-tc": "🇹🇨", "flag-td": "🇹🇩", "flag-tf": "🇹🇫", "flag-tg": "🇹🇬", "flag-th": "🇹🇭", "flag-tj": "🇹🇯", "flag-tk": "🇹🇰", "flag-tl": "🇹🇱", "flag-tm": "🇹🇲", "flag-tn": "🇹🇳", "flag-to": "🇹🇴", "flag-tr": "🇹🇷", "flag-tt": "🇹🇹", "flag-tv": "🇹🇻", "flag-tw": "🇹🇼", "flag-tz": "🇹🇿", "flag-ua": "🇺🇦", "flag-ug": "🇺🇬", "flag-um": "🇺🇲", "flag-un": "🇺🇳", us: "🇺🇸", "flag-us": "🇺🇸", "flag-uy": "🇺🇾", "flag-uz": "🇺🇿", "flag-va": "🇻🇦", "flag-vc": "🇻🇨", "flag-ve": "🇻🇪", "flag-vg": "🇻🇬", "flag-vi": "🇻🇮", "flag-vn": "🇻🇳", "flag-vu": "🇻🇺", "flag-wf": "🇼🇫", "flag-ws": "🇼🇸", "flag-xk": "🇽🇰", "flag-ye": "🇾🇪", "flag-yt": "🇾🇹", "flag-za": "🇿🇦", "flag-zm": "🇿🇲", "flag-zw": "🇿🇼", koko: "🈁", sa: "🈂️", u7121: "🈚", u6307: "🈯", u7981: "🈲", u7a7a: "🈳", u5408: "🈴", u6e80: "🈵", u6709: "🈶", u6708: "🈷️", u7533: "🈸", u5272: "🈹", u55b6: "🈺", ideograph_advantage: "🉐", accept: "🉑", cyclone: "🌀", foggy: "🌁", closed_umbrella: "🌂", night_with_stars: "🌃", sunrise_over_mountains: "🌄", sunrise: "🌅", city_sunset: "🌆", city_sunrise: "🌇", rainbow: "🌈", bridge_at_night: "🌉", ocean: "🌊", volcano: "🌋", milky_way: "🌌", earth_africa: "🌍", earth_americas: "🌎", earth_asia: "🌏", globe_with_meridians: "🌐", new_moon: "🌑", waxing_crescent_moon: "🌒", first_quarter_moon: "🌓", moon: "🌔", waxing_gibbous_moon: "🌔", full_moon: "🌕", waning_gibbous_moon: "🌖", last_quarter_moon: "🌗", waning_crescent_moon: "🌘", crescent_moon: "🌙", new_moon_with_face: "🌚", first_quarter_moon_with_face: "🌛", last_quarter_moon_with_face: "🌜", full_moon_with_face: "🌝", sun_with_face: "🌞", star2: "🌟", stars: "🌠", thermometer: "🌡️", mostly_sunny: "🌤️", sun_small_cloud: "🌤️", barely_sunny: "🌥️", sun_behind_cloud: "🌥️", partly_sunny_rain: "🌦️", sun_behind_rain_cloud: "🌦️", rain_cloud: "🌧️", snow_cloud: "🌨️", lightning: "🌩️", lightning_cloud: "🌩️", tornado: "🌪️", tornado_cloud: "🌪️", fog: "🌫️", wind_blowing_face: "🌬️", hotdog: "🌭", taco: "🌮", burrito: "🌯", chestnut: "🌰", seedling: "🌱", evergreen_tree: "🌲", deciduous_tree: "🌳", palm_tree: "🌴", cactus: "🌵", hot_pepper: "🌶️", tulip: "🌷", cherry_blossom: "🌸", rose: "🌹", hibiscus: "🌺", sunflower: "🌻", blossom: "🌼", corn: "🌽", ear_of_rice: "🌾", herb: "🌿", four_leaf_clover: "🍀", maple_leaf: "🍁", fallen_leaf: "🍂", leaves: "🍃", mushroom: "🍄", tomato: "🍅", eggplant: "🍆", grapes: "🍇", melon: "🍈", watermelon: "🍉", tangerine: "🍊", lemon: "🍋", banana: "🍌", pineapple: "🍍", apple: "🍎", green_apple: "🍏", pear: "🍐", peach: "🍑", cherries: "🍒", strawberry: "🍓", hamburger: "🍔", pizza: "🍕", meat_on_bone: "🍖", poultry_leg: "🍗", rice_cracker: "🍘", rice_ball: "🍙", rice: "🍚", curry: "🍛", ramen: "🍜", spaghetti: "🍝", bread: "🍞", fries: "🍟", sweet_potato: "🍠", dango: "🍡", oden: "🍢", sushi: "🍣", fried_shrimp: "🍤", fish_cake: "🍥", icecream: "🍦", shaved_ice: "🍧", ice_cream: "🍨", doughnut: "🍩", cookie: "🍪", chocolate_bar: "🍫", candy: "🍬", lollipop: "🍭", custard: "🍮", honey_pot: "🍯", cake: "🍰", bento: "🍱", stew: "🍲", fried_egg: "🍳", cooking: "🍳", fork_and_knife: "🍴", tea: "🍵", sake: "🍶", wine_glass: "🍷", cocktail: "🍸", tropical_drink: "🍹", beer: "🍺", beers: "🍻", baby_bottle: "🍼", knife_fork_plate: "🍽️", champagne: "🍾", popcorn: "🍿", ribbon: "🎀", gift: "🎁", birthday: "🎂", jack_o_lantern: "🎃", christmas_tree: "🎄", santa: "🎅", fireworks: "🎆", sparkler: "🎇", balloon: "🎈", tada: "🎉", confetti_ball: "🎊", tanabata_tree: "🎋", crossed_flags: "🎌", bamboo: "🎍", dolls: "🎎", flags: "🎏", wind_chime: "🎐", rice_scene: "🎑", school_satchel: "🎒", mortar_board: "🎓", medal: "🎖️", reminder_ribbon: "🎗️", studio_microphone: "🎙️", level_slider: "🎚️", control_knobs: "🎛️", film_frames: "🎞️", admission_tickets: "🎟️", carousel_horse: "🎠", ferris_wheel: "🎡", roller_coaster: "🎢", fishing_pole_and_fish: "🎣", microphone: "🎤", movie_camera: "🎥", cinema: "🎦", headphones: "🎧", art: "🎨", tophat: "🎩", circus_tent: "🎪", ticket: "🎫", clapper: "🎬", performing_arts: "🎭", video_game: "🎮", dart: "🎯", slot_machine: "🎰", "8ball": "🎱", game_die: "🎲", bowling: "🎳", flower_playing_cards: "🎴", musical_note: "🎵", notes: "🎶", saxophone: "🎷", guitar: "🎸", musical_keyboard: "🎹", trumpet: "🎺", violin: "🎻", musical_score: "🎼", running_shirt_with_sash: "🎽", tennis: "🎾", ski: "🎿", basketball: "🏀", checkered_flag: "🏁", snowboarder: "🏂", "woman-running": "🏃♀️", "man-running": "🏃♂️", runner: "🏃♂️", running: "🏃♂️", "woman-surfing": "🏄♀️", "man-surfing": "🏄♂️", surfer: "🏄♂️", sports_medal: "🏅", trophy: "🏆", horse_racing: "🏇", football: "🏈", rugby_football: "🏉", "woman-swimming": "🏊♀️", "man-swimming": "🏊♂️", swimmer: "🏊♂️", "woman-lifting-weights": "🏋️♀️", "man-lifting-weights": "🏋️♂️", weight_lifter: "🏋️♂️", "woman-golfing": "🏌️♀️", "man-golfing": "🏌️♂️", golfer: "🏌️♂️", racing_motorcycle: "🏍️", racing_car: "🏎️", cricket_bat_and_ball: "🏏", volleyball: "🏐", field_hockey_stick_and_ball: "🏑", ice_hockey_stick_and_puck: "🏒", table_tennis_paddle_and_ball: "🏓", snow_capped_mountain: "🏔️", camping: "🏕️", beach_with_umbrella: "🏖️", building_construction: "🏗️", house_buildings: "🏘️", cityscape: "🏙️", derelict_house_building: "🏚️", classical_building: "🏛️", desert: "🏜️", desert_island: "🏝️", national_park: "🏞️", stadium: "🏟️", house: "🏠", house_with_garden: "🏡", office: "🏢", post_office: "🏣", european_post_office: "🏤", hospital: "🏥", bank: "🏦", atm: "🏧", hotel: "🏨", love_hotel: "🏩", convenience_store: "🏪", school: "🏫", department_store: "🏬", factory: "🏭", izakaya_lantern: "🏮", lantern: "🏮", japanese_castle: "🏯", european_castle: "🏰", "rainbow-flag": "🏳️🌈", transgender_flag: "🏳️⚧️", waving_white_flag: "🏳️", pirate_flag: "🏴☠️", "flag-england": "🏴", "flag-scotland": "🏴", "flag-wales": "🏴", waving_black_flag: "🏴", rosette: "🏵️", label: "🏷️", badminton_racquet_and_shuttlecock: "🏸", bow_and_arrow: "🏹", amphora: "🏺", "skin-tone-2": "🏻", "skin-tone-3": "🏼", "skin-tone-4": "🏽", "skin-tone-5": "🏾", "skin-tone-6": "🏿", rat: "🐀", mouse2: "🐁", ox: "🐂", water_buffalo: "🐃", cow2: "🐄", tiger2: "🐅", leopard: "🐆", rabbit2: "🐇", black_cat: "🐈⬛", cat2: "🐈", dragon: "🐉", crocodile: "🐊", whale2: "🐋", snail: "🐌", snake: "🐍", racehorse: "🐎", ram: "🐏", goat: "🐐", sheep: "🐑", monkey: "🐒", rooster: "🐓", chicken: "🐔", service_dog: "🐕🦺", dog2: "🐕", pig2: "🐖", boar: "🐗", elephant: "🐘", octopus: "🐙", shell: "🐚", bug: "🐛", ant: "🐜", bee: "🐝", honeybee: "🐝", ladybug: "🐞", lady_beetle: "🐞", fish: "🐟", tropical_fish: "🐠", blowfish: "🐡", turtle: "🐢", hatching_chick: "🐣", baby_chick: "🐤", hatched_chick: "🐥", bird: "🐦", penguin: "🐧", koala: "🐨", poodle: "🐩", dromedary_camel: "🐪", camel: "🐫", dolphin: "🐬", flipper: "🐬", mouse: "🐭", cow: "🐮", tiger: "🐯", rabbit: "🐰", cat: "🐱", dragon_face: "🐲", whale: "🐳", horse: "🐴", monkey_face: "🐵", dog: "🐶", pig: "🐷", frog: "🐸", hamster: "🐹", wolf: "🐺", polar_bear: "🐻❄️", bear: "🐻", panda_face: "🐼", pig_nose: "🐽", feet: "🐾", paw_prints: "🐾", chipmunk: "🐿️", eyes: "👀", "eye-in-speech-bubble": "👁️🗨️", eye: "👁️", ear: "👂", nose: "👃", lips: "👄", tongue: "👅", point_up_2: "👆", point_down: "👇", point_left: "👈", point_right: "👉", facepunch: "👊", punch: "👊", wave: "👋", ok_hand: "👌", "+1": "👍", thumbsup: "👍", "-1": "👎", thumbsdown: "👎", clap: "👏", open_hands: "👐", crown: "👑", womans_hat: "👒", eyeglasses: "👓", necktie: "👔", shirt: "👕", tshirt: "👕", jeans: "👖", dress: "👗", kimono: "👘", bikini: "👙", womans_clothes: "👚", purse: "👛", handbag: "👜", pouch: "👝", mans_shoe: "👞", shoe: "👞", athletic_shoe: "👟", high_heel: "👠", sandal: "👡", boot: "👢", footprints: "👣", bust_in_silhouette: "👤", busts_in_silhouette: "👥", boy: "👦", girl: "👧", "male-farmer": "👨🌾", "male-cook": "👨🍳", man_feeding_baby: "👨🍼", "male-student": "👨🎓", "male-singer": "👨🎤", "male-artist": "👨🎨", "male-teacher": "👨🏫", "male-factory-worker": "👨🏭", "man-boy-boy": "👨👦👦", "man-boy": "👨👦", "man-girl-boy": "👨👧👦", "man-girl-girl": "👨👧👧", "man-girl": "👨👧", "man-man-boy": "👨👨👦", "man-man-boy-boy": "👨👨👦👦", "man-man-girl": "👨👨👧", "man-man-girl-boy": "👨👨👧👦", "man-man-girl-girl": "👨👨👧👧", "man-woman-boy": "👨👩👦", family: "👨👩👦", "man-woman-boy-boy": "👨👩👦👦", "man-woman-girl": "👨👩👧", "man-woman-girl-boy": "👨👩👧👦", "man-woman-girl-girl": "👨👩👧👧", "male-technologist": "👨💻", "male-office-worker": "👨💼", "male-mechanic": "👨🔧", "male-scientist": "👨🔬", "male-astronaut": "👨🚀", "male-firefighter": "👨🚒", man_with_probing_cane: "👨🦯", red_haired_man: "👨🦰", curly_haired_man: "👨🦱", bald_man: "👨🦲", white_haired_man: "👨🦳", man_in_motorized_wheelchair: "👨🦼", man_in_manual_wheelchair: "👨🦽", "male-doctor": "👨⚕️", "male-judge": "👨⚖️", "male-pilot": "👨✈️", "man-heart-man": "👨❤️👨", "man-kiss-man": "👨❤️💋👨", man: "👨", "female-farmer": "👩🌾", "female-cook": "👩🍳", woman_feeding_baby: "👩🍼", "female-student": "👩🎓", "female-singer": "👩🎤", "female-artist": "👩🎨", "female-teacher": "👩🏫", "female-factory-worker": "👩🏭", "woman-boy-boy": "👩👦👦", "woman-boy": "👩👦", "woman-girl-boy": "👩👧👦", "woman-girl-girl": "👩👧👧", "woman-girl": "👩👧", "woman-woman-boy": "👩👩👦", "woman-woman-boy-boy": "👩👩👦👦", "woman-woman-girl": "👩👩👧", "woman-woman-girl-boy": "👩👩👧👦", "woman-woman-girl-girl": "👩👩👧👧", "female-technologist": "👩💻", "female-office-worker": "👩💼", "female-mechanic": "👩🔧", "female-scientist": "👩🔬", "female-astronaut": "👩🚀", "female-firefighter": "👩🚒", woman_with_probing_cane: "👩🦯", red_haired_woman: "👩🦰", curly_haired_woman: "👩🦱", bald_woman: "👩🦲", white_haired_woman: "👩🦳", woman_in_motorized_wheelchair: "👩🦼", woman_in_manual_wheelchair: "👩🦽", "female-doctor": "👩⚕️", "female-judge": "👩⚖️", "female-pilot": "👩✈️", "woman-heart-man": "👩❤️👨", "woman-heart-woman": "👩❤️👩", "woman-kiss-man": "👩❤️💋👨", "woman-kiss-woman": "👩❤️💋👩", woman: "👩", man_and_woman_holding_hands: "👫", woman_and_man_holding_hands: "👫", couple: "👫", two_men_holding_hands: "👬", men_holding_hands: "👬", two_women_holding_hands: "👭", women_holding_hands: "👭", "female-police-officer": "👮♀️", "male-police-officer": "👮♂️", cop: "👮♂️", "women-with-bunny-ears-partying": "👯♀️", "woman-with-bunny-ears-partying": "👯♀️", dancers: "👯♀️", "men-with-bunny-ears-partying": "👯♂️", "man-with-bunny-ears-partying": "👯♂️", woman_with_veil: "👰♀️", man_with_veil: "👰♂️", bride_with_veil: "👰", "blond-haired-woman": "👱♀️", "blond-haired-man": "👱♂️", person_with_blond_hair: "👱♂️", man_with_gua_pi_mao: "👲", "woman-wearing-turban": "👳♀️", "man-wearing-turban": "👳♂️", man_with_turban: "👳♂️", older_man: "👴", older_woman: "👵", baby: "👶", "female-construction-worker": "👷♀️", "male-construction-worker": "👷♂️", construction_worker: "👷♂️", princess: "👸", japanese_ogre: "👹", japanese_goblin: "👺", ghost: "👻", angel: "👼", alien: "👽", space_invader: "👾", imp: "👿", skull: "💀", "woman-tipping-hand": "💁♀️", information_desk_person: "💁♀️", "man-tipping-hand": "💁♂️", "female-guard": "💂♀️", "male-guard": "💂♂️", guardsman: "💂♂️", dancer: "💃", lipstick: "💄", nail_care: "💅", "woman-getting-massage": "💆♀️", massage: "💆♀️", "man-getting-massage": "💆♂️", "woman-getting-haircut": "💇♀️", haircut: "💇♀️", "man-getting-haircut": "💇♂️", barber: "💈", syringe: "💉", pill: "💊", kiss: "💋", love_letter: "💌", ring: "💍", gem: "💎", couplekiss: "💏", bouquet: "💐", couple_with_heart: "💑", wedding: "💒", heartbeat: "💓", broken_heart: "💔", two_hearts: "💕", sparkling_heart: "💖", heartpulse: "💗", cupid: "💘", blue_heart: "💙", green_heart: "💚", yellow_heart: "💛", purple_heart: "💜", gift_heart: "💝", revolving_hearts: "💞", heart_decoration: "💟", diamond_shape_with_a_dot_inside: "💠", bulb: "💡", anger: "💢", bomb: "💣", zzz: "💤", boom: "💥", collision: "💥", sweat_drops: "💦", droplet: "💧", dash: "💨", hankey: "💩", poop: "💩", shit: "💩", muscle: "💪", dizzy: "💫", speech_balloon: "💬", thought_balloon: "💭", white_flower: "💮", moneybag: "💰", currency_exchange: "💱", heavy_dollar_sign: "💲", credit_card: "💳", yen: "💴", dollar: "💵", euro: "💶", pound: "💷", money_with_wings: "💸", chart: "💹", seat: "💺", computer: "💻", briefcase: "💼", minidisc: "💽", floppy_disk: "💾", cd: "💿", dvd: "📀", file_folder: "📁", open_file_folder: "📂", page_with_curl: "📃", page_facing_up: "📄", date: "📅", calendar: "📆", card_index: "📇", chart_with_upwards_trend: "📈", chart_with_downwards_trend: "📉", bar_chart: "📊", clipboard: "📋", pushpin: "📌", round_pushpin: "📍", paperclip: "📎", straight_ruler: "📏", triangular_ruler: "📐", bookmark_tabs: "📑", ledger: "📒", notebook: "📓", notebook_with_decorative_cover: "📔", closed_book: "📕", book: "📖", open_book: "📖", green_book: "📗", blue_book: "📘", orange_book: "📙", books: "📚", name_badge: "📛", scroll: "📜", memo: "📝", pencil: "📝", telephone_receiver: "📞", pager: "📟", fax: "📠", satellite_antenna: "📡", loudspeaker: "📢", mega: "📣", outbox_tray: "📤", inbox_tray: "📥", package: "📦", "e-mail": "📧", incoming_envelope: "📨", envelope_with_arrow: "📩", mailbox_closed: "📪", mailbox: "📫", mailbox_with_mail: "📬", mailbox_with_no_mail: "📭", postbox: "📮", postal_horn: "📯", newspaper: "📰", iphone: "📱", calling: "📲", vibration_mode: "📳", mobile_phone_off: "📴", no_mobile_phones: "📵", signal_strength: "📶", camera: "📷", camera_with_flash: "📸", video_camera: "📹", tv: "📺", radio: "📻", vhs: "📼", film_projector: "📽️", prayer_beads: "📿", twisted_rightwards_arrows: "🔀", repeat: "🔁", repeat_one: "🔂", arrows_clockwise: "🔃", arrows_counterclockwise: "🔄", low_brightness: "🔅", high_brightness: "🔆", mute: "🔇", speaker: "🔈", sound: "🔉", loud_sound: "🔊", battery: "🔋", electric_plug: "🔌", mag: "🔍", mag_right: "🔎", lock_with_ink_pen: "🔏", closed_lock_with_key: "🔐", key: "🔑", lock: "🔒", unlock: "🔓", bell: "🔔", no_bell: "🔕", bookmark: "🔖", link: "🔗", radio_button: "🔘", back: "🔙", end: "🔚", on: "🔛", soon: "🔜", top: "🔝", underage: "🔞", keycap_ten: "🔟", capital_abcd: "🔠", abcd: "🔡", symbols: "🔣", abc: "🔤", fire: "🔥", flashlight: "🔦", wrench: "🔧", hammer: "🔨", nut_and_bolt: "🔩", hocho: "🔪", knife: "🔪", gun: "🔫", microscope: "🔬", telescope: "🔭", crystal_ball: "🔮", six_pointed_star: "🔯", beginner: "🔰", trident: "🔱", black_square_button: "🔲", white_square_button: "🔳", red_circle: "🔴", large_blue_circle: "🔵", large_orange_diamond: "🔶", large_blue_diamond: "🔷", small_orange_diamond: "🔸", small_blue_diamond: "🔹", small_red_triangle: "🔺", small_red_triangle_down: "🔻", arrow_up_small: "🔼", arrow_down_small: "🔽", om_symbol: "🕉️", dove_of_peace: "🕊️", kaaba: "🕋", mosque: "🕌", synagogue: "🕍", menorah_with_nine_branches: "🕎", clock1: "🕐", clock2: "🕑", clock3: "🕒", clock4: "🕓", clock5: "🕔", clock6: "🕕", clock7: "🕖", clock8: "🕗", clock9: "🕘", clock10: "🕙", clock11: "🕚", clock12: "🕛", clock130: "🕜", clock230: "🕝", clock330: "🕞", clock430: "🕟", clock530: "🕠", clock630: "🕡", clock730: "🕢", clock830: "🕣", clock930: "🕤", clock1030: "🕥", clock1130: "🕦", clock1230: "🕧", candle: "🕯️", mantelpiece_clock: "🕰️", hole: "🕳️", man_in_business_suit_levitating: "🕴️", "female-detective": "🕵️♀️", "male-detective": "🕵️♂️", sleuth_or_spy: "🕵️♂️", dark_sunglasses: "🕶️", spider: "🕷️", spider_web: "🕸️", joystick: "🕹️", man_dancing: "🕺", linked_paperclips: "🖇️", lower_left_ballpoint_pen: "🖊️", lower_left_fountain_pen: "🖋️", lower_left_paintbrush: "🖌️", lower_left_crayon: "🖍️", raised_hand_with_fingers_splayed: "🖐️", middle_finger: "🖕", reversed_hand_with_middle_finger_extended: "🖕", "spock-hand": "🖖", black_heart: "🖤", desktop_computer: "🖥️", printer: "🖨️", three_button_mouse: "🖱️", trackball: "🖲️", frame_with_picture: "🖼️", card_index_dividers: "🗂️", card_file_box: "🗃️", file_cabinet: "🗄️", wastebasket: "🗑️", spiral_note_pad: "🗒️", spiral_calendar_pad: "🗓️", compression: "🗜️", old_key: "🗝️", rolled_up_newspaper: "🗞️", dagger_knife: "🗡️", speaking_head_in_silhouette: "🗣️", left_speech_bubble: "🗨️", right_anger_bubble: "🗯️", ballot_box_with_ballot: "🗳️", world_map: "🗺️", mount_fuji: "🗻", tokyo_tower: "🗼", statue_of_liberty: "🗽", japan: "🗾", moyai: "🗿", grinning: "😀", grin: "😁", joy: "😂", smiley: "😃", smile: "😄", sweat_smile: "😅", laughing: "😆", satisfied: "😆", innocent: "😇", smiling_imp: "😈", wink: "😉", blush: "😊", yum: "😋", relieved: "😌", heart_eyes: "😍", sunglasses: "😎", smirk: "😏", neutral_face: "😐", expressionless: "😑", unamused: "😒", sweat: "😓", pensive: "😔", confused: "😕", confounded: "😖", kissing: "😗", kissing_heart: "😘", kissing_smiling_eyes: "😙", kissing_closed_eyes: "😚", stuck_out_tongue: "😛", stuck_out_tongue_winking_eye: "😜", stuck_out_tongue_closed_eyes: "😝", disappointed: "😞", worried: "😟", angry: "😠", rage: "😡", cry: "😢", persevere: "😣", triumph: "😤", disappointed_relieved: "😥", frowning: "😦", anguished: "😧", fearful: "😨", weary: "😩", sleepy: "😪", tired_face: "😫", grimacing: "😬", sob: "😭", face_exhaling: "😮💨", open_mouth: "😮", hushed: "😯", cold_sweat: "😰", scream: "😱", astonished: "😲", flushed: "😳", sleeping: "😴", face_with_spiral_eyes: "😵💫", dizzy_face: "😵", face_in_clouds: "😶🌫️", no_mouth: "😶", mask: "😷", smile_cat: "😸", joy_cat: "😹", smiley_cat: "😺", heart_eyes_cat: "😻", smirk_cat: "😼", kissing_cat: "😽", pouting_cat: "😾", crying_cat_face: "😿", scream_cat: "🙀", slightly_frowning_face: "🙁", slightly_smiling_face: "🙂", upside_down_face: "🙃", face_with_rolling_eyes: "🙄", "woman-gesturing-no": "🙅♀️", no_good: "🙅♀️", "man-gesturing-no": "🙅♂️", "woman-gesturing-ok": "🙆♀️", ok_woman: "🙆♀️", "man-gesturing-ok": "🙆♂️", "woman-bowing": "🙇♀️", "man-bowing": "🙇♂️", bow: "🙇♂️", see_no_evil: "🙈", hear_no_evil: "🙉", speak_no_evil: "🙊", "woman-raising-hand": "🙋♀️", raising_hand: "🙋♀️", "man-raising-hand": "🙋♂️", raised_hands: "🙌", "woman-frowning": "🙍♀️", person_frowning: "🙍♀️", "man-frowning": "🙍♂️", "woman-pouting": "🙎♀️", person_with_pouting_face: "🙎♀️", "man-pouting": "🙎♂️", pray: "🙏", rocket: "🚀", helicopter: "🚁", steam_locomotive: "🚂", railway_car: "🚃", bullettrain_side: "🚄", bullettrain_front: "🚅", train2: "🚆", metro: "🚇", light_rail: "🚈", station: "🚉", tram: "🚊", train: "🚋", bus: "🚌", oncoming_bus: "🚍", trolleybus: "🚎", busstop: "🚏", minibus: "🚐", ambulance: "🚑", fire_engine: "🚒", police_car: "🚓", oncoming_police_car: "🚔", taxi: "🚕", oncoming_taxi: "🚖", car: "🚗", red_car: "🚗", oncoming_automobile: "🚘", blue_car: "🚙", truck: "🚚", articulated_lorry: "🚛", tractor: "🚜", monorail: "🚝", mountain_railway: "🚞", suspension_railway: "🚟", mountain_cableway: "🚠", aerial_tramway: "🚡", ship: "🚢", "woman-rowing-boat": "🚣♀️", "man-rowing-boat": "🚣♂️", rowboat: "🚣♂️", speedboat: "🚤", traffic_light: "🚥", vertical_traffic_light: "🚦", construction: "🚧", rotating_light: "🚨", triangular_flag_on_post: "🚩", door: "🚪", no_entry_sign: "🚫", smoking: "🚬", no_smoking: "🚭", put_litter_in_its_place: "🚮", do_not_litter: "🚯", potable_water: "🚰", "non-potable_water": "🚱", bike: "🚲", no_bicycles: "🚳", "woman-biking": "🚴♀️", "man-biking": "🚴♂️", bicyclist: "🚴♂️", "woman-mountain-biking": "🚵♀️", "man-mountain-biking": "🚵♂️", mountain_bicyclist: "🚵♂️", "woman-walking": "🚶♀️", "man-walking": "🚶♂️", walking: "🚶♂️", no_pedestrians: "🚷", children_crossing: "🚸", mens: "🚹", womens: "🚺", restroom: "🚻", baby_symbol: "🚼", toilet: "🚽", wc: "🚾", shower: "🚿", bath: "🛀", bathtub: "🛁", passport_control: "🛂", customs: "🛃", baggage_claim: "🛄", left_luggage: "🛅", couch_and_lamp: "🛋️", sleeping_accommodation: "🛌", shopping_bags: "🛍️", bellhop_bell: "🛎️", bed: "🛏️", place_of_worship: "🛐", octagonal_sign: "🛑", shopping_trolley: "🛒", hindu_temple: "🛕", hut: "🛖", elevator: "🛗", hammer_and_wrench: "🛠️", shield: "🛡️", oil_drum: "🛢️", motorway: "🛣️", railway_track: "🛤️", motor_boat: "🛥️", small_airplane: "🛩️", airplane_departure: "🛫", airplane_arriving: "🛬", satellite: "🛰️", passenger_ship: "🛳️", scooter: "🛴", motor_scooter: "🛵", canoe: "🛶", sled: "🛷", flying_saucer: "🛸", skateboard: "🛹", auto_rickshaw: "🛺", pickup_truck: "🛻", roller_skate: "🛼", large_orange_circle: "🟠", large_yellow_circle: "🟡", large_green_circle: "🟢", large_purple_circle: "🟣", large_brown_circle: "🟤", large_red_square: "🟥", large_blue_square: "🟦", large_orange_square: "🟧", large_yellow_square: "🟨", large_green_square: "🟩", large_purple_square: "🟪", large_brown_square: "🟫", pinched_fingers: "🤌", white_heart: "🤍", brown_heart: "🤎", pinching_hand: "🤏", zipper_mouth_face: "🤐", money_mouth_face: "🤑", face_with_thermometer: "🤒", nerd_face: "🤓", thinking_face: "🤔", face_with_head_bandage: "🤕", robot_face: "🤖", hugging_face: "🤗", the_horns: "🤘", sign_of_the_horns: "🤘", call_me_hand: "🤙", raised_back_of_hand: "🤚", "left-facing_fist": "🤛", "right-facing_fist": "🤜", handshake: "🤝", crossed_fingers: "🤞", hand_with_index_and_middle_fingers_crossed: "🤞", i_love_you_hand_sign: "🤟", face_with_cowboy_hat: "🤠", clown_face: "🤡", nauseated_face: "🤢", rolling_on_the_floor_laughing: "🤣", drooling_face: "🤤", lying_face: "🤥", "woman-facepalming": "🤦♀️", "man-facepalming": "🤦♂️", face_palm: "🤦", sneezing_face: "🤧", face_with_raised_eyebrow: "🤨", face_with_one_eyebrow_raised: "🤨", "star-struck": "🤩", grinning_face_with_star_eyes: "🤩", zany_face: "🤪", grinning_face_with_one_large_and_one_small_eye: "🤪", shushing_face: "🤫", face_with_finger_covering_closed_lips: "🤫", face_with_symbols_on_mouth: "🤬", serious_face_with_symbols_covering_mouth: "🤬", face_with_hand_over_mouth: "🤭", smiling_face_with_smiling_eyes_and_hand_covering_mouth: "🤭", face_vomiting: "🤮", face_with_open_mouth_vomiting: "🤮", exploding_head: "🤯", shocked_face_with_exploding_head: "🤯", pregnant_woman: "🤰", "breast-feeding": "🤱", palms_up_together: "🤲", selfie: "🤳", prince: "🤴", woman_in_tuxedo: "🤵♀️", man_in_tuxedo: "🤵♂️", person_in_tuxedo: "🤵", mrs_claus: "🤶", mother_christmas: "🤶", "woman-shrugging": "🤷♀️", "man-shrugging": "🤷♂️", shrug: "🤷", "woman-cartwheeling": "🤸♀️", "man-cartwheeling": "🤸♂️", person_doing_cartwheel: "🤸", "woman-juggling": "🤹♀️", "man-juggling": "🤹♂️", juggling: "🤹", fencer: "🤺", "woman-wrestling": "🤼♀️", "man-wrestling": "🤼♂️", wrestlers: "🤼", "woman-playing-water-polo": "🤽♀️", "man-playing-water-polo": "🤽♂️", water_polo: "🤽", "woman-playing-handball": "🤾♀️", "man-playing-handball": "🤾♂️", handball: "🤾", diving_mask: "🤿", wilted_flower: "🥀", drum_with_drumsticks: "🥁", clinking_glasses: "🥂", tumbler_glass: "🥃", spoon: "🥄", goal_net: "🥅", first_place_medal: "🥇", second_place_medal: "🥈", third_place_medal: "🥉", boxing_glove: "🥊", martial_arts_uniform: "🥋", curling_stone: "🥌", lacrosse: "🥍", softball: "🥎", flying_disc: "🥏", croissant: "🥐", avocado: "🥑", cucumber: "🥒", bacon: "🥓", potato: "🥔", carrot: "🥕", baguette_bread: "🥖", green_salad: "🥗", shallow_pan_of_food: "🥘", stuffed_flatbread: "🥙", egg: "🥚", glass_of_milk: "🥛", peanuts: "🥜", kiwifruit: "🥝", pancakes: "🥞", dumpling: "🥟", fortune_cookie: "🥠", takeout_box: "🥡", chopsticks: "🥢", bowl_with_spoon: "🥣", cup_with_straw: "🥤", coconut: "🥥", broccoli: "🥦", pie: "🥧", pretzel: "🥨", cut_of_meat: "🥩", sandwich: "🥪", canned_food: "🥫", leafy_green: "🥬", mango: "🥭", moon_cake: "🥮", bagel: "🥯", smiling_face_with_3_hearts: "🥰", yawning_face: "🥱", smiling_face_with_tear: "🥲", partying_face: "🥳", woozy_face: "🥴", hot_face: "🥵", cold_face: "🥶", ninja: "🥷", disguised_face: "🥸", pleading_face: "🥺", sari: "🥻", lab_coat: "🥼", goggles: "🥽", hiking_boot: "🥾", womans_flat_shoe: "🥿", crab: "🦀", lion_face: "🦁", scorpion: "🦂", turkey: "🦃", unicorn_face: "🦄", eagle: "🦅", duck: "🦆", bat: "🦇", shark: "🦈", owl: "🦉", fox_face: "🦊", butterfly: "🦋", deer: "🦌", gorilla: "🦍", lizard: "🦎", rhinoceros: "🦏", shrimp: "🦐", squid: "🦑", giraffe_face: "🦒", zebra_face: "🦓", hedgehog: "🦔", sauropod: "🦕", "t-rex": "🦖", cricket: "🦗", kangaroo: "🦘", llama: "🦙", peacock: "🦚", hippopotamus: "🦛", parrot: "🦜", raccoon: "🦝", lobster: "🦞", mosquito: "🦟", microbe: "🦠", badger: "🦡", swan: "🦢", mammoth: "🦣", dodo: "🦤", sloth: "🦥", otter: "🦦", orangutan: "🦧", skunk: "🦨", flamingo: "🦩", oyster: "🦪", beaver: "🦫", bison: "🦬", seal: "🦭", guide_dog: "🦮", probing_cane: "🦯", bone: "🦴", leg: "🦵", foot: "🦶", tooth: "🦷", female_superhero: "🦸♀️", male_superhero: "🦸♂️", superhero: "🦸", female_supervillain: "🦹♀️", male_supervillain: "🦹♂️", supervillain: "🦹", safety_vest: "🦺", ear_with_hearing_aid: "🦻", motorized_wheelchair: "🦼", manual_wheelchair: "🦽", mechanical_arm: "🦾", mechanical_leg: "🦿", cheese_wedge: "🧀", cupcake: "🧁", salt: "🧂", beverage_box: "🧃", garlic: "🧄", onion: "🧅", falafel: "🧆", waffle: "🧇", butter: "🧈", mate_drink: "🧉", ice_cube: "🧊", bubble_tea: "🧋", woman_standing: "🧍♀️", man_standing: "🧍♂️", standing_person: "🧍", woman_kneeling: "🧎♀️", man_kneeling: "🧎♂️", kneeling_person: "🧎", deaf_woman: "🧏♀️", deaf_man: "🧏♂️", deaf_person: "🧏", face_with_monocle: "🧐", farmer: "🧑🌾", cook: "🧑🍳", person_feeding_baby: "🧑🍼", mx_claus: "🧑🎄", student: "🧑🎓", singer: "🧑🎤", artist: "🧑🎨", teacher: "🧑🏫", factory_worker: "🧑🏭", technologist: "🧑💻", office_worker: "🧑💼", mechanic: "🧑🔧", scientist: "🧑🔬", astronaut: "🧑🚀", firefighter: "🧑🚒", people_holding_hands: "🧑🤝🧑", person_with_probing_cane: "🧑🦯", red_haired_person: "🧑🦰", curly_haired_person: "🧑🦱", bald_person: "🧑🦲", white_haired_person: "🧑🦳", person_in_motorized_wheelchair: "🧑🦼", person_in_manual_wheelchair: "🧑🦽", health_worker: "🧑⚕️", judge: "🧑⚖️", pilot: "🧑✈️", adult: "🧑", child: "🧒", older_adult: "🧓", woman_with_beard: "🧔♀️", man_with_beard: "🧔♂️", bearded_person: "🧔", person_with_headscarf: "🧕", woman_in_steamy_room: "🧖♀️", man_in_steamy_room: "🧖♂️", person_in_steamy_room: "🧖♂️", woman_climbing: "🧗♀️", person_climbing: "🧗♀️", man_climbing: "🧗♂️", woman_in_lotus_position: "🧘♀️", person_in_lotus_position: "🧘♀️", man_in_lotus_position: "🧘♂️", female_mage: "🧙♀️", mage: "🧙♀️", male_mage: "🧙♂️", female_fairy: "🧚♀️", fairy: "🧚♀️", male_fairy: "🧚♂️", female_vampire: "🧛♀️", vampire: "🧛♀️", male_vampire: "🧛♂️", mermaid: "🧜♀️", merman: "🧜♂️", merperson: "🧜♂️", female_elf: "🧝♀️", male_elf: "🧝♂️", elf: "🧝♂️", female_genie: "🧞♀️", male_genie: "🧞♂️", genie: "🧞♂️", female_zombie: "🧟♀️", male_zombie: "🧟♂️", zombie: "🧟♂️", brain: "🧠", orange_heart: "🧡", billed_cap: "🧢", scarf: "🧣", gloves: "🧤", coat: "🧥", socks: "🧦", red_envelope: "🧧", firecracker: "🧨", jigsaw: "🧩", test_tube: "🧪", petri_dish: "🧫", dna: "🧬", compass: "🧭", abacus: "🧮", fire_extinguisher: "🧯", toolbox: "🧰", bricks: "🧱", magnet: "🧲", luggage: "🧳", lotion_bottle: "🧴", thread: "🧵", yarn: "🧶", safety_pin: "🧷", teddy_bear: "🧸", broom: "🧹", basket: "🧺", roll_of_paper: "🧻", soap: "🧼", sponge: "🧽", receipt: "🧾", nazar_amulet: "🧿", ballet_shoes: "🩰", "one-piece_swimsuit": "🩱", briefs: "🩲", shorts: "🩳", thong_sandal: "🩴", drop_of_blood: "🩸", adhesive_bandage: "🩹", stethoscope: "🩺", "yo-yo": "🪀", kite: "🪁", parachute: "🪂", boomerang: "🪃", magic_wand: "🪄", pinata: "🪅", nesting_dolls: "🪆", ringed_planet: "🪐", chair: "🪑", razor: "🪒", axe: "🪓", diya_lamp: "🪔", banjo: "🪕", military_helmet: "🪖", accordion: "🪗", long_drum: "🪘", coin: "🪙", carpentry_saw: "🪚", screwdriver: "🪛", ladder: "🪜", hook: "🪝", mirror: "🪞", window: "🪟", plunger: "🪠", sewing_needle: "🪡", knot: "🪢", bucket: "🪣", mouse_trap: "🪤", toothbrush: "🪥", headstone: "🪦", placard: "🪧", rock: "🪨", fly: "🪰", worm: "🪱", beetle: "🪲", cockroach: "🪳", potted_plant: "🪴", wood: "🪵", feather: "🪶", anatomical_heart: "🫀", lungs: "🫁", people_hugging: "🫂", blueberries: "🫐", bell_pepper: "🫑", olive: "🫒", flatbread: "🫓", tamale: "🫔", fondue: "🫕", teapot: "🫖", bangbang: "‼️", interrobang: "⁉️", tm: "™️", information_source: "ℹ️", left_right_arrow: "↔️", arrow_up_down: "↕️", arrow_upper_left: "↖️", arrow_upper_right: "↗️", arrow_lower_right: "↘️", arrow_lower_left: "↙️", leftwards_arrow_with_hook: "↩️", arrow_right_hook: "↪️", watch: "⌚", hourglass: "⌛", keyboard: "⌨️", eject: "⏏️", fast_forward: "⏩", rewind: "⏪", arrow_double_up: "⏫", arrow_double_down: "⏬", black_right_pointing_double_triangle_with_vertical_bar: "⏭️", black_left_pointing_double_triangle_with_vertical_bar: "⏮️", black_right_pointing_triangle_with_double_vertical_bar: "⏯️", alarm_clock: "⏰", stopwatch: "⏱️", timer_clock: "⏲️", hourglass_flowing_sand: "⏳", double_vertical_bar: "⏸️", black_square_for_stop: "⏹️", black_circle_for_record: "⏺️", m: "Ⓜ️", black_small_square: "▪️", white_small_square: "▫️", arrow_forward: "▶️", arrow_backward: "◀️", white_medium_square: "◻️", black_medium_square: "◼️", white_medium_small_square: "◽", black_medium_small_square: "◾", sunny: "☀️", cloud: "☁️", umbrella: "☂️", snowman: "☃️", comet: "☄️", phone: "☎️", telephone: "☎️", ballot_box_with_check: "☑️", shamrock: "☘️", point_up: "☝️", skull_and_crossbones: "☠️", radioactive_sign: "☢️", biohazard_sign: "☣️", orthodox_cross: "☦️", star_and_crescent: "☪️", peace_symbol: "☮️", yin_yang: "☯️", wheel_of_dharma: "☸️", white_frowning_face: "☹️", relaxed: "☺️", female_sign: "♀️", male_sign: "♂️", gemini: "♊", cancer: "♋", leo: "♌", virgo: "♍", libra: "♎", scorpius: "♏", chess_pawn: "♟️", spades: "♠️", clubs: "♣️", hearts: "♥️", diamonds: "♦️", hotsprings: "♨️", recycle: "♻️", infinity: "♾️", wheelchair: "♿", hammer_and_pick: "⚒️", crossed_swords: "⚔️", medical_symbol: "⚕️", staff_of_aesculapius: "⚕️", scales: "⚖️", alembic: "⚗️", gear: "⚙️", atom_symbol: "⚛️", fleur_de_lis: "⚜️", warning: "⚠️", zap: "⚡", transgender_symbol: "⚧️", white_circle: "⚪", black_circle: "⚫", coffin: "⚰️", funeral_urn: "⚱️", soccer: "⚽", baseball: "⚾", snowman_without_snow: "⛄", partly_sunny: "⛅", thunder_cloud_and_rain: "⛈️", ophiuchus: "⛎", pick: "⛏️", helmet_with_white_cross: "⛑️", chains: "⛓️", no_entry: "⛔", shinto_shrine: "⛩️", church: "⛪", mountain: "⛰️", umbrella_on_ground: "⛱️", fountain: "⛲", golf: "⛳", ferry: "⛴️", boat: "⛵", sailboat: "⛵", skier: "⛷️", ice_skate: "⛸️", "woman-bouncing-ball": "⛹️♀️", "man-bouncing-ball": "⛹️♂️", person_with_ball: "⛹️♂️", tent: "⛺", fuelpump: "⛽", scissors: "✂️", airplane: "✈️", email: "✉️", envelope: "✉️", fist: "✊", hand: "✋", raised_hand: "✋", v: "✌️", writing_hand: "✍️", pencil2: "✏️", black_nib: "✒️", heavy_check_mark: "✔️", heavy_multiplication_x: "✖️", latin_cross: "✝️", star_of_david: "✡️", eight_spoked_asterisk: "✳️", eight_pointed_black_star: "✴️", snowflake: "❄️", sparkle: "❇️", x: "❌", negative_squared_cross_mark: "❎", heavy_heart_exclamation_mark_ornament: "❣️", heart_on_fire: "❤️🔥", mending_heart: "❤️🩹", heart: "❤️", arrow_right: "➡️", curly_loop: "➰", loop: "➿", arrow_heading_up: "⤴️", arrow_heading_down: "⤵️", arrow_left: "⬅️", arrow_up: "⬆️", arrow_down: "⬇️", black_large_square: "⬛", white_large_square: "⬜", star: "⭐", o: "⭕", wavy_dash: "〰️", part_alternation_mark: "〽️", congratulations: "㊗️", secret: "㊙️" };
|
|
96053
96568
|
});
|
|
96054
96569
|
|
|
96055
96570
|
// node_modules/.bun/node-emoji@1.11.0/node_modules/node-emoji/lib/emoji.js
|
|
96056
|
-
var require_emoji2 = __commonJS((exports, module)
|
|
96571
|
+
var require_emoji2 = __commonJS(function(exports, module) {
|
|
96057
96572
|
var toArray = require_toArray();
|
|
96058
96573
|
var emojiByName = require_emoji();
|
|
96059
96574
|
var emojiNameRegex = /:([a-zA-Z0-9_\-\+]+):/g;
|
|
@@ -96198,7 +96713,7 @@ var require_emoji2 = __commonJS((exports, module) => {
|
|
|
96198
96713
|
});
|
|
96199
96714
|
|
|
96200
96715
|
// node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
96201
|
-
var require_has_flag = __commonJS((exports, module)
|
|
96716
|
+
var require_has_flag = __commonJS(function(exports, module) {
|
|
96202
96717
|
module.exports = (flag, argv = process.argv) => {
|
|
96203
96718
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
96204
96719
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -96208,7 +96723,7 @@ var require_has_flag = __commonJS((exports, module) => {
|
|
|
96208
96723
|
});
|
|
96209
96724
|
|
|
96210
96725
|
// node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
96211
|
-
var require_supports_color = __commonJS((exports, module)
|
|
96726
|
+
var require_supports_color = __commonJS(function(exports, module) {
|
|
96212
96727
|
var os = __require("os");
|
|
96213
96728
|
var tty = __require("tty");
|
|
96214
96729
|
var hasFlag = require_has_flag();
|
|
@@ -96307,7 +96822,7 @@ var require_supports_color = __commonJS((exports, module) => {
|
|
|
96307
96822
|
});
|
|
96308
96823
|
|
|
96309
96824
|
// node_modules/.bun/supports-hyperlinks@2.3.0/node_modules/supports-hyperlinks/index.js
|
|
96310
|
-
var require_supports_hyperlinks = __commonJS((exports, module)
|
|
96825
|
+
var require_supports_hyperlinks = __commonJS(function(exports, module) {
|
|
96311
96826
|
var supportsColor = require_supports_color();
|
|
96312
96827
|
var hasFlag = require_has_flag();
|
|
96313
96828
|
function parseVersion(versionString) {
|
|
@@ -96386,7 +96901,7 @@ var require_supports_hyperlinks = __commonJS((exports, module) => {
|
|
|
96386
96901
|
});
|
|
96387
96902
|
|
|
96388
96903
|
// node_modules/.bun/marked-terminal@5.2.0+2cbc53c039b95cf4/node_modules/marked-terminal/index.cjs
|
|
96389
|
-
var require_marked_terminal = __commonJS((exports, module)
|
|
96904
|
+
var require_marked_terminal = __commonJS(function(exports, module) {
|
|
96390
96905
|
var process$1 = __require("node:process");
|
|
96391
96906
|
var os = __require("node:os");
|
|
96392
96907
|
var tty = __require("node:tty");
|
|
@@ -97374,7 +97889,7 @@ var require_marked_terminal = __commonJS((exports, module) => {
|
|
|
97374
97889
|
});
|
|
97375
97890
|
|
|
97376
97891
|
// node_modules/.bun/escape-string-regexp@1.0.5/node_modules/escape-string-regexp/index.js
|
|
97377
|
-
var require_escape_string_regexp = __commonJS((exports, module)
|
|
97892
|
+
var require_escape_string_regexp = __commonJS(function(exports, module) {
|
|
97378
97893
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
97379
97894
|
module.exports = function(str) {
|
|
97380
97895
|
if (typeof str !== "string") {
|
|
@@ -97385,7 +97900,7 @@ var require_escape_string_regexp = __commonJS((exports, module) => {
|
|
|
97385
97900
|
});
|
|
97386
97901
|
|
|
97387
97902
|
// node_modules/.bun/ansi-styles@2.2.1/node_modules/ansi-styles/index.js
|
|
97388
|
-
var require_ansi_styles = __commonJS((exports, module)
|
|
97903
|
+
var require_ansi_styles = __commonJS(function(exports, module) {
|
|
97389
97904
|
function assembleStyles() {
|
|
97390
97905
|
var styles2 = {
|
|
97391
97906
|
modifiers: {
|
|
@@ -97444,14 +97959,14 @@ var require_ansi_styles = __commonJS((exports, module) => {
|
|
|
97444
97959
|
});
|
|
97445
97960
|
|
|
97446
97961
|
// node_modules/.bun/has-ansi@2.0.0/node_modules/has-ansi/index.js
|
|
97447
|
-
var require_has_ansi = __commonJS((exports, module)
|
|
97962
|
+
var require_has_ansi = __commonJS(function(exports, module) {
|
|
97448
97963
|
var ansiRegex = require_ansi_regex();
|
|
97449
97964
|
var re = new RegExp(ansiRegex().source);
|
|
97450
97965
|
module.exports = re.test.bind(re);
|
|
97451
97966
|
});
|
|
97452
97967
|
|
|
97453
97968
|
// node_modules/.bun/supports-color@2.0.0/node_modules/supports-color/index.js
|
|
97454
|
-
var require_supports_color2 = __commonJS((exports, module)
|
|
97969
|
+
var require_supports_color2 = __commonJS(function(exports, module) {
|
|
97455
97970
|
var argv = process.argv;
|
|
97456
97971
|
var terminator = argv.indexOf("--");
|
|
97457
97972
|
var hasFlag = function(flag) {
|
|
@@ -97489,7 +98004,7 @@ var require_supports_color2 = __commonJS((exports, module) => {
|
|
|
97489
98004
|
});
|
|
97490
98005
|
|
|
97491
98006
|
// node_modules/.bun/chalk@1.1.3/node_modules/chalk/index.js
|
|
97492
|
-
var require_chalk = __commonJS((exports, module)
|
|
98007
|
+
var require_chalk = __commonJS(function(exports, module) {
|
|
97493
98008
|
var escapeStringRegexp = require_escape_string_regexp();
|
|
97494
98009
|
var ansiStyles = require_ansi_styles();
|
|
97495
98010
|
var stripAnsi = require_strip_ansi();
|
|
@@ -97570,7 +98085,7 @@ var require_chalk = __commonJS((exports, module) => {
|
|
|
97570
98085
|
});
|
|
97571
98086
|
|
|
97572
98087
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/markdown.js
|
|
97573
|
-
var require_markdown = __commonJS((exports, module)
|
|
98088
|
+
var require_markdown = __commonJS(function(exports, module) {
|
|
97574
98089
|
var blessed = require_blessed();
|
|
97575
98090
|
var Box = blessed.Box;
|
|
97576
98091
|
var marked = require_marked();
|
|
@@ -97624,7 +98139,7 @@ var require_markdown = __commonJS((exports, module) => {
|
|
|
97624
98139
|
});
|
|
97625
98140
|
|
|
97626
98141
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/charts/bar.js
|
|
97627
|
-
var require_bar = __commonJS((exports, module)
|
|
98142
|
+
var require_bar = __commonJS(function(exports, module) {
|
|
97628
98143
|
var blessed = require_blessed();
|
|
97629
98144
|
var Node = blessed.Node;
|
|
97630
98145
|
var Canvas = require_canvas();
|
|
@@ -97705,7 +98220,7 @@ var require_bar = __commonJS((exports, module) => {
|
|
|
97705
98220
|
});
|
|
97706
98221
|
|
|
97707
98222
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/charts/stacked-bar.js
|
|
97708
|
-
var require_stacked_bar = __commonJS((exports, module)
|
|
98223
|
+
var require_stacked_bar = __commonJS(function(exports, module) {
|
|
97709
98224
|
var blessed = require_blessed();
|
|
97710
98225
|
var Node = blessed.Node;
|
|
97711
98226
|
var Canvas = require_canvas();
|
|
@@ -97861,7 +98376,7 @@ var require_stacked_bar = __commonJS((exports, module) => {
|
|
|
97861
98376
|
});
|
|
97862
98377
|
|
|
97863
98378
|
// node_modules/.bun/lodash@4.17.21/node_modules/lodash/lodash.js
|
|
97864
|
-
var require_lodash = __commonJS((exports, module)
|
|
98379
|
+
var require_lodash = __commonJS(function(exports, module) {
|
|
97865
98380
|
(function() {
|
|
97866
98381
|
var undefined2;
|
|
97867
98382
|
var VERSION = "4.17.21";
|
|
@@ -101088,7 +101603,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
101088
101603
|
}
|
|
101089
101604
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
101090
101605
|
});
|
|
101091
|
-
function
|
|
101606
|
+
function join13(array, separator) {
|
|
101092
101607
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
101093
101608
|
}
|
|
101094
101609
|
function last(array) {
|
|
@@ -103020,7 +103535,7 @@ __p += '`;
|
|
|
103020
103535
|
lodash.isUndefined = isUndefined;
|
|
103021
103536
|
lodash.isWeakMap = isWeakMap;
|
|
103022
103537
|
lodash.isWeakSet = isWeakSet;
|
|
103023
|
-
lodash.join =
|
|
103538
|
+
lodash.join = join13;
|
|
103024
103539
|
lodash.kebabCase = kebabCase;
|
|
103025
103540
|
lodash.last = last;
|
|
103026
103541
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -103277,7 +103792,7 @@ __p += '`;
|
|
|
103277
103792
|
});
|
|
103278
103793
|
|
|
103279
103794
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/widget/charts/line.js
|
|
103280
|
-
var require_line = __commonJS((exports, module)
|
|
103795
|
+
var require_line = __commonJS(function(exports, module) {
|
|
103281
103796
|
var blessed = require_blessed();
|
|
103282
103797
|
var Node = blessed.Node;
|
|
103283
103798
|
var Canvas = require_canvas();
|
|
@@ -103484,7 +103999,7 @@ var require_line = __commonJS((exports, module) => {
|
|
|
103484
103999
|
});
|
|
103485
104000
|
|
|
103486
104001
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/lib/server-utils.js
|
|
103487
|
-
var require_server_utils = __commonJS((exports)
|
|
104002
|
+
var require_server_utils = __commonJS(function(exports) {
|
|
103488
104003
|
var url = __require("url");
|
|
103489
104004
|
var contrib = require_blessed_contrib();
|
|
103490
104005
|
var blessed = require_blessed();
|
|
@@ -103548,7 +104063,7 @@ var require_server_utils = __commonJS((exports) => {
|
|
|
103548
104063
|
});
|
|
103549
104064
|
|
|
103550
104065
|
// node_modules/.bun/blessed-contrib@4.11.0/node_modules/blessed-contrib/index.js
|
|
103551
|
-
var require_blessed_contrib = __commonJS((exports)
|
|
104066
|
+
var require_blessed_contrib = __commonJS(function(exports) {
|
|
103552
104067
|
exports.grid = require_grid();
|
|
103553
104068
|
exports.carousel = require_carousel();
|
|
103554
104069
|
exports.map = require_map2();
|
|
@@ -103701,32 +104216,20 @@ __export(exports_dev, {
|
|
|
103701
104216
|
default: () => dev
|
|
103702
104217
|
});
|
|
103703
104218
|
import { spawn } from "node:child_process";
|
|
103704
|
-
import { existsSync as
|
|
103705
|
-
import { join as
|
|
103706
|
-
|
|
103707
|
-
|
|
103708
|
-
const
|
|
103709
|
-
if (
|
|
103710
|
-
return
|
|
103711
|
-
}
|
|
103712
|
-
const cwd = process.cwd();
|
|
103713
|
-
const nodeModulesPaths = [
|
|
103714
|
-
join11(cwd, "node_modules", ".bin", "reroute"),
|
|
103715
|
-
join11(cwd, "..", "node_modules", ".bin", "reroute"),
|
|
103716
|
-
join11(cwd, "..", "..", "node_modules", ".bin", "reroute"),
|
|
103717
|
-
join11(cwd, "..", "..", "..", "node_modules", ".bin", "reroute")
|
|
103718
|
-
];
|
|
103719
|
-
for (const binPath2 of nodeModulesPaths) {
|
|
103720
|
-
if (existsSync6(binPath2)) {
|
|
103721
|
-
return binPath2;
|
|
103722
|
-
}
|
|
104219
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
104220
|
+
import { join as join13 } from "node:path";
|
|
104221
|
+
import { pathToFileURL as pathToFileURL9 } from "node:url";
|
|
104222
|
+
function parsePort(args) {
|
|
104223
|
+
const portIndex = args.findIndex((arg) => arg === "--port" || arg === "-p");
|
|
104224
|
+
if (portIndex !== -1 && args[portIndex + 1]) {
|
|
104225
|
+
return Number(args[portIndex + 1]);
|
|
103723
104226
|
}
|
|
103724
|
-
return "
|
|
104227
|
+
return Number(process.env.PORT || "3000");
|
|
103725
104228
|
}
|
|
103726
104229
|
async function waitForInitialBuild(genProcess) {
|
|
103727
104230
|
console.log("[reroute/dev] Waiting for initial build...");
|
|
103728
104231
|
const outputBuffer = [];
|
|
103729
|
-
const buildCompletePromise = new Promise((
|
|
104232
|
+
const buildCompletePromise = new Promise((resolve3, reject) => {
|
|
103730
104233
|
const timeout = setTimeout(() => {
|
|
103731
104234
|
reject(new Error("Timeout waiting for initial build to complete (120s)"));
|
|
103732
104235
|
}, 120000);
|
|
@@ -103736,7 +104239,7 @@ async function waitForInitialBuild(genProcess) {
|
|
|
103736
104239
|
clearTimeout(timeout);
|
|
103737
104240
|
genProcess.stdout?.removeListener("data", checkComplete);
|
|
103738
104241
|
genProcess.stderr?.removeListener("data", checkComplete);
|
|
103739
|
-
|
|
104242
|
+
resolve3();
|
|
103740
104243
|
}
|
|
103741
104244
|
};
|
|
103742
104245
|
genProcess.stdout?.on("data", checkComplete);
|
|
@@ -103746,15 +104249,33 @@ async function waitForInitialBuild(genProcess) {
|
|
|
103746
104249
|
console.log("[reroute/dev] Initial build complete!");
|
|
103747
104250
|
return outputBuffer;
|
|
103748
104251
|
}
|
|
103749
|
-
async function
|
|
104252
|
+
async function startTui(port) {
|
|
104253
|
+
const rerouteCmd = getRerouteCommand();
|
|
104254
|
+
const useShell = rerouteCmd.includes(" ");
|
|
104255
|
+
const genCommand = useShell ? `${rerouteCmd} gen --watch` : rerouteCmd;
|
|
104256
|
+
const genArgs = useShell ? [] : ["gen", "--watch"];
|
|
104257
|
+
const genProcess = spawn(genCommand, genArgs, {
|
|
104258
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
104259
|
+
shell: useShell,
|
|
104260
|
+
env: {
|
|
104261
|
+
...process.env,
|
|
104262
|
+
PORT: String(port),
|
|
104263
|
+
REROUTE_DEV: "1"
|
|
104264
|
+
}
|
|
104265
|
+
});
|
|
104266
|
+
const outputBuffer = await waitForInitialBuild(genProcess).catch((error) => {
|
|
104267
|
+
console.error("[reroute/dev] Failed to complete initial build:", error);
|
|
104268
|
+
genProcess.kill();
|
|
104269
|
+
process.exit(1);
|
|
104270
|
+
});
|
|
103750
104271
|
const serverProcess = spawn("bun", ["--watch", "src/index.ts"], {
|
|
103751
104272
|
stdio: ["ignore", "pipe", "pipe"],
|
|
103752
104273
|
env: {
|
|
103753
104274
|
...process.env,
|
|
103754
|
-
PORT: String(port)
|
|
104275
|
+
PORT: String(port),
|
|
104276
|
+
REROUTE_DEV: "1"
|
|
103755
104277
|
}
|
|
103756
104278
|
});
|
|
103757
|
-
console.log("[reroute/dev] Starting server...");
|
|
103758
104279
|
try {
|
|
103759
104280
|
await waitForServerReady(port);
|
|
103760
104281
|
console.log(`[reroute/dev] ✓ Server ready at http://localhost:${port}
|
|
@@ -103765,48 +104286,6 @@ async function startServerProcess(genProcess, port) {
|
|
|
103765
104286
|
serverProcess.kill();
|
|
103766
104287
|
process.exit(1);
|
|
103767
104288
|
}
|
|
103768
|
-
return serverProcess;
|
|
103769
|
-
}
|
|
103770
|
-
function setupDefaultMode(genProcess, serverProcess, outputBuffer) {
|
|
103771
|
-
const genBuffer = { current: "" };
|
|
103772
|
-
const serverBuffer = { current: "" };
|
|
103773
|
-
const handleGenOutput = (data) => {
|
|
103774
|
-
const text = genBuffer.current + data.toString();
|
|
103775
|
-
const lines = text.split(`
|
|
103776
|
-
`);
|
|
103777
|
-
genBuffer.current = lines.pop() || "";
|
|
103778
|
-
for (const line of lines) {
|
|
103779
|
-
if (!line.trim())
|
|
103780
|
-
continue;
|
|
103781
|
-
const ansiColored = colorizeLogPrefixAnsi(line);
|
|
103782
|
-
console.log(ansiColored);
|
|
103783
|
-
}
|
|
103784
|
-
};
|
|
103785
|
-
const handleServerOutput = createServerOutputHandler(serverBuffer);
|
|
103786
|
-
for (const data of outputBuffer) {
|
|
103787
|
-
handleGenOutput(data);
|
|
103788
|
-
}
|
|
103789
|
-
genProcess.stdout?.on("data", handleGenOutput);
|
|
103790
|
-
genProcess.stderr?.on("data", handleGenOutput);
|
|
103791
|
-
serverProcess.stdout?.on("data", handleServerOutput);
|
|
103792
|
-
serverProcess.stderr?.on("data", handleServerOutput);
|
|
103793
|
-
genProcess.on("exit", (code) => {
|
|
103794
|
-
console.log(`
|
|
103795
|
-
[reroute/gen] Process exited with code ${code}`);
|
|
103796
|
-
});
|
|
103797
|
-
serverProcess.on("exit", (code) => {
|
|
103798
|
-
console.log(`
|
|
103799
|
-
[server] Process exited with code ${code}`);
|
|
103800
|
-
});
|
|
103801
|
-
process.on("SIGINT", () => {
|
|
103802
|
-
console.log(`
|
|
103803
|
-
[reroute/dev] Shutting down...`);
|
|
103804
|
-
genProcess.kill("SIGINT");
|
|
103805
|
-
serverProcess.kill("SIGINT");
|
|
103806
|
-
process.exit(0);
|
|
103807
|
-
});
|
|
103808
|
-
}
|
|
103809
|
-
async function setupTerminalUI(genProcess, serverProcess, outputBuffer) {
|
|
103810
104289
|
const blessed = await Promise.resolve().then(() => __toESM(require_blessed(), 1));
|
|
103811
104290
|
const contrib = await Promise.resolve().then(() => __toESM(require_blessed_contrib(), 1));
|
|
103812
104291
|
const screen = blessed.default.screen({
|
|
@@ -103822,33 +104301,53 @@ async function setupTerminalUI(genProcess, serverProcess, outputBuffer) {
|
|
|
103822
104301
|
const { setupTerminalUIHandlers: setupTerminalUIHandlers2 } = await Promise.resolve().then(() => exports_terminal_ui);
|
|
103823
104302
|
setupTerminalUIHandlers2(screen, grid, genProcess, serverProcess, outputBuffer, blessed, colorizeLogPrefix);
|
|
103824
104303
|
}
|
|
104304
|
+
async function startDefault(port) {
|
|
104305
|
+
process.env.PORT = String(port);
|
|
104306
|
+
process.env.REROUTE_DEV = "1";
|
|
104307
|
+
const session = await startGenWatch(process.cwd(), ["--watch"]);
|
|
104308
|
+
const entry = join13(process.cwd(), "src/index.ts");
|
|
104309
|
+
if (!existsSync7(entry)) {
|
|
104310
|
+
session.close();
|
|
104311
|
+
throw new Error(`[reroute/dev] Missing ${entry}`);
|
|
104312
|
+
}
|
|
104313
|
+
console.log("[reroute/dev] Starting server...");
|
|
104314
|
+
await import(pathToFileURL9(entry).href);
|
|
104315
|
+
try {
|
|
104316
|
+
await waitForServerReady(port);
|
|
104317
|
+
console.log(`[reroute/dev] ✓ Server ready at http://localhost:${port}
|
|
104318
|
+
`);
|
|
104319
|
+
} catch (error) {
|
|
104320
|
+
session.close();
|
|
104321
|
+
console.error("[reroute/dev] Server failed to start:", error);
|
|
104322
|
+
process.exit(1);
|
|
104323
|
+
}
|
|
104324
|
+
const shutdown = () => {
|
|
104325
|
+
console.log(`
|
|
104326
|
+
[reroute/dev] Shutting down...`);
|
|
104327
|
+
session.close();
|
|
104328
|
+
process.exit(0);
|
|
104329
|
+
};
|
|
104330
|
+
process.on("SIGINT", shutdown);
|
|
104331
|
+
process.on("SIGTERM", shutdown);
|
|
104332
|
+
}
|
|
103825
104333
|
async function dev(args) {
|
|
103826
104334
|
const terminalUI = args.includes("--tui") || args.includes("-t");
|
|
103827
|
-
const
|
|
103828
|
-
|
|
104335
|
+
const port = parsePort(args);
|
|
104336
|
+
if (await isServerRunning(port)) {
|
|
104337
|
+
console.log(`[reroute/dev] Already running at http://localhost:${port} — not starting another instance`);
|
|
104338
|
+
return;
|
|
104339
|
+
}
|
|
104340
|
+
process.env.PORT = String(port);
|
|
104341
|
+
process.env.REROUTE_DEV = "1";
|
|
103829
104342
|
try {
|
|
103830
|
-
console.log("[reroute/dev] Starting development
|
|
104343
|
+
console.log("[reroute/dev] Starting development server...");
|
|
103831
104344
|
console.log(`[reroute/dev] Press Ctrl+C to stop
|
|
103832
104345
|
`);
|
|
103833
|
-
|
|
103834
|
-
|
|
103835
|
-
|
|
103836
|
-
const genArgs = useShell ? [] : ["gen", "--watch"];
|
|
103837
|
-
const genProcess = spawn(genCommand, genArgs, {
|
|
103838
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
103839
|
-
shell: useShell
|
|
103840
|
-
});
|
|
103841
|
-
const outputBuffer = await waitForInitialBuild(genProcess).catch((error) => {
|
|
103842
|
-
console.error("[reroute/dev] Failed to complete initial build:", error);
|
|
103843
|
-
genProcess.kill();
|
|
103844
|
-
process.exit(1);
|
|
103845
|
-
});
|
|
103846
|
-
const serverProcess = await startServerProcess(genProcess, port);
|
|
103847
|
-
if (!terminalUI) {
|
|
103848
|
-
setupDefaultMode(genProcess, serverProcess, outputBuffer);
|
|
103849
|
-
} else {
|
|
103850
|
-
await setupTerminalUI(genProcess, serverProcess, outputBuffer);
|
|
104346
|
+
if (terminalUI) {
|
|
104347
|
+
await startTui(port);
|
|
104348
|
+
return;
|
|
103851
104349
|
}
|
|
104350
|
+
await startDefault(port);
|
|
103852
104351
|
} catch (error) {
|
|
103853
104352
|
if (error.code === "SIGINT") {
|
|
103854
104353
|
console.log(`
|
|
@@ -103860,6 +104359,8 @@ async function dev(args) {
|
|
|
103860
104359
|
}
|
|
103861
104360
|
}
|
|
103862
104361
|
var init_dev = __esm(() => {
|
|
104362
|
+
init_gen();
|
|
104363
|
+
init_command();
|
|
103863
104364
|
init_log();
|
|
103864
104365
|
});
|
|
103865
104366
|
|
|
@@ -103869,23 +104370,23 @@ __export(exports_start, {
|
|
|
103869
104370
|
default: () => start
|
|
103870
104371
|
});
|
|
103871
104372
|
import { spawn as spawn2 } from "node:child_process";
|
|
103872
|
-
import { existsSync as
|
|
103873
|
-
import { join as
|
|
104373
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
104374
|
+
import { join as join14 } from "node:path";
|
|
103874
104375
|
function getRerouteCommand2() {
|
|
103875
|
-
const binPath =
|
|
103876
|
-
const isBunDev =
|
|
104376
|
+
const binPath = join14(import.meta.dir, "..", "..", "bin.ts");
|
|
104377
|
+
const isBunDev = existsSync8(binPath);
|
|
103877
104378
|
if (isBunDev) {
|
|
103878
104379
|
return `bun ${binPath}`;
|
|
103879
104380
|
}
|
|
103880
104381
|
const cwd = process.cwd();
|
|
103881
104382
|
const nodeModulesPaths = [
|
|
103882
|
-
|
|
103883
|
-
|
|
103884
|
-
|
|
103885
|
-
|
|
104383
|
+
join14(cwd, "node_modules", ".bin", "reroute"),
|
|
104384
|
+
join14(cwd, "..", "node_modules", ".bin", "reroute"),
|
|
104385
|
+
join14(cwd, "..", "..", "node_modules", ".bin", "reroute"),
|
|
104386
|
+
join14(cwd, "..", "..", "..", "node_modules", ".bin", "reroute")
|
|
103886
104387
|
];
|
|
103887
104388
|
for (const binPath2 of nodeModulesPaths) {
|
|
103888
|
-
if (
|
|
104389
|
+
if (existsSync8(binPath2)) {
|
|
103889
104390
|
return binPath2;
|
|
103890
104391
|
}
|
|
103891
104392
|
}
|
|
@@ -103922,7 +104423,7 @@ async function start(args) {
|
|
|
103922
104423
|
`);
|
|
103923
104424
|
const genCommand = useShell ? `${rerouteCmd} gen ${genArgs.join(" ")}` : rerouteCmd;
|
|
103924
104425
|
const genArgsWithCmd = useShell ? [] : ["gen", ...genArgs];
|
|
103925
|
-
await new Promise((
|
|
104426
|
+
await new Promise((resolve3, reject) => {
|
|
103926
104427
|
const genProcess = spawn2(genCommand, genArgsWithCmd, {
|
|
103927
104428
|
stdio: ["ignore", "pipe", "pipe"],
|
|
103928
104429
|
shell: useShell
|
|
@@ -103933,7 +104434,7 @@ async function start(args) {
|
|
|
103933
104434
|
if (code !== null && code !== 0) {
|
|
103934
104435
|
reject(new Error(`Gen exited with code ${code}`));
|
|
103935
104436
|
} else {
|
|
103936
|
-
|
|
104437
|
+
resolve3();
|
|
103937
104438
|
}
|
|
103938
104439
|
});
|
|
103939
104440
|
genProcess.on("error", (error) => {
|
|
@@ -103974,13 +104475,13 @@ async function start(args) {
|
|
|
103974
104475
|
serverProcess.kill("SIGINT");
|
|
103975
104476
|
process.exit(0);
|
|
103976
104477
|
});
|
|
103977
|
-
await new Promise((
|
|
104478
|
+
await new Promise((resolve3, reject) => {
|
|
103978
104479
|
serverProcess.on("exit", (code) => {
|
|
103979
104480
|
if (code !== null && code !== 0) {
|
|
103980
104481
|
console.error(colorizeLogPrefixAnsi(`[reroute/start] Server exited with code ${code}`));
|
|
103981
104482
|
reject(new Error(`Server exited with code ${code}`));
|
|
103982
104483
|
} else {
|
|
103983
|
-
|
|
104484
|
+
resolve3();
|
|
103984
104485
|
}
|
|
103985
104486
|
});
|
|
103986
104487
|
serverProcess.on("error", (error) => {
|
|
@@ -104006,17 +104507,17 @@ var init_start = __esm(() => {
|
|
|
104006
104507
|
// packages/cli/src/commands/lib/assets.ts
|
|
104007
104508
|
import {
|
|
104008
104509
|
cpSync,
|
|
104009
|
-
existsSync as
|
|
104510
|
+
existsSync as existsSync9,
|
|
104010
104511
|
mkdirSync,
|
|
104011
104512
|
readdirSync
|
|
104012
104513
|
} from "node:fs";
|
|
104013
|
-
import { join as
|
|
104514
|
+
import { join as join15 } from "node:path";
|
|
104014
104515
|
function copyAssetsToReroute(cwd, sourceAssetsDir, rerouteAssetsDir) {
|
|
104015
|
-
if (!
|
|
104516
|
+
if (!existsSync9(sourceAssetsDir)) {
|
|
104016
104517
|
return 0;
|
|
104017
104518
|
}
|
|
104018
|
-
const rerouteDir =
|
|
104019
|
-
if (!
|
|
104519
|
+
const rerouteDir = join15(cwd, ".reroute");
|
|
104520
|
+
if (!existsSync9(rerouteDir)) {
|
|
104020
104521
|
mkdirSync(rerouteDir, { recursive: true });
|
|
104021
104522
|
}
|
|
104022
104523
|
cpSync(sourceAssetsDir, rerouteAssetsDir, { recursive: true });
|
|
@@ -104027,7 +104528,7 @@ function countFiles(dir) {
|
|
|
104027
104528
|
const entries = readdirSync(dir, { withFileTypes: true });
|
|
104028
104529
|
for (const entry of entries) {
|
|
104029
104530
|
if (entry.isDirectory()) {
|
|
104030
|
-
count += countFiles(
|
|
104531
|
+
count += countFiles(join15(dir, entry.name));
|
|
104031
104532
|
} else {
|
|
104032
104533
|
count++;
|
|
104033
104534
|
}
|
|
@@ -104042,23 +104543,23 @@ __export(exports_build, {
|
|
|
104042
104543
|
default: () => build
|
|
104043
104544
|
});
|
|
104044
104545
|
import { spawn as spawn3 } from "node:child_process";
|
|
104045
|
-
import { existsSync as
|
|
104046
|
-
import { join as
|
|
104546
|
+
import { existsSync as existsSync10, readFileSync as readFileSync5, rmSync, unlinkSync } from "node:fs";
|
|
104547
|
+
import { join as join16 } from "node:path";
|
|
104047
104548
|
function getRerouteCommand3() {
|
|
104048
|
-
const binPath =
|
|
104049
|
-
const isBunDev =
|
|
104549
|
+
const binPath = join16(import.meta.dir, "..", "..", "bin.ts");
|
|
104550
|
+
const isBunDev = existsSync10(binPath);
|
|
104050
104551
|
if (isBunDev) {
|
|
104051
104552
|
return `bun ${binPath}`;
|
|
104052
104553
|
}
|
|
104053
104554
|
const cwd = process.cwd();
|
|
104054
104555
|
const nodeModulesPaths = [
|
|
104055
|
-
|
|
104056
|
-
|
|
104057
|
-
|
|
104058
|
-
|
|
104556
|
+
join16(cwd, "node_modules", ".bin", "reroute"),
|
|
104557
|
+
join16(cwd, "..", "node_modules", ".bin", "reroute"),
|
|
104558
|
+
join16(cwd, "..", "..", "node_modules", ".bin", "reroute"),
|
|
104559
|
+
join16(cwd, "..", "..", "..", "node_modules", ".bin", "reroute")
|
|
104059
104560
|
];
|
|
104060
104561
|
for (const binPath2 of nodeModulesPaths) {
|
|
104061
|
-
if (
|
|
104562
|
+
if (existsSync10(binPath2)) {
|
|
104062
104563
|
return binPath2;
|
|
104063
104564
|
}
|
|
104064
104565
|
}
|
|
@@ -104066,10 +104567,10 @@ function getRerouteCommand3() {
|
|
|
104066
104567
|
}
|
|
104067
104568
|
function getOutputName() {
|
|
104068
104569
|
const cwd = process.cwd();
|
|
104069
|
-
const packageJsonPath =
|
|
104070
|
-
if (
|
|
104570
|
+
const packageJsonPath = join16(cwd, "package.json");
|
|
104571
|
+
if (existsSync10(packageJsonPath)) {
|
|
104071
104572
|
try {
|
|
104072
|
-
const packageJson = JSON.parse(
|
|
104573
|
+
const packageJson = JSON.parse(readFileSync5(packageJsonPath, "utf-8"));
|
|
104073
104574
|
const name = packageJson.name;
|
|
104074
104575
|
if (name) {
|
|
104075
104576
|
const parts = name.split("-");
|
|
@@ -104098,20 +104599,20 @@ function parseBuildArgs(args) {
|
|
|
104098
104599
|
return { outfile, compileBinary, noCompression, externalArgs };
|
|
104099
104600
|
}
|
|
104100
104601
|
function cleanDistFolder(cwd) {
|
|
104101
|
-
const distDir =
|
|
104102
|
-
if (
|
|
104602
|
+
const distDir = join16(cwd, "dist");
|
|
104603
|
+
if (existsSync10(distDir)) {
|
|
104103
104604
|
process.stdout.write(colorizeLogPrefixAnsi(`[reroute/build] Cleaning dist folder...
|
|
104104
104605
|
`));
|
|
104105
104606
|
rmSync(distDir, { recursive: true });
|
|
104106
104607
|
}
|
|
104107
104608
|
}
|
|
104108
104609
|
async function cleanRerouteFolder(cwd) {
|
|
104109
|
-
const rerouteDir =
|
|
104110
|
-
if (
|
|
104610
|
+
const rerouteDir = join16(cwd, ".reroute");
|
|
104611
|
+
if (existsSync10(rerouteDir)) {
|
|
104111
104612
|
process.stdout.write(colorizeLogPrefixAnsi(`[reroute/build] Cleaning .reroute folder...
|
|
104112
104613
|
`));
|
|
104113
104614
|
rmSync(rerouteDir, { recursive: true, force: true });
|
|
104114
|
-
await new Promise((
|
|
104615
|
+
await new Promise((resolve3) => setTimeout(resolve3, 100));
|
|
104115
104616
|
process.stdout.write(colorizeLogPrefixAnsi(`[reroute/build] ✓ .reroute folder cleaned
|
|
104116
104617
|
`));
|
|
104117
104618
|
}
|
|
@@ -104137,7 +104638,7 @@ async function runGenCommand(rerouteCmd, useShell, noCompression) {
|
|
|
104137
104638
|
const genArgs = useShell ? [] : ["gen", "--prod", noCompression ? "--no-compression" : ""];
|
|
104138
104639
|
const genBuffer = { current: "" };
|
|
104139
104640
|
const handleGenOutput = createOutputHandler(genBuffer);
|
|
104140
|
-
await new Promise((
|
|
104641
|
+
await new Promise((resolve3, reject) => {
|
|
104141
104642
|
const genProcess = spawn3(genCommand, genArgs, {
|
|
104142
104643
|
stdio: ["ignore", "pipe", "pipe"],
|
|
104143
104644
|
shell: useShell
|
|
@@ -104148,7 +104649,7 @@ async function runGenCommand(rerouteCmd, useShell, noCompression) {
|
|
|
104148
104649
|
if (code !== null && code !== 0) {
|
|
104149
104650
|
reject(new Error(`Gen exited with code ${code}`));
|
|
104150
104651
|
} else {
|
|
104151
|
-
|
|
104652
|
+
resolve3();
|
|
104152
104653
|
}
|
|
104153
104654
|
});
|
|
104154
104655
|
genProcess.on("error", (error) => {
|
|
@@ -104161,10 +104662,10 @@ async function runGenCommand(rerouteCmd, useShell, noCompression) {
|
|
|
104161
104662
|
async function copyAssets(cwd) {
|
|
104162
104663
|
const config2 = await loadConfig(cwd);
|
|
104163
104664
|
const appSrc = config2.app?.src ?? "./src/client/App";
|
|
104164
|
-
const
|
|
104165
|
-
const assetsPath =
|
|
104166
|
-
const sourceAssetsDir =
|
|
104167
|
-
const rerouteAssetsDir =
|
|
104665
|
+
const dirname8 = __require("node:path").dirname;
|
|
104666
|
+
const assetsPath = dirname8(appSrc);
|
|
104667
|
+
const sourceAssetsDir = join16(cwd, assetsPath, "assets");
|
|
104668
|
+
const rerouteAssetsDir = join16(cwd, ".reroute", "assets");
|
|
104168
104669
|
process.stdout.write(colorizeLogPrefixAnsi(`[reroute/build] Copying assets...
|
|
104169
104670
|
`));
|
|
104170
104671
|
const fileCount = copyAssetsToReroute(cwd, sourceAssetsDir, rerouteAssetsDir);
|
|
@@ -104179,9 +104680,9 @@ async function copyAssets(cwd) {
|
|
|
104179
104680
|
async function buildBundle(cwd, buildArgs) {
|
|
104180
104681
|
const external = [...buildArgs.externalArgs, "sharp", "@vercel/og"];
|
|
104181
104682
|
const buildResult = await Bun.build({
|
|
104182
|
-
entrypoints: [
|
|
104683
|
+
entrypoints: [join16(cwd, ".reroute/entry.ts")],
|
|
104183
104684
|
target: "bun",
|
|
104184
|
-
outdir:
|
|
104685
|
+
outdir: join16(cwd, "dist"),
|
|
104185
104686
|
sourcemap: "external",
|
|
104186
104687
|
...getCommonBuildOptions(),
|
|
104187
104688
|
external,
|
|
@@ -104224,8 +104725,8 @@ function cleanupBundledFiles(rerouteDir) {
|
|
|
104224
104725
|
"markdown-components.ts"
|
|
104225
104726
|
];
|
|
104226
104727
|
for (const file of tsFilesToRemove) {
|
|
104227
|
-
const filePath =
|
|
104228
|
-
if (
|
|
104728
|
+
const filePath = join16(rerouteDir, file);
|
|
104729
|
+
if (existsSync10(filePath)) {
|
|
104229
104730
|
try {
|
|
104230
104731
|
unlinkSync(filePath);
|
|
104231
104732
|
cleanupCount++;
|
|
@@ -104234,8 +104735,8 @@ function cleanupBundledFiles(rerouteDir) {
|
|
|
104234
104735
|
}
|
|
104235
104736
|
const dirsToRemove = ["markdown", "streaming"];
|
|
104236
104737
|
for (const dir of dirsToRemove) {
|
|
104237
|
-
const dirPath =
|
|
104238
|
-
if (
|
|
104738
|
+
const dirPath = join16(rerouteDir, dir);
|
|
104739
|
+
if (existsSync10(dirPath)) {
|
|
104239
104740
|
try {
|
|
104240
104741
|
rmSync(dirPath, { recursive: true });
|
|
104241
104742
|
cleanupCount++;
|
|
@@ -104268,7 +104769,7 @@ async function build(args) {
|
|
|
104268
104769
|
await runGenCommand(rerouteCmd, useShell, buildArgs.noCompression);
|
|
104269
104770
|
await copyAssets(cwd);
|
|
104270
104771
|
await buildBundle(cwd, buildArgs);
|
|
104271
|
-
const rerouteDir =
|
|
104772
|
+
const rerouteDir = join16(cwd, ".reroute");
|
|
104272
104773
|
cleanupBundledFiles(rerouteDir);
|
|
104273
104774
|
logBuildComplete(buildStartTime, buildArgs);
|
|
104274
104775
|
process.exit(0);
|
|
@@ -104284,60 +104785,31 @@ var init_build = __esm(() => {
|
|
|
104284
104785
|
init_log();
|
|
104285
104786
|
});
|
|
104286
104787
|
|
|
104287
|
-
// packages/cli/src/commands/lib/command.ts
|
|
104288
|
-
var exports_command = {};
|
|
104289
|
-
__export(exports_command, {
|
|
104290
|
-
getRerouteCommand: () => getRerouteCommand4
|
|
104291
|
-
});
|
|
104292
|
-
import { existsSync as existsSync10 } from "node:fs";
|
|
104293
|
-
import { join as join15 } from "node:path";
|
|
104294
|
-
function getRerouteCommand4() {
|
|
104295
|
-
const binPath = join15(import.meta.dir, "..", "..", "bin.ts");
|
|
104296
|
-
const isBunDev = existsSync10(binPath);
|
|
104297
|
-
if (isBunDev) {
|
|
104298
|
-
return `bun ${binPath}`;
|
|
104299
|
-
}
|
|
104300
|
-
const cwd = process.cwd();
|
|
104301
|
-
const nodeModulesPaths = [
|
|
104302
|
-
join15(cwd, "node_modules", ".bin", "reroute"),
|
|
104303
|
-
join15(cwd, "..", "node_modules", ".bin", "reroute"),
|
|
104304
|
-
join15(cwd, "..", "..", "node_modules", ".bin", "reroute"),
|
|
104305
|
-
join15(cwd, "..", "..", "..", "node_modules", ".bin", "reroute")
|
|
104306
|
-
];
|
|
104307
|
-
for (const binPath2 of nodeModulesPaths) {
|
|
104308
|
-
if (existsSync10(binPath2)) {
|
|
104309
|
-
return binPath2;
|
|
104310
|
-
}
|
|
104311
|
-
}
|
|
104312
|
-
return "reroute";
|
|
104313
|
-
}
|
|
104314
|
-
var init_command = () => {};
|
|
104315
|
-
|
|
104316
104788
|
// packages/cli/src/commands/analyze.ts
|
|
104317
104789
|
var exports_analyze = {};
|
|
104318
104790
|
__export(exports_analyze, {
|
|
104319
104791
|
default: () => analyze
|
|
104320
104792
|
});
|
|
104321
104793
|
import { existsSync as existsSync11, statSync } from "node:fs";
|
|
104322
|
-
import { readdir as readdir8, readFile, stat as
|
|
104323
|
-
import { basename as
|
|
104794
|
+
import { readdir as readdir8, readFile, stat as stat6, writeFile as writeFile2 } from "node:fs/promises";
|
|
104795
|
+
import { basename as basename4, join as join17, relative as relative3 } from "node:path";
|
|
104324
104796
|
import Table from "cli-table3";
|
|
104325
104797
|
async function findChunkBundles(cwd) {
|
|
104326
104798
|
const bundles = [];
|
|
104327
|
-
const chunksDir =
|
|
104799
|
+
const chunksDir = join17(cwd, ".reroute", "chunks");
|
|
104328
104800
|
if (!existsSync11(chunksDir))
|
|
104329
104801
|
return bundles;
|
|
104330
104802
|
const collections2 = await readdir8(chunksDir, { withFileTypes: true });
|
|
104331
104803
|
for (const collection of collections2) {
|
|
104332
104804
|
if (!collection.isDirectory())
|
|
104333
104805
|
continue;
|
|
104334
|
-
const collectionDir =
|
|
104806
|
+
const collectionDir = join17(chunksDir, collection.name);
|
|
104335
104807
|
const files = await readdir8(collectionDir);
|
|
104336
104808
|
for (const file of files) {
|
|
104337
104809
|
if (!file.endsWith(".js"))
|
|
104338
104810
|
continue;
|
|
104339
|
-
const filePath =
|
|
104340
|
-
const stats = await
|
|
104811
|
+
const filePath = join17(collectionDir, file);
|
|
104812
|
+
const stats = await stat6(filePath);
|
|
104341
104813
|
const content2 = await Bun.file(filePath).arrayBuffer();
|
|
104342
104814
|
const gzippedSize = Bun.gzipSync(new Uint8Array(content2)).length;
|
|
104343
104815
|
bundles.push({
|
|
@@ -104354,12 +104826,12 @@ async function findChunkBundles(cwd) {
|
|
|
104354
104826
|
}
|
|
104355
104827
|
async function findDistBundles(cwd) {
|
|
104356
104828
|
const bundles = [];
|
|
104357
|
-
const distDir =
|
|
104829
|
+
const distDir = join17(cwd, "dist");
|
|
104358
104830
|
if (!existsSync11(distDir))
|
|
104359
104831
|
return bundles;
|
|
104360
104832
|
const files = await readdir8(distDir);
|
|
104361
104833
|
for (const file of files) {
|
|
104362
|
-
const filePath =
|
|
104834
|
+
const filePath = join17(distDir, file);
|
|
104363
104835
|
const stats = statSync(filePath);
|
|
104364
104836
|
if (stats.isFile() && !file.endsWith(".map") && !file.endsWith(".d.ts")) {
|
|
104365
104837
|
const content2 = await Bun.file(filePath).arrayBuffer();
|
|
@@ -104385,9 +104857,9 @@ async function findBundles(cwd) {
|
|
|
104385
104857
|
}
|
|
104386
104858
|
async function findBrowserEntry(cwd) {
|
|
104387
104859
|
try {
|
|
104388
|
-
const clientDir =
|
|
104389
|
-
const tsxEntry =
|
|
104390
|
-
const tsEntry =
|
|
104860
|
+
const clientDir = join17(cwd, "src", "client");
|
|
104861
|
+
const tsxEntry = join17(clientDir, "index.tsx");
|
|
104862
|
+
const tsEntry = join17(clientDir, "index.ts");
|
|
104391
104863
|
let sourceEntry = null;
|
|
104392
104864
|
if (existsSync11(tsxEntry)) {
|
|
104393
104865
|
sourceEntry = tsxEntry;
|
|
@@ -104420,17 +104892,17 @@ async function findBrowserEntry(cwd) {
|
|
|
104420
104892
|
console.warn("[reroute/analyze] Browser build produced no outputs");
|
|
104421
104893
|
return null;
|
|
104422
104894
|
}
|
|
104423
|
-
const tempDir =
|
|
104895
|
+
const tempDir = join17(cwd, ".reroute", "browser");
|
|
104424
104896
|
await import("node:fs/promises").then((fs) => fs.mkdir(tempDir, { recursive: true }));
|
|
104425
104897
|
const output = result.outputs[0];
|
|
104426
104898
|
const code = await output.text();
|
|
104427
104899
|
const actualHash = await generateContentHash2(code);
|
|
104428
|
-
const bundlePath =
|
|
104429
|
-
await
|
|
104900
|
+
const bundlePath = join17(tempDir, `index.${actualHash}.js`);
|
|
104901
|
+
await writeFile2(bundlePath, code, "utf-8");
|
|
104430
104902
|
const mapOutput = result.outputs.find((o) => o.path.endsWith(".map"));
|
|
104431
104903
|
if (mapOutput) {
|
|
104432
104904
|
const mapContent = await mapOutput.text();
|
|
104433
|
-
await
|
|
104905
|
+
await writeFile2(`${bundlePath}.map`, mapContent, "utf-8");
|
|
104434
104906
|
}
|
|
104435
104907
|
return bundlePath;
|
|
104436
104908
|
} catch (error) {
|
|
@@ -104477,7 +104949,7 @@ function calculateStats(bundles) {
|
|
|
104477
104949
|
}
|
|
104478
104950
|
async function getInstalledPackageSizes(cwd) {
|
|
104479
104951
|
const packageSizes = new Map;
|
|
104480
|
-
const nodeModulesDir =
|
|
104952
|
+
const nodeModulesDir = join17(cwd, "node_modules");
|
|
104481
104953
|
if (!existsSync11(nodeModulesDir))
|
|
104482
104954
|
return packageSizes;
|
|
104483
104955
|
try {
|
|
@@ -104492,7 +104964,7 @@ async function getInstalledPackageSizes(cwd) {
|
|
|
104492
104964
|
const [sizeKB, path3] = line.split("\t");
|
|
104493
104965
|
if (!path3)
|
|
104494
104966
|
continue;
|
|
104495
|
-
const pkgName =
|
|
104967
|
+
const pkgName = basename4(path3);
|
|
104496
104968
|
if (pkgName.startsWith("@")) {
|
|
104497
104969
|
const scopeDir = path3;
|
|
104498
104970
|
const scopedOutput = execSync(`du -sk ${scopeDir}/* 2>/dev/null || true`, {
|
|
@@ -104504,7 +104976,7 @@ async function getInstalledPackageSizes(cwd) {
|
|
|
104504
104976
|
const [scopedSizeKB, scopedPath] = scopedLine.split("\t");
|
|
104505
104977
|
if (!scopedPath)
|
|
104506
104978
|
continue;
|
|
104507
|
-
const fullPkgName = `${pkgName}/${
|
|
104979
|
+
const fullPkgName = `${pkgName}/${basename4(scopedPath)}`;
|
|
104508
104980
|
packageSizes.set(fullPkgName, Number.parseInt(scopedSizeKB, 10) * 1024);
|
|
104509
104981
|
}
|
|
104510
104982
|
} else {
|
|
@@ -104519,7 +104991,7 @@ async function buildDependencyTree(entryPath, cwd) {
|
|
|
104519
104991
|
if (!existsSync11(entryPath))
|
|
104520
104992
|
return null;
|
|
104521
104993
|
const root = {
|
|
104522
|
-
name:
|
|
104994
|
+
name: basename4(entryPath),
|
|
104523
104995
|
path: entryPath,
|
|
104524
104996
|
size: 0,
|
|
104525
104997
|
children: []
|
|
@@ -104533,14 +105005,14 @@ async function buildDependencyTree(entryPath, cwd) {
|
|
|
104533
105005
|
if (!pkgNode) {
|
|
104534
105006
|
pkgNode = {
|
|
104535
105007
|
name: pkgName || "unknown",
|
|
104536
|
-
path:
|
|
105008
|
+
path: join17(cwd, "node_modules", pkgName || ""),
|
|
104537
105009
|
size: 0,
|
|
104538
105010
|
children: []
|
|
104539
105011
|
};
|
|
104540
105012
|
nodeModulesNode.children?.push(pkgNode);
|
|
104541
105013
|
}
|
|
104542
105014
|
pkgNode.children?.push({
|
|
104543
|
-
name:
|
|
105015
|
+
name: basename4(filePath),
|
|
104544
105016
|
path: filePath,
|
|
104545
105017
|
size
|
|
104546
105018
|
});
|
|
@@ -104554,7 +105026,7 @@ async function buildDependencyTree(entryPath, cwd) {
|
|
|
104554
105026
|
if (!child) {
|
|
104555
105027
|
child = {
|
|
104556
105028
|
name: part,
|
|
104557
|
-
path:
|
|
105029
|
+
path: join17(cwd, ...parts.slice(0, i + 1)),
|
|
104558
105030
|
size: 0,
|
|
104559
105031
|
children: []
|
|
104560
105032
|
};
|
|
@@ -104563,7 +105035,7 @@ async function buildDependencyTree(entryPath, cwd) {
|
|
|
104563
105035
|
current = child;
|
|
104564
105036
|
}
|
|
104565
105037
|
current.children?.push({
|
|
104566
|
-
name: parts[parts.length - 1] ||
|
|
105038
|
+
name: parts[parts.length - 1] || basename4(filePath),
|
|
104567
105039
|
path: filePath,
|
|
104568
105040
|
size
|
|
104569
105041
|
});
|
|
@@ -104585,7 +105057,7 @@ async function buildDependencyTree(entryPath, cwd) {
|
|
|
104585
105057
|
const modulePattern = /\/\/\s*(.+?\.(?:ts|tsx|js|jsx|mjs|cjs))\s*$/gm;
|
|
104586
105058
|
const nodeModulesNode = {
|
|
104587
105059
|
name: "node_modules",
|
|
104588
|
-
path:
|
|
105060
|
+
path: join17(cwd, "node_modules"),
|
|
104589
105061
|
size: 0,
|
|
104590
105062
|
children: []
|
|
104591
105063
|
};
|
|
@@ -104651,7 +105123,7 @@ async function buildTreeFromSourceMap(bundlePath, cwd) {
|
|
|
104651
105123
|
if (sourcePath.startsWith("/") || sourcePath.match(/^[A-Za-z]:\\/))
|
|
104652
105124
|
return sourcePath;
|
|
104653
105125
|
const bundleDir = bundlePath.substring(0, bundlePath.lastIndexOf("/"));
|
|
104654
|
-
return
|
|
105126
|
+
return join17(bundleDir, sourceRoot || "", sourcePath);
|
|
104655
105127
|
}, computeSizes = function(node) {
|
|
104656
105128
|
if (node.children && node.children.length > 0) {
|
|
104657
105129
|
node.size = node.children.reduce((s, c) => s + computeSizes(c), 0);
|
|
@@ -104716,14 +105188,14 @@ async function buildTreeFromSourceMap(bundlePath, cwd) {
|
|
|
104716
105188
|
}
|
|
104717
105189
|
}
|
|
104718
105190
|
const root = {
|
|
104719
|
-
name:
|
|
105191
|
+
name: basename4(bundlePath),
|
|
104720
105192
|
path: bundlePath,
|
|
104721
105193
|
size: 0,
|
|
104722
105194
|
children: []
|
|
104723
105195
|
};
|
|
104724
105196
|
const nodeModulesNode = {
|
|
104725
105197
|
name: "node_modules",
|
|
104726
|
-
path:
|
|
105198
|
+
path: join17(cwd, "node_modules"),
|
|
104727
105199
|
size: 0,
|
|
104728
105200
|
children: []
|
|
104729
105201
|
};
|
|
@@ -104763,14 +105235,14 @@ async function buildTreeFromSourceMap(bundlePath, cwd) {
|
|
|
104763
105235
|
if (!pkgNode) {
|
|
104764
105236
|
pkgNode = {
|
|
104765
105237
|
name: pkgName || "unknown",
|
|
104766
|
-
path:
|
|
105238
|
+
path: join17(cwd, "node_modules", pkgName || ""),
|
|
104767
105239
|
size: 0,
|
|
104768
105240
|
children: []
|
|
104769
105241
|
};
|
|
104770
105242
|
nodeModulesNode.children?.push(pkgNode);
|
|
104771
105243
|
}
|
|
104772
105244
|
pkgNode.children?.push({
|
|
104773
|
-
name:
|
|
105245
|
+
name: basename4(srcPath),
|
|
104774
105246
|
path: srcPath,
|
|
104775
105247
|
size
|
|
104776
105248
|
});
|
|
@@ -104784,7 +105256,7 @@ async function buildTreeFromSourceMap(bundlePath, cwd) {
|
|
|
104784
105256
|
if (!child) {
|
|
104785
105257
|
child = {
|
|
104786
105258
|
name: part,
|
|
104787
|
-
path:
|
|
105259
|
+
path: join17(cwd, ...parts.slice(0, i2 + 1)),
|
|
104788
105260
|
size: 0,
|
|
104789
105261
|
children: []
|
|
104790
105262
|
};
|
|
@@ -104793,7 +105265,7 @@ async function buildTreeFromSourceMap(bundlePath, cwd) {
|
|
|
104793
105265
|
current = child;
|
|
104794
105266
|
}
|
|
104795
105267
|
current.children?.push({
|
|
104796
|
-
name: parts[parts.length - 1] ||
|
|
105268
|
+
name: parts[parts.length - 1] || basename4(srcPath),
|
|
104797
105269
|
path: srcPath,
|
|
104798
105270
|
size
|
|
104799
105271
|
});
|
|
@@ -104814,11 +105286,11 @@ async function generateHTMLReport(stats, depTree, mainInfo, browserDepTree, brow
|
|
|
104814
105286
|
let actualServerBinarySize = null;
|
|
104815
105287
|
let actualServerBinaryGzipped = null;
|
|
104816
105288
|
try {
|
|
104817
|
-
const distDir =
|
|
105289
|
+
const distDir = join17(process.cwd(), "dist");
|
|
104818
105290
|
if (existsSync11(distDir)) {
|
|
104819
105291
|
const files = await readdir8(distDir);
|
|
104820
105292
|
for (const file of files) {
|
|
104821
|
-
const filePath =
|
|
105293
|
+
const filePath = join17(distDir, file);
|
|
104822
105294
|
const stats2 = statSync(filePath);
|
|
104823
105295
|
if (stats2.isFile() && !file.includes(".")) {
|
|
104824
105296
|
actualServerBinarySize = stats2.size;
|
|
@@ -106300,11 +106772,11 @@ async function printConsoleReport(stats, depTree, mainInfo, browserDepTree, brow
|
|
|
106300
106772
|
let actualServerBinarySize = null;
|
|
106301
106773
|
let actualServerBinaryGzipped = null;
|
|
106302
106774
|
try {
|
|
106303
|
-
const distDir =
|
|
106775
|
+
const distDir = join17(process.cwd(), "dist");
|
|
106304
106776
|
if (existsSync11(distDir)) {
|
|
106305
106777
|
const files = await readdir8(distDir);
|
|
106306
106778
|
for (const file of files) {
|
|
106307
|
-
const filePath =
|
|
106779
|
+
const filePath = join17(distDir, file);
|
|
106308
106780
|
const stats2 = statSync(filePath);
|
|
106309
106781
|
if (stats2.isFile() && !file.includes(".")) {
|
|
106310
106782
|
actualServerBinarySize = stats2.size;
|
|
@@ -106338,17 +106810,17 @@ async function analyze(args) {
|
|
|
106338
106810
|
const isProd = isProductionMode(args);
|
|
106339
106811
|
const searchIndex = args.indexOf("--search");
|
|
106340
106812
|
const initialSearch = searchIndex !== -1 && args[searchIndex + 1] ? args[searchIndex + 1] : "";
|
|
106341
|
-
const rerouteIndexPath =
|
|
106813
|
+
const rerouteIndexPath = join17(cwd, ".reroute", "index.ts");
|
|
106342
106814
|
if (!existsSync11(rerouteIndexPath)) {
|
|
106343
106815
|
console.log(colorizeLogPrefixAnsi(`[reroute/analyze] .reroute artifacts not found, running build...
|
|
106344
106816
|
`));
|
|
106345
106817
|
const { spawn: spawn4 } = await import("node:child_process");
|
|
106346
|
-
const { getRerouteCommand:
|
|
106347
|
-
const rerouteCmd =
|
|
106818
|
+
const { getRerouteCommand: getRerouteCommand4 } = await Promise.resolve().then(() => (init_command(), exports_command));
|
|
106819
|
+
const rerouteCmd = getRerouteCommand4();
|
|
106348
106820
|
const useShell = rerouteCmd.includes(" ");
|
|
106349
106821
|
const buildCommand = useShell ? `${rerouteCmd} build` : rerouteCmd;
|
|
106350
106822
|
const buildArgs = useShell ? [] : ["build"];
|
|
106351
|
-
await new Promise((
|
|
106823
|
+
await new Promise((resolve3, reject) => {
|
|
106352
106824
|
const buildProcess = spawn4(buildCommand, buildArgs, {
|
|
106353
106825
|
stdio: "inherit",
|
|
106354
106826
|
shell: useShell
|
|
@@ -106357,7 +106829,7 @@ async function analyze(args) {
|
|
|
106357
106829
|
if (code !== null && code !== 0) {
|
|
106358
106830
|
reject(new Error(`Build exited with code ${code}`));
|
|
106359
106831
|
} else {
|
|
106360
|
-
|
|
106832
|
+
resolve3();
|
|
106361
106833
|
}
|
|
106362
106834
|
});
|
|
106363
106835
|
buildProcess.on("error", (error) => {
|
|
@@ -106385,11 +106857,11 @@ async function analyze(args) {
|
|
|
106385
106857
|
`));
|
|
106386
106858
|
}
|
|
106387
106859
|
try {
|
|
106388
|
-
const browserStat = await
|
|
106860
|
+
const browserStat = await stat6(browserEntry);
|
|
106389
106861
|
const browserContent = await readFile(browserEntry);
|
|
106390
106862
|
const browserGzipped = Bun.gzipSync(browserContent).length;
|
|
106391
106863
|
browserInfo = {
|
|
106392
|
-
name:
|
|
106864
|
+
name: basename4(browserEntry),
|
|
106393
106865
|
size: browserStat.size,
|
|
106394
106866
|
gzippedSize: browserGzipped
|
|
106395
106867
|
};
|
|
@@ -106401,12 +106873,12 @@ async function analyze(args) {
|
|
|
106401
106873
|
let entry = null;
|
|
106402
106874
|
let depTree = null;
|
|
106403
106875
|
let mainInfo = null;
|
|
106404
|
-
const srcEntry =
|
|
106876
|
+
const srcEntry = join17(cwd, "src", "index.ts");
|
|
106405
106877
|
if (existsSync11(srcEntry)) {
|
|
106406
106878
|
console.log(colorizeLogPrefixAnsi(`[reroute/analyze] Building server binary for analysis...
|
|
106407
106879
|
`));
|
|
106408
106880
|
const { mkdir: mkdir4 } = await import("node:fs/promises");
|
|
106409
|
-
const serverAnalysisDir =
|
|
106881
|
+
const serverAnalysisDir = join17(cwd, ".reroute", "server");
|
|
106410
106882
|
await mkdir4(serverAnalysisDir, { recursive: true });
|
|
106411
106883
|
const result = await Bun.build({
|
|
106412
106884
|
entrypoints: [srcEntry],
|
|
@@ -106419,12 +106891,12 @@ async function analyze(args) {
|
|
|
106419
106891
|
if (result.success && result.outputs.length > 0) {
|
|
106420
106892
|
const output = result.outputs[0];
|
|
106421
106893
|
const code = await output.text();
|
|
106422
|
-
const analysisEntry =
|
|
106423
|
-
await
|
|
106894
|
+
const analysisEntry = join17(serverAnalysisDir, "index.js");
|
|
106895
|
+
await writeFile2(analysisEntry, code, "utf-8");
|
|
106424
106896
|
const mapOutput = result.outputs.find((o) => o.path.endsWith(".map"));
|
|
106425
106897
|
if (mapOutput) {
|
|
106426
106898
|
const mapContent = await mapOutput.text();
|
|
106427
|
-
await
|
|
106899
|
+
await writeFile2(`${analysisEntry}.map`, mapContent, "utf-8");
|
|
106428
106900
|
}
|
|
106429
106901
|
entry = analysisEntry;
|
|
106430
106902
|
}
|
|
@@ -106437,7 +106909,7 @@ async function analyze(args) {
|
|
|
106437
106909
|
`));
|
|
106438
106910
|
const installedSizes = await getInstalledPackageSizes(cwd);
|
|
106439
106911
|
if (depTree) {
|
|
106440
|
-
const packageJsonPath =
|
|
106912
|
+
const packageJsonPath = join17(cwd, "package.json");
|
|
106441
106913
|
if (existsSync11(packageJsonPath)) {
|
|
106442
106914
|
try {
|
|
106443
106915
|
const packageJson = JSON.parse(await readFile(packageJsonPath, "utf-8"));
|
|
@@ -106449,7 +106921,7 @@ async function analyze(args) {
|
|
|
106449
106921
|
if (!trackedPkgs.has(pkgName) && installedSizes.has(pkgName)) {
|
|
106450
106922
|
nodeModulesNode.children?.push({
|
|
106451
106923
|
name: pkgName,
|
|
106452
|
-
path:
|
|
106924
|
+
path: join17(cwd, "node_modules", pkgName),
|
|
106453
106925
|
size: installedSizes.get(pkgName) || 0
|
|
106454
106926
|
});
|
|
106455
106927
|
}
|
|
@@ -106467,11 +106939,11 @@ async function analyze(args) {
|
|
|
106467
106939
|
}
|
|
106468
106940
|
}
|
|
106469
106941
|
try {
|
|
106470
|
-
const entryStat = await
|
|
106942
|
+
const entryStat = await stat6(entry);
|
|
106471
106943
|
const entryContent = await readFile(entry);
|
|
106472
106944
|
const entryGzipped = Bun.gzipSync(entryContent).length;
|
|
106473
106945
|
mainInfo = {
|
|
106474
|
-
name:
|
|
106946
|
+
name: basename4(entry),
|
|
106475
106947
|
size: entryStat.size,
|
|
106476
106948
|
gzippedSize: entryGzipped
|
|
106477
106949
|
};
|
|
@@ -106480,11 +106952,11 @@ async function analyze(args) {
|
|
|
106480
106952
|
const fullOutput = args.includes("--full");
|
|
106481
106953
|
await printConsoleReport(stats, depTree, mainInfo, browserDepTree, browserInfo, fullOutput);
|
|
106482
106954
|
if (outputHtml || openBrowser) {
|
|
106483
|
-
const htmlPath =
|
|
106955
|
+
const htmlPath = join17(cwd, ".reroute", "analysis.html");
|
|
106484
106956
|
const html2 = await generateHTMLReport(stats, depTree, mainInfo, browserDepTree, browserInfo, initialSearch);
|
|
106485
106957
|
const { mkdir: mkdir4 } = await import("node:fs/promises");
|
|
106486
|
-
await mkdir4(
|
|
106487
|
-
await
|
|
106958
|
+
await mkdir4(join17(cwd, ".reroute"), { recursive: true });
|
|
106959
|
+
await writeFile2(htmlPath, html2, "utf-8");
|
|
106488
106960
|
console.log(colorizeLogPrefixAnsi(`[reroute/analyze] HTML report generated: ${relative3(cwd, htmlPath)}
|
|
106489
106961
|
`));
|
|
106490
106962
|
if (openBrowser) {
|
|
@@ -106547,7 +107019,7 @@ __export(exports_og, {
|
|
|
106547
107019
|
});
|
|
106548
107020
|
import { spawn as spawn4 } from "node:child_process";
|
|
106549
107021
|
import { readdir as readdir9 } from "node:fs/promises";
|
|
106550
|
-
import { join as
|
|
107022
|
+
import { join as join18 } from "node:path";
|
|
106551
107023
|
function getPortFromConfig(baseUrl) {
|
|
106552
107024
|
if (!baseUrl)
|
|
106553
107025
|
return 3000;
|
|
@@ -106563,12 +107035,12 @@ async function killProcessOnPort(port) {
|
|
|
106563
107035
|
const proc = spawn4("bunx", ["kill-port", String(port)], {
|
|
106564
107036
|
stdio: "ignore"
|
|
106565
107037
|
});
|
|
106566
|
-
await new Promise((
|
|
106567
|
-
proc.on("close", () =>
|
|
107038
|
+
await new Promise((resolve3) => {
|
|
107039
|
+
proc.on("close", () => resolve3());
|
|
106568
107040
|
});
|
|
106569
107041
|
} catch {}
|
|
106570
107042
|
}
|
|
106571
|
-
async function
|
|
107043
|
+
async function isServerRunning2(port) {
|
|
106572
107044
|
try {
|
|
106573
107045
|
const response = await fetch(`http://localhost:${port}`, {
|
|
106574
107046
|
signal: AbortSignal.timeout(1000)
|
|
@@ -106579,7 +107051,7 @@ async function isServerRunning(port) {
|
|
|
106579
107051
|
}
|
|
106580
107052
|
}
|
|
106581
107053
|
async function ensureServer(cwd, port) {
|
|
106582
|
-
const alreadyRunning = await
|
|
107054
|
+
const alreadyRunning = await isServerRunning2(port);
|
|
106583
107055
|
if (alreadyRunning) {
|
|
106584
107056
|
console.log(`✅ Dev server already running at http://localhost:${port}
|
|
106585
107057
|
`);
|
|
@@ -106626,8 +107098,8 @@ async function scanForOgTemplates(dir, base, routes) {
|
|
|
106626
107098
|
try {
|
|
106627
107099
|
const entries = await readdir9(dir, { withFileTypes: true });
|
|
106628
107100
|
for (const entry of entries) {
|
|
106629
|
-
const fullPath =
|
|
106630
|
-
const relativePath =
|
|
107101
|
+
const fullPath = join18(dir, entry.name);
|
|
107102
|
+
const relativePath = join18(base, entry.name);
|
|
106631
107103
|
if (entry.isDirectory()) {
|
|
106632
107104
|
if (entry.name === "content")
|
|
106633
107105
|
continue;
|
|
@@ -106648,7 +107120,7 @@ async function addContentRoutes(routesPath, routes) {
|
|
|
106648
107120
|
for (const entry of entries) {
|
|
106649
107121
|
if (!entry.isDirectory())
|
|
106650
107122
|
continue;
|
|
106651
|
-
const contentDir =
|
|
107123
|
+
const contentDir = join18(routesPath, entry.name, "content");
|
|
106652
107124
|
try {
|
|
106653
107125
|
const contentFiles = await readdir9(contentDir);
|
|
106654
107126
|
if (contentFiles.length === 0)
|
|
@@ -106665,7 +107137,7 @@ async function addContentRoutes(routesPath, routes) {
|
|
|
106665
107137
|
async function findRoutesWithOG(cwd) {
|
|
106666
107138
|
const routes = [];
|
|
106667
107139
|
try {
|
|
106668
|
-
const manifestPath =
|
|
107140
|
+
const manifestPath = join18(cwd, ".reroute", "manifest.json");
|
|
106669
107141
|
const manifestFile = Bun.file(manifestPath);
|
|
106670
107142
|
const manifest = await manifestFile.json();
|
|
106671
107143
|
if (manifest.staticRoutes && Array.isArray(manifest.staticRoutes)) {
|
|
@@ -106676,7 +107148,7 @@ async function findRoutesWithOG(cwd) {
|
|
|
106676
107148
|
}
|
|
106677
107149
|
} catch {
|
|
106678
107150
|
console.warn("⚠️ .reroute/manifest.json not found, scanning routes directory...");
|
|
106679
|
-
const routesPath =
|
|
107151
|
+
const routesPath = join18(cwd, ROUTES_DIR2);
|
|
106680
107152
|
await scanForOgTemplates(routesPath, "", routes);
|
|
106681
107153
|
await addContentRoutes(routesPath, routes);
|
|
106682
107154
|
}
|
|
@@ -106928,7 +107400,7 @@ async function getVersionString2() {
|
|
|
106928
107400
|
}
|
|
106929
107401
|
async function getVersion2() {
|
|
106930
107402
|
if (true) {
|
|
106931
|
-
return "1.0.0-alpha.
|
|
107403
|
+
return "1.0.0-alpha.11";
|
|
106932
107404
|
}
|
|
106933
107405
|
const possiblePaths = [
|
|
106934
107406
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -106945,10 +107417,10 @@ async function getVersion2() {
|
|
|
106945
107417
|
}
|
|
106946
107418
|
async function getCommit2() {
|
|
106947
107419
|
if (true) {
|
|
106948
|
-
return "
|
|
107420
|
+
return "560df44";
|
|
106949
107421
|
}
|
|
106950
107422
|
return "dev";
|
|
106951
107423
|
}
|
|
106952
107424
|
main();
|
|
106953
107425
|
|
|
106954
|
-
//# debugId=
|
|
107426
|
+
//# debugId=BAC40B7CF280329664756E2164756E21
|