From 54f7240b6c5b532737b4778c4586b6c8f9460bb7 Mon Sep 17 00:00:00 2001 From: Olivier Giniaux Date: Mon, 11 Jul 2022 22:29:51 +0200 Subject: [PATCH] chore: mark packages as side effects free for tree shaking --- CHANGELOG.md | 1 + experimental/packages/exporter-trace-otlp-grpc/package.json | 3 ++- experimental/packages/exporter-trace-otlp-http/package.json | 3 ++- experimental/packages/exporter-trace-otlp-proto/package.json | 3 ++- experimental/packages/opentelemetry-api-metrics/package.json | 1 + .../opentelemetry-exporter-metrics-otlp-grpc/package.json | 3 ++- .../opentelemetry-exporter-metrics-otlp-http/package.json | 3 ++- .../opentelemetry-exporter-metrics-otlp-proto/package.json | 3 ++- .../packages/opentelemetry-exporter-prometheus/package.json | 3 ++- .../packages/opentelemetry-instrumentation-fetch/package.json | 3 ++- .../packages/opentelemetry-instrumentation-grpc/package.json | 3 ++- .../packages/opentelemetry-instrumentation-http/package.json | 3 ++- .../package.json | 3 ++- .../packages/opentelemetry-instrumentation/package.json | 1 + .../packages/opentelemetry-sdk-metrics-base/package.json | 3 ++- experimental/packages/opentelemetry-sdk-node/package.json | 3 ++- experimental/packages/otlp-exporter-base/package.json | 1 + experimental/packages/otlp-grpc-exporter-base/package.json | 3 ++- experimental/packages/otlp-proto-exporter-base/package.json | 3 ++- experimental/packages/otlp-transformer/package.json | 3 ++- packages/opentelemetry-context-async-hooks/package.json | 3 ++- packages/opentelemetry-core/package.json | 3 ++- packages/opentelemetry-exporter-jaeger/package.json | 3 ++- packages/opentelemetry-exporter-zipkin/package.json | 3 ++- packages/opentelemetry-propagator-b3/package.json | 1 + packages/opentelemetry-propagator-jaeger/package.json | 3 ++- packages/opentelemetry-resources/package.json | 3 ++- packages/opentelemetry-sdk-trace-base/package.json | 3 ++- packages/opentelemetry-sdk-trace-web/package.json | 3 ++- packages/opentelemetry-semantic-conventions/package.json | 3 ++- packages/opentelemetry-shim-opentracing/package.json | 3 ++- 31 files changed, 57 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9715932e97..1e9219e9fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file. ### :house: (Internal) * test: add node 18 and remove EoL node versions [#3048](https://github.com/open-telemetry/opentelemetry-js/pull/3048) @dyladan +* chore: mark packages as side effects free for tree shaking []() @ogxd ## 1.3.1 diff --git a/experimental/packages/exporter-trace-otlp-grpc/package.json b/experimental/packages/exporter-trace-otlp-grpc/package.json index 8412dd8eda..3c83d18684 100644 --- a/experimental/packages/exporter-trace-otlp-grpc/package.json +++ b/experimental/packages/exporter-trace-otlp-grpc/package.json @@ -74,5 +74,6 @@ "@opentelemetry/otlp-transformer": "0.30.0", "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-trace-base": "1.4.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/exporter-trace-otlp-http/package.json b/experimental/packages/exporter-trace-otlp-http/package.json index fb0ce6578c..f4ad5aeeec 100644 --- a/experimental/packages/exporter-trace-otlp-http/package.json +++ b/experimental/packages/exporter-trace-otlp-http/package.json @@ -99,5 +99,6 @@ "@opentelemetry/otlp-transformer": "0.30.0", "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-trace-base": "1.4.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/exporter-trace-otlp-proto/package.json b/experimental/packages/exporter-trace-otlp-proto/package.json index ee97d7df61..4bb1488a55 100644 --- a/experimental/packages/exporter-trace-otlp-proto/package.json +++ b/experimental/packages/exporter-trace-otlp-proto/package.json @@ -74,5 +74,6 @@ "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-trace-base": "1.4.0", "protobufjs": "^6.9.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-api-metrics/package.json b/experimental/packages/opentelemetry-api-metrics/package.json index 176f905535..312b356b94 100644 --- a/experimental/packages/opentelemetry-api-metrics/package.json +++ b/experimental/packages/opentelemetry-api-metrics/package.json @@ -63,6 +63,7 @@ "dependencies": { "@opentelemetry/api": "^1.0.0" }, + "sideEffects": false, "devDependencies": { "@types/mocha": "8.2.3", "@types/node": "14.17.33", diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json index 5a9f5b2a4d..421a99756b 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/package.json @@ -75,5 +75,6 @@ "@opentelemetry/otlp-transformer": "0.30.0", "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-metrics-base": "0.30.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json index 0e43c77085..a933d35124 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-http/package.json @@ -100,5 +100,6 @@ "@opentelemetry/otlp-transformer": "0.30.0", "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-metrics-base": "0.30.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json index 2154a396ff..af9dd091eb 100644 --- a/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json +++ b/experimental/packages/opentelemetry-exporter-metrics-otlp-proto/package.json @@ -76,5 +76,6 @@ "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-metrics-base": "0.30.0", "protobufjs": "^6.9.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-exporter-prometheus/package.json b/experimental/packages/opentelemetry-exporter-prometheus/package.json index 4d653dbc34..a825c9bd3b 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/package.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/package.json @@ -62,5 +62,6 @@ "@opentelemetry/api-metrics": "0.30.0", "@opentelemetry/core": "1.4.0", "@opentelemetry/sdk-metrics-base": "0.30.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index c85e761d0b..3b72de7a9b 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -91,5 +91,6 @@ "@opentelemetry/instrumentation": "0.30.0", "@opentelemetry/sdk-trace-web": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/package.json b/experimental/packages/opentelemetry-instrumentation-grpc/package.json index 96d5692800..2a38e9bb2e 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/package.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/package.json @@ -74,5 +74,6 @@ "@opentelemetry/api-metrics": "0.30.0", "@opentelemetry/instrumentation": "0.30.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-instrumentation-http/package.json b/experimental/packages/opentelemetry-instrumentation-http/package.json index d6b78c55b2..ffb87e3e14 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/package.json +++ b/experimental/packages/opentelemetry-instrumentation-http/package.json @@ -78,5 +78,6 @@ "@opentelemetry/instrumentation": "0.30.0", "@opentelemetry/semantic-conventions": "1.4.0", "semver": "^7.3.5" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index 6f9b785885..f28dec50cd 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -91,5 +91,6 @@ "@opentelemetry/instrumentation": "0.30.0", "@opentelemetry/sdk-trace-web": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index de05a2bec1..cabe7bdf4d 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -73,6 +73,7 @@ "semver": "^7.3.2", "shimmer": "^1.2.1" }, + "sideEffects": false, "peerDependencies": { "@opentelemetry/api": "^1.0.0" }, diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/package.json b/experimental/packages/opentelemetry-sdk-metrics-base/package.json index 4245e958ee..aa08842b05 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/package.json +++ b/experimental/packages/opentelemetry-sdk-metrics-base/package.json @@ -81,5 +81,6 @@ "@opentelemetry/core": "1.4.0", "@opentelemetry/resources": "1.4.0", "lodash.merge": "4.6.2" - } + }, + "sideEffects": false } diff --git a/experimental/packages/opentelemetry-sdk-node/package.json b/experimental/packages/opentelemetry-sdk-node/package.json index dc6861c82c..3406c7114c 100644 --- a/experimental/packages/opentelemetry-sdk-node/package.json +++ b/experimental/packages/opentelemetry-sdk-node/package.json @@ -72,5 +72,6 @@ "ts-loader": "8.3.0", "ts-mocha": "9.0.2", "typescript": "4.4.4" - } + }, + "sideEffects": false } diff --git a/experimental/packages/otlp-exporter-base/package.json b/experimental/packages/otlp-exporter-base/package.json index 25a7cfcb01..ef975849f5 100644 --- a/experimental/packages/otlp-exporter-base/package.json +++ b/experimental/packages/otlp-exporter-base/package.json @@ -63,6 +63,7 @@ "dependencies": { "@opentelemetry/core": "1.4.0" }, + "sideEffects": false, "devDependencies": { "@opentelemetry/api": "^1.0.0", "@types/mocha": "8.2.3", diff --git a/experimental/packages/otlp-grpc-exporter-base/package.json b/experimental/packages/otlp-grpc-exporter-base/package.json index 6f2b22a406..0fc333dfe6 100644 --- a/experimental/packages/otlp-grpc-exporter-base/package.json +++ b/experimental/packages/otlp-grpc-exporter-base/package.json @@ -75,5 +75,6 @@ "@grpc/proto-loader": "^0.6.9", "@opentelemetry/core": "1.4.0", "@opentelemetry/otlp-exporter-base": "0.30.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/otlp-proto-exporter-base/package.json b/experimental/packages/otlp-proto-exporter-base/package.json index 97cbb4dcdd..e7204621f0 100644 --- a/experimental/packages/otlp-proto-exporter-base/package.json +++ b/experimental/packages/otlp-proto-exporter-base/package.json @@ -69,5 +69,6 @@ "@opentelemetry/core": "1.4.0", "@opentelemetry/otlp-exporter-base": "0.30.0", "protobufjs": "^6.9.0" - } + }, + "sideEffects": false } diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index c2b4fe357f..bd56e39b76 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -82,5 +82,6 @@ "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-metrics-base": "0.30.0", "@opentelemetry/sdk-trace-base": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-context-async-hooks/package.json b/packages/opentelemetry-context-async-hooks/package.json index b6683dae87..f4640081e1 100644 --- a/packages/opentelemetry-context-async-hooks/package.json +++ b/packages/opentelemetry-context-async-hooks/package.json @@ -56,5 +56,6 @@ }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index 9b31319303..499b8fa19b 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -92,5 +92,6 @@ }, "dependencies": { "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-exporter-jaeger/package.json b/packages/opentelemetry-exporter-jaeger/package.json index c4cb745acf..f12b515a02 100644 --- a/packages/opentelemetry-exporter-jaeger/package.json +++ b/packages/opentelemetry-exporter-jaeger/package.json @@ -66,5 +66,6 @@ "@opentelemetry/sdk-trace-base": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0", "jaeger-client": "^3.15.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 8a8344fb1d..498f66a423 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -95,5 +95,6 @@ "@opentelemetry/resources": "1.4.0", "@opentelemetry/sdk-trace-base": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-propagator-b3/package.json b/packages/opentelemetry-propagator-b3/package.json index 2d5f1ad6d0..641990105d 100644 --- a/packages/opentelemetry-propagator-b3/package.json +++ b/packages/opentelemetry-propagator-b3/package.json @@ -53,6 +53,7 @@ "dependencies": { "@opentelemetry/core": "1.4.0" }, + "sideEffects": false, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.2.0" }, diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index f0766ad596..c5d53da057 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -81,5 +81,6 @@ }, "dependencies": { "@opentelemetry/core": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index 93b9d44bdf..627e62110d 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -91,5 +91,6 @@ "dependencies": { "@opentelemetry/core": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index 08b27b6ab7..4405ecc2b9 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -94,5 +94,6 @@ "@opentelemetry/core": "1.4.0", "@opentelemetry/resources": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index e3147a22d2..83089e09f7 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -94,5 +94,6 @@ "@opentelemetry/core": "1.4.0", "@opentelemetry/sdk-trace-base": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-semantic-conventions/package.json b/packages/opentelemetry-semantic-conventions/package.json index edcc780bb8..ed45a41409 100644 --- a/packages/opentelemetry-semantic-conventions/package.json +++ b/packages/opentelemetry-semantic-conventions/package.json @@ -60,5 +60,6 @@ "sinon": "12.0.1", "ts-mocha": "9.0.2", "typescript": "4.4.4" - } + }, + "sideEffects": false } diff --git a/packages/opentelemetry-shim-opentracing/package.json b/packages/opentelemetry-shim-opentracing/package.json index 91b0f8e0fa..6f7f3e1f96 100644 --- a/packages/opentelemetry-shim-opentracing/package.json +++ b/packages/opentelemetry-shim-opentracing/package.json @@ -62,5 +62,6 @@ "@opentelemetry/core": "1.4.0", "@opentelemetry/semantic-conventions": "1.4.0", "opentracing": "^0.14.4" - } + }, + "sideEffects": false }