Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 226aa60

Browse files
Switch @opencensus/web-core to use @opencensus/web-types (#28)
1 parent 3f40493 commit 226aa60

16 files changed

Lines changed: 79 additions & 348 deletions

File tree

packages/opencensus-web-core/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = (config) => {
2929
files: ['test/index.ts'],
3030
preprocessors: {'test/index.ts': ['webpack']},
3131
// Use webpack so that tree-shaking will remove all Node.js dependencies of
32-
// the `@opencensus/core` library, since they are not actually used in this
32+
// the `@opencensus/web-types` library, since they are not actually used in this
3333
// package's compiled JS code. Only the TypeScript interfaces from
3434
// `@opecensus/core` are used.
3535
webpack: webpackConfig,

packages/opencensus-web-core/package-lock.json

Lines changed: 3 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencensus-web-core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
"access": "public"
4444
},
4545
"devDependencies": {
46-
"@opencensus/core": "^0.0.9",
4746
"@types/jasmine": "^3.3.4",
48-
"@types/node": "^10.12.18",
4947
"gts": "^0.9.0",
5048
"istanbul-instrumenter-loader": "^3.0.1",
5149
"jasmine": "^3.3.1",
@@ -61,6 +59,8 @@
6159
"webpack": "^4.18.0",
6260
"webpack-cli": "^3.1.0"
6361
},
64-
"dependencies": {},
62+
"dependencies": {
63+
"@opencensus/web-types": "^0.0.1"
64+
},
6565
"sideEffects": false
6666
}

packages/opencensus-web-core/src/exporters/noop_exporter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
import * as coreTypes from '@opencensus/core';
17+
import * as webTypes from '@opencensus/web-types';
1818

19-
export class NoopExporter implements coreTypes.Exporter {
20-
publish(roots: coreTypes.RootSpan[]): Promise<number|string|void> {
19+
export class NoopExporter implements webTypes.Exporter {
20+
publish(roots: webTypes.RootSpan[]): Promise<number|string|void> {
2121
return Promise.resolve();
2222
}
2323

24-
onStartSpan(root: coreTypes.RootSpan) {}
24+
onStartSpan(root: webTypes.RootSpan) {}
2525

26-
onEndSpan(root: coreTypes.RootSpan) {}
26+
onEndSpan(root: webTypes.RootSpan) {}
2727
}

packages/opencensus-web-core/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ export {RootSpan} from './trace/model/root-span';
1919
export {Span} from './trace/model/span';
2020
export {Tracer} from './trace/model/tracer';
2121
export {Tracing} from './trace/model/tracing';
22-
export * from './trace/model/enums';
2322
export * from './trace/model/attribute-keys';
2423

25-
// Re-export types this uses from @opencensus/core.
26-
export {Annotation, Attributes, BufferConfig, Config, Exporter, ExporterConfig, Link, Logger, MessageEvent, Propagation, SpanContext, SpanEventListener, Status, TracerConfig, TraceState} from '@opencensus/core';
24+
// Re-export types this uses from @opencensus/web-types.
25+
export {Annotation, Attributes, BufferConfig, CanonicalCode, Config, Exporter, ExporterConfig, Link, LinkType, Logger, MessageEvent, MessageEventType, Propagation, SpanContext, SpanEventListener, SpanKind, Status, TracerConfig, TraceState} from '@opencensus/web-types';
2726

2827
export * from './common/time-util';
2928
export * from './common/url-util';

packages/opencensus-web-core/src/trace/model/enums.ts

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)