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

Commit

Permalink
Switch @opencensus/web-core to use @opencensus/web-types (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
draffensperger committed Mar 21, 2019
1 parent 3f40493 commit 226aa60
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 348 deletions.
2 changes: 1 addition & 1 deletion packages/opencensus-web-core/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = (config) => {
files: ['test/index.ts'],
preprocessors: {'test/index.ts': ['webpack']},
// Use webpack so that tree-shaking will remove all Node.js dependencies of
// the `@opencensus/core` library, since they are not actually used in this
// the `@opencensus/web-types` library, since they are not actually used in this
// package's compiled JS code. Only the TypeScript interfaces from
// `@opecensus/core` are used.
webpack: webpackConfig,
Expand Down
64 changes: 3 additions & 61 deletions packages/opencensus-web-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/opencensus-web-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
"access": "public"
},
"devDependencies": {
"@opencensus/core": "^0.0.9",
"@types/jasmine": "^3.3.4",
"@types/node": "^10.12.18",
"gts": "^0.9.0",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine": "^3.3.1",
Expand All @@ -61,6 +59,8 @@
"webpack": "^4.18.0",
"webpack-cli": "^3.1.0"
},
"dependencies": {},
"dependencies": {
"@opencensus/web-types": "^0.0.1"
},
"sideEffects": false
}
10 changes: 5 additions & 5 deletions packages/opencensus-web-core/src/exporters/noop_exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

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

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

onStartSpan(root: coreTypes.RootSpan) {}
onStartSpan(root: webTypes.RootSpan) {}

onEndSpan(root: coreTypes.RootSpan) {}
onEndSpan(root: webTypes.RootSpan) {}
}
5 changes: 2 additions & 3 deletions packages/opencensus-web-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ export {RootSpan} from './trace/model/root-span';
export {Span} from './trace/model/span';
export {Tracer} from './trace/model/tracer';
export {Tracing} from './trace/model/tracing';
export * from './trace/model/enums';
export * from './trace/model/attribute-keys';

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

export * from './common/time-util';
export * from './common/url-util';
Expand Down
206 changes: 0 additions & 206 deletions packages/opencensus-web-core/src/trace/model/enums.ts

This file was deleted.

0 comments on commit 226aa60

Please sign in to comment.