Skip to content

Commit 8aae3a1

Browse files
chore: move impl module close to stub module and verify types match
1 parent 1da28fa commit 8aae3a1

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/worker/src/workflow/otel-workflow-imports.ts renamed to packages/interceptors-opentelemetry/src/workflow/workflow-imports-impl.ts

File renamed without changes.

packages/test/src/test-otel.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { BasicTracerProvider, InMemorySpanExporter, SimpleSpanProcessor } from '
1212
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
1313
import test from 'ava';
1414
import { v4 as uuid4 } from 'uuid';
15+
import type * as workflowImportStub from '@temporalio/interceptors-opentelemetry/lib/workflow/workflow-imports';
16+
import type * as workflowImportImpl from '@temporalio/interceptors-opentelemetry/lib/workflow/workflow-imports-impl';
1517
import { WorkflowClient, WithStartWorkflowOperation, WorkflowClientInterceptor } from '@temporalio/client';
1618
import { OpenTelemetryWorkflowClientInterceptor } from '@temporalio/interceptors-opentelemetry/lib/client';
1719
import { OpenTelemetryWorkflowClientCallsInterceptor } from '@temporalio/interceptors-opentelemetry';
@@ -719,3 +721,8 @@ test.skip('otel interceptors are complete', async (t) => {
719721
const _client = {} as OpenTelemetryWorkflowClientInterceptor satisfies Required<WorkflowClientInterceptor>;
720722
t.pass();
721723
});
724+
725+
test.skip('workflow-imports stub and impl have same type', async (t) => {
726+
const _implSatisfiesStub = {} as typeof workflowImportImpl satisfies typeof workflowImportStub;
727+
const _stubSatisfiesImpl = {} as typeof workflowImportStub satisfies typeof workflowImportImpl;
728+
});

packages/worker/src/workflow/bundler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ exports.importInterceptors = function importInterceptors() {
224224
// When creating the workflow bundle we replace the module containing the stubs with a module that reexports the actual implementations.
225225
new NormalModuleReplacementPlugin(
226226
/[\\/](?:@temporalio|packages)[\\/]interceptors-opentelemetry[\\/](?:src|lib)[\\/]workflow[\\/]workflow-imports\.[jt]s$/,
227-
path.resolve(__dirname, 'otel-workflow-imports.js')
227+
'./workflow-imports-impl.js'
228228
),
229229
],
230230
externals: captureProblematicModules,

0 commit comments

Comments
 (0)