@neat.is/core 0.4.12 → 0.4.14

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
@@ -10,6 +10,7 @@ import {
10
10
  addCallEdges,
11
11
  addConfigNodes,
12
12
  addDatabasesAndCompat,
13
+ addImports,
13
14
  addInfra,
14
15
  addProject,
15
16
  addServiceAliases,
@@ -43,17 +44,17 @@ import {
43
44
  setStatus,
44
45
  startPersistLoop,
45
46
  startStalenessLoop
46
- } from "./chunk-WDG4QEFO.js";
47
+ } from "./chunk-XS4CGNRO.js";
47
48
  import {
48
49
  startOtelGrpcReceiver
49
- } from "./chunk-3QCRUEQD.js";
50
+ } from "./chunk-GHPHVXYM.js";
50
51
  import {
51
52
  __dirname,
52
53
  __require,
53
54
  assertBindAuthority,
54
55
  buildOtelReceiver,
55
56
  readAuthEnv
56
- } from "./chunk-HVF4S7J3.js";
57
+ } from "./chunk-6CO7C4IU.js";
57
58
 
58
59
  // src/cli.ts
59
60
  import path8 from "path";
@@ -197,6 +198,7 @@ import chokidar from "chokidar";
197
198
  var ALL_PHASES = [
198
199
  "services",
199
200
  "aliases",
201
+ "imports",
200
202
  "databases",
201
203
  "configs",
202
204
  "calls",
@@ -220,6 +222,7 @@ function classifyChange(relPath) {
220
222
  phases.add("aliases");
221
223
  }
222
224
  if (/\.(?:js|jsx|mjs|cjs|ts|tsx|py)$/.test(base)) {
225
+ phases.add("imports");
223
226
  phases.add("calls");
224
227
  }
225
228
  if (/\.ya?ml$/.test(base) && !/^docker-compose.*\.ya?ml$/.test(base)) {
@@ -241,6 +244,11 @@ async function runExtractPhases(graph, scanPath, phases, project = DEFAULT_PROJE
241
244
  if (phases.has("aliases")) {
242
245
  await addServiceAliases(graph, scanPath, services);
243
246
  }
247
+ if (phases.has("imports")) {
248
+ const r = await addImports(graph, services);
249
+ nodesAdded += r.nodesAdded;
250
+ edgesAdded += r.edgesAdded;
251
+ }
244
252
  if (phases.has("databases")) {
245
253
  const r = await addDatabasesAndCompat(graph, services, scanPath);
246
254
  nodesAdded += r.nodesAdded;
@@ -702,8 +710,9 @@ import semver from "semver";
702
710
 
703
711
  // src/installers/templates.ts
704
712
  var OTEL_INIT_HEADER = "// Generated by `neat init --apply` (ADR-069). OpenTelemetry auto-instrumentation hook.";
705
- var OTEL_INIT_STAMP = "// neat-template-version: 4 \u2014 layered file-first capture (ADR-090): stack walk + handler-entry + off-stack facades.";
713
+ var OTEL_INIT_STAMP = "// neat-template-version: 5 \u2014 layered file-first capture (ADR-090) + http/json protocol pin (#468).";
706
714
  var OTEL_OTLP_HEADERS_JS = "if (process.env.NEAT_OTEL_TOKEN) process.env.OTEL_EXPORTER_OTLP_HEADERS ||= 'Authorization=Bearer ' + process.env.NEAT_OTEL_TOKEN";
715
+ var OTEL_OTLP_PROTOCOL_JS = "process.env.OTEL_EXPORTER_OTLP_PROTOCOL ||= 'http/json'";
707
716
  function neatCaptureSource(ts) {
708
717
  const spanT = ts ? ": any" : "";
709
718
  const strOpt = ts ? ": string | undefined" : "";
@@ -993,6 +1002,7 @@ var OTEL_INIT_CJS = `${OTEL_INIT_HEADER}
993
1002
  ${OTEL_INIT_STAMP}
994
1003
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
995
1004
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1005
+ ${OTEL_OTLP_PROTOCOL_JS}
996
1006
  ${OTEL_OTLP_HEADERS_JS}
997
1007
 
998
1008
  const { NodeSDK } = require('@opentelemetry/sdk-node')
@@ -1011,6 +1021,7 @@ var OTEL_INIT_ESM = `${OTEL_INIT_HEADER}
1011
1021
  ${OTEL_INIT_STAMP}
1012
1022
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
1013
1023
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1024
+ ${OTEL_OTLP_PROTOCOL_JS}
1014
1025
  ${OTEL_OTLP_HEADERS_JS}
1015
1026
 
1016
1027
  import { NodeSDK } from '@opentelemetry/sdk-node'
@@ -1034,6 +1045,7 @@ ${OTEL_INIT_STAMP}
1034
1045
  // constraining the runtime logic. The file is regenerated, never hand-edited.
1035
1046
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
1036
1047
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1048
+ ${OTEL_OTLP_PROTOCOL_JS}
1037
1049
  ${OTEL_OTLP_HEADERS_JS}
1038
1050
 
1039
1051
  import { NodeSDK } from '@opentelemetry/sdk-node'
@@ -1059,6 +1071,7 @@ function renderEnvNeat(serviceName, projectName) {
1059
1071
  "# Generated by `neat init --apply` (ADR-069).",
1060
1072
  `OTEL_SERVICE_NAME=${serviceName}`,
1061
1073
  `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/projects/${projectName}/v1/traces`,
1074
+ "OTEL_EXPORTER_OTLP_PROTOCOL=http/json",
1062
1075
  "# Set NEAT_OTEL_TOKEN to the daemon's OTLP secret to authenticate exported spans (#410).",
1063
1076
  "# NEAT_OTEL_TOKEN=",
1064
1077
  ""
@@ -1082,6 +1095,7 @@ export async function register() {
1082
1095
  var NEXT_INSTRUMENTATION_NODE_TS = `${NEXT_INSTRUMENTATION_HEADER}
1083
1096
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
1084
1097
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1098
+ ${OTEL_OTLP_PROTOCOL_JS}
1085
1099
  ${OTEL_OTLP_HEADERS_JS}
1086
1100
 
1087
1101
  import { NodeSDK } from '@opentelemetry/sdk-node'
@@ -1094,6 +1108,7 @@ new NodeSDK({ instrumentations }).start()
1094
1108
  var NEXT_INSTRUMENTATION_NODE_JS = `${NEXT_INSTRUMENTATION_HEADER}
1095
1109
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
1096
1110
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1111
+ ${OTEL_OTLP_PROTOCOL_JS}
1097
1112
  ${OTEL_OTLP_HEADERS_JS}
1098
1113
 
1099
1114
  const { NodeSDK } = require('@opentelemetry/sdk-node')
@@ -1113,6 +1128,7 @@ var FRAMEWORK_OTEL_INIT_HEADER = "// Generated by `neat init --apply` (ADR-074).
1113
1128
  var FRAMEWORK_OTEL_INIT_TS_BODY = `${FRAMEWORK_OTEL_INIT_HEADER}
1114
1129
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
1115
1130
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1131
+ ${OTEL_OTLP_PROTOCOL_JS}
1116
1132
  ${OTEL_OTLP_HEADERS_JS}
1117
1133
 
1118
1134
  import { NodeSDK } from '@opentelemetry/sdk-node'
@@ -1127,6 +1143,7 @@ sdk.start()
1127
1143
  var FRAMEWORK_OTEL_INIT_JS_BODY = `${FRAMEWORK_OTEL_INIT_HEADER}
1128
1144
  process.env.OTEL_SERVICE_NAME ||= '__SERVICE_NAME__'
1129
1145
  process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||= 'http://localhost:4318/projects/__PROJECT__/v1/traces'
1146
+ ${OTEL_OTLP_PROTOCOL_JS}
1130
1147
  ${OTEL_OTLP_HEADERS_JS}
1131
1148
 
1132
1149
  const { NodeSDK } = require('@opentelemetry/sdk-node')