Skip to content

Commit

Permalink
[perf] Migrate @azure-tests/perf-ai-language-text to ESM (#32208)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR

- @azure-tests/perf-ai-language-text
- @azure-tests/perf-ai-form-recognizer
- @azure-tests/perf-service-bus

### Issues associated with this PR

- #31338

### Describe the problem that is addressed by this PR

Migrates @azure-tests/perf-ai-language-text to ESM and fixes up previous
packages already moved to ESM

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
  • Loading branch information
mpodwysocki authored Dec 17, 2024
1 parent 29b642d commit 0e13ee1
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 30 deletions.
59 changes: 45 additions & 14 deletions sdk/cognitivelanguage/perf-tests/ai-language-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,76 @@
"sdk-type": "perf-test",
"version": "1.0.0",
"description": "Performance tests for @azure/ai-language-text",
"main": "",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"keywords": [],
"author": "",
"license": "ISC",
"author": "Microsoft Corporation",
"license": "MIT",
"dependencies": {
"@azure-tools/test-perf": "^1.0.0",
"@azure/ai-language-text": "^1.1.0",
"@azure/identity": "^4.0.1",
"dotenv": "^16.0.0"
"@azure/identity": "^4.5.0",
"dotenv": "^16.0.0",
"tslib": "^2.8.1"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"ts-node": "^10.0.0",
"tslib": "^2.2.0",
"typescript": "~5.6.2"
},
"private": true,
"scripts": {
"build": "npm run clean && tsc -p .",
"build": "npm run clean && dev-tool run build-package",
"build:samples": "echo skipped",
"build:test": "echo skipped",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"clean": "dev-tool run vendored rimraf --glob dist dist-* types *.tgz *.log",
"format": "dev-tool run vendored prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"",
"format": "dev-tool run vendored prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"integration-test": "echo skipped",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"lint": "eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs test",
"lint:fix": "eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs test --fix --fix-type [problem,suggestion]",
"lint": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src",
"lint:fix": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"perf-test:node": "ts-node test/index.spec.ts",
"perf-test:node": "npm run build && node dist/esm/index.js",
"test": "echo skipped",
"test:browser": "echo skipped",
"test:node": "echo skipped",
"unit-test": "echo skipped",
"unit-test:browser": "echo skipped",
"unit-test:node": "echo skipped",
"update-snippets": "echo skipped"
}
},
"type": "module",
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"selfLink": false
},
"files": [
"dist/",
"README.md",
"LICENSE"
],
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"types": "./dist/commonjs/index.d.ts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// Licensed under the MIT License.

import { createPerfProgram } from "@azure-tools/test-perf";
import { LanguageDetectionTest } from "./languageDetection.spec";

import dotenv from "dotenv";
dotenv.config();
import { LanguageDetectionTest } from "./languageDetection.spec.js";
import "dotenv/config";

const perfProgram = createPerfProgram(LanguageDetectionTest);

Expand Down
18 changes: 15 additions & 3 deletions sdk/cognitivelanguage/perf-tests/ai-language-text/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"extends": "../../../../tsconfig",
"compilerOptions": {
"module": "CommonJS",
"noEmit": true
"module": "NodeNext",
"moduleResolution": "NodeNext",
"rootDir": ".",
"paths": {
"@azure-tests/perf-ai-language-text": ["./src/index.spec.js"]
}
},
"include": ["./test/**/*.ts"]
"include": [
"src/**/*.ts",
"src/**/*.mts",
"src/**/*.cts",
"samples-dev/**/*.ts",
"test/**/*.ts",
"test/**/*.mts",
"test/**/*.cts"
]
}
13 changes: 6 additions & 7 deletions sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"private": true,
"description": "Performance Tests for @azure/ai-form-recognizer",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"keywords": [],
"author": "Microsoft Corporation",
"license": "MIT",
"dependencies": {
"@azure-tools/test-perf": "^1.0.0",
"@azure/ai-form-recognizer": "^5.0.0",
"@azure/core-util": "^1.11.0",
"@azure/identity": "^4.0.1",
"@azure/identity": "^4.5.0",
"dotenv": "^16.0.0",
"tslib": "^2.8.1"
},
Expand All @@ -26,16 +26,16 @@
"build": "npm run clean && dev-tool run build-package",
"build:samples": "echo skipped",
"build:test": "echo skipped",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"clean": "dev-tool run vendored rimraf --glob dist dist-* types *.tgz *.log",
"format": "dev-tool run vendored prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"",
"format": "dev-tool run vendored prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
"integration-test": "echo skipped",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"lint": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src",
"lint:fix": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"perf-test:node": "npm run build && node dist/esm/index.spec.js",
"perf-test:node": "npm run build && node dist/esm/index.js",
"test": "echo skipped",
"test:browser": "echo skipped",
"test:node": "echo skipped",
Expand Down Expand Up @@ -74,6 +74,5 @@
}
}
},
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
"types": "./dist/commonjs/index.d.ts"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
DocumentModelAdministrationClient,
} from "@azure/ai-form-recognizer";
import { DefaultAzureCredential, TokenCredential } from "@azure/identity";
import { randomUUID } from "@azure/core-util";
import { randomUUID } from "node:crypto";

function unreachable(message?: string): never {
throw new Error(message ?? "Unreachable Exception.");
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/perf-tests/service-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"lint": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src",
"lint:fix": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs src --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"perf-test:node": "npm run build && node dist/esm/index.spec.js",
"perf-test:node": "npm run build && node dist/esm/index.js",
"test": "echo skipped",
"test:browser": "echo skipped",
"test:node": "echo skipped",
Expand Down

0 comments on commit 0e13ee1

Please sign in to comment.