Skip to content

Commit

Permalink
Add typedoc docs (#56)
Browse files Browse the repository at this point in the history
* Add typedoc docs

* oops, yarn run docs -> yarn docs

* Fix review comments

- Rename docs to documentation
- Add lerna run docs

* set out to docs/out

* Change out path
  • Loading branch information
mayurkale22 authored Jun 28, 2019
1 parent 969925d commit c97bdc6
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ yarn.lock
package-lock.json
packages/**/yarn.lock
packages/**/package-lock.json

# docs files
docs
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ The `opentelemetry-js` project is written in TypeScript.
- `yarn bootstrap` or `npm run bootstrap` Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies.
- `yarn test` or `npm test` tests code the same way that our CI will test it.
- `yarn fix` or `npm run fix` lint (and maybe fix) any changes.
- `yarn docs` or `npm run docs` to generate API documentation.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"bootstrap": "lerna bootstrap",
"bump": "lerna publish",
"codecov": "lerna run codecov",
"check": "lerna run check"
"check": "lerna run check",
"docs": "lerna run docs"
},
"repository": "open-telemetry/opentelemetry-js",
"keywords": [
Expand Down
4 changes: 3 additions & 1 deletion packages/opentelemetry-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
"test": "npm run compile && npm run check"
"test": "npm run compile && npm run check",
"docs": "typedoc --tsconfig tsconfig.json"
},
"keywords": [
"opentelemetry",
Expand Down Expand Up @@ -38,6 +39,7 @@
},
"devDependencies": {
"gts": "^1.0.0",
"typedoc": "^0.14.2",
"typescript": "^3.4.5"
}
}
8 changes: 4 additions & 4 deletions packages/opentelemetry-types/src/trace/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { Attributes } from './attributes';
import { SpanContext } from './span_context';

/**
* A pointer from the current span to another span in the same trace or in a
* different trace.
* A pointer from the current {@link Span} to another span in the same trace or
* in a different trace.
*/
export interface Link {
/** The SpanContext of a linked span. */
/** The {@link SpanContext} of a linked span. */
spanContext: SpanContext;
/** A set of attributes on the link. */
/** A set of {@link Attributes} on the link. */
attributes?: Attributes;
}
11 changes: 4 additions & 7 deletions packages/opentelemetry-types/src/trace/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Attributes } from './attributes';
*/
export interface Span {
/**
* Returns the SpanContext object associated with this Span.
* Returns the {@link SpanContext} object associated with this Span.
*
* @returns the SpanContext object associated with this Span.
*/
Expand Down Expand Up @@ -62,7 +62,7 @@ export interface Span {
* @param [attributes] the attributes that will be added; these are
* associated with this event.
*/
addEvent(name: string, attributes?: { [key: string]: unknown }): this;
addEvent(name: string, attributes?: Attributes): this;

/**
* Adds a link to the Span.
Expand All @@ -71,14 +71,11 @@ export interface Span {
* @param [attributes] the attributes that will be added; these are
* associated with this link.
*/
addLink(
spanContext: SpanContext,
attributes?: { [key: string]: unknown }
): this;
addLink(spanContext: SpanContext, attributes?: Attributes): this;

/**
* Sets a status to the span. If used, this will override the default Span
* status. Default is 'OK'.
* status. Default is {@link CanonicalCode.OK}.
*
* @param status the Status to set.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry-types/src/trace/span_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { TraceState } from './trace_state';
import { TraceOptions } from './trace_options';

/**
* A SpanContext represents the portion of a Span which must be serialized and
* propagated along side of a distributed context.
* A SpanContext represents the portion of a {@link Span} which must be
* serialized and propagated along side of a distributed context.
*/
export interface SpanContext {
/**
Expand Down
8 changes: 7 additions & 1 deletion packages/opentelemetry-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@
},
"include": [
"src/**/*.ts"
]
],
"typedocOptions": {
"name": "OpenTelemetry Documentation",
"out": "docs/out",
"mode": "file",
"hideGenerator": true
}
}

0 comments on commit c97bdc6

Please sign in to comment.