@heystack/otel 0.3.2 → 0.3.3

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.
Files changed (2) hide show
  1. package/dist/next.js +12 -2
  2. package/package.json +4 -2
package/dist/next.js CHANGED
@@ -44,13 +44,23 @@ export async function registerHeystack(o) {
44
44
  // path (and a workers build must not bundle the node path) — the import is
45
45
  // runtime-selected per environment. `@vite-ignore` covers Vite/Rollup;
46
46
  // `webpackIgnore` covers Next/Turbopack/webpack.
47
+ //
48
+ // IMPORTANT: use the BARE package subpath ("@heystack/otel/workers"), NOT a
49
+ // relative "./workers.js". With the ignore hints the specifier is left as a
50
+ // literal runtime import; Next relocates this code into a server chunk and
51
+ // OpenNext's esbuild re-bundles it. A relative path would then resolve
52
+ // against the CHUNK dir (where no workers.js exists) and the build fails
53
+ // (issue: 0.3.2 broke OpenNext builds this way). A bare specifier resolves
54
+ // through Node's exports map / node_modules from anywhere, surviving both
55
+ // Next chunk relocation and OpenNext's re-bundle. The exports map points
56
+ // "./workers" → "./dist/workers.js" and "./node" → "./dist/node.js".
47
57
  const { initHeystackWorkers } = await import(
48
- /* @vite-ignore */ /* webpackIgnore: true */ "./workers.js");
58
+ /* @vite-ignore */ /* webpackIgnore: true */ "@heystack/otel/workers");
49
59
  initHeystackWorkers({ apiKey, service: o.service, endpoint: o.endpoint });
50
60
  }
51
61
  else {
52
62
  const { initHeystack } = await import(
53
- /* @vite-ignore */ /* webpackIgnore: true */ "./node.js");
63
+ /* @vite-ignore */ /* webpackIgnore: true */ "@heystack/otel/node");
54
64
  initHeystack({
55
65
  apiKey,
56
66
  service: o.service,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heystack/otel",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Runtime-aware OpenTelemetry tracing that exports to Heystack (Node, Next.js, Workers).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,9 @@
18
18
  "build": "tsc -p tsconfig.build.json",
19
19
  "test": "vitest run",
20
20
  "typecheck": "tsc --noEmit",
21
- "prepublishOnly": "pnpm build"
21
+ "validate": "node scripts/validate-entries.mjs",
22
+ "check": "pnpm typecheck && pnpm build && pnpm validate && pnpm test",
23
+ "prepublishOnly": "pnpm build && pnpm validate"
22
24
  },
23
25
  "dependencies": {
24
26
  "@opentelemetry/api": "^1.9.0",