Skip to content

Commit

Permalink
Add expirmental entry points.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangcodes committed Jan 14, 2025
1 parent ab859aa commit c92cf57
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
RouterProvider,
useParams,
} from 'react-router-dom';
// import { UserInteractionInstrumentation } from '@honeycombio/opentelemetry-web/experimental';
import { UserInteractionInstrumentation } from '@honeycombio/opentelemetry-web/experimental';
import { HoneycombWebSDK } from '@honeycombio/opentelemetry-web';
import { getWebAutoInstrumentations } from '@opentelemetry/auto-instrumentations-web';
import { ReactRouterSpanProcessor } from './reactRouterSpanProcessor';
Expand Down Expand Up @@ -83,9 +83,9 @@ try {
enabled: false,
},
}),
// new UserInteractionInstrumentation({
// rootNodeId: 'root',
// }),
new UserInteractionInstrumentation({
rootNodeId: 'root',
}),
], // add automatic instrumentation
spanProcessors: [new ReactRouterSpanProcessor({ router })],
});
Expand Down
6 changes: 6 additions & 0 deletions packages/honeycomb-opentelemetry-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"default": "./dist/esm/index.js"
},
"./experimental": {
"types": "./dist/types/experimental/index.d.ts",
"require": "./dist/cjs/experimental/index.js",
"import": "./dist/esm/experimental/index.js",
"default": "./dist/esm/experimental/index.js"
}
},
"files": [
Expand Down
11 changes: 7 additions & 4 deletions packages/honeycomb-opentelemetry-web/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const getExternalDepsFromPackageJSON = () => {
return (id) => pattern.test(id);
};

const entryPoint = './src/index.ts';
const entryPoint = {
index: './src/index.ts',
'experimental/index': './src/experimental/index.ts',
};

const modulePlugins = [
autoExternal(),
Expand All @@ -46,13 +49,13 @@ const modulePlugins = [

const cjsConfig = {
input: entryPoint,
output: { file: 'dist/cjs/index.js', format: 'cjs' },
output: { dir: 'dist/cjs', format: 'cjs' },
plugins: [...modulePlugins],
};

const esmConfig = {
input: entryPoint,
output: { file: 'dist/esm/index.js', format: 'esm' },
output: { dir: 'dist/esm', format: 'esm' },
plugins: [...modulePlugins],
};

Expand Down Expand Up @@ -98,7 +101,7 @@ const cdnConfig = {

const typesConfig = {
input: entryPoint,
output: { file: 'dist/types/index.d.ts', format: 'esm' },
output: { dir: 'dist/types/', format: 'esm' },
plugins: [
autoExternal(),
dts(),
Expand Down

0 comments on commit c92cf57

Please sign in to comment.