@absolutejs/absolute 0.19.0-beta.1036 → 0.19.0-beta.1037

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-TIyEAN/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-DCqFru/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-TIyEAN/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-DCqFru/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-TIyEAN/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-DCqFru/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/cli/index.js CHANGED
@@ -171986,9 +171986,288 @@ var init_mem = __esm(() => {
171986
171986
  HEADERS = ["NAME", "SOURCE", "PORT", "RSS", "% SYS"];
171987
171987
  });
171988
171988
 
171989
+ // src/cli/scripts/env.ts
171990
+ var exports_env = {};
171991
+ __export(exports_env, {
171992
+ scanEnvUsage: () => scanEnvUsage,
171993
+ runEnv: () => runEnv,
171994
+ collectEnvVars: () => collectEnvVars
171995
+ });
171996
+ import { existsSync as existsSync12, readFileSync as readFileSync14 } from "fs";
171997
+ import { join as join13 } from "path";
171998
+ var {env: env3, Glob: Glob3 } = globalThis.Bun;
171999
+ var EXTENSIONS = "ts,tsx,js,jsx,mjs,cjs,svelte,vue", STATUS_WIDTH, keysInFile = (text) => [...text.matchAll(/getEnv\(\s*['"]([^'"]+)['"]\s*\)/g)].map((match) => match[1]).filter((key) => key !== undefined), scanPatterns = () => existsSync12(join13(process.cwd(), "src")) ? [`src/**/*.{${EXTENSIONS}}`] : [`*.{${EXTENSIONS}}`], scanEnvUsage = async () => {
172000
+ const scans = scanPatterns().map((pattern) => Array.fromAsync(new Glob3(pattern).scan({ cwd: process.cwd() })));
172001
+ const files = (await Promise.all(scans)).flat();
172002
+ const usage = new Map;
172003
+ files.forEach((file) => {
172004
+ keysInFile(readFileSync14(file, "utf-8")).forEach((key) => {
172005
+ usage.set(key, [...usage.get(key) ?? [], file]);
172006
+ });
172007
+ });
172008
+ return usage;
172009
+ }, isSet = (key) => typeof env3[key] === "string" && env3[key] !== "", collectEnvVars = async () => {
172010
+ const usage = await scanEnvUsage();
172011
+ return [...usage.keys()].sort().map((key) => ({
172012
+ files: usage.get(key) ?? [],
172013
+ key,
172014
+ set: isSet(key)
172015
+ }));
172016
+ }, printTable = (vars) => {
172017
+ const keyWidth = Math.max(...vars.map((entry) => entry.key.length));
172018
+ const lines = vars.map((entry) => {
172019
+ const mark = entry.set ? `${colors.green}\u2713${colors.reset}` : `${colors.red}\u2717${colors.reset}`;
172020
+ const status2 = entry.set ? "set" : `${colors.red}missing${colors.reset}`;
172021
+ const count = `${colors.dim}${entry.files.length} file${entry.files.length === 1 ? "" : "s"}${colors.reset}`;
172022
+ return ` ${mark} ${padLine(entry.key, keyWidth)}${" ".repeat(LIST_TUI_COLUMN_GAP)}${padLine(status2, STATUS_WIDTH)}${" ".repeat(LIST_TUI_COLUMN_GAP)}${count}`;
172023
+ });
172024
+ process.stdout.write(`${lines.join(`
172025
+ `)}
172026
+ `);
172027
+ }, runEnv = async (args) => {
172028
+ const vars = await collectEnvVars();
172029
+ if (vars.length === 0) {
172030
+ process.stdout.write(`${colors.dim}No getEnv() usage found under src/.${colors.reset}
172031
+ `);
172032
+ return;
172033
+ }
172034
+ const missing = vars.filter((entry) => !entry.set);
172035
+ if (args.includes("--json")) {
172036
+ process.stdout.write(`${JSON.stringify({ missing, vars }, null, 2)}
172037
+ `);
172038
+ return;
172039
+ }
172040
+ printTable(vars);
172041
+ const summary = missing.length === 0 ? `${colors.green}all ${vars.length} set${colors.reset}` : `${colors.red}${missing.length} missing${colors.reset}`;
172042
+ process.stdout.write(`
172043
+ ${colors.dim}${vars.length} referenced \xB7 ${colors.reset}${summary}
172044
+ `);
172045
+ if (args.includes("--check") && missing.length > 0) {
172046
+ process.exitCode = 1;
172047
+ }
172048
+ };
172049
+ var init_env = __esm(() => {
172050
+ init_constants();
172051
+ init_tuiPrimitives();
172052
+ STATUS_WIDTH = "missing".length;
172053
+ });
172054
+
172055
+ // src/cli/scripts/logs.ts
172056
+ var exports_logs = {};
172057
+ __export(exports_logs, {
172058
+ runLogs: () => runLogs
172059
+ });
172060
+ import {
172061
+ closeSync as closeSync2,
172062
+ existsSync as existsSync13,
172063
+ openSync as openSync4,
172064
+ readSync as readSync2,
172065
+ statSync as statSync2,
172066
+ watchFile
172067
+ } from "fs";
172068
+ var DEFAULT_LINES = 40, POLL_MS = 250, LINES_FLAG_SPAN = 2, readFrom = (path, start2, length) => {
172069
+ if (length <= 0)
172070
+ return "";
172071
+ const descriptor = openSync4(path, "r");
172072
+ try {
172073
+ const buffer = Buffer.alloc(length);
172074
+ readSync2(descriptor, buffer, 0, length, start2);
172075
+ return buffer.toString("utf-8");
172076
+ } finally {
172077
+ closeSync2(descriptor);
172078
+ }
172079
+ }, tailLines = (path, maxLines) => {
172080
+ const { size } = statSync2(path);
172081
+ const start2 = Math.max(0, size - LIST_LOG_TAIL_MAX_BYTES);
172082
+ const lines = readFrom(path, start2, size - start2).split(`
172083
+ `);
172084
+ return lines.slice(Math.max(0, lines.length - maxLines)).join(`
172085
+ `);
172086
+ }, parseLines = (args) => {
172087
+ const index = args.findIndex((arg) => arg === "-n" || arg === "--lines");
172088
+ if (index === UNFOUND_INDEX)
172089
+ return DEFAULT_LINES;
172090
+ const value = Number(args[index + 1]);
172091
+ return Number.isInteger(value) && value > 0 ? value : DEFAULT_LINES;
172092
+ }, targetName = (args) => {
172093
+ const index = args.findIndex((arg) => arg === "-n" || arg === "--lines");
172094
+ const cleaned = index === UNFOUND_INDEX ? args : [...args.slice(0, index), ...args.slice(index + LINES_FLAG_SPAN)];
172095
+ return cleaned.find((arg) => !arg.startsWith("-"));
172096
+ }, followFile = (path) => {
172097
+ let offset = statSync2(path).size;
172098
+ watchFile(path, { interval: POLL_MS }, (current) => {
172099
+ if (current.size > offset) {
172100
+ process.stdout.write(readFrom(path, offset, current.size - offset));
172101
+ }
172102
+ offset = current.size;
172103
+ });
172104
+ }, printDim2 = (message) => {
172105
+ process.stdout.write(`${colors.dim}${message}${colors.reset}
172106
+ `);
172107
+ }, printAvailable = (instances) => {
172108
+ const named = instances.filter((instance) => instance.logFile !== null);
172109
+ if (named.length === 0) {
172110
+ printDim2("No running servers have a captured log.");
172111
+ return;
172112
+ }
172113
+ printDim2("Servers with logs:");
172114
+ named.forEach((instance) => printDim2(` ${instance.name}`));
172115
+ }, runLogs = async (args) => {
172116
+ const instances = await enrichInstances(await discoverInstances());
172117
+ const name = targetName(args);
172118
+ if (name === undefined) {
172119
+ printDim2("Usage: absolute logs <name> [-f] [-n <lines>]");
172120
+ printAvailable(instances);
172121
+ return;
172122
+ }
172123
+ const match = instances.find((instance) => instance.name === name);
172124
+ if (!match) {
172125
+ printDim2(`No running server named "${name}".`);
172126
+ printAvailable(instances);
172127
+ return;
172128
+ }
172129
+ if (match.logFile === null || !existsSync13(match.logFile)) {
172130
+ printDim2(`"${name}" has no captured log (untracked, or started outside the CLI).`);
172131
+ return;
172132
+ }
172133
+ process.stdout.write(`${tailLines(match.logFile, parseLines(args))}
172134
+ `);
172135
+ if (args.includes("-f") || args.includes("--follow")) {
172136
+ printDim2(`\u2014 following ${match.name} \xB7 ctrl+c to stop \u2014`);
172137
+ followFile(match.logFile);
172138
+ }
172139
+ };
172140
+ var init_logs = __esm(() => {
172141
+ init_constants();
172142
+ init_discoverInstances();
172143
+ init_instanceStatus();
172144
+ init_tuiPrimitives();
172145
+ });
172146
+
172147
+ // src/cli/scripts/doctor.ts
172148
+ var exports_doctor = {};
172149
+ __export(exports_doctor, {
172150
+ runDoctor: () => runDoctor
172151
+ });
172152
+ import { existsSync as existsSync14 } from "fs";
172153
+ import { createRequire } from "module";
172154
+ import { arch as arch4, platform as platform5 } from "os";
172155
+ import { join as join14 } from "path";
172156
+ var FRAMEWORK_FIELDS2, projectRequire, check = (status2, label, detail) => ({
172157
+ detail,
172158
+ label,
172159
+ status: status2
172160
+ }), readString = (source, key) => {
172161
+ const value = Reflect.get(source, key);
172162
+ return typeof value === "string" ? value : undefined;
172163
+ }, resolveVersion = (specifier) => {
172164
+ try {
172165
+ const pkg = projectRequire(`${specifier}/package.json`);
172166
+ const version2 = pkg && typeof pkg === "object" ? Reflect.get(pkg, "version") : null;
172167
+ return typeof version2 === "string" ? version2 : null;
172168
+ } catch {
172169
+ return null;
172170
+ }
172171
+ }, checkBun = () => check("ok", "Bun runtime", `v${Bun.version}`), checkAbsolute = () => {
172172
+ const version2 = resolveVersion("@absolutejs/absolute");
172173
+ return version2 === null ? check("fail", "@absolutejs/absolute", "not resolvable here") : check("ok", "@absolutejs/absolute", `v${version2}`);
172174
+ }, checkNative = () => {
172175
+ const target = `@absolutejs/native-${platform5()}-${arch4()}`;
172176
+ const version2 = resolveVersion(target);
172177
+ return version2 === null ? check("warn", "Native binary", `${target} not installed`) : check("ok", "Native binary", `v${version2}`);
172178
+ }, loadConfigOrNull = async () => {
172179
+ try {
172180
+ return await loadRawConfig();
172181
+ } catch {
172182
+ return null;
172183
+ }
172184
+ }, frameworkChecks = (config) => FRAMEWORK_FIELDS2.flatMap((field) => {
172185
+ const dir = readString(config, field);
172186
+ if (dir === undefined)
172187
+ return [];
172188
+ const label = `${field.replace("Directory", "")} pages`;
172189
+ return [
172190
+ existsSync14(join14(process.cwd(), dir)) ? check("ok", label, dir) : check("fail", label, `${dir} (missing)`)
172191
+ ];
172192
+ }), envCheck = async () => {
172193
+ const vars = await collectEnvVars();
172194
+ const missing = vars.filter((entry) => !entry.set);
172195
+ if (vars.length === 0)
172196
+ return check("ok", "Env vars", "no getEnv() usage");
172197
+ if (missing.length === 0) {
172198
+ return check("ok", "Env vars", `all ${vars.length} set`);
172199
+ }
172200
+ return check("fail", "Env vars", `missing ${missing.map((entry) => entry.key).join(", ")}`);
172201
+ }, devPort = (config) => {
172202
+ const dev2 = Reflect.get(config, "dev");
172203
+ const port = dev2 && typeof dev2 === "object" ? Reflect.get(dev2, "port") : undefined;
172204
+ return typeof port === "number" ? port : DEFAULT_PORT;
172205
+ }, portCheck = async (config) => {
172206
+ const port = devPort(config);
172207
+ const holder = (await scanListeners()).find((listener) => listener.port === port);
172208
+ return holder ? check("warn", "Dev port", `${port} in use by pid ${holder.pid}`) : check("ok", "Dev port", `${port} free`);
172209
+ }, STATUS_MARK, renderCheck = (entry, labelWidth) => ` ${STATUS_MARK[entry.status]} ${entry.label.padEnd(labelWidth)} ${colors.dim}${entry.detail}${colors.reset}`, printReport2 = (checks) => {
172210
+ const labelWidth = Math.max(...checks.map((entry) => entry.label.length));
172211
+ const failed = checks.filter((entry) => entry.status === "fail").length;
172212
+ const warned = checks.filter((entry) => entry.status === "warn").length;
172213
+ const summary = failed > 0 ? `${colors.red}${failed} failed${colors.reset}` : `${colors.green}all good${colors.reset}`;
172214
+ const lines = checks.map((entry) => renderCheck(entry, labelWidth));
172215
+ process.stdout.write(`${lines.join(`
172216
+ `)}
172217
+
172218
+ ${colors.dim}${checks.length} checks \xB7 ${colors.reset}${summary}${colors.dim} \xB7 ${warned} warning${warned === 1 ? "" : "s"}${colors.reset}
172219
+ `);
172220
+ }, runDoctor = async (args) => {
172221
+ const config = await loadConfigOrNull();
172222
+ const configCheck = config === null ? check("fail", "Config", "absolute.config.ts not found or invalid") : check("ok", "Config", "absolute.config.ts loaded");
172223
+ const [env4, port] = await Promise.all([
172224
+ envCheck(),
172225
+ config === null ? check("warn", "Dev port", "skipped (no config)") : portCheck(config)
172226
+ ]);
172227
+ const checks = [
172228
+ checkBun(),
172229
+ checkAbsolute(),
172230
+ checkNative(),
172231
+ configCheck,
172232
+ ...config === null ? [] : frameworkChecks(config),
172233
+ env4,
172234
+ port
172235
+ ];
172236
+ if (args.includes("--json")) {
172237
+ process.stdout.write(`${JSON.stringify(checks, null, 2)}
172238
+ `);
172239
+ } else {
172240
+ printReport2(checks);
172241
+ }
172242
+ if (checks.some((entry) => entry.status === "fail")) {
172243
+ process.exitCode = 1;
172244
+ }
172245
+ };
172246
+ var init_doctor = __esm(() => {
172247
+ init_constants();
172248
+ init_loadConfig();
172249
+ init_portScan();
172250
+ init_tuiPrimitives();
172251
+ init_env();
172252
+ FRAMEWORK_FIELDS2 = [
172253
+ "reactDirectory",
172254
+ "vueDirectory",
172255
+ "svelteDirectory",
172256
+ "angularDirectory",
172257
+ "htmlDirectory",
172258
+ "htmxDirectory"
172259
+ ];
172260
+ projectRequire = createRequire(join14(process.cwd(), "package.json"));
172261
+ STATUS_MARK = {
172262
+ fail: `${colors.red}\u2717${colors.reset}`,
172263
+ ok: `${colors.green}\u2713${colors.reset}`,
172264
+ warn: `${colors.yellow}\u26A0${colors.reset}`
172265
+ };
172266
+ });
172267
+
171989
172268
  // src/build/externalAssetPlugin.ts
171990
- import { copyFileSync as copyFileSync2, existsSync as existsSync12, mkdirSync as mkdirSync7, statSync as statSync2 } from "fs";
171991
- import { basename as basename6, dirname as dirname4, join as join13, resolve as resolve11 } from "path";
172269
+ import { copyFileSync as copyFileSync2, existsSync as existsSync15, mkdirSync as mkdirSync7, statSync as statSync3 } from "fs";
172270
+ import { basename as basename6, dirname as dirname4, join as join15, resolve as resolve11 } from "path";
171992
172271
  var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
171993
172272
  name: "absolute-external-asset",
171994
172273
  setup(bld) {
@@ -172009,12 +172288,12 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
172009
172288
  if (!relPath)
172010
172289
  continue;
172011
172290
  const assetPath = resolve11(sourceDir, relPath);
172012
- if (!existsSync12(assetPath))
172291
+ if (!existsSync15(assetPath))
172013
172292
  continue;
172014
- if (!statSync2(assetPath).isFile())
172293
+ if (!statSync3(assetPath).isFile())
172015
172294
  continue;
172016
- const targetPath = join13(outDir, basename6(assetPath));
172017
- if (existsSync12(targetPath))
172295
+ const targetPath = join15(outDir, basename6(assetPath));
172296
+ if (existsSync15(targetPath))
172018
172297
  continue;
172019
172298
  mkdirSync7(dirname4(targetPath), { recursive: true });
172020
172299
  copyFileSync2(assetPath, targetPath);
@@ -172031,19 +172310,19 @@ __export(exports_compile, {
172031
172310
  shouldEmbedCompiledAsset: () => shouldEmbedCompiledAsset,
172032
172311
  compile: () => compile
172033
172312
  });
172034
- var {env: env3 } = globalThis.Bun;
172313
+ var {env: env4 } = globalThis.Bun;
172035
172314
  import {
172036
172315
  cpSync,
172037
- existsSync as existsSync13,
172316
+ existsSync as existsSync16,
172038
172317
  mkdirSync as mkdirSync8,
172039
172318
  readdirSync as readdirSync3,
172040
- readFileSync as readFileSync14,
172319
+ readFileSync as readFileSync15,
172041
172320
  rmSync as rmSync5,
172042
- statSync as statSync3,
172321
+ statSync as statSync4,
172043
172322
  unlinkSync as unlinkSync4,
172044
172323
  writeFileSync as writeFileSync6
172045
172324
  } from "fs";
172046
- import { basename as basename7, dirname as dirname5, join as join14, relative as relative3, resolve as resolve12 } from "path";
172325
+ import { basename as basename7, dirname as dirname5, join as join16, relative as relative3, resolve as resolve12 } from "path";
172047
172326
  var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[cli]\x1B[0m ${color}${message}\x1B[0m`, compileBanner = (version2) => {
172048
172327
  const resolvedVersion = version2 || "unknown";
172049
172328
  console.log("");
@@ -172056,7 +172335,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172056
172335
  const entry = pending.pop();
172057
172336
  if (!entry)
172058
172337
  continue;
172059
- const fullPath = join14(entry.parentPath, entry.name);
172338
+ const fullPath = join16(entry.parentPath, entry.name);
172060
172339
  if (entry.isDirectory())
172061
172340
  pending = pending.concat(readdirSync3(fullPath, { withFileTypes: true }));
172062
172341
  else
@@ -172076,7 +172355,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172076
172355
  const entry = pending.pop();
172077
172356
  if (!entry)
172078
172357
  continue;
172079
- const fullPath = join14(entry.parentPath, entry.name);
172358
+ const fullPath = join16(entry.parentPath, entry.name);
172080
172359
  if (entry.isDirectory()) {
172081
172360
  if (SERVER_RUNTIME_SCAN_SKIP_DIRS.has(entry.name))
172082
172361
  continue;
@@ -172091,7 +172370,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172091
172370
  const normalizedOutdir = resolve12(outdir);
172092
172371
  const copyReference = (filePath, relPath) => {
172093
172372
  const assetSource = resolve12(dirname5(filePath), relPath);
172094
- if (!existsSync13(assetSource) || !statSync3(assetSource).isFile())
172373
+ if (!existsSync16(assetSource) || !statSync4(assetSource).isFile())
172095
172374
  return;
172096
172375
  const assetTarget = resolve12(normalizedOutdir, relPath.replace(/^\.\//, ""));
172097
172376
  if (assetTarget !== normalizedOutdir && !assetTarget.startsWith(`${normalizedOutdir}/`))
@@ -172103,7 +172382,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172103
172382
  cpSync(assetSource, assetTarget, { force: true });
172104
172383
  };
172105
172384
  for (const filePath of collectProjectSourceFiles(process.cwd())) {
172106
- const source = readFileSync14(filePath, "utf-8");
172385
+ const source = readFileSync15(filePath, "utf-8");
172107
172386
  SERVER_RUNTIME_ASSET_RE.lastIndex = 0;
172108
172387
  let match;
172109
172388
  while ((match = SERVER_RUNTIME_ASSET_RE.exec(source)) !== null) {
@@ -172132,7 +172411,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172132
172411
  }
172133
172412
  }, readPackageVersion4 = (candidate) => {
172134
172413
  try {
172135
- const pkg = JSON.parse(readFileSync14(candidate, "utf-8"));
172414
+ const pkg = JSON.parse(readFileSync15(candidate, "utf-8"));
172136
172415
  if (pkg.name !== "@absolutejs/absolute")
172137
172416
  return null;
172138
172417
  const ver = pkg.version;
@@ -172175,7 +172454,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172175
172454
  resolve12(import.meta.dir, "..", "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
172176
172455
  ];
172177
172456
  for (const candidate of candidates) {
172178
- if (existsSync13(candidate))
172457
+ if (existsSync16(candidate))
172179
172458
  return candidate;
172180
172459
  }
172181
172460
  return resolve12(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
@@ -172191,7 +172470,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172191
172470
  return true;
172192
172471
  }, tryReadNodePackageJson = (packageDir) => {
172193
172472
  try {
172194
- return JSON.parse(readFileSync14(join14(packageDir, "package.json"), "utf-8"));
172473
+ return JSON.parse(readFileSync15(join16(packageDir, "package.json"), "utf-8"));
172195
172474
  } catch {
172196
172475
  return null;
172197
172476
  }
@@ -172203,7 +172482,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172203
172482
  if (!pkg)
172204
172483
  return;
172205
172484
  seen.add(specifier);
172206
- const destDir = join14(outdir, "node_modules", ...specifier.split("/"));
172485
+ const destDir = join16(outdir, "node_modules", ...specifier.split("/"));
172207
172486
  rmSync5(destDir, { force: true, recursive: true });
172208
172487
  cpSync(srcDir, destDir, {
172209
172488
  force: true,
@@ -172226,7 +172505,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172226
172505
  if (!buildConfig.angularDirectory)
172227
172506
  return;
172228
172507
  const angularScopeDir = resolve12(process.cwd(), "node_modules", "@angular");
172229
- const angularPackages = existsSync13(angularScopeDir) ? readdirSync3(angularScopeDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => entry.name !== "compiler-cli").map((entry) => `@angular/${entry.name}`) : [];
172508
+ const angularPackages = existsSync16(angularScopeDir) ? readdirSync3(angularScopeDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).filter((entry) => entry.name !== "compiler-cli").map((entry) => `@angular/${entry.name}`) : [];
172230
172509
  const roots = new Set([...angularPackages, "rxjs", "tslib", "typescript"]);
172231
172510
  const seen = new Set;
172232
172511
  for (const specifier of roots) {
@@ -172243,15 +172522,15 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172243
172522
  }
172244
172523
  copyAngularRuntimePackages(buildConfig, outdir);
172245
172524
  }, collectRuntimePackageSpecifiers = (distDir) => {
172246
- const nodeModulesDir = join14(distDir, "node_modules");
172247
- if (!existsSync13(nodeModulesDir))
172525
+ const nodeModulesDir = join16(distDir, "node_modules");
172526
+ if (!existsSync16(nodeModulesDir))
172248
172527
  return [];
172249
172528
  const specifiers = [];
172250
172529
  for (const entry of readdirSync3(nodeModulesDir, { withFileTypes: true })) {
172251
172530
  if (!entry.isDirectory())
172252
172531
  continue;
172253
172532
  if (entry.name.startsWith("@")) {
172254
- const scopeDir = join14(nodeModulesDir, entry.name);
172533
+ const scopeDir = join16(nodeModulesDir, entry.name);
172255
172534
  for (const scopedEntry of readdirSync3(scopeDir, {
172256
172535
  withFileTypes: true
172257
172536
  })) {
@@ -172283,21 +172562,21 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172283
172562
  const packageSpecifier = packageSpecifiers.find((root) => specifier === root || specifier.startsWith(`${root}/`));
172284
172563
  if (!packageSpecifier)
172285
172564
  return null;
172286
- const packageDir = join14(distDir, "node_modules", ...packageSpecifier.split("/"));
172565
+ const packageDir = join16(distDir, "node_modules", ...packageSpecifier.split("/"));
172287
172566
  const subpath = specifier.slice(packageSpecifier.length);
172288
- const subPackageDir = subpath ? join14(packageDir, ...subpath.slice(1).split("/")) : null;
172289
- const resolvedPackageDir = subPackageDir && existsSync13(join14(subPackageDir, "package.json")) ? subPackageDir : packageDir;
172290
- const packageJsonPath = join14(resolvedPackageDir, "package.json");
172291
- if (!existsSync13(packageJsonPath))
172567
+ const subPackageDir = subpath ? join16(packageDir, ...subpath.slice(1).split("/")) : null;
172568
+ const resolvedPackageDir = subPackageDir && existsSync16(join16(subPackageDir, "package.json")) ? subPackageDir : packageDir;
172569
+ const packageJsonPath = join16(resolvedPackageDir, "package.json");
172570
+ if (!existsSync16(packageJsonPath))
172292
172571
  return null;
172293
- const pkg = JSON.parse(readFileSync14(packageJsonPath, "utf-8"));
172572
+ const pkg = JSON.parse(readFileSync15(packageJsonPath, "utf-8"));
172294
172573
  const exportKey = resolvedPackageDir !== subPackageDir && subpath ? `.${subpath}` : ".";
172295
172574
  const rootExport = pkg.exports?.[exportKey];
172296
172575
  const entry = pickExportEntry(rootExport) ?? (resolvedPackageDir === subPackageDir || !subpath ? pkg.module ?? pkg.main ?? "index.js" : `.${subpath}`);
172297
- return join14(resolvedPackageDir, entry);
172576
+ return join16(resolvedPackageDir, entry);
172298
172577
  }, RUNTIME_JS_EXTENSIONS, MODULE_SPECIFIER_RE, isRuntimeJsFile = (filePath) => RUNTIME_JS_EXTENSIONS.some((extension) => filePath.endsWith(extension)), isNodeModulesPath = (filePath) => filePath.split(/[\\/]/).includes("node_modules"), isFile = (filePath) => {
172299
172578
  try {
172300
- return statSync3(filePath).isFile();
172579
+ return statSync4(filePath).isFile();
172301
172580
  } catch {
172302
172581
  return false;
172303
172582
  }
@@ -172307,13 +172586,13 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172307
172586
  const candidates = [
172308
172587
  candidate,
172309
172588
  ...RUNTIME_JS_EXTENSIONS.map((extension) => `${candidate}${extension}`),
172310
- ...RUNTIME_JS_EXTENSIONS.map((extension) => join14(candidate, `index${extension}`))
172589
+ ...RUNTIME_JS_EXTENSIONS.map((extension) => join16(candidate, `index${extension}`))
172311
172590
  ];
172312
172591
  return candidates.find((filePath) => isRuntimeJsFile(filePath) && isFile(filePath)) ?? null;
172313
172592
  }, findContainingRuntimePackageDir = (filePath) => {
172314
172593
  let dir = dirname5(filePath);
172315
172594
  while (dir !== dirname5(dir)) {
172316
- if (isNodeModulesPath(dir) && existsSync13(join14(dir, "package.json"))) {
172595
+ if (isNodeModulesPath(dir) && existsSync16(join16(dir, "package.json"))) {
172317
172596
  return dir;
172318
172597
  }
172319
172598
  dir = dirname5(dir);
@@ -172329,7 +172608,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172329
172608
  const entry = pickExportEntry(pkg?.imports?.[specifier]);
172330
172609
  if (!entry)
172331
172610
  return null;
172332
- return join14(packageDir, entry);
172611
+ return join16(packageDir, entry);
172333
172612
  }, collectRuntimeRewriteRoots = (distDir) => collectFiles2(distDir).filter((filePath) => isRuntimeJsFile(filePath) && !isNodeModulesPath(filePath)), rewriteRuntimeModuleSpecifiers = (distDir) => {
172334
172613
  const packageSpecifiers = collectRuntimePackageSpecifiers(distDir);
172335
172614
  if (packageSpecifiers.length === 0)
@@ -172348,7 +172627,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
172348
172627
  if (!filePath || seen.has(filePath))
172349
172628
  continue;
172350
172629
  seen.add(filePath);
172351
- const source = readFileSync14(filePath, "utf-8");
172630
+ const source = readFileSync15(filePath, "utf-8");
172352
172631
  const rewritten = source.replace(MODULE_SPECIFIER_RE, (match, prefix, quote, specifier) => {
172353
172632
  if (typeof specifier === "string" && specifier.startsWith(".")) {
172354
172633
  enqueue(resolveRuntimeJsFile(resolve12(dirname5(filePath), specifier)));
@@ -172821,7 +173100,7 @@ console.log(\`
172821
173100
  const resolvedOutdir = resolve12(outdir ?? "dist");
172822
173101
  await withBuildDirectoryLock(resolvedOutdir, () => compileUnlocked(serverEntry, resolvedOutdir, outfile, configPath2));
172823
173102
  }, compileUnlocked = async (serverEntry, resolvedOutdir, outfile, configPath2) => {
172824
- const prerenderPort = Number(env3.COMPILE_PORT) || Number(env3.PORT) || DEFAULT_PORT + 1;
173103
+ const prerenderPort = Number(env4.COMPILE_PORT) || Number(env4.PORT) || DEFAULT_PORT + 1;
172825
173104
  killStaleProcesses(prerenderPort);
172826
173105
  const entryName = basename7(serverEntry).replace(/\.[^.]+$/, "");
172827
173106
  const resolvedOutfile = resolve12(outfile ?? "compiled-server");
@@ -172886,11 +173165,11 @@ console.log(\`
172886
173165
  process.exit(1);
172887
173166
  }
172888
173167
  const outputPath = resolve12(resolvedOutdir, `${entryName}.js`);
172889
- if (!existsSync13(outputPath)) {
173168
+ if (!existsSync16(outputPath)) {
172890
173169
  console.error(cliTag4("\x1B[31m", `Expected output not found: ${outputPath}`));
172891
173170
  process.exit(1);
172892
173171
  }
172893
- if (existsSync13(resolve12(resolvedOutdir, "angular", "vendor", "server"))) {
173172
+ if (existsSync16(resolve12(resolvedOutdir, "angular", "vendor", "server"))) {
172894
173173
  const vendorDir = resolve12(resolvedOutdir, "angular", "vendor", "server");
172895
173174
  const vendorEntries = readdirSync3(vendorDir).filter((f) => f.endsWith(".js"));
172896
173175
  const angularServerVendorPaths = {};
@@ -172912,7 +173191,7 @@ console.log(\`
172912
173191
  copyServerRuntimeAssetReferences(resolvedOutdir);
172913
173192
  const prerenderStart = performance.now();
172914
173193
  process.stdout.write(cliTag4("\x1B[36m", "Pre-rendering pages"));
172915
- rmSync5(join14(resolvedOutdir, "_prerendered"), {
173194
+ rmSync5(join16(resolvedOutdir, "_prerendered"), {
172916
173195
  force: true,
172917
173196
  recursive: true
172918
173197
  });
@@ -172931,7 +173210,7 @@ console.log(\`
172931
173210
  const compileStart = performance.now();
172932
173211
  process.stdout.write(cliTag4("\x1B[36m", "Compiling standalone executable"));
172933
173212
  const entrypointCode = generateEntrypoint(resolvedOutdir, serverEntry, prerenderMap, absoluteVersion, buildConfig);
172934
- const entrypointPath = join14(resolvedOutdir, "_compile_entrypoint.ts");
173213
+ const entrypointPath = join16(resolvedOutdir, "_compile_entrypoint.ts");
172935
173214
  await Bun.write(entrypointPath, entrypointCode);
172936
173215
  mkdirSync8(dirname5(resolvedOutfile), { recursive: true });
172937
173216
  const result = await Bun.build({
@@ -173027,11 +173306,11 @@ var exports_typecheck = {};
173027
173306
  __export(exports_typecheck, {
173028
173307
  typecheck: () => typecheck
173029
173308
  });
173030
- import { resolve as resolve13, join as join15 } from "path";
173031
- import { existsSync as existsSync14, readFileSync as readFileSync15 } from "fs";
173309
+ import { resolve as resolve13, join as join17 } from "path";
173310
+ import { existsSync as existsSync17, readFileSync as readFileSync16 } from "fs";
173032
173311
  import { mkdir as mkdir2, writeFile } from "fs/promises";
173033
173312
  var isCommandService3 = (service) => service.kind === "command" || Array.isArray(service.command), resolveConfigPath = (configPath2) => resolve13(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts"), getTypecheckTargets = async (configPath2) => {
173034
- if (!existsSync14(resolveConfigPath(configPath2))) {
173313
+ if (!existsSync17(resolveConfigPath(configPath2))) {
173035
173314
  return [{}];
173036
173315
  }
173037
173316
  const rawConfig = await loadRawConfig(configPath2);
@@ -173052,7 +173331,7 @@ var isCommandService3 = (service) => service.kind === "command" || Array.isArray
173052
173331
  return { exitCode, name, output: (stdout + stderr).trim() };
173053
173332
  }, shellEscape = (value) => `'${value.replaceAll("'", "'\\''")}'`, runShell = async (name, command) => run(name, ["/bin/bash", "-lc", command]), findBin = (name) => {
173054
173333
  const local = resolve13("node_modules", ".bin", name);
173055
- return existsSync14(local) ? local : null;
173334
+ return existsSync17(local) ? local : null;
173056
173335
  }, ANSI_COLOR_REGEX, ANSI_PURPLE_REGEX, ANSI_CYAN_REGEX, ANSI_TOKEN_END_REGEX, stripAnsi3 = (str) => str.replace(ANSI_COLOR_REGEX, ""), formatSvelteOutput = (output) => {
173057
173336
  const cwd = `${process.cwd()}/`;
173058
173337
  const summaryMatch = stripAnsi3(output).match(/svelte-check found (\d+) error/);
@@ -173104,10 +173383,10 @@ Found ${errorCount} error${suffix}.`;
173104
173383
  resolve13(import.meta.dir, "../../types", fileName),
173105
173384
  resolve13(import.meta.dir, "../../../types", fileName)
173106
173385
  ];
173107
- return candidates.find((candidate) => existsSync14(candidate)) ?? candidates[0];
173386
+ return candidates.find((candidate) => existsSync17(candidate)) ?? candidates[0];
173108
173387
  }, ABSOLUTE_TYPECHECK_FILES, readProjectTsconfig = () => {
173109
173388
  try {
173110
- return JSON.parse(readFileSync15(resolve13("tsconfig.json"), "utf-8"));
173389
+ return JSON.parse(readFileSync16(resolve13("tsconfig.json"), "utf-8"));
173111
173390
  } catch {
173112
173391
  return {};
173113
173392
  }
@@ -173135,7 +173414,7 @@ Found ${errorCount} error${suffix}.`;
173135
173414
  console.error("\x1B[31m\u2717\x1B[0m vue-tsc is required for Vue type checking. Install it: bun add -d vue-tsc");
173136
173415
  process.exit(1);
173137
173416
  }
173138
- const vueTsconfigPath = join15(cacheDir, "tsconfig.vue-check.json");
173417
+ const vueTsconfigPath = join17(cacheDir, "tsconfig.vue-check.json");
173139
173418
  return writeFile(vueTsconfigPath, JSON.stringify({
173140
173419
  compilerOptions: {
173141
173420
  rootDir: ".."
@@ -173150,7 +173429,7 @@ Found ${errorCount} error${suffix}.`;
173150
173429
  resolve13(vueTsconfigPath),
173151
173430
  "--incremental",
173152
173431
  "--tsBuildInfoFile",
173153
- join15(cacheDir, "vue-tsc.tsbuildinfo"),
173432
+ join17(cacheDir, "vue-tsc.tsbuildinfo"),
173154
173433
  "--pretty"
173155
173434
  ]));
173156
173435
  }, buildAngularCheck = async (cacheDir, angularDir) => {
@@ -173159,7 +173438,7 @@ Found ${errorCount} error${suffix}.`;
173159
173438
  console.error("\x1B[31m\u2717\x1B[0m @angular/compiler-cli is required for Angular type checking. Install it: bun add -d @angular/compiler-cli");
173160
173439
  process.exit(1);
173161
173440
  }
173162
- const angularTsconfigPath = join15(cacheDir, "tsconfig.angular-check.json");
173441
+ const angularTsconfigPath = join17(cacheDir, "tsconfig.angular-check.json");
173163
173442
  await writeFile(angularTsconfigPath, JSON.stringify({
173164
173443
  angularCompilerOptions: {
173165
173444
  strictTemplates: true
@@ -173179,7 +173458,7 @@ Found ${errorCount} error${suffix}.`;
173179
173458
  console.error("\x1B[31m\u2717\x1B[0m typescript is required for type checking. Install it: bun add -d typescript");
173180
173459
  process.exit(1);
173181
173460
  }
173182
- const tscConfigPath = join15(cacheDir, "tsconfig.typecheck.json");
173461
+ const tscConfigPath = join17(cacheDir, "tsconfig.typecheck.json");
173183
173462
  return writeFile(tscConfigPath, JSON.stringify({
173184
173463
  compilerOptions: {
173185
173464
  rootDir: ".."
@@ -173194,7 +173473,7 @@ Found ${errorCount} error${suffix}.`;
173194
173473
  resolve13(tscConfigPath),
173195
173474
  "--incremental",
173196
173475
  "--tsBuildInfoFile",
173197
- join15(cacheDir, "tsc.tsbuildinfo"),
173476
+ join17(cacheDir, "tsc.tsbuildinfo"),
173198
173477
  "--pretty"
173199
173478
  ]));
173200
173479
  }, buildSvelteCheck = async (cacheDir, svelteDir) => {
@@ -173203,7 +173482,7 @@ Found ${errorCount} error${suffix}.`;
173203
173482
  console.error("\x1B[31m\u2717\x1B[0m svelte-check is required for Svelte type checking. Install it: bun add -d svelte-check");
173204
173483
  process.exit(1);
173205
173484
  }
173206
- const svelteTsconfigPath = join15(cacheDir, "tsconfig.svelte-check.json");
173485
+ const svelteTsconfigPath = join17(cacheDir, "tsconfig.svelte-check.json");
173207
173486
  await writeFile(svelteTsconfigPath, JSON.stringify({
173208
173487
  extends: resolve13("tsconfig.json"),
173209
173488
  files: ABSOLUTE_TYPECHECK_FILES,
@@ -176910,6 +177189,18 @@ if (command === "dev") {
176910
177189
  sendTelemetryEvent("cli:command", { command: "mem" });
176911
177190
  const { runMem: runMem2 } = await Promise.resolve().then(() => (init_mem(), exports_mem));
176912
177191
  await runMem2(args);
177192
+ } else if (command === "env") {
177193
+ sendTelemetryEvent("cli:command", { command: "env" });
177194
+ const { runEnv: runEnv2 } = await Promise.resolve().then(() => (init_env(), exports_env));
177195
+ await runEnv2(args);
177196
+ } else if (command === "logs") {
177197
+ sendTelemetryEvent("cli:command", { command: "logs" });
177198
+ const { runLogs: runLogs2 } = await Promise.resolve().then(() => (init_logs(), exports_logs));
177199
+ await runLogs2(args);
177200
+ } else if (command === "doctor") {
177201
+ sendTelemetryEvent("cli:command", { command: "doctor" });
177202
+ const { runDoctor: runDoctor2 } = await Promise.resolve().then(() => (init_doctor(), exports_doctor));
177203
+ await runDoctor2(args);
176913
177204
  } else if (command === "info") {
176914
177205
  sendTelemetryEvent("cli:command", { command });
176915
177206
  info();
@@ -176949,8 +177240,11 @@ if (command === "dev") {
176949
177240
  console.error(" start [entry] [--outdir dir] Start production server");
176950
177241
  console.error(" compile [entry] [--outdir dir] [--outfile path] Compile standalone executable");
176951
177242
  console.error(" config [--port n] Open the unified config UI (ESLint, tsconfig, Prettier)");
177243
+ console.error(" doctor [--json] Diagnose the project (bun, config, framework dirs, env, port)");
177244
+ console.error(" env [--check] [--json] Report env vars the app reads (getEnv) and which are missing");
176952
177245
  console.error(" eslint Run ESLint (cached)");
176953
177246
  console.error(" info Print system info for bug reports");
177247
+ console.error(" logs <name> [-f] [-n <lines>] Tail a running server's log by name");
176954
177248
  console.error(" ls [--sizes] [--json] List the project's pages by framework (from source)");
176955
177249
  console.error(" mem [--json] Memory report (RSS) for running servers, plus system usage");
176956
177250
  console.error(" ps [--watch] [--json] [--kill <pid|port>] [--kill-all] List/manage running servers");
@@ -0,0 +1 @@
1
+ export declare const runDoctor: (args: string[]) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ export declare const scanEnvUsage: () => Promise<Map<string, string[]>>;
2
+ export declare const collectEnvVars: () => Promise<{
3
+ files: string[];
4
+ key: string;
5
+ set: boolean;
6
+ }[]>;
7
+ export declare const runEnv: (args: string[]) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const runLogs: (args: string[]) => Promise<void>;
package/package.json CHANGED
@@ -411,7 +411,7 @@
411
411
  ]
412
412
  }
413
413
  },
414
- "version": "0.19.0-beta.1036",
414
+ "version": "0.19.0-beta.1037",
415
415
  "workspaces": [
416
416
  "tests/fixtures/*",
417
417
  "tests/fixtures/_packages/*"