@neat.is/core 0.4.20-dev.20260621 → 0.4.20-dev.20260623

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/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readDaemonRecord
4
- } from "./chunk-IWGDXLXA.js";
4
+ } from "./chunk-62ELQVIP.js";
5
5
  import {
6
6
  buildSearchIndex
7
7
  } from "./chunk-XOOCA5T7.js";
@@ -53,7 +53,7 @@ import {
53
53
  signalDaemonStop,
54
54
  startPersistLoop,
55
55
  startStalenessLoop
56
- } from "./chunk-RVOCG6UZ.js";
56
+ } from "./chunk-GNAX2CBF.js";
57
57
  import {
58
58
  startOtelGrpcReceiver
59
59
  } from "./chunk-MTXF77TN.js";
@@ -1308,6 +1308,7 @@ export const onRequest = defineMiddleware(async (context, next) => {
1308
1308
  `;
1309
1309
 
1310
1310
  // src/installers/javascript.ts
1311
+ import { resolve as resolveRegistry } from "@neat.is/instrumentation-registry";
1311
1312
  var SDK_PACKAGES = [
1312
1313
  { name: "@opentelemetry/api", version: "^1.9.0" },
1313
1314
  { name: "@opentelemetry/sdk-node", version: "^0.57.0" },
@@ -1432,6 +1433,34 @@ function hasNextDependency(pkg) {
1432
1433
  function allDeps(pkg) {
1433
1434
  return { ...pkg.dependencies ?? {}, ...pkg.devDependencies ?? {} };
1434
1435
  }
1436
+ var WEB_FRAMEWORK_DEPS = [
1437
+ "express",
1438
+ "fastify",
1439
+ "koa",
1440
+ "@hapi/hapi",
1441
+ "hapi",
1442
+ "restify",
1443
+ "connect",
1444
+ "@nestjs/core",
1445
+ "next",
1446
+ "hono",
1447
+ "elysia",
1448
+ "polka",
1449
+ "micro"
1450
+ ];
1451
+ function looksLikeWebApp(pkg) {
1452
+ const deps = allDeps(pkg);
1453
+ return WEB_FRAMEWORK_DEPS.some((name) => name in deps);
1454
+ }
1455
+ function uninstrumentedLibraries(pkg) {
1456
+ const deps = allDeps(pkg);
1457
+ const out = [];
1458
+ for (const [name, version] of Object.entries(deps)) {
1459
+ const entry2 = resolveRegistry(name, version);
1460
+ if (entry2 && entry2.coverage === "gap") out.push(name);
1461
+ }
1462
+ return out;
1463
+ }
1435
1464
  var REMIX_ENTRY_CANDIDATES = [
1436
1465
  "app/entry.server.ts",
1437
1466
  "app/entry.server.tsx",
@@ -1511,6 +1540,9 @@ var SRC_INDEX_CANDIDATES = INDEX_EXTENSIONS.map((ext) => `src/index${ext}`);
1511
1540
  var SRC_NAMED_CANDIDATES = ["server", "main", "app"].flatMap(
1512
1541
  (name) => INDEX_EXTENSIONS.map((ext) => `src/${name}${ext}`)
1513
1542
  );
1543
+ var ROOT_NAMED_CANDIDATES = ["server", "app", "main"].flatMap(
1544
+ (name) => INDEX_EXTENSIONS.map((ext) => `${name}${ext}`)
1545
+ );
1514
1546
  var SCRIPT_LAUNCHERS = /* @__PURE__ */ new Set([
1515
1547
  "node",
1516
1548
  "ts-node",
@@ -1585,6 +1617,10 @@ async function resolveEntry(serviceDir, pkg) {
1585
1617
  const candidate = path5.join(serviceDir, rel);
1586
1618
  if (await exists(candidate)) return candidate;
1587
1619
  }
1620
+ for (const rel of ROOT_NAMED_CANDIDATES) {
1621
+ const candidate = path5.join(serviceDir, rel);
1622
+ if (await exists(candidate)) return candidate;
1623
+ }
1588
1624
  for (const name of INDEX_CANDIDATES) {
1589
1625
  const candidate = path5.join(serviceDir, name);
1590
1626
  if (await exists(candidate)) return candidate;
@@ -2759,8 +2795,17 @@ async function applyInstallersOver(services, project, options = {}) {
2759
2795
  if (!installPlans.has(key)) installPlans.set(key, cmd);
2760
2796
  }
2761
2797
  } else if (outcome.outcome === "already-instrumented") already++;
2762
- else if (outcome.outcome === "lib-only") libOnly++;
2763
- else if (outcome.outcome === "browser-bundle") {
2798
+ else if (outcome.outcome === "lib-only") {
2799
+ libOnly++;
2800
+ if (svc.pkg && looksLikeWebApp(svc.pkg)) {
2801
+ const svcName = path7.basename(svc.dir);
2802
+ console.warn(
2803
+ `neat: runtime layer won't engage for ${svcName}: no entry point found.
2804
+ ${svc.dir} depends on a web framework but neat couldn't resolve an entry to instrument.
2805
+ Add a "start" script to package.json, or point neat at the entry file directly.`
2806
+ );
2807
+ }
2808
+ } else if (outcome.outcome === "browser-bundle") {
2764
2809
  browserBundle++;
2765
2810
  console.log(`skipping ${svc.dir}: browser bundle; browser-OTel support lands in a future release.`);
2766
2811
  } else if (outcome.outcome === "react-native") {
@@ -2819,6 +2864,19 @@ async function applyInstallersOver(services, project, options = {}) {
2819
2864
  See docs/installer-scope.md \u2192 "Manual setup for out-of-scope runtimes"`
2820
2865
  );
2821
2866
  }
2867
+ if (svc.pkg && (outcome.outcome === "instrumented" || outcome.outcome === "already-instrumented")) {
2868
+ const gaps = uninstrumentedLibraries(svc.pkg);
2869
+ if (gaps.length > 0) {
2870
+ const svcName = path7.basename(svc.dir);
2871
+ const list = gaps.join(", ");
2872
+ const verb = gaps.length === 1 ? "this library" : "these libraries";
2873
+ console.warn(
2874
+ `neat: calls to ${list} won't be observed by default in ${svcName}.
2875
+ ${verb} aren't in the default instrumentation set, so they produce no OBSERVED edges.
2876
+ Run \`neat list-uninstrumented\` to review them, then \`neat extend\` to capture them.`
2877
+ );
2878
+ }
2879
+ }
2822
2880
  }
2823
2881
  const packageManagerInstalls = [];
2824
2882
  for (const cmd of installPlans.values()) {