Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: export API singleton types #1864

Merged
merged 5 commits into from
Jan 27, 2021

Conversation

dyladan
Copy link
Member

@dyladan dyladan commented Jan 25, 2021

This will fix the currently-failing lint workflow.

An update to typedoc means that only classes which are exported are included in the documentation. Here, the API singletons are exported as type only. This means they can't be used directly, but are included in the typedoc documentation and the following code will compile successfully:

import { context, ContextAPI } from "@opentelemetry/api";

let ctx: ContextAPI = context;

The following code will still fail:

import { ContextAPI } from "@opentelemetry/api";

const ctx = new ContextAPI() // this will fail
const ctx2 = ContextAPI.getInstance() // this will also fail

@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #1864 (2eeb611) into main (1eed360) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1864      +/-   ##
==========================================
- Coverage   92.37%   92.35%   -0.02%     
==========================================
  Files         157      157              
  Lines        5104     5104              
  Branches     1085     1085              
==========================================
- Hits         4715     4714       -1     
- Misses        389      390       +1     
Impacted Files Coverage Δ
...emetry-core/src/platform/node/RandomIdGenerator.ts 87.50% <0.00%> (-6.25%) ⬇️

Base automatically changed from master to main January 25, 2021 19:26
@dyladan dyladan mentioned this pull request Jan 26, 2021
@dyladan dyladan linked an issue Jan 26, 2021 that may be closed by this pull request
@dyladan
Copy link
Member Author

dyladan commented Jan 26, 2021

@obecny ptal before merge because this affects API

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dyladan dyladan merged commit 8f29081 into open-telemetry:main Jan 27, 2021
@Flarna Flarna deleted the export-api-type branch February 10, 2021 09:06
dyladan added a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
dyladan added a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Documentation-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOCS
4 participants