Skip to content

Commit

Permalink
[core] regen tracing samples (#29548)
Browse files Browse the repository at this point in the history
Regenerates samples to fix any formatting issues as well as remove the
`type: module` specifier as we are not generating ESM for our samples.

Resolves #29521
  • Loading branch information
maorleger committed May 1, 2024
1 parent a7ad757 commit 5ec963a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions sdk/core/core-tracing/samples/v1/javascript/basicTracing.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BasicClient {
// You do not need to close the span.
const result = await Promise.resolve({ value: 42 });
return result.value;
}
},
);
}

Expand Down Expand Up @@ -81,11 +81,11 @@ class BasicClient {
async withUserCallback(callback, options = {}) {
const { span, updatedOptions } = this.tracingClient.startSpan(
"BasicClient.withUserCallback",
options
options,
);
const result = this.tracingClient.withContext(
updatedOptions.tracingOptions.tracingContext,
callback
callback,
);
span.setStatus({ status: "success" });
span.end();
Expand Down
1 change: 0 additions & 1 deletion sdk/core/core-tracing/samples/v1/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"private": true,
"version": "1.0.0",
"description": "Azure SDK Core client library samples for JavaScript",
"type": "module",
"engines": {
"node": ">=18.0.0"
},
Expand Down
1 change: 0 additions & 1 deletion sdk/core/core-tracing/samples/v1/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"private": true,
"version": "1.0.0",
"description": "Azure SDK Core client library samples for TypeScript",
"type": "module",
"engines": {
"node": ">=18.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BasicClient {
// You do not need to close the span.
const result = await Promise.resolve({ value: 42 });
return result.value;
}
},
);
}

Expand Down Expand Up @@ -87,15 +87,15 @@ class BasicClient {
*/
async withUserCallback<Callback extends (...args: unknown[]) => ReturnType<Callback>>(
callback: Callback,
options: OperationOptions = {}
options: OperationOptions = {},
): Promise<ReturnType<Callback>> {
const { span, updatedOptions } = this.tracingClient.startSpan(
"BasicClient.withUserCallback",
options
options,
);
const result = this.tracingClient.withContext(
updatedOptions.tracingOptions!.tracingContext!,
callback
callback,
);
span.setStatus({ status: "success" });
span.end();
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/samples/v1/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2018",
"target": "ES2020",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
Expand Down

0 comments on commit 5ec963a

Please sign in to comment.