@interfere/next 8.1.0 → 8.1.2

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,3 +1,6 @@
1
- import { consent, init } from "@interfere/react/internal/client";
2
- import { ConsentCategory, ConsentState, GateableCategory } from "@interfere/types/sdk/plugins/manifest";
3
- export { type ConsentCategory, type ConsentState, type GateableCategory, consent, init };
1
+ import { ClientOptions, ClientOptions as ClientOptions$1, consent } from "@interfere/react/internal/client";
2
+
3
+ //#region src/instrument-client.d.ts
4
+ declare function init(opts?: ClientOptions$1): void;
5
+ //#endregion
6
+ export { type ClientOptions, consent, init };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrument-client.d.mts","names":[],"sources":["../src/instrument-client.ts"],"mappings":";;;iBAYgB,IAAA,CAAK,IAAA,GAAO,eAAA"}
@@ -1,2 +1,11 @@
1
- import { consent, init } from "@interfere/react/internal/client";
1
+ import { PRODUCER_VERSION } from "./internal/version.mjs";
2
+ import { consent, init as init$1 } from "@interfere/react/internal/client";
3
+ //#region src/instrument-client.ts
4
+ function init(opts) {
5
+ init$1({
6
+ ...opts,
7
+ _wrapperVersions: [PRODUCER_VERSION, ...opts?._wrapperVersions ?? []]
8
+ });
9
+ }
10
+ //#endregion
2
11
  export { consent, init };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrument-client.mjs","names":[],"sources":["../src/instrument-client.ts"],"sourcesContent":["import { init as coreInit } from \"@interfere/react/internal/client\";\n\n// biome-ignore lint/performance/noBarrelFile: Next.js instrument-client entrypoint should be a direct re-export.\nexport {\n type ClientOptions,\n consent,\n} from \"@interfere/react/internal/client\";\n\nimport type { ClientOptions } from \"@interfere/react/internal/client\";\n\nimport { PRODUCER_VERSION } from \"./internal/version.js\";\n\nexport function init(opts?: ClientOptions): void {\n coreInit({\n ...opts,\n _wrapperVersions: [PRODUCER_VERSION, ...(opts?._wrapperVersions ?? [])],\n });\n}\n"],"mappings":";;;AAYA,SAAgB,KAAK,MAA4B;AAC/C,QAAS;EACP,GAAG;EACH,kBAAkB,CAAC,kBAAkB,GAAI,MAAM,oBAAoB,EAAE,CAAE;EACxE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.d.mts","names":[],"sources":["../../../src/internal/server/envelope.ts"],"mappings":";;;;;UAoBU,wBAAA;EAAA,SACC,OAAA,GAAU,mBAAA;EAAA,SACV,KAAA;EAAA,SACA,OAAA,EAAS,iBAAA;EAAA,SACT,OAAA,EAAS,oBAAA;AAAA;AAAA,iBAGJ,kBAAA,CACd,MAAA,EAAQ,wBAAA,GACP,QAAA"}
1
+ {"version":3,"file":"envelope.d.mts","names":[],"sources":["../../../src/internal/server/envelope.ts"],"mappings":";;;;;UAqBU,wBAAA;EAAA,SACC,OAAA,GAAU,mBAAA;EAAA,SACV,KAAA;EAAA,SACA,OAAA,EAAS,iBAAA;EAAA,SACT,OAAA,EAAS,oBAAA;AAAA;AAAA,iBAGJ,kBAAA,CACd,MAAA,EAAQ,wBAAA,GACP,QAAA"}
@@ -1,4 +1,5 @@
1
- import { PRODUCER_VERSION } from "../version.mjs";
1
+ import { PRODUCER_VERSION as PRODUCER_VERSION$1 } from "../version.mjs";
2
+ import { PRODUCER_VERSION } from "@interfere/react/internal/version";
2
3
  import { sessionIdSchema } from "@interfere/types/data/session";
3
4
  import { toError, toExceptions } from "@interfere/types/sdk/errors";
4
5
  import { v7 } from "uuid";
@@ -24,7 +25,8 @@ function buildErrorEnvelope(params) {
24
25
  environment: runtime.environment,
25
26
  buildId: runtime.buildId,
26
27
  releaseId: runtime.releaseId,
27
- producerVersion: PRODUCER_VERSION,
28
+ producerVersion: PRODUCER_VERSION$1,
29
+ sdkStack: [PRODUCER_VERSION$1, PRODUCER_VERSION],
28
30
  sessionId: session.id,
29
31
  ...session.source ? { sessionSource: session.source } : {},
30
32
  ...nextjsContext ? { context: nextjsContext } : {}
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.mjs","names":["uuidv7"],"sources":["../../../src/internal/server/envelope.ts"],"sourcesContent":["import type { SessionId } from \"@interfere/types/data/session\";\nimport { sessionIdSchema } from \"@interfere/types/data/session\";\nimport type { Envelope, SessionSource } from \"@interfere/types/sdk/envelope\";\nimport { toError, toExceptions } from \"@interfere/types/sdk/errors\";\nimport type { NextjsContext } from \"@interfere/types/sdk/plugins/context/next\";\nimport type { ErrorMechanism } from \"@interfere/types/sdk/plugins/payload/errors\";\n\nimport { v7 as uuidv7 } from \"uuid\";\n\nimport { PRODUCER_VERSION } from \"../version.js\";\nimport type { ServerCaptureRuntime } from \"./runtime.js\";\nimport type { CaptureErrorContext, NormalizedRequest } from \"./types.js\";\n\nconst SESSION_HEADER = \"x-interfere-session\";\n\nconst DEFAULT_ERROR_MECHANISM: ErrorMechanism = {\n type: \"captureError\",\n handled: true,\n};\n\ninterface BuildErrorEnvelopeParams {\n readonly context?: CaptureErrorContext | undefined;\n readonly error: unknown;\n readonly request: NormalizedRequest | null;\n readonly runtime: ServerCaptureRuntime;\n}\n\nexport function buildErrorEnvelope(\n params: BuildErrorEnvelopeParams\n): Envelope<\"error\"> {\n const { error, request, context, runtime } = params;\n const session = resolveSession(request?.headers ?? new Headers());\n\n let nextjsContext: NextjsContext | undefined;\n if (context?.nextjs) {\n nextjsContext = toNextjsContext(context.nextjs);\n } else if (request) {\n nextjsContext = toNextjsRequestContext(request);\n }\n\n return {\n uuid: uuidv7(),\n v: 0,\n type: \"error\",\n payload: {\n exceptions: toExceptions(\n toError(error),\n context?.mechanism ?? DEFAULT_ERROR_MECHANISM\n ),\n },\n clientTs: Date.now(),\n runtime: runtime.runtime,\n environment: runtime.environment,\n buildId: runtime.buildId,\n releaseId: runtime.releaseId,\n producerVersion: PRODUCER_VERSION,\n sessionId: session.id,\n ...(session.source ? { sessionSource: session.source } : {}),\n ...(nextjsContext ? { context: nextjsContext } : {}),\n };\n}\n\nfunction toNextjsRequestContext(request: NormalizedRequest): NextjsContext {\n return {\n runtime: \"nextjs\",\n requestMethod: request.method,\n requestPath: request.path,\n };\n}\n\nfunction toNextjsContext(\n context: Omit<NextjsContext, \"runtime\">\n): NextjsContext {\n return {\n runtime: \"nextjs\",\n ...context,\n };\n}\n\nfunction resolveSession(headers: Headers): {\n readonly id: SessionId | null;\n readonly source?: SessionSource;\n} {\n const sessionId = headers.get(SESSION_HEADER);\n if (sessionId === null) {\n return { id: null };\n }\n\n const parsed = sessionIdSchema.safeParse(sessionId);\n if (!parsed.success) {\n return { id: null };\n }\n\n return {\n id: parsed.data,\n source: \"header\",\n };\n}\n"],"mappings":";;;;;AAaA,MAAM,iBAAiB;AAEvB,MAAM,0BAA0C;CAC9C,MAAM;CACN,SAAS;CACV;AASD,SAAgB,mBACd,QACmB;CACnB,MAAM,EAAE,OAAO,SAAS,SAAS,YAAY;CAC7C,MAAM,UAAU,eAAe,SAAS,WAAW,IAAI,SAAS,CAAC;CAEjE,IAAI;AACJ,KAAI,SAAS,OACX,iBAAgB,gBAAgB,QAAQ,OAAO;UACtC,QACT,iBAAgB,uBAAuB,QAAQ;AAGjD,QAAO;EACL,MAAMA,IAAQ;EACd,GAAG;EACH,MAAM;EACN,SAAS,EACP,YAAY,aACV,QAAQ,MAAM,EACd,SAAS,aAAa,wBACvB,EACF;EACD,UAAU,KAAK,KAAK;EACpB,SAAS,QAAQ;EACjB,aAAa,QAAQ;EACrB,SAAS,QAAQ;EACjB,WAAW,QAAQ;EACnB,iBAAiB;EACjB,WAAW,QAAQ;EACnB,GAAI,QAAQ,SAAS,EAAE,eAAe,QAAQ,QAAQ,GAAG,EAAE;EAC3D,GAAI,gBAAgB,EAAE,SAAS,eAAe,GAAG,EAAE;EACpD;;AAGH,SAAS,uBAAuB,SAA2C;AACzE,QAAO;EACL,SAAS;EACT,eAAe,QAAQ;EACvB,aAAa,QAAQ;EACtB;;AAGH,SAAS,gBACP,SACe;AACf,QAAO;EACL,SAAS;EACT,GAAG;EACJ;;AAGH,SAAS,eAAe,SAGtB;CACA,MAAM,YAAY,QAAQ,IAAI,eAAe;AAC7C,KAAI,cAAc,KAChB,QAAO,EAAE,IAAI,MAAM;CAGrB,MAAM,SAAS,gBAAgB,UAAU,UAAU;AACnD,KAAI,CAAC,OAAO,QACV,QAAO,EAAE,IAAI,MAAM;AAGrB,QAAO;EACL,IAAI,OAAO;EACX,QAAQ;EACT"}
1
+ {"version":3,"file":"envelope.mjs","names":["uuidv7","PRODUCER_VERSION","REACT_VERSION"],"sources":["../../../src/internal/server/envelope.ts"],"sourcesContent":["import { PRODUCER_VERSION as REACT_VERSION } from \"@interfere/react/internal/version\";\nimport type { SessionId } from \"@interfere/types/data/session\";\nimport { sessionIdSchema } from \"@interfere/types/data/session\";\nimport type { Envelope, SessionSource } from \"@interfere/types/sdk/envelope\";\nimport { toError, toExceptions } from \"@interfere/types/sdk/errors\";\nimport type { NextjsContext } from \"@interfere/types/sdk/plugins/context/next\";\nimport type { ErrorMechanism } from \"@interfere/types/sdk/plugins/payload/errors\";\n\nimport { v7 as uuidv7 } from \"uuid\";\n\nimport { PRODUCER_VERSION } from \"../version.js\";\nimport type { ServerCaptureRuntime } from \"./runtime.js\";\nimport type { CaptureErrorContext, NormalizedRequest } from \"./types.js\";\n\nconst SESSION_HEADER = \"x-interfere-session\";\n\nconst DEFAULT_ERROR_MECHANISM: ErrorMechanism = {\n type: \"captureError\",\n handled: true,\n};\n\ninterface BuildErrorEnvelopeParams {\n readonly context?: CaptureErrorContext | undefined;\n readonly error: unknown;\n readonly request: NormalizedRequest | null;\n readonly runtime: ServerCaptureRuntime;\n}\n\nexport function buildErrorEnvelope(\n params: BuildErrorEnvelopeParams\n): Envelope<\"error\"> {\n const { error, request, context, runtime } = params;\n const session = resolveSession(request?.headers ?? new Headers());\n\n let nextjsContext: NextjsContext | undefined;\n if (context?.nextjs) {\n nextjsContext = toNextjsContext(context.nextjs);\n } else if (request) {\n nextjsContext = toNextjsRequestContext(request);\n }\n\n return {\n uuid: uuidv7(),\n v: 0,\n type: \"error\",\n payload: {\n exceptions: toExceptions(\n toError(error),\n context?.mechanism ?? DEFAULT_ERROR_MECHANISM\n ),\n },\n clientTs: Date.now(),\n runtime: runtime.runtime,\n environment: runtime.environment,\n buildId: runtime.buildId,\n releaseId: runtime.releaseId,\n producerVersion: PRODUCER_VERSION,\n sdkStack: [PRODUCER_VERSION, REACT_VERSION],\n sessionId: session.id,\n ...(session.source ? { sessionSource: session.source } : {}),\n ...(nextjsContext ? { context: nextjsContext } : {}),\n };\n}\n\nfunction toNextjsRequestContext(request: NormalizedRequest): NextjsContext {\n return {\n runtime: \"nextjs\",\n requestMethod: request.method,\n requestPath: request.path,\n };\n}\n\nfunction toNextjsContext(\n context: Omit<NextjsContext, \"runtime\">\n): NextjsContext {\n return {\n runtime: \"nextjs\",\n ...context,\n };\n}\n\nfunction resolveSession(headers: Headers): {\n readonly id: SessionId | null;\n readonly source?: SessionSource;\n} {\n const sessionId = headers.get(SESSION_HEADER);\n if (sessionId === null) {\n return { id: null };\n }\n\n const parsed = sessionIdSchema.safeParse(sessionId);\n if (!parsed.success) {\n return { id: null };\n }\n\n return {\n id: parsed.data,\n source: \"header\",\n };\n}\n"],"mappings":";;;;;;AAcA,MAAM,iBAAiB;AAEvB,MAAM,0BAA0C;CAC9C,MAAM;CACN,SAAS;CACV;AASD,SAAgB,mBACd,QACmB;CACnB,MAAM,EAAE,OAAO,SAAS,SAAS,YAAY;CAC7C,MAAM,UAAU,eAAe,SAAS,WAAW,IAAI,SAAS,CAAC;CAEjE,IAAI;AACJ,KAAI,SAAS,OACX,iBAAgB,gBAAgB,QAAQ,OAAO;UACtC,QACT,iBAAgB,uBAAuB,QAAQ;AAGjD,QAAO;EACL,MAAMA,IAAQ;EACd,GAAG;EACH,MAAM;EACN,SAAS,EACP,YAAY,aACV,QAAQ,MAAM,EACd,SAAS,aAAa,wBACvB,EACF;EACD,UAAU,KAAK,KAAK;EACpB,SAAS,QAAQ;EACjB,aAAa,QAAQ;EACrB,SAAS,QAAQ;EACjB,WAAW,QAAQ;EACnB,iBAAiBC;EACjB,UAAU,CAACA,oBAAkBC,iBAAc;EAC3C,WAAW,QAAQ;EACnB,GAAI,QAAQ,SAAS,EAAE,eAAe,QAAQ,QAAQ,GAAG,EAAE;EAC3D,GAAI,gBAAgB,EAAE,SAAS,eAAe,GAAG,EAAE;EACpD;;AAGH,SAAS,uBAAuB,SAA2C;AACzE,QAAO;EACL,SAAS;EACT,eAAe,QAAQ;EACvB,aAAa,QAAQ;EACtB;;AAGH,SAAS,gBACP,SACe;AACf,QAAO;EACL,SAAS;EACT,GAAG;EACJ;;AAGH,SAAS,eAAe,SAGtB;CACA,MAAM,YAAY,QAAQ,IAAI,eAAe;AAC7C,KAAI,cAAc,KAChB,QAAO,EAAE,IAAI,MAAM;CAGrB,MAAM,SAAS,gBAAgB,UAAU,UAAU;AACnD,KAAI,CAAC,OAAO,QACV,QAAO,EAAE,IAAI,MAAM;AAGrB,QAAO;EACL,IAAI,OAAO;EACX,QAAQ;EACT"}
package/dist/package.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
2
  var name = "@interfere/next";
3
- var version = "8.1.0";
3
+ var version = "8.1.2";
4
4
  //#endregion
5
5
  export { name, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interfere/next",
3
- "version": "8.1.0",
3
+ "version": "8.1.2",
4
4
  "license": "MIT",
5
5
  "description": "Build software that never breaks.",
6
6
  "keywords": [
@@ -62,36 +62,36 @@
62
62
  "typecheck": "tsc --noEmit --incremental"
63
63
  },
64
64
  "dependencies": {
65
- "@interfere/constants": "^8.1.0",
66
- "@interfere/react": "^8.1.0",
67
- "@interfere/sdk": "^8.1.0",
68
- "@interfere/types": "^8.1.0",
65
+ "@interfere/constants": "^8.1.2",
66
+ "@interfere/react": "^8.1.2",
67
+ "@interfere/sdk": "^8.1.2",
68
+ "@interfere/types": "^8.1.2",
69
69
  "chalk": "^5.6.2",
70
70
  "uuid": "^13.0.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "next": ">=16.2.2",
74
- "react": ">=19",
75
- "react-dom": ">=19"
73
+ "next": ">=16.2.3",
74
+ "react": ">=19.2.5",
75
+ "react-dom": ">=19.2.5"
76
76
  },
77
77
  "devDependencies": {
78
- "@interfere/typescript-config": "^8.1.0",
79
- "@interfere/test-utils": "^1.0.0",
78
+ "@interfere/test-utils": "^1.0.1",
79
+ "@interfere/typescript-config": "^8.1.1",
80
80
  "@types/node": "^24.12.0",
81
81
  "@types/react": "19.2.14",
82
82
  "@types/react-dom": "19.2.3",
83
83
  "@vitejs/plugin-react": "^6.0.1",
84
- "@vitest/browser": "4.1.2",
85
- "@vitest/browser-playwright": "4.1.2",
86
- "@vitest/coverage-v8": "^4.1.2",
87
- "next": "^16.2.2",
84
+ "@vitest/browser": "4.1.4",
85
+ "@vitest/browser-playwright": "4.1.4",
86
+ "@vitest/coverage-v8": "^4.1.4",
87
+ "next": "^16.2.3",
88
88
  "playwright": "^1.59.0",
89
- "react": "^19.2.4",
90
- "react-dom": "^19.2.4",
91
- "tsdown": "^0.21.6",
89
+ "react": "^19.2.5",
90
+ "react-dom": "^19.2.5",
91
+ "tsdown": "^0.21.7",
92
92
  "typescript": "6.0.2",
93
- "vitest": "^4.1.2",
94
- "vitest-browser-react": "2.1.0",
95
- "webpack": "^5.105.1"
93
+ "vitest": "^4.1.4",
94
+ "vitest-browser-react": "2.2.0",
95
+ "webpack": "^5.106.1"
96
96
  }
97
97
  }