diff --git a/.github/workflows/peer-api.yaml b/.github/workflows/peer-api.yaml index 2917235bc3f..ce642134d09 100644 --- a/.github/workflows/peer-api.yaml +++ b/.github/workflows/peer-api.yaml @@ -18,6 +18,9 @@ jobs: - name: Install lerna run: npm install -g lerna + - name: Install semver + run: npm install semver + - name: Check API dependency semantics (stable) run: lerna exec --ignore propagation-validation-server "node ../../scripts/peer-api-check.js" diff --git a/experimental/packages/opentelemetry-api-metrics/package.json b/experimental/packages/opentelemetry-api-metrics/package.json index 5cb9e1503b4..ecc624c4b9e 100644 --- a/experimental/packages/opentelemetry-api-metrics/package.json +++ b/experimental/packages/opentelemetry-api-metrics/package.json @@ -54,11 +54,7 @@ "publishConfig": { "access": "public" }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.2" - }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/webpack-env": "1.16.2", diff --git a/experimental/packages/opentelemetry-exporter-otlp-grpc/package.json b/experimental/packages/opentelemetry-exporter-otlp-grpc/package.json index 0e169d818b4..8c7729b2558 100644 --- a/experimental/packages/opentelemetry-exporter-otlp-grpc/package.json +++ b/experimental/packages/opentelemetry-exporter-otlp-grpc/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/api-metrics": "0.26.0", "@types/mocha": "8.2.3", "@types/node": "14.17.11", @@ -64,7 +64,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@grpc/grpc-js": "^1.3.7", diff --git a/experimental/packages/opentelemetry-exporter-otlp-http/package.json b/experimental/packages/opentelemetry-exporter-otlp-http/package.json index 91399c51a8d..ab16f94c4cd 100644 --- a/experimental/packages/opentelemetry-exporter-otlp-http/package.json +++ b/experimental/packages/opentelemetry-exporter-otlp-http/package.json @@ -56,7 +56,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -83,7 +83,7 @@ "webpack-merge": "5.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/api-metrics": "0.26.0", diff --git a/experimental/packages/opentelemetry-exporter-otlp-proto/package.json b/experimental/packages/opentelemetry-exporter-otlp-proto/package.json index a8f7ff5afa7..80eba493188 100644 --- a/experimental/packages/opentelemetry-exporter-otlp-proto/package.json +++ b/experimental/packages/opentelemetry-exporter-otlp-proto/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/api-metrics": "0.26.0", "@types/mocha": "8.2.3", "@types/node": "14.17.11", @@ -64,7 +64,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@grpc/proto-loader": "^0.6.4", diff --git a/experimental/packages/opentelemetry-exporter-prometheus/package.json b/experimental/packages/opentelemetry-exporter-prometheus/package.json index a8af029d50e..777666c3db7 100644 --- a/experimental/packages/opentelemetry-exporter-prometheus/package.json +++ b/experimental/packages/opentelemetry-exporter-prometheus/package.json @@ -41,7 +41,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -54,7 +54,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/api-metrics": "0.26.0", diff --git a/experimental/packages/opentelemetry-instrumentation-fetch/package.json b/experimental/packages/opentelemetry-instrumentation-fetch/package.json index 40b652afb5d..f7c060a8dec 100644 --- a/experimental/packages/opentelemetry-instrumentation-fetch/package.json +++ b/experimental/packages/opentelemetry-instrumentation-fetch/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/context-zone": "1.0.0", "@opentelemetry/propagator-b3": "1.0.0", "@opentelemetry/sdk-trace-base": "1.0.0", @@ -78,7 +78,7 @@ "webpack-merge": "5.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/package.json b/experimental/packages/opentelemetry-instrumentation-grpc/package.json index 158588b7fbc..282c77b035d 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/package.json +++ b/experimental/packages/opentelemetry-instrumentation-grpc/package.json @@ -45,7 +45,7 @@ "devDependencies": { "@grpc/grpc-js": "1.3.7", "@grpc/proto-loader": "0.6.4", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/context-async-hooks": "1.0.0", "@opentelemetry/core": "1.0.0", "@opentelemetry/sdk-trace-base": "1.0.0", @@ -66,7 +66,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/api-metrics": "0.26.0", diff --git a/experimental/packages/opentelemetry-instrumentation-http/package.json b/experimental/packages/opentelemetry-instrumentation-http/package.json index 41abcbab84b..3bfda8c880e 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/package.json +++ b/experimental/packages/opentelemetry-instrumentation-http/package.json @@ -43,7 +43,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/context-async-hooks": "1.0.0", "@opentelemetry/sdk-trace-base": "1.0.0", "@opentelemetry/sdk-trace-node": "1.0.0", @@ -69,7 +69,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json index 66d3c85f331..2145f91b33e 100644 --- a/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json +++ b/experimental/packages/opentelemetry-instrumentation-xml-http-request/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/context-zone": "1.0.0", "@opentelemetry/propagator-b3": "1.0.0", "@opentelemetry/sdk-trace-base": "1.0.0", @@ -78,7 +78,7 @@ "webpack-merge": "5.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/experimental/packages/opentelemetry-instrumentation/package.json b/experimental/packages/opentelemetry-instrumentation/package.json index 7204d0e3911..194e7d041b2 100644 --- a/experimental/packages/opentelemetry-instrumentation/package.json +++ b/experimental/packages/opentelemetry-instrumentation/package.json @@ -67,11 +67,11 @@ "shimmer": "^1.2.1" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/semver": "7.3.8", diff --git a/experimental/packages/opentelemetry-sdk-metrics-base/package.json b/experimental/packages/opentelemetry-sdk-metrics-base/package.json index 862e167d1d7..a6c490d1e62 100644 --- a/experimental/packages/opentelemetry-sdk-metrics-base/package.json +++ b/experimental/packages/opentelemetry-sdk-metrics-base/package.json @@ -46,7 +46,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@types/lodash.merge": "4.6.6", "@types/mocha": "8.2.3", "@types/node": "14.17.11", @@ -60,7 +60,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/api-metrics": "0.26.0", diff --git a/experimental/packages/opentelemetry-sdk-node/package.json b/experimental/packages/opentelemetry-sdk-node/package.json index dddf6d0845f..28a9e746c1c 100644 --- a/experimental/packages/opentelemetry-sdk-node/package.json +++ b/experimental/packages/opentelemetry-sdk-node/package.json @@ -53,10 +53,10 @@ "@opentelemetry/sdk-trace-node": "1.0.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@opentelemetry/context-async-hooks": "1.0.0", "@types/mocha": "8.2.3", "@types/node": "14.17.11", diff --git a/integration-tests/propagation-validation-server/package.json b/integration-tests/propagation-validation-server/package.json index 7c11eb10b11..d36492b47f0 100644 --- a/integration-tests/propagation-validation-server/package.json +++ b/integration-tests/propagation-validation-server/package.json @@ -11,7 +11,7 @@ "compile": "tsc --build" }, "dependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/context-async-hooks": "1.0.0", "@opentelemetry/core": "1.0.0", "@opentelemetry/sdk-trace-base": "1.0.0", diff --git a/package.json b/package.json index 702e0cde245..eba827332a4 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "lerna": "3.22.1", "lerna-changelog": "1.0.1", "markdownlint-cli": "0.28.1", + "semver": "7.3.5", "typedoc": "0.21.6", "typescript": "4.3.5", "update-ts-references": "2.4.0" diff --git a/packages/opentelemetry-context-async-hooks/package.json b/packages/opentelemetry-context-async-hooks/package.json index 67b4751d957..470e1d209cf 100644 --- a/packages/opentelemetry-context-async-hooks/package.json +++ b/packages/opentelemetry-context-async-hooks/package.json @@ -42,7 +42,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "codecov": "3.8.3", @@ -53,6 +53,6 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" } } diff --git a/packages/opentelemetry-context-zone-peer-dep/package.json b/packages/opentelemetry-context-zone-peer-dep/package.json index 94c21e2a089..aefebb26021 100644 --- a/packages/opentelemetry-context-zone-peer-dep/package.json +++ b/packages/opentelemetry-context-zone-peer-dep/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -75,7 +75,7 @@ "zone.js": "0.11.4" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": ">=1.0.0 <1.1.0", "zone.js": "^0.10.2 || ^0.11.0" }, "sideEffects": false diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index 573ea927be4..fd33b2ad216 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -57,7 +57,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -81,7 +81,7 @@ "webpack": "4.46.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/semantic-conventions": "1.0.0" diff --git a/packages/opentelemetry-exporter-jaeger/package.json b/packages/opentelemetry-exporter-jaeger/package.json index e2988c1869a..c3ec50f6093 100644 --- a/packages/opentelemetry-exporter-jaeger/package.json +++ b/packages/opentelemetry-exporter-jaeger/package.json @@ -42,7 +42,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@opentelemetry/resources": "1.0.0", "@types/mocha": "8.2.3", "@types/node": "14.17.11", @@ -57,7 +57,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index 653dc8a3215..c14b9d9ae3b 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -54,7 +54,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "^1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -81,7 +81,7 @@ "webpack-merge": "5.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": "^1.0.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/packages/opentelemetry-propagator-b3/package.json b/packages/opentelemetry-propagator-b3/package.json index 5015c0a74bb..c7e1e42fe94 100644 --- a/packages/opentelemetry-propagator-b3/package.json +++ b/packages/opentelemetry-propagator-b3/package.json @@ -48,10 +48,10 @@ "@opentelemetry/core": "1.0.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "codecov": "3.8.3", diff --git a/packages/opentelemetry-propagator-jaeger/package.json b/packages/opentelemetry-propagator-jaeger/package.json index 16fe0436903..e8ee5ccb1b0 100644 --- a/packages/opentelemetry-propagator-jaeger/package.json +++ b/packages/opentelemetry-propagator-jaeger/package.json @@ -49,7 +49,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -72,7 +72,7 @@ "webpack": "4.46.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/core": "1.0.0" diff --git a/packages/opentelemetry-resources/package.json b/packages/opentelemetry-resources/package.json index 2eb290aa59e..4ae97c1be43 100644 --- a/packages/opentelemetry-resources/package.json +++ b/packages/opentelemetry-resources/package.json @@ -50,7 +50,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -64,7 +64,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/packages/opentelemetry-sdk-trace-base/package.json b/packages/opentelemetry-sdk-trace-base/package.json index 9f52b0efa04..f08887ceeee 100644 --- a/packages/opentelemetry-sdk-trace-base/package.json +++ b/packages/opentelemetry-sdk-trace-base/package.json @@ -55,7 +55,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@types/mocha": "8.2.3", "@types/node": "14.17.11", "@types/sinon": "10.0.2", @@ -78,7 +78,7 @@ "webpack": "4.46.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/packages/opentelemetry-sdk-trace-node/package.json b/packages/opentelemetry-sdk-trace-node/package.json index 69d5195d6d1..336ac2c0d42 100644 --- a/packages/opentelemetry-sdk-trace-node/package.json +++ b/packages/opentelemetry-sdk-trace-node/package.json @@ -43,7 +43,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@opentelemetry/resources": "1.0.0", "@opentelemetry/semantic-conventions": "1.0.0", "@types/mocha": "8.2.3", @@ -59,7 +59,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/context-async-hooks": "1.0.0", diff --git a/packages/opentelemetry-sdk-trace-web/package.json b/packages/opentelemetry-sdk-trace-web/package.json index ca9cb926434..2cc79a26727 100644 --- a/packages/opentelemetry-sdk-trace-web/package.json +++ b/packages/opentelemetry-sdk-trace-web/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@opentelemetry/context-zone": "1.0.0", "@opentelemetry/propagator-b3": "1.0.0", "@opentelemetry/resources": "1.0.0", @@ -79,7 +79,7 @@ "webpack-merge": "5.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/packages/opentelemetry-shim-opentracing/package.json b/packages/opentelemetry-shim-opentracing/package.json index 496657c20ab..b84d7dce3da 100644 --- a/packages/opentelemetry-shim-opentracing/package.json +++ b/packages/opentelemetry-shim-opentracing/package.json @@ -40,7 +40,7 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.2", + "@opentelemetry/api": "~1.0.3", "@opentelemetry/propagator-b3": "1.0.0", "@opentelemetry/propagator-jaeger": "1.0.0", "@opentelemetry/sdk-trace-base": "1.0.0", @@ -54,7 +54,7 @@ "typescript": "4.3.5" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.2" + "@opentelemetry/api": ">=1.0.0 <1.1.0" }, "dependencies": { "@opentelemetry/core": "1.0.0", diff --git a/scripts/peer-api-check.js b/scripts/peer-api-check.js index 6e359e04731..3d79e60f449 100644 --- a/scripts/peer-api-check.js +++ b/scripts/peer-api-check.js @@ -17,6 +17,7 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); +const semver = require('semver'); const appRoot = process.cwd(); @@ -29,7 +30,7 @@ if (pjson.dependencies && pjson.dependencies["@opentelemetry/api"]) const peerVersion = pjson.peerDependencies && pjson.peerDependencies["@opentelemetry/api"] const devVersion = pjson.devDependencies && pjson.devDependencies["@opentelemetry/api"] if (peerVersion) { - if (peerVersion !== devVersion) { + if (!semver.subset(devVersion, peerVersion)) { throw new Error(`Package ${pjson.name} depends on peer API version ${peerVersion} but version ${devVersion} in development`); } console.log(`${pjson.name} OK`);