diff --git a/sdk/monitor/opentelemetry-exporter-azure-monitor/package.json b/sdk/monitor/opentelemetry-exporter-azure-monitor/package.json index 62931380e6e6..ada3736cb9c6 100644 --- a/sdk/monitor/opentelemetry-exporter-azure-monitor/package.json +++ b/sdk/monitor/opentelemetry-exporter-azure-monitor/package.json @@ -12,7 +12,7 @@ "build:autorest": "autorest ./swagger/README.md --typescript --v3", "build:browser": "echo skipped", "build:test": "echo skipped", - "build:node": "tsc -p .", + "build:node": "tsc -p . && rollup -c 2>&1", "build": "npm run build:node && npm run build:browser && api-extractor run --local", "extract-api": "tsc -p . && api-extractor run --local", "lint": "eslint . --ext .ts || exit 0", @@ -20,10 +20,10 @@ "test:node": "npm run unit-test:node", "test:browser": "npm run unit-test:browser", "unit-test:browser": "echo skipped", - "unit-test:node": "nyc ts-mocha -p ./tsconfig.json 'test/unit/**/*.test.ts'", + "unit-test:node": "nyc mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/unit/**/*.test.ts\"", "unit-test:node:no-timeout": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "functional-test": "ts-mocha -p ./tsconfig.json 'test/functional/**/*.test.ts'", + "functional-test": "nyc mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/functional/**/*.test.ts\"", "integration-test:browser": "echo skipped", "integration-test:node": "npm run functional-test", "integration-test": "npm run integration-test:node && npm run integration-test:browser", @@ -62,6 +62,7 @@ ] }, "devDependencies": { + "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@microsoft/api-extractor": "7.7.11", "@types/mocha": "^7.0.2", @@ -74,8 +75,9 @@ "nyc": "^14.0.0", "prettier": "^1.16.4", "rimraf": "^3.0.0", + "rollup": "^1.16.3", "sinon": "^9.0.2", - "ts-mocha": "^7.0.0", + "ts-node": "^8.3.0", "typescript": "4.1.2", "typedoc": "0.15.0" }, @@ -85,7 +87,8 @@ "@opentelemetry/core": "^0.10.2", "@opentelemetry/resources": "^0.10.2", "@opentelemetry/semantic-conventions": "^0.10.2", - "@opentelemetry/tracing": "^0.10.2" + "@opentelemetry/tracing": "^0.10.2", + "tslib": "^2.0.0" }, "sideEffects": false, "keywords": [ diff --git a/sdk/monitor/opentelemetry-exporter-azure-monitor/rollup.config.js b/sdk/monitor/opentelemetry-exporter-azure-monitor/rollup.config.js new file mode 100644 index 000000000000..96d051412a13 --- /dev/null +++ b/sdk/monitor/opentelemetry-exporter-azure-monitor/rollup.config.js @@ -0,0 +1,3 @@ +import { makeConfig } from "@azure/dev-tool/shared-config/rollup"; + +export default makeConfig(require("./package.json"), { disableBrowserBundle: true }); diff --git a/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/export/trace.test.ts b/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/export/trace.test.ts index c312db8b9667..516b9412ec66 100644 --- a/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/export/trace.test.ts +++ b/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/export/trace.test.ts @@ -12,7 +12,7 @@ import { } from "../breezeTestUtils"; import { FileSystemPersist } from "../../../src/platform"; import { TelemetryItem as Envelope } from "../../../src/generated"; -import nock = require("nock"); +import nock from "nock"; function toObject(obj: T): T { return JSON.parse(JSON.stringify(obj)) as T; diff --git a/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/platform/nodejs/httpSender.test.ts b/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/platform/nodejs/httpSender.test.ts index baecef93bbcf..ab170aafff50 100644 --- a/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/platform/nodejs/httpSender.test.ts +++ b/sdk/monitor/opentelemetry-exporter-azure-monitor/test/unit/platform/nodejs/httpSender.test.ts @@ -10,7 +10,7 @@ import { partialBreezeResponse } from "../../breezeTestUtils"; import { TelemetryItem as Envelope } from "../../../../src/generated"; -import nock = require("nock"); +import nock from "nock"; describe("HttpSender", () => { const scope = nock(DEFAULT_BREEZE_ENDPOINT).post("/v2/track"); diff --git a/sdk/monitor/opentelemetry-exporter-azure-monitor/tsconfig.json b/sdk/monitor/opentelemetry-exporter-azure-monitor/tsconfig.json index 6eb8666d2f8d..3863167ddb92 100644 --- a/sdk/monitor/opentelemetry-exporter-azure-monitor/tsconfig.json +++ b/sdk/monitor/opentelemetry-exporter-azure-monitor/tsconfig.json @@ -1,25 +1,8 @@ { "extends": "../../../tsconfig.package", "compilerOptions": { - "importHelpers": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "module": "commonjs", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "pretty": true, - "sourceMap": true, - "strict": true, - "strictNullChecks": true, - "target": "es5", - "incremental": true, - "outDir": "dist-esm", - "declarationDir": "types", - "lib": [] + "outDir": "./dist-esm", + "declarationDir": "./types" }, "include": ["src/**/*.ts", "test/**/*.ts"] }