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

Commit 528be79

Browse files
committed
refactor: remove some unwanted dependencies from Tracer
1 parent 135ec64 commit 528be79

6 files changed

Lines changed: 36 additions & 10 deletions

File tree

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,12 @@ npm-debug.log
3030
.nyc_output/
3131
build/
3232

33+
#backup files
34+
*--
35+
*_backup
36+
37+
#log files
38+
*.log
39+
40+
3341

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/bin
2+
/coverage
3+
/doc
4+
/test

packages/opencensus-core/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"types": "build/src/index.d.js",
77
"repository": "census-instrumentation/opencensus-node",
88
"scripts": {
9+
"build": "node_modules/.bin/tsc --declaration",
910
"test": "npm run script run-unit-tests",
1011
"compile-all": "npm run script compile-auto",
1112
"compile-strict": "npm run script compile-auto-strict",
@@ -25,6 +26,17 @@
2526
"engines": {
2627
"node": ">=6.00"
2728
},
29+
"files": [
30+
"build/src/**/*.js",
31+
"build/src/**/*.d.ts",
32+
"doc",
33+
"CHANGELOG.md",
34+
"LICENSE",
35+
"README.md"
36+
],
37+
"publishConfig": {
38+
"access": "public"
39+
},
2840
"devDependencies": {
2941
"@types/continuation-local-storage": "^3.2.1",
3042
"@types/debug": "0.0.30",
@@ -47,7 +59,6 @@
4759
"continuation-local-storage": "^3.2.1",
4860
"debug": "^3.1.0",
4961
"end-of-stream": "^1.4.1",
50-
"npm": "^5.7.1",
5162
"require-in-the-middle": "^2.2.1",
5263
"semver": "^5.5.0",
5364
"shimmer": "^1.2.0",

packages/opencensus-core/src/trace/model/tracer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ import * as cls from '../../internal/cls'
1818
import { RootSpan } from './rootspan'
1919
import { Span } from './span'
2020
import { debug } from '../../internal/util'
21-
import { Stackdriver } from '../../exporters/stackdriver/stackdriver'
22-
import { StackdriverOptions } from '../../exporters/stackdriver/options'
2321
import { Sampler } from '../config/sampler'
24-
import { TraceContext, TraceOptions, OnEndSpanEventListener, SpanBaseModel } from '../types/tracetypes';
25-
import { TracerConfig, defaultConfig } from '../tracing';
22+
import { TraceContext, TraceOptions, OnEndSpanEventListener, SpanBaseModel, TracerConfig, defaultConfig } from '../types/tracetypes';
23+
2624

2725
export type Func<T> = (...args: any[]) => T;
2826

packages/opencensus-core/src/trace/types/tracetypes.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ import { Sampler } from '../config/sampler'
2222
export interface MapLabels { [propName: string]: string; }
2323
export interface MapObjects { [propName: string]: any; }
2424

25+
export interface TracerConfig {
26+
sampleRate?: number;
27+
ignoreUrls?: Array<string | RegExp>;
28+
}
29+
30+
export const defaultConfig: TracerConfig = {
31+
sampleRate: 1.0
32+
}
33+
2534
export interface TraceContext {
2635
traceId: string,
2736
spanId: string,
@@ -47,7 +56,6 @@ export interface SpanData {
4756
parentSpanId?: string;
4857
}
4958

50-
5159
export abstract class SpanBaseModel {
5260

5361
protected _className: string;

packages/opencensus-core/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
"node_modules"
1818
],
1919
"include": [
20-
"src/*.ts",
21-
"src/trace/*.ts",
22-
"src/trace/plugins/*.ts",
23-
"src/internal/*.ts"
20+
"src/**/*.ts"
2421
]
2522

2623
}

0 commit comments

Comments
 (0)