From e3da68a62a068041c24de0e73b6ac9b7da5a5c37 Mon Sep 17 00:00:00 2001 From: legendecas Date: Mon, 21 Nov 2022 14:05:33 +0800 Subject: [PATCH 1/3] chore(instrumentation): pin @opentelemetry/sdk-metrics to v1.8.0 --- .../packages/opentelemetry-instrumentation/package.json | 2 +- .../packages/opentelemetry-instrumentation/tsconfig.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index 8dc3dfb9d2..8730074fcf 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -76,7 +76,7 @@ "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/sdk-metrics": "^1.8.0", + "@opentelemetry/sdk-metrics": "1.8.0", "@babel/core": "7.16.0", "@opentelemetry/api": "^1.3.0", "@types/mocha": "10.0.0", diff --git a/experimental/packages/opentelemetry-instrumentation/tsconfig.json b/experimental/packages/opentelemetry-instrumentation/tsconfig.json index e22548584a..a9d9aba52a 100644 --- a/experimental/packages/opentelemetry-instrumentation/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation/tsconfig.json @@ -11,6 +11,9 @@ "references": [ { "path": "../../../api" + }, + { + "path": "../../../packages/sdk-metrics" } ] } From d422d27969f331beb831cbdc510a2ea2c09f83e7 Mon Sep 17 00:00:00 2001 From: legendecas Date: Thu, 27 Oct 2022 11:50:09 +0800 Subject: [PATCH 2/3] chore: automatically generate tsconfigs --- .github/workflows/unit-test.yml | 8 +- CHANGELOG.md | 2 + api/package.json | 6 +- api/tsconfig.all.json | 9 - api/tsconfig.esm.json | 5 +- api/tsconfig.esnext.json | 5 +- api/tsconfig.json | 8 +- experimental/packages/api-logs/package.json | 6 +- .../packages/api-logs/tsconfig.all.json | 9 - .../packages/api-logs/tsconfig.docs.json | 15 - .../packages/api-logs/tsconfig.esm.json | 7 +- .../packages/api-logs/tsconfig.esnext.json | 7 +- experimental/packages/api-logs/tsconfig.json | 5 +- .../exporter-trace-otlp-grpc/package.json | 2 +- .../exporter-trace-otlp-grpc/tsconfig.json | 4 +- .../exporter-trace-otlp-http/package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 22 +- .../tsconfig.esnext.json | 22 +- .../exporter-trace-otlp-http/tsconfig.json | 5 +- .../exporter-trace-otlp-proto/package.json | 2 +- .../exporter-trace-otlp-proto/tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 13 +- .../tsconfig.esnext.json | 13 +- .../tsconfig.json | 5 +- .../tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 22 +- .../tsconfig.esnext.json | 22 +- .../tsconfig.json | 5 +- .../tsconfig.json | 4 +- .../tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 25 +- .../tsconfig.esnext.json | 25 +- .../tsconfig.json | 4 +- .../tsconfig.json | 4 +- .../tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 25 +- .../tsconfig.esnext.json | 25 +- .../tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 10 +- .../tsconfig.esnext.json | 10 +- .../tsconfig.json | 5 +- .../opentelemetry-sdk-node/tsconfig.json | 4 +- .../packages/otlp-exporter-base/package.json | 6 +- .../otlp-exporter-base/tsconfig.all.json | 9 - .../otlp-exporter-base/tsconfig.esm.json | 10 +- .../otlp-exporter-base/tsconfig.esnext.json | 10 +- .../packages/otlp-exporter-base/tsconfig.json | 5 +- .../otlp-grpc-exporter-base/tsconfig.json | 4 +- .../otlp-proto-exporter-base/tsconfig.json | 4 +- .../packages/otlp-transformer/package.json | 6 +- .../otlp-transformer/tsconfig.all.json | 9 - .../otlp-transformer/tsconfig.esm.json | 19 +- .../otlp-transformer/tsconfig.esnext.json | 19 +- .../packages/otlp-transformer/tsconfig.json | 5 +- package.json | 11 +- .../tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 7 +- .../tsconfig.esnext.json | 7 +- .../tsconfig.json | 3 +- .../opentelemetry-context-zone/package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 7 +- .../tsconfig.esnext.json | 7 +- .../opentelemetry-context-zone/tsconfig.json | 3 +- packages/opentelemetry-core/package.json | 6 +- packages/opentelemetry-core/tsconfig.all.json | 9 - packages/opentelemetry-core/tsconfig.esm.json | 7 +- .../opentelemetry-core/tsconfig.esnext.json | 7 +- packages/opentelemetry-core/tsconfig.json | 5 +- .../tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 13 +- .../tsconfig.esnext.json | 13 +- .../tsconfig.json | 5 +- .../opentelemetry-propagator-b3/package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 7 +- .../tsconfig.esnext.json | 7 +- .../opentelemetry-propagator-b3/tsconfig.json | 5 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 7 +- .../tsconfig.esnext.json | 7 +- .../tsconfig.json | 7 +- packages/opentelemetry-resources/package.json | 4 +- .../opentelemetry-resources/tsconfig.all.json | 9 - .../opentelemetry-resources/tsconfig.esm.json | 9 +- .../tsconfig.esnext.json | 9 +- .../opentelemetry-resources/tsconfig.json | 5 +- .../opentelemetry-sdk-trace-base/package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 11 +- .../tsconfig.esnext.json | 11 +- .../tsconfig.json | 5 +- .../tsconfig.json | 4 +- .../opentelemetry-sdk-trace-web/package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 17 +- .../tsconfig.esnext.json | 17 +- .../opentelemetry-sdk-trace-web/tsconfig.json | 4 +- .../package.json | 6 +- .../tsconfig.all.json | 9 - .../tsconfig.esm.json | 5 +- .../tsconfig.esnext.json | 5 +- .../tsconfig.json | 13 +- .../tsconfig.json | 4 +- packages/sdk-metrics/package.json | 6 +- packages/sdk-metrics/tsconfig.all.json | 9 - packages/sdk-metrics/tsconfig.esm.json | 13 +- packages/sdk-metrics/tsconfig.esnext.json | 13 +- packages/sdk-metrics/tsconfig.json | 5 +- packages/template/package.json | 6 +- packages/template/tsconfig.all.json | 9 - packages/template/tsconfig.json | 7 +- scripts/update-ts-configs-constants.js | 68 ++++ scripts/update-ts-configs.js | 307 ++++++++++++++++++ tsconfig.esm.json | 69 ++++ tsconfig.esnext.json | 69 ++++ tsconfig.json | 83 +++-- 133 files changed, 1157 insertions(+), 503 deletions(-) delete mode 100644 api/tsconfig.all.json delete mode 100644 experimental/packages/api-logs/tsconfig.all.json delete mode 100644 experimental/packages/api-logs/tsconfig.docs.json delete mode 100644 experimental/packages/exporter-trace-otlp-http/tsconfig.all.json delete mode 100644 experimental/packages/opentelemetry-browser-detector/tsconfig.all.json delete mode 100644 experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.all.json delete mode 100644 experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.all.json delete mode 100644 experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.all.json delete mode 100644 experimental/packages/opentelemetry-instrumentation/tsconfig.all.json delete mode 100644 experimental/packages/otlp-exporter-base/tsconfig.all.json delete mode 100644 experimental/packages/otlp-transformer/tsconfig.all.json delete mode 100644 packages/opentelemetry-context-zone-peer-dep/tsconfig.all.json delete mode 100644 packages/opentelemetry-context-zone/tsconfig.all.json delete mode 100644 packages/opentelemetry-core/tsconfig.all.json delete mode 100644 packages/opentelemetry-exporter-zipkin/tsconfig.all.json delete mode 100644 packages/opentelemetry-propagator-b3/tsconfig.all.json delete mode 100644 packages/opentelemetry-propagator-jaeger/tsconfig.all.json delete mode 100644 packages/opentelemetry-resources/tsconfig.all.json delete mode 100644 packages/opentelemetry-sdk-trace-base/tsconfig.all.json delete mode 100644 packages/opentelemetry-sdk-trace-web/tsconfig.all.json delete mode 100644 packages/opentelemetry-semantic-conventions/tsconfig.all.json delete mode 100644 packages/sdk-metrics/tsconfig.all.json delete mode 100644 packages/template/tsconfig.all.json create mode 100644 scripts/update-ts-configs-constants.js create mode 100644 scripts/update-ts-configs.js create mode 100644 tsconfig.esm.json create mode 100644 tsconfig.esnext.json diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 618e168e1e..76e3c51505 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -47,7 +47,7 @@ jobs: - name: Build 🔧 run: | - npx lerna run compile + npm run compile - name: Unit tests run: | @@ -94,7 +94,7 @@ jobs: - name: Build 🔧 run: | npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe" - npx lerna run compile + npm run compile - name: Unit tests run: npm run test @@ -130,7 +130,7 @@ jobs: - name: Build 🔧 run: | - npx lerna run compile + npm run compile - name: Unit tests run: npm run test:browser @@ -167,7 +167,7 @@ jobs: - name: Build 🔧 run: | - npx lerna run compile + npm run compile - name: Unit tests run: npm run test:webworker diff --git a/CHANGELOG.md b/CHANGELOG.md index ab76cfe617..6ec5fb321e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :house: (Internal) +* chore: automatically generate tsconfigs [#3432](https://github.com/open-telemetry/opentelemetry-js/pull/3432) @legendecas + ## 1.8.0 * `@opentelemetry/sdk-metrics` has been promoted to stable diff --git a/api/package.json b/api/package.json index 50e3782e80..34607fba00 100644 --- a/api/package.json +++ b/api/package.json @@ -12,12 +12,12 @@ }, "repository": "open-telemetry/opentelemetry-js", "scripts": { - "clean": "tsc --build --clean", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "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", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "docs": "typedoc", "docs:deploy": "gh-pages --dist docs/out", "docs:test": "linkinator docs/out --silent && linkinator docs/*.md *.md --markdown --silent", @@ -29,7 +29,7 @@ "cycle-check": "dpdm --exit-code circular:1 src/index.ts", "version": "node ../scripts/version-update.js", "prewatch": "npm run precompile", - "watch": "tsc --build --watch", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "peer-api-check": "node ../scripts/peer-api-check.js" }, "keywords": [ diff --git a/api/tsconfig.all.json b/api/tsconfig.all.json deleted file mode 100644 index 4aa747e89f..0000000000 --- a/api/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "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 index 50611a86af..0817b3decd 100644 --- a/api/tsconfig.esm.json +++ b/api/tsconfig.esm.json @@ -1,11 +1,12 @@ { "extends": "../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" - ] + ], + "references": [] } diff --git a/api/tsconfig.esnext.json b/api/tsconfig.esnext.json index 0e3427cbc1..54d1d053dc 100644 --- a/api/tsconfig.esnext.json +++ b/api/tsconfig.esnext.json @@ -1,11 +1,12 @@ { "extends": "../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" - ] + ], + "references": [] } diff --git a/api/tsconfig.json b/api/tsconfig.json index 088086278b..9622af53cd 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -1,13 +1,13 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" ], - "references": [ - ] + "references": [] } diff --git a/experimental/packages/api-logs/package.json b/experimental/packages/api-logs/package.json index 952a107fcb..9305131a13 100644 --- a/experimental/packages/api-logs/package.json +++ b/experimental/packages/api-logs/package.json @@ -15,8 +15,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts", "test:browser": "nyc karma start --single-run", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", @@ -25,7 +25,7 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "node ../../../scripts/version-update.js" }, diff --git a/experimental/packages/api-logs/tsconfig.all.json b/experimental/packages/api-logs/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/api-logs/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/api-logs/tsconfig.docs.json b/experimental/packages/api-logs/tsconfig.docs.json deleted file mode 100644 index 18c131e2b9..0000000000 --- a/experimental/packages/api-logs/tsconfig.docs.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "rootDir": ".", - "outDir": "build" - }, - "include": [ - "src/**/*.ts" - ], - "typedocOptions": { - "name": "OpenTelemetry Logs API for JavaScript", - "out": "docs/out", - "mode": "file", - "hideGenerator": true - } -} diff --git a/experimental/packages/api-logs/tsconfig.esm.json b/experimental/packages/api-logs/tsconfig.esm.json index 379f547a46..f0383c0042 100644 --- a/experimental/packages/api-logs/tsconfig.esm.json +++ b/experimental/packages/api-logs/tsconfig.esm.json @@ -1,11 +1,16 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + } ] } diff --git a/experimental/packages/api-logs/tsconfig.esnext.json b/experimental/packages/api-logs/tsconfig.esnext.json index cb78dd6ff3..218899ff2d 100644 --- a/experimental/packages/api-logs/tsconfig.esnext.json +++ b/experimental/packages/api-logs/tsconfig.esnext.json @@ -1,11 +1,16 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + } ] } diff --git a/experimental/packages/api-logs/tsconfig.json b/experimental/packages/api-logs/tsconfig.json index e22548584a..5849e79c03 100644 --- a/experimental/packages/api-logs/tsconfig.json +++ b/experimental/packages/api-logs/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/exporter-trace-otlp-grpc/package.json b/experimental/packages/exporter-trace-otlp-grpc/package.json index 4b7b41c973..76cb6f28f7 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/package.json +++ b/experimental/packages/exporter-trace-otlp-grpc/package.json @@ -14,7 +14,7 @@ "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "version": "node ../../../scripts/version-update.js", - "watch": "tsc -w", + "watch": "tsc --watch --build", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../../scripts/peer-api-check.js", diff --git a/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json b/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json index abde2bfde9..fbba1d1183 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-grpc/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/exporter-trace-otlp-http/package.json b/experimental/packages/exporter-trace-otlp-http/package.json index bd17747f7f..2240afaf4b 100644 --- a/experimental/packages/exporter-trace-otlp-http/package.json +++ b/experimental/packages/exporter-trace-otlp-http/package.json @@ -15,8 +15,8 @@ }, "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", @@ -25,7 +25,7 @@ "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "version": "node ../../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../../scripts/peer-api-check.js", diff --git a/experimental/packages/exporter-trace-otlp-http/tsconfig.all.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/exporter-trace-otlp-http/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json index 379f547a46..8647f6ec56 100644 --- a/experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json @@ -1,11 +1,31 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../otlp-exporter-base" + }, + { + "path": "../otlp-transformer" + } ] } diff --git a/experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json index cb78dd6ff3..b85acc27df 100644 --- a/experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json @@ -1,11 +1,31 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../otlp-exporter-base" + }, + { + "path": "../otlp-transformer" + } ] } diff --git a/experimental/packages/exporter-trace-otlp-http/tsconfig.json b/experimental/packages/exporter-trace-otlp-http/tsconfig.json index bb73fd2a34..6beb818c1a 100644 --- a/experimental/packages/exporter-trace-otlp-http/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-http/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/exporter-trace-otlp-proto/package.json b/experimental/packages/exporter-trace-otlp-proto/package.json index 1a44e0ea66..6205e060ed 100644 --- a/experimental/packages/exporter-trace-otlp-proto/package.json +++ b/experimental/packages/exporter-trace-otlp-proto/package.json @@ -14,7 +14,7 @@ "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "version": "node ../../../scripts/version-update.js", - "watch": "tsc -w", + "watch": "tsc --build --watch", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../../scripts/peer-api-check.js", diff --git a/experimental/packages/exporter-trace-otlp-proto/tsconfig.json b/experimental/packages/exporter-trace-otlp-proto/tsconfig.json index 9b6c50baef..cf9d8d1ec7 100644 --- a/experimental/packages/exporter-trace-otlp-proto/tsconfig.json +++ b/experimental/packages/exporter-trace-otlp-proto/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/opentelemetry-browser-detector/package.json b/experimental/packages/opentelemetry-browser-detector/package.json index 9af38cea26..2ff0c1de20 100644 --- a/experimental/packages/opentelemetry-browser-detector/package.json +++ b/experimental/packages/opentelemetry-browser-detector/package.json @@ -9,8 +9,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", @@ -19,7 +19,7 @@ "tdd:browser": "karma start", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "version": "node ../../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../../scripts/peer-api-check.js" diff --git a/experimental/packages/opentelemetry-browser-detector/tsconfig.all.json b/experimental/packages/opentelemetry-browser-detector/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/opentelemetry-browser-detector/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/opentelemetry-browser-detector/tsconfig.esm.json b/experimental/packages/opentelemetry-browser-detector/tsconfig.esm.json index 379f547a46..28f1109019 100644 --- a/experimental/packages/opentelemetry-browser-detector/tsconfig.esm.json +++ b/experimental/packages/opentelemetry-browser-detector/tsconfig.esm.json @@ -1,11 +1,22 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/opentelemetry-semantic-conventions" + } ] } diff --git a/experimental/packages/opentelemetry-browser-detector/tsconfig.esnext.json b/experimental/packages/opentelemetry-browser-detector/tsconfig.esnext.json index cb78dd6ff3..ae74c831fe 100644 --- a/experimental/packages/opentelemetry-browser-detector/tsconfig.esnext.json +++ b/experimental/packages/opentelemetry-browser-detector/tsconfig.esnext.json @@ -1,11 +1,22 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/opentelemetry-semantic-conventions" + } ] } diff --git a/experimental/packages/opentelemetry-browser-detector/tsconfig.json b/experimental/packages/opentelemetry-browser-detector/tsconfig.json index 6294198a83..3dbac05642 100644 --- a/experimental/packages/opentelemetry-browser-detector/tsconfig.json +++ b/experimental/packages/opentelemetry-browser-detector/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json index 2ba3d74b8b..def89129d9 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index e17aa4f5e9..b715e1b7b3 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -15,8 +15,8 @@ }, "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", @@ -25,7 +25,7 @@ "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "version": "node ../../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../../scripts/peer-api-check.js", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.all.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esm.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esm.json index 379f547a46..8a5b590775 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esm.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esm.json @@ -1,11 +1,31 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/sdk-metrics" + }, + { + "path": "../otlp-exporter-base" + }, + { + "path": "../otlp-transformer" + } ] } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esnext.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esnext.json index cb78dd6ff3..75da611141 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esnext.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esnext.json @@ -1,11 +1,31 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/sdk-metrics" + }, + { + "path": "../otlp-exporter-base" + }, + { + "path": "../otlp-transformer" + } ] } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json index 7ae0cb4939..d6e4653434 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json index 1539111d42..d3497ee2dd 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json b/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json index cd21ec8274..a58f4cd3bd 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index cebc08ada0..68c3222baf 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -9,15 +9,15 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "version": "node ../../../scripts/version-update.js", "tdd": "karma start", "test:browser": "nyc karma start --single-run", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "node ../../../scripts/version-update.js", "peer-api-check": "node ../../../scripts/peer-api-check.js" diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.all.json b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esm.json b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esm.json index 6bbf1dbea5..bdaa95d3ed 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esm.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,7 +10,28 @@ ], "references": [ { - "path": "../opentelemetry-instrumentation/tsconfig.esm.json" + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-context-zone" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-propagator-b3" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-web" + }, + { + "path": "../../../packages/opentelemetry-semantic-conventions" + }, + { + "path": "../opentelemetry-instrumentation" } ] } diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esnext.json b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esnext.json index 1289248d95..825401c45e 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esnext.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,7 +10,28 @@ ], "references": [ { - "path": "../opentelemetry-instrumentation/tsconfig.esnext.json" + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-context-zone" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-propagator-b3" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-web" + }, + { + "path": "../../../packages/opentelemetry-semantic-conventions" + }, + { + "path": "../opentelemetry-instrumentation" } ] } diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json index 9b921df4d9..d531cbbb41 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "build", - "skipLibCheck": true + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json index 0170a84c3c..8f10d906d1 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json index ca127b85dc..7b14448a30 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-http/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index 1f1b480ecc..bd5990fad4 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -9,15 +9,15 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "version": "node ../../../scripts/version-update.js", "tdd": "karma start", "test:browser": "nyc karma start --single-run", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "node ../../../scripts/version-update.js", "peer-api-check": "node ../../../scripts/peer-api-check.js" diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.all.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esm.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esm.json index 6bbf1dbea5..bdaa95d3ed 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esm.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,7 +10,28 @@ ], "references": [ { - "path": "../opentelemetry-instrumentation/tsconfig.esm.json" + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-context-zone" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-propagator-b3" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-web" + }, + { + "path": "../../../packages/opentelemetry-semantic-conventions" + }, + { + "path": "../opentelemetry-instrumentation" } ] } diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esnext.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esnext.json index 1289248d95..825401c45e 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esnext.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,7 +10,28 @@ ], "references": [ { - "path": "../opentelemetry-instrumentation/tsconfig.esnext.json" + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-context-zone" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-propagator-b3" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-web" + }, + { + "path": "../../../packages/opentelemetry-semantic-conventions" + }, + { + "path": "../opentelemetry-instrumentation" } ] } diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json index 9b921df4d9..d531cbbb41 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "build", - "skipLibCheck": true + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index 8730074fcf..44bf0467b6 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -38,8 +38,8 @@ ], "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "lint": "eslint . --ext .ts", @@ -50,7 +50,7 @@ "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "version": "node ../../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "node ../../../scripts/version-update.js", "peer-api-check": "node ../../../scripts/peer-api-check.js" diff --git a/experimental/packages/opentelemetry-instrumentation/tsconfig.all.json b/experimental/packages/opentelemetry-instrumentation/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/opentelemetry-instrumentation/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/opentelemetry-instrumentation/tsconfig.esm.json b/experimental/packages/opentelemetry-instrumentation/tsconfig.esm.json index 379f547a46..a673b46483 100644 --- a/experimental/packages/opentelemetry-instrumentation/tsconfig.esm.json +++ b/experimental/packages/opentelemetry-instrumentation/tsconfig.esm.json @@ -1,11 +1,19 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/sdk-metrics" + } ] } diff --git a/experimental/packages/opentelemetry-instrumentation/tsconfig.esnext.json b/experimental/packages/opentelemetry-instrumentation/tsconfig.esnext.json index cb78dd6ff3..f70e767a6e 100644 --- a/experimental/packages/opentelemetry-instrumentation/tsconfig.esnext.json +++ b/experimental/packages/opentelemetry-instrumentation/tsconfig.esnext.json @@ -1,11 +1,19 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/sdk-metrics" + } ] } diff --git a/experimental/packages/opentelemetry-instrumentation/tsconfig.json b/experimental/packages/opentelemetry-instrumentation/tsconfig.json index a9d9aba52a..668bce7426 100644 --- a/experimental/packages/opentelemetry-instrumentation/tsconfig.json +++ b/experimental/packages/opentelemetry-instrumentation/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/opentelemetry-sdk-node/tsconfig.json b/experimental/packages/opentelemetry-sdk-node/tsconfig.json index 3b5a3efd79..add730f8bc 100644 --- a/experimental/packages/opentelemetry-sdk-node/tsconfig.json +++ b/experimental/packages/opentelemetry-sdk-node/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/otlp-exporter-base/package.json b/experimental/packages/otlp-exporter-base/package.json index 712a269d62..1590864270 100644 --- a/experimental/packages/otlp-exporter-base/package.json +++ b/experimental/packages/otlp-exporter-base/package.json @@ -15,8 +15,8 @@ }, "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", "lint": "eslint . --ext .ts", @@ -26,7 +26,7 @@ "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "version": "node ../../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile" }, diff --git a/experimental/packages/otlp-exporter-base/tsconfig.all.json b/experimental/packages/otlp-exporter-base/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/otlp-exporter-base/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/otlp-exporter-base/tsconfig.esm.json b/experimental/packages/otlp-exporter-base/tsconfig.esm.json index 379f547a46..ae47403334 100644 --- a/experimental/packages/otlp-exporter-base/tsconfig.esm.json +++ b/experimental/packages/otlp-exporter-base/tsconfig.esm.json @@ -1,11 +1,19 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + } ] } diff --git a/experimental/packages/otlp-exporter-base/tsconfig.esnext.json b/experimental/packages/otlp-exporter-base/tsconfig.esnext.json index cb78dd6ff3..5f6cf572d5 100644 --- a/experimental/packages/otlp-exporter-base/tsconfig.esnext.json +++ b/experimental/packages/otlp-exporter-base/tsconfig.esnext.json @@ -1,11 +1,19 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + } ] } diff --git a/experimental/packages/otlp-exporter-base/tsconfig.json b/experimental/packages/otlp-exporter-base/tsconfig.json index fbb799ec14..6feabd6465 100644 --- a/experimental/packages/otlp-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-exporter-base/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/experimental/packages/otlp-grpc-exporter-base/tsconfig.json b/experimental/packages/otlp-grpc-exporter-base/tsconfig.json index bb73fd2a34..417e1ad468 100644 --- a/experimental/packages/otlp-grpc-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-grpc-exporter-base/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/otlp-proto-exporter-base/tsconfig.json b/experimental/packages/otlp-proto-exporter-base/tsconfig.json index b0fd3b0b55..442b34dd38 100644 --- a/experimental/packages/otlp-proto-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-proto-exporter-base/tsconfig.json @@ -2,8 +2,8 @@ "extends": "../../../tsconfig.base.json", "compilerOptions": { "allowJs": true, - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index 4d0f59f88e..6d66cef933 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -13,14 +13,14 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test:browser": "nyc karma start --single-run", - "watch": "tsc --build -w tsconfig.all.json", + "watch": "tsc --build -w tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "peer-api-check": "node ../../../scripts/peer-api-check.js", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../" }, diff --git a/experimental/packages/otlp-transformer/tsconfig.all.json b/experimental/packages/otlp-transformer/tsconfig.all.json deleted file mode 100644 index 06c5491334..0000000000 --- a/experimental/packages/otlp-transformer/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/experimental/packages/otlp-transformer/tsconfig.esm.json b/experimental/packages/otlp-transformer/tsconfig.esm.json index 379f547a46..ec36d4d115 100644 --- a/experimental/packages/otlp-transformer/tsconfig.esm.json +++ b/experimental/packages/otlp-transformer/tsconfig.esm.json @@ -1,11 +1,28 @@ { "extends": "../../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../../../packages/sdk-metrics" + } ] } diff --git a/experimental/packages/otlp-transformer/tsconfig.esnext.json b/experimental/packages/otlp-transformer/tsconfig.esnext.json index cb78dd6ff3..5c344c8861 100644 --- a/experimental/packages/otlp-transformer/tsconfig.esnext.json +++ b/experimental/packages/otlp-transformer/tsconfig.esnext.json @@ -1,11 +1,28 @@ { "extends": "../../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../../api" + }, + { + "path": "../../../packages/opentelemetry-core" + }, + { + "path": "../../../packages/opentelemetry-resources" + }, + { + "path": "../../../packages/opentelemetry-sdk-trace-base" + }, + { + "path": "../../../packages/sdk-metrics" + } ] } diff --git a/experimental/packages/otlp-transformer/tsconfig.json b/experimental/packages/otlp-transformer/tsconfig.json index cbcb2b9bc6..88d7f2d5ab 100644 --- a/experimental/packages/otlp-transformer/tsconfig.json +++ b/experimental/packages/otlp-transformer/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/package.json b/package.json index 716db784bb..74823ed6af 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "OpenTelemetry is a distributed tracing and stats collection framework.", "scripts": { "precompile": "lerna run version", - "compile": "lerna run protos && tsc --build", + "compile": "lerna run protos && tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prewatch": "npm run precompile", - "watch": "tsc --build --watch", - "clean": "tsc --build --clean", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "postinstall": "npm run update-ts-references && npm run bootstrap", "postcompile": "npm run submodule && npm run protos:copy", "submodule": "git submodule sync --recursive && git submodule update --init --recursive", @@ -35,7 +35,7 @@ "lint:markdown": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md", "lint:markdown:fix": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md --fix", "reset": "lerna clean -y && rm -rf node_modules && npm i && npm run compile && npm run lint:fix", - "update-ts-references": "update-ts-references" + "update-ts-configs": "node scripts/update-ts-configs.js" }, "repository": "open-telemetry/opentelemetry-js", "keywords": [ @@ -60,8 +60,7 @@ "markdownlint-cli": "0.32.2", "semver": "7.3.5", "typedoc": "0.22.10", - "typescript": "4.4.4", - "update-ts-references": "2.4.1" + "typescript": "4.4.4" }, "changelog": { "repo": "open-telemetry/opentelemetry-js", diff --git a/packages/opentelemetry-context-async-hooks/tsconfig.json b/packages/opentelemetry-context-async-hooks/tsconfig.json index b1ea0838e6..7e466ec926 100644 --- a/packages/opentelemetry-context-async-hooks/tsconfig.json +++ b/packages/opentelemetry-context-async-hooks/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/packages/opentelemetry-context-zone-peer-dep/package.json b/packages/opentelemetry-context-zone-peer-dep/package.json index 153d158d37..9da1990fe6 100644 --- a/packages/opentelemetry-context-zone-peer-dep/package.json +++ b/packages/opentelemetry-context-zone-peer-dep/package.json @@ -9,15 +9,15 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "version": "node ../../scripts/version-update.js", "tdd": "karma start", "test:browser": "nyc karma start --single-run", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-context-zone-peer-dep/tsconfig.all.json b/packages/opentelemetry-context-zone-peer-dep/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-context-zone-peer-dep/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-context-zone-peer-dep/tsconfig.esm.json b/packages/opentelemetry-context-zone-peer-dep/tsconfig.esm.json index b3530914ff..971caf60aa 100644 --- a/packages/opentelemetry-context-zone-peer-dep/tsconfig.esm.json +++ b/packages/opentelemetry-context-zone-peer-dep/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "files": [ @@ -10,5 +10,10 @@ ], "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../api" + } ] } diff --git a/packages/opentelemetry-context-zone-peer-dep/tsconfig.esnext.json b/packages/opentelemetry-context-zone-peer-dep/tsconfig.esnext.json index a16a4467ad..ff768ce18a 100644 --- a/packages/opentelemetry-context-zone-peer-dep/tsconfig.esnext.json +++ b/packages/opentelemetry-context-zone-peer-dep/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "files": [ @@ -10,5 +10,10 @@ ], "include": [ "src/**/*.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 da6d2b6486..a4adfa3f7f 100644 --- a/packages/opentelemetry-context-zone-peer-dep/tsconfig.json +++ b/packages/opentelemetry-context-zone-peer-dep/tsconfig.json @@ -1,9 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "build", - "skipLibCheck": true + "rootDir": "." }, "files": [ "node_modules/zone.js/dist/zone.js.d.ts" diff --git a/packages/opentelemetry-context-zone/package.json b/packages/opentelemetry-context-zone/package.json index 14f36b16fb..b7a8a0f0d8 100644 --- a/packages/opentelemetry-context-zone/package.json +++ b/packages/opentelemetry-context-zone/package.json @@ -9,12 +9,12 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-context-zone/tsconfig.all.json b/packages/opentelemetry-context-zone/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-context-zone/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-context-zone/tsconfig.esm.json b/packages/opentelemetry-context-zone/tsconfig.esm.json index ffc5a7aac2..01f05a6dc9 100644 --- a/packages/opentelemetry-context-zone/tsconfig.esm.json +++ b/packages/opentelemetry-context-zone/tsconfig.esm.json @@ -1,16 +1,19 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, + "files": [ + "node_modules/zone.js/dist/zone.js.d.ts" + ], "include": [ "src/**/*.ts" ], "references": [ { - "path": "../opentelemetry-context-zone-peer-dep/tsconfig.esm.json" + "path": "../opentelemetry-context-zone-peer-dep" } ] } diff --git a/packages/opentelemetry-context-zone/tsconfig.esnext.json b/packages/opentelemetry-context-zone/tsconfig.esnext.json index 65674b8c67..0f34342c63 100644 --- a/packages/opentelemetry-context-zone/tsconfig.esnext.json +++ b/packages/opentelemetry-context-zone/tsconfig.esnext.json @@ -1,16 +1,19 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, + "files": [ + "node_modules/zone.js/dist/zone.js.d.ts" + ], "include": [ "src/**/*.ts" ], "references": [ { - "path": "../opentelemetry-context-zone-peer-dep/tsconfig.esnext.json" + "path": "../opentelemetry-context-zone-peer-dep" } ] } diff --git a/packages/opentelemetry-context-zone/tsconfig.json b/packages/opentelemetry-context-zone/tsconfig.json index e714c6958f..0a1a4e353f 100644 --- a/packages/opentelemetry-context-zone/tsconfig.json +++ b/packages/opentelemetry-context-zone/tsconfig.json @@ -1,9 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "build", - "skipLibCheck": true + "rootDir": "." }, "files": [ "node_modules/zone.js/dist/zone.js.d.ts" diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index 7fa8b1d418..c2caf81b75 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -15,8 +15,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts --exclude 'test/platform/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "tdd": "npm run tdd:node", @@ -27,7 +27,7 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-core/tsconfig.all.json b/packages/opentelemetry-core/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-core/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-core/tsconfig.esm.json b/packages/opentelemetry-core/tsconfig.esm.json index 0b6bbbb13d..fdabf4b57f 100644 --- a/packages/opentelemetry-core/tsconfig.esm.json +++ b/packages/opentelemetry-core/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,7 +10,10 @@ ], "references": [ { - "path": "../opentelemetry-semantic-conventions/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-core/tsconfig.esnext.json b/packages/opentelemetry-core/tsconfig.esnext.json index 3931d37fb6..3d3cb45fd0 100644 --- a/packages/opentelemetry-core/tsconfig.esnext.json +++ b/packages/opentelemetry-core/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,7 +10,10 @@ ], "references": [ { - "path": "../opentelemetry-semantic-conventions/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-core/tsconfig.json b/packages/opentelemetry-core/tsconfig.json index 101baf4195..9c47daec70 100644 --- a/packages/opentelemetry-core/tsconfig.json +++ b/packages/opentelemetry-core/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-exporter-jaeger/tsconfig.json b/packages/opentelemetry-exporter-jaeger/tsconfig.json index ce2661c050..a23aa22bd2 100644 --- a/packages/opentelemetry-exporter-jaeger/tsconfig.json +++ b/packages/opentelemetry-exporter-jaeger/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 7d56b47a1b..976c5c4de9 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -15,8 +15,8 @@ }, "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "lint": "eslint . --ext .ts", @@ -25,7 +25,7 @@ "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-exporter-zipkin/tsconfig.all.json b/packages/opentelemetry-exporter-zipkin/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-exporter-zipkin/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-exporter-zipkin/tsconfig.esm.json b/packages/opentelemetry-exporter-zipkin/tsconfig.esm.json index 812ff19a36..56cf35eea0 100644 --- a/packages/opentelemetry-exporter-zipkin/tsconfig.esm.json +++ b/packages/opentelemetry-exporter-zipkin/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,16 +10,19 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-resources/tsconfig.esm.json" + "path": "../opentelemetry-resources" }, { - "path": "../opentelemetry-sdk-trace-base/tsconfig.esm.json" + "path": "../opentelemetry-sdk-trace-base" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esm.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-exporter-zipkin/tsconfig.esnext.json b/packages/opentelemetry-exporter-zipkin/tsconfig.esnext.json index a8750d0b62..5d9a60ea20 100644 --- a/packages/opentelemetry-exporter-zipkin/tsconfig.esnext.json +++ b/packages/opentelemetry-exporter-zipkin/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,16 +10,19 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-resources/tsconfig.esnext.json" + "path": "../opentelemetry-resources" }, { - "path": "../opentelemetry-sdk-trace-base/tsconfig.esnext.json" + "path": "../opentelemetry-sdk-trace-base" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esnext.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-exporter-zipkin/tsconfig.json b/packages/opentelemetry-exporter-zipkin/tsconfig.json index ce2661c050..c8b602f0e0 100644 --- a/packages/opentelemetry-exporter-zipkin/tsconfig.json +++ b/packages/opentelemetry-exporter-zipkin/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-propagator-b3/package.json b/packages/opentelemetry-propagator-b3/package.json index dd2ab2756e..828d33901a 100644 --- a/packages/opentelemetry-propagator-b3/package.json +++ b/packages/opentelemetry-propagator-b3/package.json @@ -9,14 +9,14 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-propagator-b3/tsconfig.all.json b/packages/opentelemetry-propagator-b3/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-propagator-b3/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-propagator-b3/tsconfig.esm.json b/packages/opentelemetry-propagator-b3/tsconfig.esm.json index c809d9c9aa..76f5aed507 100644 --- a/packages/opentelemetry-propagator-b3/tsconfig.esm.json +++ b/packages/opentelemetry-propagator-b3/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,7 +10,10 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" } ] } diff --git a/packages/opentelemetry-propagator-b3/tsconfig.esnext.json b/packages/opentelemetry-propagator-b3/tsconfig.esnext.json index 14b360b653..4b926c1c87 100644 --- a/packages/opentelemetry-propagator-b3/tsconfig.esnext.json +++ b/packages/opentelemetry-propagator-b3/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,7 +10,10 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" } ] } diff --git a/packages/opentelemetry-propagator-b3/tsconfig.json b/packages/opentelemetry-propagator-b3/tsconfig.json index f60209f8c4..d01ca872ee 100644 --- a/packages/opentelemetry-propagator-b3/tsconfig.json +++ b/packages/opentelemetry-propagator-b3/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index e44d3c77f7..34f98c0f80 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -8,18 +8,18 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/index-webpack.ts'", "test:browser": "nyc karma start --single-run", "tdd": "npm run tdd:node", "tdd:node": "npm run test -- --watch-extensions ts --watch", "tdd:browser": "karma start", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", - "clean": "tsc --build --clean tsconfig.all.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-propagator-jaeger/tsconfig.all.json b/packages/opentelemetry-propagator-jaeger/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-propagator-jaeger/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-propagator-jaeger/tsconfig.esm.json b/packages/opentelemetry-propagator-jaeger/tsconfig.esm.json index c809d9c9aa..76f5aed507 100644 --- a/packages/opentelemetry-propagator-jaeger/tsconfig.esm.json +++ b/packages/opentelemetry-propagator-jaeger/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,7 +10,10 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" } ] } diff --git a/packages/opentelemetry-propagator-jaeger/tsconfig.esnext.json b/packages/opentelemetry-propagator-jaeger/tsconfig.esnext.json index 14b360b653..4b926c1c87 100644 --- a/packages/opentelemetry-propagator-jaeger/tsconfig.esnext.json +++ b/packages/opentelemetry-propagator-jaeger/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,7 +10,10 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" } ] } diff --git a/packages/opentelemetry-propagator-jaeger/tsconfig.json b/packages/opentelemetry-propagator-jaeger/tsconfig.json index a942b2b6aa..d01ca872ee 100644 --- a/packages/opentelemetry-propagator-jaeger/tsconfig.json +++ b/packages/opentelemetry-propagator-jaeger/tsconfig.json @@ -1,9 +1,10 @@ { - "extends": "../../tsconfig.base", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index a65084826c..0ac8f7343b 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -15,8 +15,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "codecov:webworker": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "lint": "eslint . --ext .ts", diff --git a/packages/opentelemetry-resources/tsconfig.all.json b/packages/opentelemetry-resources/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-resources/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-resources/tsconfig.esm.json b/packages/opentelemetry-resources/tsconfig.esm.json index aa276f4b43..dc247ea71d 100644 --- a/packages/opentelemetry-resources/tsconfig.esm.json +++ b/packages/opentelemetry-resources/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,10 +10,13 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esm.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-resources/tsconfig.esnext.json b/packages/opentelemetry-resources/tsconfig.esnext.json index 458395ca17..df87d6341a 100644 --- a/packages/opentelemetry-resources/tsconfig.esnext.json +++ b/packages/opentelemetry-resources/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,10 +10,13 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esnext.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-resources/tsconfig.json b/packages/opentelemetry-resources/tsconfig.json index bbd7dbbe43..873053f076 100644 --- a/packages/opentelemetry-resources/tsconfig.json +++ b/packages/opentelemetry-resources/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index 4d8d98cf3d..3c4c54896f 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -15,8 +15,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'", "test:browser": "nyc karma start --single-run", "test:webworker": "nyc karma start karma.worker.js --single-run", @@ -28,7 +28,7 @@ "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "codecov:webworker": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-sdk-trace-base/tsconfig.all.json b/packages/opentelemetry-sdk-trace-base/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-sdk-trace-base/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-sdk-trace-base/tsconfig.esm.json b/packages/opentelemetry-sdk-trace-base/tsconfig.esm.json index 5f0156d661..8c54819c4f 100644 --- a/packages/opentelemetry-sdk-trace-base/tsconfig.esm.json +++ b/packages/opentelemetry-sdk-trace-base/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,13 +10,16 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-resources/tsconfig.esm.json" + "path": "../opentelemetry-resources" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esm.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-sdk-trace-base/tsconfig.esnext.json b/packages/opentelemetry-sdk-trace-base/tsconfig.esnext.json index 09baee3e80..5ec46d3156 100644 --- a/packages/opentelemetry-sdk-trace-base/tsconfig.esnext.json +++ b/packages/opentelemetry-sdk-trace-base/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,13 +10,16 @@ ], "references": [ { - "path": "../opentelemetry-core/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-resources/tsconfig.esnext.json" + "path": "../opentelemetry-resources" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esnext.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-sdk-trace-base/tsconfig.json b/packages/opentelemetry-sdk-trace-base/tsconfig.json index fa14714abd..2d87ab62f9 100644 --- a/packages/opentelemetry-sdk-trace-base/tsconfig.json +++ b/packages/opentelemetry-sdk-trace-base/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-sdk-trace-node/tsconfig.json b/packages/opentelemetry-sdk-trace-node/tsconfig.json index 837d89d421..31559ba9b3 100644 --- a/packages/opentelemetry-sdk-trace-node/tsconfig.json +++ b/packages/opentelemetry-sdk-trace-node/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index 70f3c21256..2540dbff1b 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -9,8 +9,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", @@ -19,7 +19,7 @@ "tdd": "karma start", "test:browser": "nyc karma start --single-run", "test:webworker": "nyc karma start karma.worker.js --single-run", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-sdk-trace-web/tsconfig.all.json b/packages/opentelemetry-sdk-trace-web/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-sdk-trace-web/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-sdk-trace-web/tsconfig.esm.json b/packages/opentelemetry-sdk-trace-web/tsconfig.esm.json index 57e4813bbd..b4393361b5 100644 --- a/packages/opentelemetry-sdk-trace-web/tsconfig.esm.json +++ b/packages/opentelemetry-sdk-trace-web/tsconfig.esm.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ @@ -10,22 +10,25 @@ ], "references": [ { - "path": "../opentelemetry-context-zone/tsconfig.esm.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-context-zone" }, { - "path": "../opentelemetry-core/tsconfig.esm.json" + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-propagator-b3/tsconfig.esm.json" + "path": "../opentelemetry-propagator-b3" }, { - "path": "../opentelemetry-resources/tsconfig.esm.json" + "path": "../opentelemetry-resources" }, { - "path": "../opentelemetry-sdk-trace-base/tsconfig.esm.json" + "path": "../opentelemetry-sdk-trace-base" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esm.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-sdk-trace-web/tsconfig.esnext.json b/packages/opentelemetry-sdk-trace-web/tsconfig.esnext.json index 0dd807e866..db7a907a82 100644 --- a/packages/opentelemetry-sdk-trace-web/tsconfig.esnext.json +++ b/packages/opentelemetry-sdk-trace-web/tsconfig.esnext.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ @@ -10,22 +10,25 @@ ], "references": [ { - "path": "../opentelemetry-context-zone/tsconfig.esnext.json" + "path": "../../api" + }, + { + "path": "../opentelemetry-context-zone" }, { - "path": "../opentelemetry-core/tsconfig.esnext.json" + "path": "../opentelemetry-core" }, { - "path": "../opentelemetry-propagator-b3/tsconfig.esnext.json" + "path": "../opentelemetry-propagator-b3" }, { - "path": "../opentelemetry-resources/tsconfig.esnext.json" + "path": "../opentelemetry-resources" }, { - "path": "../opentelemetry-sdk-trace-base/tsconfig.esnext.json" + "path": "../opentelemetry-sdk-trace-base" }, { - "path": "../opentelemetry-semantic-conventions/tsconfig.esnext.json" + "path": "../opentelemetry-semantic-conventions" } ] } diff --git a/packages/opentelemetry-sdk-trace-web/tsconfig.json b/packages/opentelemetry-sdk-trace-web/tsconfig.json index 09ac19a176..1219036168 100644 --- a/packages/opentelemetry-sdk-trace-web/tsconfig.json +++ b/packages/opentelemetry-sdk-trace-web/tsconfig.json @@ -1,10 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", "outDir": "build", - "skipLibCheck": true + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/opentelemetry-semantic-conventions/package.json b/packages/opentelemetry-semantic-conventions/package.json index a801f2b02e..6ff0d6db56 100644 --- a/packages/opentelemetry-semantic-conventions/package.json +++ b/packages/opentelemetry-semantic-conventions/package.json @@ -9,12 +9,12 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "npm run precompile", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/opentelemetry-semantic-conventions/tsconfig.all.json b/packages/opentelemetry-semantic-conventions/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/opentelemetry-semantic-conventions/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/opentelemetry-semantic-conventions/tsconfig.esm.json b/packages/opentelemetry-semantic-conventions/tsconfig.esm.json index a94adff6aa..c43ba03ff0 100644 --- a/packages/opentelemetry-semantic-conventions/tsconfig.esm.json +++ b/packages/opentelemetry-semantic-conventions/tsconfig.esm.json @@ -1,11 +1,12 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" - ] + ], + "references": [] } diff --git a/packages/opentelemetry-semantic-conventions/tsconfig.esnext.json b/packages/opentelemetry-semantic-conventions/tsconfig.esnext.json index 65a918cf6b..6eaaaf7d04 100644 --- a/packages/opentelemetry-semantic-conventions/tsconfig.esnext.json +++ b/packages/opentelemetry-semantic-conventions/tsconfig.esnext.json @@ -1,11 +1,12 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" - ] + ], + "references": [] } diff --git a/packages/opentelemetry-semantic-conventions/tsconfig.json b/packages/opentelemetry-semantic-conventions/tsconfig.json index a388bb16f9..d6e4e25caf 100644 --- a/packages/opentelemetry-semantic-conventions/tsconfig.json +++ b/packages/opentelemetry-semantic-conventions/tsconfig.json @@ -1,8 +1,13 @@ { - "extends": "../../tsconfig.es5.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, - "include": ["src/**/*.ts", "test/**/*.ts"] + "files": [], + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "references": [] } diff --git a/packages/opentelemetry-shim-opentracing/tsconfig.json b/packages/opentelemetry-shim-opentracing/tsconfig.json index 0e01f63184..7b5f7d3671 100644 --- a/packages/opentelemetry-shim-opentracing/tsconfig.json +++ b/packages/opentelemetry-shim-opentracing/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", diff --git a/packages/sdk-metrics/package.json b/packages/sdk-metrics/package.json index f799b62b78..c50aec2bd1 100644 --- a/packages/sdk-metrics/package.json +++ b/packages/sdk-metrics/package.json @@ -9,8 +9,8 @@ "repository": "open-telemetry/opentelemetry-js", "scripts": { "prepublishOnly": "npm run compile", - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test:browser": "nyc karma start --single-run", "tdd": "npm run test -- --watch-extensions ts --watch", @@ -19,7 +19,7 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "version": "node ../../scripts/version-update.js", - "watch": "tsc --build --watch tsconfig.all.json", + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", "prewatch": "node ../../scripts/version-update.js", "peer-api-check": "node ../../scripts/peer-api-check.js" diff --git a/packages/sdk-metrics/tsconfig.all.json b/packages/sdk-metrics/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/sdk-metrics/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/sdk-metrics/tsconfig.esm.json b/packages/sdk-metrics/tsconfig.esm.json index a94adff6aa..013c8cd68a 100644 --- a/packages/sdk-metrics/tsconfig.esm.json +++ b/packages/sdk-metrics/tsconfig.esm.json @@ -1,11 +1,22 @@ { "extends": "../../tsconfig.base.esm.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esm", + "rootDir": "src", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../api" + }, + { + "path": "../opentelemetry-core" + }, + { + "path": "../opentelemetry-resources" + } ] } diff --git a/packages/sdk-metrics/tsconfig.esnext.json b/packages/sdk-metrics/tsconfig.esnext.json index 65a918cf6b..98ffec480b 100644 --- a/packages/sdk-metrics/tsconfig.esnext.json +++ b/packages/sdk-metrics/tsconfig.esnext.json @@ -1,11 +1,22 @@ { "extends": "../../tsconfig.base.esnext.json", "compilerOptions": { - "rootDir": "src", "outDir": "build/esnext", + "rootDir": "src", "tsBuildInfoFile": "build/esnext/tsconfig.esnext.tsbuildinfo" }, "include": [ "src/**/*.ts" + ], + "references": [ + { + "path": "../../api" + }, + { + "path": "../opentelemetry-core" + }, + { + "path": "../opentelemetry-resources" + } ] } diff --git a/packages/sdk-metrics/tsconfig.json b/packages/sdk-metrics/tsconfig.json index 9b42c9bb79..aea59db329 100644 --- a/packages/sdk-metrics/tsconfig.json +++ b/packages/sdk-metrics/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, + "files": [], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/packages/template/package.json b/packages/template/package.json index 6342f2876c..7aa85930c6 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -45,11 +45,11 @@ "watch": "tsc --build --watch" }, "Add/change these to scripts if browser is supported": { - "compile": "tsc --build tsconfig.all.json", - "clean": "tsc --build --clean tsconfig.all.json", + "compile": "tsc --build tsconfig.json", + "clean": "tsc --build --clean tsconfig.json", "test:browser": "nyc karma start --single-run", "codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../", - "watch": "tsc --build --watch tsconfig.all.json" + "watch": "tsc --build --watch tsconfig.json" }, "keywords": [ "opentelemetry", diff --git a/packages/template/tsconfig.all.json b/packages/template/tsconfig.all.json deleted file mode 100644 index 4d28a993d3..0000000000 --- a/packages/template/tsconfig.all.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "files": [], - "references": [ - { "path": "./tsconfig.json" }, - { "path": "./tsconfig.esm.json" }, - { "path": "./tsconfig.esnext.json" } - ] -} diff --git a/packages/template/tsconfig.json b/packages/template/tsconfig.json index 4ffdbb48ce..e94f4a6357 100644 --- a/packages/template/tsconfig.json +++ b/packages/template/tsconfig.json @@ -1,13 +1,12 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": ".", - "outDir": "build" + "outDir": "build", + "rootDir": "." }, "include": [ "src/**/*.ts", "test/**/*.ts" ], - "references": [ - ] + "references": [] } diff --git a/scripts/update-ts-configs-constants.js b/scripts/update-ts-configs-constants.js new file mode 100644 index 0000000000..591d3d36b4 --- /dev/null +++ b/scripts/update-ts-configs-constants.js @@ -0,0 +1,68 @@ +/* + * 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 path = require('path'); + +function getDefaultTsConfig(pkgRoot, projectRoot) { + return { + extends: path.relative(pkgRoot, path.join(projectRoot, 'tsconfig.base.json')), + compilerOptions: { + rootDir: '.', + outDir: 'build', + }, + include: [ + "src/**/*.ts", + "test/**/*.ts", + ], + references: [], + }; +} + +function getEsmTsConfig(pkgRoot, projectRoot) { + return { + extends: path.relative(pkgRoot, path.join(projectRoot, 'tsconfig.base.esm.json')), + compilerOptions: { + rootDir: 'src', + outDir: 'build/esm', + tsBuildInfoFile: 'build/esm/tsconfig.esm.tsbuildinfo', + }, + include: [ + 'src/**/*.ts', + ], + references: [], + }; +} + +function getEsnextTsConfig(pkgRoot, projectRoot) { + return { + extends: path.relative(pkgRoot, path.join(projectRoot, 'tsconfig.base.esnext.json')), + compilerOptions: { + rootDir: 'src', + outDir: 'build/esnext', + tsBuildInfoFile: 'build/esnext/tsconfig.esnext.tsbuildinfo', + }, + include: [ + 'src/**/*.ts', + ], + references: [], + }; +} + +module.exports = { + getDefaultTsConfig, + getEsmTsConfig, + getEsnextTsConfig, +}; diff --git a/scripts/update-ts-configs.js b/scripts/update-ts-configs.js new file mode 100644 index 0000000000..ef56285359 --- /dev/null +++ b/scripts/update-ts-configs.js @@ -0,0 +1,307 @@ +/* + * 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. + */ + +/** + * This script generates per-package tsconfig.*.json from the definition in + * package/package.json. + * + * Specifically, + * 1. If the package.json has fields `main`, `module` and `esnext`, targets + * like ESM and ESNEXT tsconfig.json are generated. Otherwise only one + * default CJS target is generated. + * 2. References in tsconfig.json are generated from the package.json fields + * `dependencies`, `devDependencies` and `peerDependencies`. + */ + +const fs = require('fs'); +const path = require('path'); +const { + getDefaultTsConfig, + getEsmTsConfig, + getEsnextTsConfig, +} = require('./update-ts-config-constants'); + +const packageJsonDependencyFields = ['dependencies', 'peerDependencies', 'devDependencies']; +const tsConfigMergeKeys = [ + 'compilerOptions', + 'include', + 'files', +]; +// Make `extends` the first field. +const tsConfigPriorityKeys = ['extends']; +const ignoredLernaProjects = [ + 'experimental/examples/*', + 'experimental/backwards-compatability/*', + 'integration-tests/*', + 'selenium-tests', + 'examples/otlp-exporter-node', + 'examples/opentelemetry-web', + 'examples/https', +]; + +let dryRun = false; +const argv = process.argv.slice(2); +while (argv.length) { + switch (argv[0]) { + case '--dry': { + dryRun = true; + } + default: {} + } + argv.shift(); +} +main(); + +function main() { + const pkgRoot = process.cwd(); + const projectRoot = findProjectRoot(pkgRoot); + const lernaPackages = resolveLernaPackages(projectRoot); + + generateTsConfig(projectRoot, lernaPackages, pkgRoot, true); + for (const packageMeta of lernaPackages.values()) { + generateTsConfig(projectRoot, lernaPackages, path.join(projectRoot, packageMeta.dir), false, packageMeta); + } +} + +function generateTsConfig(projectRoot, lernaProjects, pkgRoot, isLernaRoot, packageMeta) { + // Root tsconfig.json + if (isLernaRoot) { + writeRootTsConfigJson(pkgRoot, projectRoot, lernaProjects); + return; + } + + const otelDependencies = getOtelDependencies(packageMeta.pkgJson); + const dependenciesDir = resolveDependencyDirs(lernaProjects, otelDependencies); + const references = dependenciesDir.map(it => path.relative(pkgRoot, path.join(projectRoot, it))).sort(); + + if (packageMeta.hasMultiTarget) { + writeMultiTargetTsConfigs(pkgRoot, projectRoot, references); + return; + } + writeSingleTargetTsConfig(pkgRoot, projectRoot, references); +} + +function writeRootTsConfigJson(pkgRoot, projectRoot, lernaProjects) { + const tsconfigPath = path.join(pkgRoot, 'tsconfig.json'); + const tsconfig = readJSON(tsconfigPath); + const references = Array.from(lernaProjects.values()) + .filter(it => it.isTsProject) + .map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort(); + tsconfig.references = references.map(path => { + return { path } + }); + tsconfig.typedocOptions.entryPoints = Array.from(lernaProjects.values()) + .filter(it => !it.private && it.isTsProject) + .map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort(); + writeJSON(tsconfigPath, tsconfig, dryRun); + + for (const tsconfigName of ['tsconfig.esm.json', 'tsconfig.esnext.json']) { + const tsconfigPath = path.join(pkgRoot, tsconfigName); + const tsconfig = readJSON(tsconfigPath); + const references = Array.from(lernaProjects.values()) + .filter(it => it.isTsProject && it.hasMultiTarget) + .map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort(); + tsconfig.references = references.map(pkgPath => { + return { path: path.join(pkgPath, tsconfigName), } + }); + writeJSON(tsconfigPath, tsconfig, dryRun); + } +} + +function writeMultiTargetTsConfigs(pkgRoot, projectRoot, references) { + const pairs = [ + ['tsconfig.json', getDefaultTsConfig], + ['tsconfig.esm.json', getEsmTsConfig], + ['tsconfig.esnext.json', getEsnextTsConfig] + ]; + for (const [tsconfigName, getTsConfig] of pairs) { + const tsconfigPath = path.join(pkgRoot, tsconfigName); + let tsconfig = getTsConfig(pkgRoot, projectRoot); + tsconfig.references = references.map(path => { + return { path }; + }); + tsconfig = readAndMaybeMergeTsConfig(tsconfigPath, tsconfig); + writeJSON(tsconfigPath, tsconfig, dryRun); + } +} + +function writeSingleTargetTsConfig(pkgRoot, projectRoot, references) { + const tsconfigPath = path.join(pkgRoot, 'tsconfig.json'); + let tsconfig = getDefaultTsConfig(pkgRoot, projectRoot); + tsconfig.references = references.map(path => { + return { path } + }); + tsconfig = readAndMaybeMergeTsConfig(tsconfigPath, tsconfig); + writeJSON(tsconfigPath, tsconfig, dryRun); +} + +function findProjectRoot(pkgRoot) { + let dir; + let parent = pkgRoot; + do { + dir = parent; + + try { + const stat = fs.statSync(path.join(dir, 'lerna.json')); + if (stat.isFile()) { + return dir; + } + } catch (e) { + /* ignore */ + } + + parent = path.dirname(dir); + } while (dir !== parent) +} + +function getOtelDependencies(packageJson) { + const deps = new Set(); + for (const type of packageJsonDependencyFields) { + if (packageJson[type] == null) { + continue; + } + Object.keys(packageJson[type]).filter(it => it.startsWith('@opentelemetry')) + .forEach(it => deps.add(it)) + } + return Array.from(deps.values()); +} + +function resolveLernaPackages(projectRoot) { + const map = new Map(); + const lernaJson = readJSON(`${projectRoot}/lerna.json`); + for (const pkgDefinition of lernaJson.packages) { + if (ignoredLernaProjects.includes(pkgDefinition)) { + continue; + } + if (pkgDefinition.endsWith('*')) { + const relDir = path.dirname(pkgDefinition) + const pkgs = fs.readdirSync(path.join(projectRoot, relDir)).filter(it => !it.startsWith('.')); + for (const pkg of pkgs) { + const pkgDir = path.join(relDir, pkg); + const meta = resolvePackageMeta(path.join(projectRoot, pkgDir)); + if (meta == null) { + continue; + } + map.set(meta.name, { + ...meta, + dir: pkgDir, + }); + } + } else { + const meta = resolvePackageMeta(path.join(projectRoot, pkgDefinition)); + if (meta == null) { + continue; + } + map.set(meta.name, { + ...meta, + dir: pkgDefinition, + }); + } + } + return map; +} + +function resolveDependencyDirs(lernaProjectMap, deps) { + const results = []; + for (const dep of deps) { + const meta = lernaProjectMap.get(dep); + if (meta == null) { + continue; + } + results.push(meta.dir); + } + return results; +} + +function resolvePackageMeta(pkgDir) { + try { + const pkgJson = readJSON(path.join(pkgDir, 'package.json')); + let isTsProject = false; + try { + isTsProject = fs.statSync(path.join(pkgDir, 'tsconfig.json')).isFile() + } catch {/** ignore */} + return { + name: pkgJson.name, + private: pkgJson.private, + isTsProject, + hasMultiTarget: hasEsTargets(pkgJson), + pkgJson, + }; + } catch (e) { + return null + } +} + +function readAndMaybeMergeTsConfig(tsconfigPath, updates) { + let tsconfig; + try { + tsconfig = readJSON(tsconfigPath); + } catch { + return updates; + } + updates = mergeTsConfig(tsconfig, updates); + return updates; +} + +function mergeTsConfig(existing, updates) { + for (const key of tsConfigMergeKeys) { + const value = existing[key]; + if (value === undefined) { + continue; + } + if (updates[key] === undefined) { + updates[key] = value; + continue; + } + if (Array.isArray(value)) { + updates[key] = Array.from(new Set([...value, ...updates[key]])); + } else { + updates[key] = sortObjectKeys({ ...updates[key], ...value }); + } + } + // Make `extends` the first field. + updates = sortObjectKeys(updates, tsConfigPriorityKeys); + return updates; +} + +function hasEsTargets(pjson) { + return typeof pjson.module === 'string'; +} + +function readJSON(filepath) { + const fileContent = fs.readFileSync(filepath, 'utf8'); + const json = JSON.parse(fileContent); + return json; +} + +function writeJSON(filepath, content, dry) { + const text = JSON.stringify(content, null, 2); + if (dry) { + console.log(text); + } else { + fs.writeFileSync(filepath, text + '\n', 'utf8'); + } +} + +function sortObjectKeys(obj, priorityKeys = []) { + let keys = Object.keys(obj).sort(); + keys = Array.from(new Set([...priorityKeys, ...keys])); + const ret = {}; + keys.forEach(key => { + ret[key] = obj[key]; + }); + return ret; +} diff --git a/tsconfig.esm.json b/tsconfig.esm.json new file mode 100644 index 0000000000..3c3cb876dd --- /dev/null +++ b/tsconfig.esm.json @@ -0,0 +1,69 @@ +{ + "extends": "./tsconfig.base.esm.json", + "files": [], + "references": [ + { + "path": "api/tsconfig.esm.json" + }, + { + "path": "experimental/packages/api-logs/tsconfig.esm.json" + }, + { + "path": "experimental/packages/exporter-trace-otlp-http/tsconfig.esm.json" + }, + { + "path": "experimental/packages/opentelemetry-browser-detector/tsconfig.esm.json" + }, + { + "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esm.json" + }, + { + "path": "experimental/packages/opentelemetry-instrumentation/tsconfig.esm.json" + }, + { + "path": "experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esm.json" + }, + { + "path": "experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esm.json" + }, + { + "path": "experimental/packages/otlp-exporter-base/tsconfig.esm.json" + }, + { + "path": "experimental/packages/otlp-transformer/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-context-zone/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-context-zone-peer-dep/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-core/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-exporter-zipkin/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-propagator-b3/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-propagator-jaeger/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-resources/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-sdk-trace-base/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-sdk-trace-web/tsconfig.esm.json" + }, + { + "path": "packages/opentelemetry-semantic-conventions/tsconfig.esm.json" + }, + { + "path": "packages/sdk-metrics/tsconfig.esm.json" + } + ] +} diff --git a/tsconfig.esnext.json b/tsconfig.esnext.json new file mode 100644 index 0000000000..63c1e27aa4 --- /dev/null +++ b/tsconfig.esnext.json @@ -0,0 +1,69 @@ +{ + "extends": "./tsconfig.base.esnext.json", + "files": [], + "references": [ + { + "path": "api/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/api-logs/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/exporter-trace-otlp-http/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/opentelemetry-browser-detector/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-http/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/opentelemetry-instrumentation/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/opentelemetry-instrumentation-fetch/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/opentelemetry-instrumentation-xml-http-request/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/otlp-exporter-base/tsconfig.esnext.json" + }, + { + "path": "experimental/packages/otlp-transformer/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-context-zone/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-context-zone-peer-dep/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-core/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-exporter-zipkin/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-propagator-b3/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-propagator-jaeger/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-resources/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-sdk-trace-base/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-sdk-trace-web/tsconfig.esnext.json" + }, + { + "path": "packages/opentelemetry-semantic-conventions/tsconfig.esnext.json" + }, + { + "path": "packages/sdk-metrics/tsconfig.esnext.json" + } + ] +} diff --git a/tsconfig.json b/tsconfig.json index 09ccfeb07f..347ccca34d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,19 +14,19 @@ "experimental/packages/opentelemetry-exporter-metrics-otlp-http", "experimental/packages/opentelemetry-exporter-metrics-otlp-proto", "experimental/packages/opentelemetry-exporter-prometheus", + "experimental/packages/opentelemetry-instrumentation", "experimental/packages/opentelemetry-instrumentation-fetch", "experimental/packages/opentelemetry-instrumentation-grpc", "experimental/packages/opentelemetry-instrumentation-http", "experimental/packages/opentelemetry-instrumentation-xml-http-request", - "experimental/packages/opentelemetry-instrumentation", "experimental/packages/opentelemetry-sdk-node", "experimental/packages/otlp-exporter-base", "experimental/packages/otlp-grpc-exporter-base", "experimental/packages/otlp-proto-exporter-base", "experimental/packages/otlp-transformer", "packages/opentelemetry-context-async-hooks", - "packages/opentelemetry-context-zone-peer-dep", "packages/opentelemetry-context-zone", + "packages/opentelemetry-context-zone-peer-dep", "packages/opentelemetry-core", "packages/opentelemetry-exporter-jaeger", "packages/opentelemetry-exporter-zipkin", @@ -55,118 +55,109 @@ "path": "api" }, { - "path": "packages/opentelemetry-context-async-hooks" - }, - { - "path": "packages/opentelemetry-context-zone-peer-dep" - }, - { - "path": "packages/opentelemetry-context-zone" - }, - { - "path": "packages/opentelemetry-core" + "path": "experimental/packages/api-logs" }, { - "path": "packages/opentelemetry-exporter-jaeger" + "path": "experimental/packages/exporter-trace-otlp-grpc" }, { - "path": "packages/opentelemetry-exporter-zipkin" + "path": "experimental/packages/exporter-trace-otlp-http" }, { - "path": "packages/opentelemetry-propagator-b3" + "path": "experimental/packages/exporter-trace-otlp-proto" }, { - "path": "packages/opentelemetry-propagator-jaeger" + "path": "experimental/packages/opentelemetry-browser-detector" }, { - "path": "packages/opentelemetry-resources" + "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-grpc" }, { - "path": "packages/opentelemetry-sdk-trace-base" + "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-http" }, { - "path": "packages/opentelemetry-sdk-trace-node" + "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-proto" }, { - "path": "packages/opentelemetry-sdk-trace-web" + "path": "experimental/packages/opentelemetry-exporter-prometheus" }, { - "path": "packages/opentelemetry-semantic-conventions" + "path": "experimental/packages/opentelemetry-instrumentation" }, { - "path": "packages/opentelemetry-shim-opentracing" + "path": "experimental/packages/opentelemetry-instrumentation-fetch" }, { - "path": "packages/sdk-metrics" + "path": "experimental/packages/opentelemetry-instrumentation-grpc" }, { - "path": "packages/template" + "path": "experimental/packages/opentelemetry-instrumentation-http" }, { - "path": "experimental/packages/api-logs" + "path": "experimental/packages/opentelemetry-instrumentation-xml-http-request" }, { - "path": "experimental/packages/exporter-trace-otlp-grpc" + "path": "experimental/packages/opentelemetry-sdk-node" }, { - "path": "experimental/packages/exporter-trace-otlp-http" + "path": "experimental/packages/otlp-exporter-base" }, { - "path": "experimental/packages/exporter-trace-otlp-proto" + "path": "experimental/packages/otlp-grpc-exporter-base" }, { - "path": "experimental/packages/opentelemetry-browser-detector" + "path": "experimental/packages/otlp-proto-exporter-base" }, { - "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-grpc" + "path": "experimental/packages/otlp-transformer" }, { - "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-http" + "path": "packages/opentelemetry-context-async-hooks" }, { - "path": "experimental/packages/opentelemetry-exporter-metrics-otlp-proto" + "path": "packages/opentelemetry-context-zone" }, { - "path": "experimental/packages/opentelemetry-exporter-prometheus" + "path": "packages/opentelemetry-context-zone-peer-dep" }, { - "path": "experimental/packages/opentelemetry-instrumentation-fetch" + "path": "packages/opentelemetry-core" }, { - "path": "experimental/packages/opentelemetry-instrumentation-grpc" + "path": "packages/opentelemetry-exporter-jaeger" }, { - "path": "experimental/packages/opentelemetry-instrumentation-http" + "path": "packages/opentelemetry-exporter-zipkin" }, { - "path": "experimental/packages/opentelemetry-instrumentation-xml-http-request" + "path": "packages/opentelemetry-propagator-b3" }, { - "path": "experimental/packages/opentelemetry-instrumentation" + "path": "packages/opentelemetry-propagator-jaeger" }, { - "path": "experimental/packages/opentelemetry-sdk-node" + "path": "packages/opentelemetry-resources" }, { - "path": "experimental/packages/otlp-exporter-base" + "path": "packages/opentelemetry-sdk-trace-base" }, { - "path": "experimental/packages/otlp-grpc-exporter-base" + "path": "packages/opentelemetry-sdk-trace-node" }, { - "path": "experimental/packages/otlp-proto-exporter-base" + "path": "packages/opentelemetry-sdk-trace-web" }, { - "path": "experimental/packages/otlp-transformer" + "path": "packages/opentelemetry-semantic-conventions" }, { - "path": "experimental/backwards-compatability/node14" + "path": "packages/opentelemetry-shim-opentracing" }, { - "path": "experimental/backwards-compatability/node16" + "path": "packages/sdk-metrics" }, { - "path": "integration-tests/propagation-validation-server" + "path": "packages/template" } ] } From d40d2ba7a68a9f90daf6b9a68629e6fc5cd33e7e Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Tue, 22 Nov 2022 11:54:39 -0500 Subject: [PATCH 3/3] Update missed references Co-authored-by: Marc Pichler --- package.json | 2 +- scripts/update-ts-configs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 74823ed6af..080914350d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "prewatch": "npm run precompile", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", - "postinstall": "npm run update-ts-references && npm run bootstrap", + "postinstall": "npm run update-ts-configs && npm run bootstrap", "postcompile": "npm run submodule && npm run protos:copy", "submodule": "git submodule sync --recursive && git submodule update --init --recursive", "protos:copy": "lerna run protos:copy", diff --git a/scripts/update-ts-configs.js b/scripts/update-ts-configs.js index ef56285359..d0b91a85f2 100644 --- a/scripts/update-ts-configs.js +++ b/scripts/update-ts-configs.js @@ -32,7 +32,7 @@ const { getDefaultTsConfig, getEsmTsConfig, getEsnextTsConfig, -} = require('./update-ts-config-constants'); +} = require('./update-ts-configs-constants'); const packageJsonDependencyFields = ['dependencies', 'peerDependencies', 'devDependencies']; const tsConfigMergeKeys = [