Skip to content

[mgmt] migrate mgmt package to esm 10 #32370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
36 changes: 24 additions & 12 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sdk/datadog/arm-datadog/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
Expand All @@ -11,7 +11,7 @@
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-datadog.d.ts"
"publicTrimmedFilePath": "dist/arm-datadog.d.ts"
},
"messages": {
"tsdocMessageReporting": {
Expand All @@ -28,4 +28,4 @@
}
}
}
}
}
86 changes: 58 additions & 28 deletions sdk/datadog/arm-datadog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-datadog.d.ts",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/commonjs/index.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@types/chai": "^4.2.8",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"chai": "^4.2.0",
"@vitest/browser": "^2.1.8",
"@vitest/coverage-istanbul": "^2.1.8",
"dotenv": "^16.0.0",
"mocha": "^11.0.2",
"ts-node": "^10.0.0",
"typescript": "~5.7.2"
"playwright": "^1.49.1",
"typescript": "~5.7.2",
"vitest": "^2.1.8"
},
"repository": {
"type": "git",
Expand All @@ -49,24 +49,14 @@
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"dist/",
"README.md",
"LICENSE",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
"review/",
"CHANGELOG.md"
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api",
"build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
"build:browser": "echo skipped",
"build:node": "echo skipped",
"build:samples": "echo skipped.",
Expand All @@ -78,7 +68,7 @@
"format": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:node": "dev-tool run test:vitest --esm",
"lint": "echo skipped",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"pack": "npm pack 2>&1",
Expand All @@ -87,8 +77,8 @@
"test:browser": "echo skipped",
"test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we revert this ?

"unit-test:node": "dev-tool run test:vitest",
"update-snippets": "echo skipped"
},
"sideEffects": false,
Expand All @@ -109,5 +99,45 @@
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-datadog?view=azure-node-preview"
},
"type": "module",
"tshy": {
"project": "./tsconfig.src.json",
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we shipping for React-Native and Browser support? If not, please remove the esmDialects.

"browser",
"react-native"
],
"selfLink": false
},
"browser": "./dist/browser/index.js",
"react-native": "./dist/react-native/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Informs if the current subscription is being already monitored for selected Datadog organization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Informs if the current subscription is being already monitored for selected Datadog organization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {
MicrosoftDatadogClient
} from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Create Datadog marketplace agreement in the subscription.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List Datadog marketplace agreements in the subscription.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {
MicrosoftDatadogClient
} from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Add the subscriptions that should be monitored by the Datadog monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Updates the subscriptions that are being monitored by the Datadog monitor resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List the subscriptions currently being monitored by the Datadog monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List the subscriptions currently being monitored by the Datadog monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {
MicrosoftDatadogClient
} from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Updates the subscriptions that are being monitored by the Datadog monitor resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {
MicrosoftDatadogClient
} from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Create a monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Delete a monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Get the default api key.
Expand Down
4 changes: 1 addition & 3 deletions sdk/datadog/arm-datadog/samples-dev/monitorsGetSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to Get the properties of a specific monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List the api keys for a given monitor resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List all monitors under the specified resource group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
// Licensed under the MIT License.
import { MicrosoftDatadogClient } from "@azure/arm-datadog";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";

dotenv.config();
import "dotenv/config";

/**
* This sample demonstrates how to List the hosts for a given monitor resource.
Expand Down
Loading
Loading