From c647a473db1ea0f05a7d3df3676a01bb641dc7a5 Mon Sep 17 00:00:00 2001 From: David Luna Date: Mon, 12 Feb 2024 12:38:15 +0100 Subject: [PATCH] chore: change location of types --- packages/mockotlpserver/lib/normalize.js | 6 ++---- .../{opentelemetry/proto.d.ts => lib/types-proto.d.ts} | 0 packages/mockotlpserver/lib/types.d.ts | 2 -- .../mockotlpserver/opentelemetry/proto/collector/README.md | 6 ------ scripts/update-protos.js | 2 +- 5 files changed, 3 insertions(+), 13 deletions(-) rename packages/mockotlpserver/{opentelemetry/proto.d.ts => lib/types-proto.d.ts} (100%) diff --git a/packages/mockotlpserver/lib/normalize.js b/packages/mockotlpserver/lib/normalize.js index 9dab23d7..5a93f622 100644 --- a/packages/mockotlpserver/lib/normalize.js +++ b/packages/mockotlpserver/lib/normalize.js @@ -38,10 +38,8 @@ const statusCodeEnumFromVal = { * to a value for converting 'attributes' to a simpler object, e.g.: * { 'telemetry.sdk.version': '1.19.0', * 'process.pid': 19667 } - */ - -/** - * @param {import('../opentelemetry/proto').opentelemetry.proto.common.v1.IAnyValue} v + * + * @param {import('./types-proto').opentelemetry.proto.common.v1.IAnyValue} v * @returns {any} */ function normAttrValue(v) { diff --git a/packages/mockotlpserver/opentelemetry/proto.d.ts b/packages/mockotlpserver/lib/types-proto.d.ts similarity index 100% rename from packages/mockotlpserver/opentelemetry/proto.d.ts rename to packages/mockotlpserver/lib/types-proto.d.ts diff --git a/packages/mockotlpserver/lib/types.d.ts b/packages/mockotlpserver/lib/types.d.ts index cbfec3a2..5e133217 100644 --- a/packages/mockotlpserver/lib/types.d.ts +++ b/packages/mockotlpserver/lib/types.d.ts @@ -1,5 +1,3 @@ -import type EventEmitter from 'events'; - type Long = { low: number; high: number; unsigned: boolean }; type StringValue = { stringValue: string }; type IntValue = { intValue: Long }; diff --git a/packages/mockotlpserver/opentelemetry/proto/collector/README.md b/packages/mockotlpserver/opentelemetry/proto/collector/README.md index ec9938f1..f89ee4cf 100644 --- a/packages/mockotlpserver/opentelemetry/proto/collector/README.md +++ b/packages/mockotlpserver/opentelemetry/proto/collector/README.md @@ -15,9 +15,3 @@ https://github.com/open-telemetry/opentelemetry-proto.git at the following tag/h This will be kept in sync wth the version being used in opentelemetry-js repository https://github.com/open-telemetry/opentelemetry-js.git - -The import paths of such files have been modified to be relative to avoid issues -when loading them with `protobufjs` library. Once the library issue is resolved -the files will be extracted "as is" from the repository. - -Ref: https://github.com/protobufjs/protobuf.js/issues/1971 diff --git a/scripts/update-protos.js b/scripts/update-protos.js index 2ef60a2a..591c6efb 100644 --- a/scripts/update-protos.js +++ b/scripts/update-protos.js @@ -136,7 +136,7 @@ const generateCommand = [ '|', // Then generate types join(binPath, 'pbts'), - `-o ${rootPath}/packages/mockotlpserver/opentelemetry/proto.d.ts`, + `-o ${rootPath}/packages/mockotlpserver/lib/types-proto.d.ts`, `-`, ].join(' ');