forked from open-telemetry/opentelemetry-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): fix unreachable @opentelemetry/api/experimental entry (open…
- Loading branch information
1 parent
99d8915
commit 93403a5
Showing
8 changed files
with
717 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
module.exports = { | ||
env: { | ||
mocha: true, | ||
commonjs: true, | ||
node: true, | ||
browser: true, | ||
}, | ||
...require('../../eslint.base.js'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# `opentelemetry/integration-tests-api` | ||
|
||
This is an integration test suite for `@opentelemetry/api` that verifies the | ||
api package works as expected when being imported. | ||
|
||
## Test | ||
|
||
```sh | ||
npm run test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@opentelemetry/integration-tests-api", | ||
"version": "1.21.0", | ||
"private": true, | ||
"publishConfig": { | ||
"access": "restricted" | ||
}, | ||
"description": "Verifies @opentelemetry/api in integration tests", | ||
"author": "OpenTelemetry Authors", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/integration-tests/api", | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/open-telemetry/opentelemetry-js.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/open-telemetry/opentelemetry-js/issues" | ||
}, | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"scripts": { | ||
"compile": "cross-var lerna run version --scope $npm_package_name --include-dependencies", | ||
"pretest": "npm run compile", | ||
"test": "nyc mocha test/**/*.test.js", | ||
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", | ||
"lint": "eslint . --ext .js", | ||
"lint:fix": "eslint . --ext .js --fix" | ||
}, | ||
"devDependencies": { | ||
"@opentelemetry/api": "^1.0.0", | ||
"@types/mocha": "9.1.1", | ||
"@types/node": "18.6.5", | ||
"codecov": "3.8.3", | ||
"cross-var": "1.1.0", | ||
"lerna": "6.6.2", | ||
"mocha": "10.0.0", | ||
"nyc": "15.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
const assert = require('assert'); | ||
|
||
// TypeScript v4.4.4 doesn't support `node16` or `nodenext` in | ||
// [Module Resolution](https://www.typescriptlang.org/tsconfig#moduleResolution) | ||
// which is required for typescript to resolve the `package.json#exports` | ||
// entries. | ||
// Additionally, using `node16` or `nodenext` in `tsconfig.json#moduleResolution` | ||
// requires the TypeScript to generate ESModule outputs. This is a breaking | ||
// change for CJS users. | ||
// So we have to use plain JavaScript to verity the `package.json#exports` here. | ||
|
||
describe('@opentelemetry/api entries', () => { | ||
it('should import root entry', async () => { | ||
const mod = await import('@opentelemetry/api'); | ||
assert.ok(mod.trace != null); | ||
}); | ||
|
||
it('should require root entry', () => { | ||
const mod = require('@opentelemetry/api'); | ||
assert.ok(mod.trace != null); | ||
}); | ||
|
||
it('should import experimental entry', async () => { | ||
const mod = await import('@opentelemetry/api/experimental'); | ||
assert.ok(mod.wrapTracer != null); | ||
}); | ||
|
||
it('should require experimental entry', () => { | ||
const mod = require('@opentelemetry/api/experimental'); | ||
assert.ok(mod.wrapTracer != null); | ||
}); | ||
}); |
Oops, something went wrong.