reroute-js 1.0.0-alpha.34 → 1.0.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +75 -23
- package/cli/bin.js.map +7 -7
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +5 -5
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/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 +8 -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/images.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/prerender.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/routes.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/static.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/supervise.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/lib/watch.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/commands/static-render.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +35 -8
- package/core/index.js.map +5 -5
- package/core/src/app-paths.d.ts +1 -1
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/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 +1 -1
- package/core/src/i18n/types.d.ts +1 -1
- package/core/src/image.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/discovery.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/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 +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 +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 +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 +16 -3
- package/core/src/ssr/lib/preload.d.ts.map +1 -1
- package/core/src/ssr/lib/route-match.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +1 -1
- 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 +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +36 -9
- package/elysia/index.js.map +6 -6
- 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/devReload.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/i18n.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/liveReloadClient.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts.map +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/routes/themeCssRefresh.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +3 -3
- package/react/index.js.map +3 -3
- 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 +3 -2
- package/react/src/components/Link.d.ts.map +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/i18n/LocaleProvider.d.ts +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/bundle.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/layouts.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/lib/static-data.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 +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +2 -2
- package/telemetry/server.js.map +5 -5
- 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.d.ts
CHANGED
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.36
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -68,7 +68,7 @@ async function getVersionString() {
|
|
|
68
68
|
}
|
|
69
69
|
async function getVersion() {
|
|
70
70
|
if (true) {
|
|
71
|
-
return "1.0.0-alpha.
|
|
71
|
+
return "1.0.0-alpha.36";
|
|
72
72
|
}
|
|
73
73
|
const possiblePaths = [
|
|
74
74
|
path.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -86,7 +86,7 @@ async function getVersion() {
|
|
|
86
86
|
}
|
|
87
87
|
async function getCommit() {
|
|
88
88
|
if (true) {
|
|
89
|
-
return "
|
|
89
|
+
return "dfc0a27";
|
|
90
90
|
}
|
|
91
91
|
return "dev";
|
|
92
92
|
}
|
|
@@ -3489,7 +3489,7 @@ var init_metadata2 = __esm(() => {
|
|
|
3489
3489
|
});
|
|
3490
3490
|
|
|
3491
3491
|
// packages/core/src/ssr/lib/preload.ts
|
|
3492
|
-
import { readdir as readdir6, stat as stat5 } from "node:fs/promises";
|
|
3492
|
+
import { readdir as readdir6, readFile, stat as stat5 } from "node:fs/promises";
|
|
3493
3493
|
async function preloadContentModule(pathname, clientDir, cwd, isWatchMode) {
|
|
3494
3494
|
let extraHead = "";
|
|
3495
3495
|
let hydrationScript = "";
|
|
@@ -3592,15 +3592,37 @@ function resetSSRAccessTracking() {
|
|
|
3592
3592
|
globalThis.__REROUTE_SSR_ACCESSED__ = {};
|
|
3593
3593
|
} catch {}
|
|
3594
3594
|
}
|
|
3595
|
-
function
|
|
3595
|
+
async function bundleImports(cwd, bundleUrl) {
|
|
3596
|
+
const key = `${cwd}:${bundleUrl}`;
|
|
3597
|
+
if (bundleImportsCache?.key === key)
|
|
3598
|
+
return bundleImportsCache.hrefs;
|
|
3599
|
+
const slash = bundleUrl.lastIndexOf("/");
|
|
3600
|
+
const base = bundleUrl.slice(0, slash + 1);
|
|
3601
|
+
const entry = bundleUrl.slice(slash + 1);
|
|
3602
|
+
let hrefs = [];
|
|
3603
|
+
try {
|
|
3604
|
+
const raw = await readFile(bundlePreloadPath(join2(cwd, ".reroute", "bundles")), "utf8");
|
|
3605
|
+
const manifest = JSON.parse(raw);
|
|
3606
|
+
if (manifest.entry === entry && Array.isArray(manifest.imports)) {
|
|
3607
|
+
hrefs = manifest.imports.filter((file) => typeof file === "string").map((file) => `${base}${file}`);
|
|
3608
|
+
}
|
|
3609
|
+
} catch {}
|
|
3610
|
+
bundleImportsCache = { key, hrefs };
|
|
3611
|
+
return hrefs;
|
|
3612
|
+
}
|
|
3613
|
+
function createBundlePreload(bundleUrl, imports = []) {
|
|
3596
3614
|
try {
|
|
3597
3615
|
if (typeof bundleUrl === "string" && bundleUrl.endsWith(".js")) {
|
|
3598
|
-
return `
|
|
3599
|
-
<link rel="modulepreload" href="${
|
|
3616
|
+
return [bundleUrl, ...imports].map((href) => `
|
|
3617
|
+
<link rel="modulepreload" href="${href}" />`).join("");
|
|
3600
3618
|
}
|
|
3601
3619
|
} catch {}
|
|
3602
3620
|
return "";
|
|
3603
3621
|
}
|
|
3622
|
+
function bundlePreloadPath(bundlesDir) {
|
|
3623
|
+
return join2(bundlesDir, "preload.json");
|
|
3624
|
+
}
|
|
3625
|
+
var bundleImportsCache = null;
|
|
3604
3626
|
var init_preload = __esm(() => {
|
|
3605
3627
|
init_imports();
|
|
3606
3628
|
});
|
|
@@ -4071,7 +4093,7 @@ async function performSSRSetupInternal(options, streaming, timeoutState) {
|
|
|
4071
4093
|
assertNotTimedOut();
|
|
4072
4094
|
resetSSRAccessTracking();
|
|
4073
4095
|
resetSSRContentResults();
|
|
4074
|
-
const bundlePreload = createBundlePreload(bundleUrl);
|
|
4096
|
+
const bundlePreload = createBundlePreload(bundleUrl, await bundleImports(cwd, bundleUrl));
|
|
4075
4097
|
const preloadResult = await withSpan("ssr.preload", async (span) => {
|
|
4076
4098
|
span.setAttribute("pathname", pathname);
|
|
4077
4099
|
const result = await preloadContentModule(pathname, clientDir, cwd, isWatchMode);
|
|
@@ -5491,10 +5513,13 @@ function getEffectivePolicies(policies) {
|
|
|
5491
5513
|
function robotsDisallowPath(path3) {
|
|
5492
5514
|
return path3 === "/" ? "/$" : path3;
|
|
5493
5515
|
}
|
|
5516
|
+
function exactDisallowPath(path3) {
|
|
5517
|
+
return path3.endsWith("$") ? path3 : `${path3}$`;
|
|
5518
|
+
}
|
|
5494
5519
|
function getAutoDisallows(discovery2) {
|
|
5495
5520
|
return new Set([
|
|
5496
5521
|
...discovery2.sitemapExcludedRoutes.map(robotsDisallowPath),
|
|
5497
|
-
...discovery2.redirectSourcePaths.map(
|
|
5522
|
+
...discovery2.redirectSourcePaths.map(exactDisallowPath)
|
|
5498
5523
|
]);
|
|
5499
5524
|
}
|
|
5500
5525
|
function addAllowDirectives(lines, policy) {
|
|
@@ -7050,6 +7075,8 @@ __export(exports_core, {
|
|
|
7050
7075
|
buildLlmsDiscovery: () => buildLlmsDiscovery,
|
|
7051
7076
|
buildLocaleCookie: () => buildLocaleCookie,
|
|
7052
7077
|
buildSitemapLoc: () => buildSitemapLoc,
|
|
7078
|
+
bundleImports: () => bundleImports,
|
|
7079
|
+
bundlePreloadPath: () => bundlePreloadPath,
|
|
7053
7080
|
cleanupPathScopedSSRData: () => cleanupPathScopedSSRData,
|
|
7054
7081
|
clearSSRModuleStores: () => clearSSRModuleStores,
|
|
7055
7082
|
clearWatchImportCache: () => clearWatchImportCache,
|
|
@@ -7203,6 +7230,27 @@ function getNamingConfig(options) {
|
|
|
7203
7230
|
function shouldRebuildClientBundle(filename) {
|
|
7204
7231
|
return filename.endsWith(".ts") || filename.endsWith(".tsx") || filename.endsWith(".md") || filename.endsWith(".mdx");
|
|
7205
7232
|
}
|
|
7233
|
+
function entryStaticImports(metafile, entryFile) {
|
|
7234
|
+
if (typeof metafile !== "object" || metafile === null || !("outputs" in metafile) || typeof metafile.outputs !== "object" || metafile.outputs === null) {
|
|
7235
|
+
return [];
|
|
7236
|
+
}
|
|
7237
|
+
const outputs = new Map(Object.entries(metafile.outputs).map(([path3, output]) => [fileNameOf(path3), output]));
|
|
7238
|
+
const found = [];
|
|
7239
|
+
const queue = [entryFile];
|
|
7240
|
+
for (let file = queue.shift();file !== undefined; file = queue.shift()) {
|
|
7241
|
+
for (const item of outputs.get(file)?.imports ?? []) {
|
|
7242
|
+
if (item.kind !== "import-statement" || typeof item.path !== "string")
|
|
7243
|
+
continue;
|
|
7244
|
+
const chunk = fileNameOf(item.path);
|
|
7245
|
+
if (chunk === entryFile || found.includes(chunk))
|
|
7246
|
+
continue;
|
|
7247
|
+
found.push(chunk);
|
|
7248
|
+
queue.push(chunk);
|
|
7249
|
+
}
|
|
7250
|
+
}
|
|
7251
|
+
return found;
|
|
7252
|
+
}
|
|
7253
|
+
var fileNameOf = (path3) => path3.split(/[\\/]/).pop() ?? path3;
|
|
7206
7254
|
|
|
7207
7255
|
// packages/cli/src/commands/lib/env.ts
|
|
7208
7256
|
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
@@ -8428,7 +8476,7 @@ var init_theme = __esm(() => {
|
|
|
8428
8476
|
|
|
8429
8477
|
// packages/cli/src/commands/lib/watch.ts
|
|
8430
8478
|
import { createHash as createHash3 } from "node:crypto";
|
|
8431
|
-
import { readFile } from "node:fs/promises";
|
|
8479
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
8432
8480
|
import { dirname as dirname7, isAbsolute as isAbsolute2, join as join13, resolve as resolve4, sep } from "node:path";
|
|
8433
8481
|
function isWatchNoise(name) {
|
|
8434
8482
|
return name.split(/[/\\]/).some((part) => part.startsWith(".")) || /\.bust-[^/\\]+$/.test(name);
|
|
@@ -8451,7 +8499,7 @@ function createContentFingerprint(options) {
|
|
|
8451
8499
|
async changed(absPath) {
|
|
8452
8500
|
const settling = Date.now() - startedAt < settleMs;
|
|
8453
8501
|
try {
|
|
8454
|
-
const buf = await
|
|
8502
|
+
const buf = await readFile2(absPath);
|
|
8455
8503
|
gone.delete(absPath);
|
|
8456
8504
|
const hash2 = createHash3("sha1").update(buf).digest("hex");
|
|
8457
8505
|
const prev = hashes.get(absPath);
|
|
@@ -9585,6 +9633,10 @@ async function buildEntrypointBundle(cwd, args = []) {
|
|
|
9585
9633
|
}
|
|
9586
9634
|
}
|
|
9587
9635
|
}));
|
|
9636
|
+
await Bun.write(bundlePreloadPath(bundlesDir), JSON.stringify({
|
|
9637
|
+
entry: entryFile,
|
|
9638
|
+
imports: entryStaticImports("metafile" in result ? result.metafile : undefined, entryFile)
|
|
9639
|
+
}));
|
|
9588
9640
|
if (shouldPreCompress && compressionCount > 0) {
|
|
9589
9641
|
const compressionDuration = performance.now() - compressionStartTime;
|
|
9590
9642
|
const timeStr = compressionDuration < 1000 ? `${compressionDuration.toFixed(0)}ms` : `${(compressionDuration / 1000).toFixed(2)}s`;
|
|
@@ -105697,7 +105749,7 @@ __export(exports_analyze, {
|
|
|
105697
105749
|
default: () => analyze
|
|
105698
105750
|
});
|
|
105699
105751
|
import { existsSync as existsSync14, statSync } from "node:fs";
|
|
105700
|
-
import { readdir as readdir9, readFile as
|
|
105752
|
+
import { readdir as readdir9, readFile as readFile3, stat as stat6, writeFile as writeFile2 } from "node:fs/promises";
|
|
105701
105753
|
import { basename as basename4, join as join20, relative as relative4 } from "node:path";
|
|
105702
105754
|
import Table from "cli-table3";
|
|
105703
105755
|
async function findChunkBundles(cwd) {
|
|
@@ -105959,7 +106011,7 @@ async function buildDependencyTree(entryPath, cwd) {
|
|
|
105959
106011
|
}
|
|
105960
106012
|
return node.size;
|
|
105961
106013
|
};
|
|
105962
|
-
const content2 = await
|
|
106014
|
+
const content2 = await readFile3(entryPath, "utf-8");
|
|
105963
106015
|
const modulePattern = /\/\/\s*(.+?\.(?:ts|tsx|js|jsx|mjs|cjs))\s*$/gm;
|
|
105964
106016
|
const nodeModulesNode = {
|
|
105965
106017
|
name: "node_modules",
|
|
@@ -106040,8 +106092,8 @@ async function buildTreeFromSourceMap(bundlePath, cwd) {
|
|
|
106040
106092
|
if (!existsSync14(mapPath))
|
|
106041
106093
|
return null;
|
|
106042
106094
|
const [bundle, mapJson] = await Promise.all([
|
|
106043
|
-
|
|
106044
|
-
|
|
106095
|
+
readFile3(bundlePath, "utf-8"),
|
|
106096
|
+
readFile3(mapPath, "utf-8")
|
|
106045
106097
|
]);
|
|
106046
106098
|
const map = JSON.parse(mapJson);
|
|
106047
106099
|
const sourceRoot = map.sourceRoot || "";
|
|
@@ -106200,7 +106252,7 @@ async function generateHTMLReport(stats, depTree, mainInfo, browserDepTree, brow
|
|
|
106200
106252
|
const stats2 = statSync(filePath);
|
|
106201
106253
|
if (stats2.isFile() && !file.includes(".")) {
|
|
106202
106254
|
actualServerBinarySize = stats2.size;
|
|
106203
|
-
const content2 = await
|
|
106255
|
+
const content2 = await readFile3(filePath);
|
|
106204
106256
|
actualServerBinaryGzipped = Bun.gzipSync(content2).length;
|
|
106205
106257
|
break;
|
|
106206
106258
|
}
|
|
@@ -107686,7 +107738,7 @@ async function printConsoleReport(stats, depTree, mainInfo, browserDepTree, brow
|
|
|
107686
107738
|
const stats2 = statSync(filePath);
|
|
107687
107739
|
if (stats2.isFile() && !file.includes(".")) {
|
|
107688
107740
|
actualServerBinarySize = stats2.size;
|
|
107689
|
-
const content2 = await
|
|
107741
|
+
const content2 = await readFile3(filePath);
|
|
107690
107742
|
actualServerBinaryGzipped = Bun.gzipSync(content2).length;
|
|
107691
107743
|
break;
|
|
107692
107744
|
}
|
|
@@ -107764,7 +107816,7 @@ async function analyze(args) {
|
|
|
107764
107816
|
}
|
|
107765
107817
|
try {
|
|
107766
107818
|
const browserStat = await stat6(browserEntry);
|
|
107767
|
-
const browserContent = await
|
|
107819
|
+
const browserContent = await readFile3(browserEntry);
|
|
107768
107820
|
const browserGzipped = Bun.gzipSync(browserContent).length;
|
|
107769
107821
|
browserInfo = {
|
|
107770
107822
|
name: basename4(browserEntry),
|
|
@@ -107818,7 +107870,7 @@ async function analyze(args) {
|
|
|
107818
107870
|
const packageJsonPath = join20(cwd, "package.json");
|
|
107819
107871
|
if (existsSync14(packageJsonPath)) {
|
|
107820
107872
|
try {
|
|
107821
|
-
const packageJson = JSON.parse(await
|
|
107873
|
+
const packageJson = JSON.parse(await readFile3(packageJsonPath, "utf-8"));
|
|
107822
107874
|
const runtimeDeps = packageJson.dependencies || {};
|
|
107823
107875
|
const nodeModulesNode = depTree.root.children?.find((c) => c.name === "node_modules");
|
|
107824
107876
|
if (nodeModulesNode) {
|
|
@@ -107846,7 +107898,7 @@ async function analyze(args) {
|
|
|
107846
107898
|
}
|
|
107847
107899
|
try {
|
|
107848
107900
|
const entryStat = await stat6(entry);
|
|
107849
|
-
const entryContent = await
|
|
107901
|
+
const entryContent = await readFile3(entry);
|
|
107850
107902
|
const entryGzipped = Bun.gzipSync(entryContent).length;
|
|
107851
107903
|
mainInfo = {
|
|
107852
107904
|
name: basename4(entry),
|
|
@@ -108679,7 +108731,7 @@ async function getVersionString2() {
|
|
|
108679
108731
|
}
|
|
108680
108732
|
async function getVersion2() {
|
|
108681
108733
|
if (true) {
|
|
108682
|
-
return "1.0.0-alpha.
|
|
108734
|
+
return "1.0.0-alpha.36";
|
|
108683
108735
|
}
|
|
108684
108736
|
const possiblePaths = [
|
|
108685
108737
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -108696,10 +108748,10 @@ async function getVersion2() {
|
|
|
108696
108748
|
}
|
|
108697
108749
|
async function getCommit2() {
|
|
108698
108750
|
if (true) {
|
|
108699
|
-
return "
|
|
108751
|
+
return "dfc0a27";
|
|
108700
108752
|
}
|
|
108701
108753
|
return "dev";
|
|
108702
108754
|
}
|
|
108703
108755
|
main();
|
|
108704
108756
|
|
|
108705
|
-
//# debugId=
|
|
108757
|
+
//# debugId=A24C16CC41DCEA0564756E2164756E21
|