From c2688326890ee42151aca2e15801a8769f9b53c3 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Thu, 22 Sep 2022 05:29:00 -0400 Subject: [PATCH] chore: add api to monorepo (#3261) * Add API to lerna * Update todo * Expect instead of ignore error * Add webpack test context * Block scope test variables * Fix linting * Fix lining path * Fix lint * Fix lint * Update index-webpack.worker.ts Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com> --- api/.eslintrc.js | 8 +++ api/TODO.md | 10 ++-- api/karma.conf.js | 24 ++++++++ api/karma.worker.js | 24 ++++++++ api/package.json | 58 +++++++++---------- api/src/platform/browser/globalThis.ts | 6 +- api/src/trace/NoopTracer.ts | 6 +- api/test/api/api.test.ts | 2 +- api/test/diag/consoleLogger.test.ts | 6 +- api/test/index-webpack.ts | 12 ++-- api/test/index-webpack.worker.ts | 19 ++++++ api/tsconfig.all.json | 9 +++ api/tsconfig.esm.json | 11 ++++ api/tsconfig.esnext.json | 11 ++++ api/tsconfig.json | 13 +++++ experimental/packages/api-logs/tsconfig.json | 5 ++ .../exporter-trace-otlp-grpc/tsconfig.json | 3 + .../exporter-trace-otlp-http/tsconfig.json | 3 + .../exporter-trace-otlp-proto/tsconfig.json | 3 + .../opentelemetry-api-metrics/tsconfig.json | 5 ++ .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../opentelemetry-sdk-metrics/tsconfig.json | 3 + .../opentelemetry-sdk-node/tsconfig.json | 3 + .../packages/otlp-exporter-base/tsconfig.json | 3 + .../otlp-grpc-exporter-base/tsconfig.json | 3 + .../otlp-proto-exporter-base/tsconfig.json | 3 + .../packages/otlp-transformer/tsconfig.json | 3 + .../tsconfig.json | 3 + lerna.json | 1 + .../tsconfig.json | 5 ++ .../tsconfig.json | 5 ++ packages/opentelemetry-core/tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../opentelemetry-propagator-b3/tsconfig.json | 3 + .../tsconfig.json | 3 + .../opentelemetry-resources/tsconfig.json | 3 + .../tsconfig.json | 3 + .../tsconfig.json | 3 + .../opentelemetry-sdk-trace-web/tsconfig.json | 3 + .../tsconfig.json | 3 + tsconfig.json | 4 ++ 50 files changed, 282 insertions(+), 49 deletions(-) create mode 100644 api/.eslintrc.js create mode 100644 api/karma.conf.js create mode 100644 api/karma.worker.js create mode 100644 api/test/index-webpack.worker.ts create mode 100644 api/tsconfig.all.json create mode 100644 api/tsconfig.esm.json create mode 100644 api/tsconfig.esnext.json create mode 100644 api/tsconfig.json diff --git a/api/.eslintrc.js b/api/.eslintrc.js new file mode 100644 index 0000000000..7d5c10c7f9 --- /dev/null +++ b/api/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + "env": { + "mocha": true, + "commonjs": true, + "shared-node-browser": true + }, + ...require('../eslint.config.js') +} diff --git a/api/TODO.md b/api/TODO.md index 53f2b1c282..30f67e54ec 100644 --- a/api/TODO.md +++ b/api/TODO.md @@ -3,9 +3,9 @@ These tasks must be completed before the API package can be released from this repository. - [x] remove files specific to the API git repo -- [ ] add to lerna monorepo - - [ ] add tsconfig files - - [ ] add web testing - - [ ] build esm versions +- [x] add to lerna monorepo + - [x] add tsconfig files + - [x] add web testing + - [x] build esm versions - [ ] test node versions 8, 10, and 12 -- [ ] add to auto published docs +- [x] add to auto published docs diff --git a/api/karma.conf.js b/api/karma.conf.js new file mode 100644 index 0000000000..5f7d9f888d --- /dev/null +++ b/api/karma.conf.js @@ -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 + * + * http://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 karmaWebpackConfig = require('../karma.webpack'); +const karmaBaseConfig = require('../karma.base'); + +module.exports = (config) => { + config.set(Object.assign({}, karmaBaseConfig, { + webpack: karmaWebpackConfig, + })) +}; diff --git a/api/karma.worker.js b/api/karma.worker.js new file mode 100644 index 0000000000..7917d5a000 --- /dev/null +++ b/api/karma.worker.js @@ -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 + * + * http://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 karmaWebpackConfig = require('../karma.webpack'); +const karmaBaseConfig = require('../karma.worker'); + +module.exports = (config) => { + config.set(Object.assign({}, karmaBaseConfig, { + webpack: karmaWebpackConfig, + })) +}; diff --git a/api/package.json b/api/package.json index c0a475d890..012fd629ef 100644 --- a/api/package.json +++ b/api/package.json @@ -12,22 +12,25 @@ }, "repository": "https://github.com/open-telemetry/opentelemetry-js-api.git", "scripts": { - "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p .", - "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p .", - "precompile": "npm run version", + "clean": "tsc --build --clean", + "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../", + "codecov:webworker": "nyc report --reporter=json && codecov -f coverage/*.json -p ../", + "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../", + "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "compile": "tsc --build tsconfig.json tsconfig.esm.json", "docs": "typedoc", "docs:deploy": "gh-pages --dist docs/out", "docs:test": "linkinator docs/out --silent && linkinator docs/*.md *.md --markdown --silent", - "lint:fix": "eslint src test --ext .ts --fix", - "lint": "eslint src test --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "lint": "eslint . --ext .ts", "test:browser": "nyc karma start --single-run", "test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts", + "test:webworker": "nyc karma start karma.worker.js --single-run", "cycle-check": "dpdm --exit-code circular:1 src/index.ts", - "version": "node scripts/version-update.js", - "prewatch": "npm run version", - "watch": "tsc --build --watch" + "version": "node ../scripts/version-update.js", + "prewatch": "npm run precompile", + "watch": "tsc --build --watch", + "peer-api-check": "node ../scripts/peer-api-check.js" }, "keywords": [ "opentelemetry", @@ -57,34 +60,27 @@ "access": "public" }, "devDependencies": { - "@types/mocha": "8.2.2", - "@types/node": "14.17.4", - "@types/sinon": "10.0.2", - "@types/webpack-env": "1.16.0", - "@typescript-eslint/eslint-plugin": "5.0.0", - "@typescript-eslint/parser": "5.0.0", - "codecov": "3.8.2", - "dpdm": "3.7.1", - "eslint": "7.32.0", - "eslint-plugin-header": "3.1.1", - "eslint-plugin-node": "11.1.0", - "gh-pages": "3.2.0", + "@types/mocha": "9.1.1", + "@types/node": "18.6.5", + "@types/sinon": "10.0.13", + "@types/webpack-env": "1.16.3", + "codecov": "3.8.3", + "dpdm": "3.10.0", "istanbul-instrumenter-loader": "3.0.1", - "karma": "5.2.3", + "karma": "6.3.16", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", + "karma-mocha-webworker": "1.3.0", "karma-spec-reporter": "0.0.32", "karma-webpack": "4.0.2", - "lerna-changelog": "1.0.1", - "linkinator": "2.13.6", - "mocha": "7.2.0", + "mocha": "10.0.0", "nyc": "15.1.0", - "sinon": "11.1.1", - "ts-loader": "8.2.0", - "ts-mocha": "8.0.0", - "typedoc": "0.21.2", - "typescript": "4.3.5", + "sinon": "14.0.0", + "ts-loader": "8.4.0", + "ts-mocha": "10.0.0", + "typescript": "4.4.4", "webpack": "4.46.0" - } + }, + "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api" } diff --git a/api/src/platform/browser/globalThis.ts b/api/src/platform/browser/globalThis.ts index ebea1f48c5..68ca8ac5ff 100644 --- a/api/src/platform/browser/globalThis.ts +++ b/api/src/platform/browser/globalThis.ts @@ -29,7 +29,7 @@ // eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef export const _globalThis: typeof globalThis = typeof globalThis === 'object' ? globalThis : - typeof self === 'object' ? self : - typeof window === 'object' ? window : - typeof global === 'object' ? global : + typeof self === 'object' ? self : + typeof window === 'object' ? window : + typeof global === 'object' ? global : {} as typeof globalThis; diff --git a/api/src/trace/NoopTracer.ts b/api/src/trace/NoopTracer.ts index d1db93e9cf..cf386c4f57 100644 --- a/api/src/trace/NoopTracer.ts +++ b/api/src/trace/NoopTracer.ts @@ -24,7 +24,7 @@ import { SpanOptions } from './SpanOptions'; import { SpanContext } from './span_context'; import { Tracer } from './tracer'; -const context = ContextAPI.getInstance(); +const contextApi = ContextAPI.getInstance(); /** * No-op implementations of {@link Tracer}. @@ -87,11 +87,11 @@ export class NoopTracer implements Tracer { fn = arg4 as F; } - const parentContext = ctx ?? context.active(); + const parentContext = ctx ?? contextApi.active(); const span = this.startSpan(name, opts, parentContext); const contextWithSpanSet = setSpan(parentContext, span); - return context.with(contextWithSpanSet, fn, undefined, span); + return contextApi.with(contextWithSpanSet, fn, undefined, span); } } diff --git a/api/test/api/api.test.ts b/api/test/api/api.test.ts index 4f51462a18..9b5570b763 100644 --- a/api/test/api/api.test.ts +++ b/api/test/api/api.test.ts @@ -56,7 +56,7 @@ describe('API', () => { const span = new NonRecordingSpan(); const ctx = trace.setSpan(ROOT_CONTEXT, span); context.setGlobalContextManager({ active: () => ctx, disable: () => {} } as any); - + const active = trace.getActiveSpan(); assert.strictEqual(active, span); diff --git a/api/test/diag/consoleLogger.test.ts b/api/test/diag/consoleLogger.test.ts index 2210a7c68b..fd57f11836 100644 --- a/api/test/diag/consoleLogger.test.ts +++ b/api/test/diag/consoleLogger.test.ts @@ -27,14 +27,14 @@ export const diagLoggerFunctions = [ 'error', ] as const; -const consoleFuncs: Array = [ +const consoleFuncs = [ 'debug', 'info', 'warn', 'error', 'log', 'trace', -]; +] as const; const expectedConsoleMap: { [n: string]: keyof Console } = { error: 'error', @@ -127,6 +127,7 @@ describe('DiagConsoleLogger', () => { consoleFuncs.forEach(cName => { it(`should log ${fName} message even when console doesn't support ${cName} call before construction`, () => { + // @ts-expect-error removing a console property is not allowed by types console[cName] = undefined; const consoleLogger: any = new DiagConsoleLogger(); consoleLogger[fName](`${fName} called %s`, 'param1'); @@ -142,6 +143,7 @@ describe('DiagConsoleLogger', () => { it(`should log ${fName} message even when console doesn't support ${cName} call after construction`, () => { const consoleLogger: any = new DiagConsoleLogger(); + // @ts-expect-error removing a console property is not allowed by types console[cName] = undefined; consoleLogger[fName](`${fName} called %s`, 'param1'); if (cName !== expectedConsoleMap[fName]) { diff --git a/api/test/index-webpack.ts b/api/test/index-webpack.ts index 061a48ccfa..856be100b2 100644 --- a/api/test/index-webpack.ts +++ b/api/test/index-webpack.ts @@ -13,8 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const testsContext = require.context('.', true, /test$/); -testsContext.keys().forEach(testsContext); +{ + const testsContext = require.context('.', true, /test$/); + testsContext.keys().forEach(testsContext); +} -const srcContext = require.context('.', true, /src$/); -srcContext.keys().forEach(srcContext); +{ + const srcContext = require.context('.', true, /src$/); + srcContext.keys().forEach(srcContext); +} diff --git a/api/test/index-webpack.worker.ts b/api/test/index-webpack.worker.ts new file mode 100644 index 0000000000..d568d570b1 --- /dev/null +++ b/api/test/index-webpack.worker.ts @@ -0,0 +1,19 @@ +/* + * 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 testsContext = require.context('./', true, /test$/); + testsContext.keys().forEach(testsContext); +} diff --git a/api/tsconfig.all.json b/api/tsconfig.all.json new file mode 100644 index 0000000000..4aa747e89f --- /dev/null +++ b/api/tsconfig.all.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.base.json", + "files": [], + "references": [ + { "path": "./tsconfig.json" }, + { "path": "./tsconfig.esm.json" }, + { "path": "./tsconfig.esnext.json" } + ] +} diff --git a/api/tsconfig.esm.json b/api/tsconfig.esm.json new file mode 100644 index 0000000000..50611a86af --- /dev/null +++ b/api/tsconfig.esm.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.base.esm.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build/esm", + "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/api/tsconfig.esnext.json b/api/tsconfig.esnext.json new file mode 100644 index 0000000000..0e3427cbc1 --- /dev/null +++ b/api/tsconfig.esnext.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.base.esnext.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build/esnext", + "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/api/tsconfig.json b/api/tsconfig.json new file mode 100644 index 0000000000..088086278b --- /dev/null +++ b/api/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "references": [ + ] +} diff --git a/experimental/packages/api-logs/tsconfig.json b/experimental/packages/api-logs/tsconfig.json index ed9d0830bd..e22548584a 100644 --- a/experimental/packages/api-logs/tsconfig.json +++ b/experimental/packages/api-logs/tsconfig.json @@ -7,5 +7,10 @@ "include": [ "src/**/*.ts", "test/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + } ] } diff --git a/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json b/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json index 94d47b6e19..abde2bfde9 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/exporter-trace-otlp-http/tsconfig.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.json index 087c804079..bb73fd2a34 100644 --- a/experimental/packages/exporter-trace-otlp-http/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/exporter-trace-otlp-proto/tsconfig.json b/experimental/packages/exporter-trace-otlp-proto/tsconfig.json index 3324a8a529..9b6c50baef 100644 --- a/experimental/packages/exporter-trace-otlp-proto/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-proto/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/opentelemetry-api-metrics/tsconfig.json b/experimental/packages/opentelemetry-api-metrics/tsconfig.json index ed9d0830bd..e22548584a 100644 --- a/experimental/packages/opentelemetry-api-metrics/tsconfig.json +++ b/experimental/packages/opentelemetry-api-metrics/tsconfig.json @@ -7,5 +7,10 @@ "include": [ "src/**/*.ts", "test/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + } ] } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json index b6a4e45748..1be23dd8b2 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json index 132af2033a..1f981132ba 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json index be2921b2fd..63e825da3f 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json b/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json index b9a0327885..138ffc3aad 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json index b228a2080a..9b921df4d9 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json @@ -10,6 +10,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-context-zone" }, diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json index 8b4ba562f1..c21412396f 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-context-async-hooks" }, diff --git a/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json index 034c613b3e..94828c26da 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-context-async-hooks" }, diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json index b228a2080a..9b921df4d9 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json @@ -10,6 +10,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-context-zone" }, diff --git a/experimental/packages/opentelemetry-instrumentation/tsconfig.json b/experimental/packages/opentelemetry-instrumentation/tsconfig.json index 948abef3ce..af53bd1755 100644 --- a/experimental/packages/opentelemetry-instrumentation/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../opentelemetry-api-metrics" } diff --git a/experimental/packages/opentelemetry-sdk-metrics/tsconfig.json b/experimental/packages/opentelemetry-sdk-metrics/tsconfig.json index 53d44a09df..c56be210db 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/tsconfig.json +++ b/experimental/packages/opentelemetry-sdk-metrics/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/opentelemetry-sdk-node/tsconfig.json b/experimental/packages/opentelemetry-sdk-node/tsconfig.json index 8249dd1ce6..3d1db30739 100644 --- a/experimental/packages/opentelemetry-sdk-node/tsconfig.json +++ b/experimental/packages/opentelemetry-sdk-node/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-context-async-hooks" }, diff --git a/experimental/packages/otlp-exporter-base/tsconfig.json b/experimental/packages/otlp-exporter-base/tsconfig.json index 3e284c16fc..fbb799ec14 100644 --- a/experimental/packages/otlp-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-exporter-base/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" } diff --git a/experimental/packages/otlp-grpc-exporter-base/tsconfig.json b/experimental/packages/otlp-grpc-exporter-base/tsconfig.json index 087c804079..bb73fd2a34 100644 --- a/experimental/packages/otlp-grpc-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-grpc-exporter-base/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/otlp-proto-exporter-base/tsconfig.json b/experimental/packages/otlp-proto-exporter-base/tsconfig.json index 3e05eef24c..b0fd3b0b55 100644 --- a/experimental/packages/otlp-proto-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-proto-exporter-base/tsconfig.json @@ -11,6 +11,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/experimental/packages/otlp-transformer/tsconfig.json b/experimental/packages/otlp-transformer/tsconfig.json index a396bcb48f..e06d7404a5 100644 --- a/experimental/packages/otlp-transformer/tsconfig.json +++ b/experimental/packages/otlp-transformer/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../../api" + }, { "path": "../../../packages/opentelemetry-core" }, diff --git a/integration-tests/propagation-validation-server/tsconfig.json b/integration-tests/propagation-validation-server/tsconfig.json index eb74c6b4c6..7b374cea7b 100644 --- a/integration-tests/propagation-validation-server/tsconfig.json +++ b/integration-tests/propagation-validation-server/tsconfig.json @@ -6,6 +6,9 @@ }, "include": [], "references": [ + { + "path": "../../api" + }, { "path": "../../packages/opentelemetry-context-async-hooks" }, diff --git a/lerna.json b/lerna.json index 04c90d0ef0..5c0f76b9c2 100644 --- a/lerna.json +++ b/lerna.json @@ -2,6 +2,7 @@ "version": "independent", "npmClient": "npm", "packages": [ + "api", "packages/*", "experimental/packages/*", "experimental/backwards-compatability/*", diff --git a/packages/opentelemetry-context-async-hooks/tsconfig.json b/packages/opentelemetry-context-async-hooks/tsconfig.json index bdc94d2213..b1ea0838e6 100644 --- a/packages/opentelemetry-context-async-hooks/tsconfig.json +++ b/packages/opentelemetry-context-async-hooks/tsconfig.json @@ -7,5 +7,10 @@ "include": [ "src/**/*.ts", "test/**/*.ts" + ], + "references": [ + { + "path": "../../api" + } ] } diff --git a/packages/opentelemetry-context-zone-peer-dep/tsconfig.json b/packages/opentelemetry-context-zone-peer-dep/tsconfig.json index 479d4bc0d2..da6d2b6486 100644 --- a/packages/opentelemetry-context-zone-peer-dep/tsconfig.json +++ b/packages/opentelemetry-context-zone-peer-dep/tsconfig.json @@ -11,5 +11,10 @@ "include": [ "src/**/*.ts", "test/**/*.ts" + ], + "references": [ + { + "path": "../../api" + } ] } diff --git a/packages/opentelemetry-core/tsconfig.json b/packages/opentelemetry-core/tsconfig.json index 0717beecbf..101baf4195 100644 --- a/packages/opentelemetry-core/tsconfig.json +++ b/packages/opentelemetry-core/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-semantic-conventions" } diff --git a/packages/opentelemetry-exporter-jaeger/tsconfig.json b/packages/opentelemetry-exporter-jaeger/tsconfig.json index 8b45d214a9..ce2661c050 100644 --- a/packages/opentelemetry-exporter-jaeger/tsconfig.json +++ b/packages/opentelemetry-exporter-jaeger/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" }, diff --git a/packages/opentelemetry-exporter-zipkin/tsconfig.json b/packages/opentelemetry-exporter-zipkin/tsconfig.json index 8b45d214a9..ce2661c050 100644 --- a/packages/opentelemetry-exporter-zipkin/tsconfig.json +++ b/packages/opentelemetry-exporter-zipkin/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" }, diff --git a/packages/opentelemetry-propagator-b3/tsconfig.json b/packages/opentelemetry-propagator-b3/tsconfig.json index 789e61fc86..f60209f8c4 100644 --- a/packages/opentelemetry-propagator-b3/tsconfig.json +++ b/packages/opentelemetry-propagator-b3/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" } diff --git a/packages/opentelemetry-propagator-jaeger/tsconfig.json b/packages/opentelemetry-propagator-jaeger/tsconfig.json index a6c0bb2617..a942b2b6aa 100644 --- a/packages/opentelemetry-propagator-jaeger/tsconfig.json +++ b/packages/opentelemetry-propagator-jaeger/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" } diff --git a/packages/opentelemetry-resources/tsconfig.json b/packages/opentelemetry-resources/tsconfig.json index 51dcc3ed88..bbd7dbbe43 100644 --- a/packages/opentelemetry-resources/tsconfig.json +++ b/packages/opentelemetry-resources/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" }, diff --git a/packages/opentelemetry-sdk-trace-base/tsconfig.json b/packages/opentelemetry-sdk-trace-base/tsconfig.json index b16c7037b4..fa14714abd 100644 --- a/packages/opentelemetry-sdk-trace-base/tsconfig.json +++ b/packages/opentelemetry-sdk-trace-base/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" }, diff --git a/packages/opentelemetry-sdk-trace-node/tsconfig.json b/packages/opentelemetry-sdk-trace-node/tsconfig.json index 5894551b3d..837d89d421 100644 --- a/packages/opentelemetry-sdk-trace-node/tsconfig.json +++ b/packages/opentelemetry-sdk-trace-node/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-context-async-hooks" }, diff --git a/packages/opentelemetry-sdk-trace-web/tsconfig.json b/packages/opentelemetry-sdk-trace-web/tsconfig.json index f317cb38d1..09ac19a176 100644 --- a/packages/opentelemetry-sdk-trace-web/tsconfig.json +++ b/packages/opentelemetry-sdk-trace-web/tsconfig.json @@ -10,6 +10,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-context-zone" }, diff --git a/packages/opentelemetry-shim-opentracing/tsconfig.json b/packages/opentelemetry-shim-opentracing/tsconfig.json index a256765295..0e01f63184 100644 --- a/packages/opentelemetry-shim-opentracing/tsconfig.json +++ b/packages/opentelemetry-shim-opentracing/tsconfig.json @@ -9,6 +9,9 @@ "test/**/*.ts" ], "references": [ + { + "path": "../../api" + }, { "path": "../opentelemetry-core" }, diff --git a/tsconfig.json b/tsconfig.json index 9f3cd60df8..10419db907 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "typedocOptions": { "entryPointStrategy": "packages", "entryPoints": [ + "api", "experimental/packages/exporter-trace-otlp-grpc", "experimental/packages/exporter-trace-otlp-http", "experimental/packages/exporter-trace-otlp-proto", @@ -49,6 +50,9 @@ "excludePrivate": true }, "references": [ + { + "path": "api" + }, { "path": "packages/opentelemetry-context-async-hooks" },