Skip to content
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

[anamoly-dectector-rest] Migration to ESM/vitest #31952

Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5dc9658
Migration: Update package.json, tsconfig.json, and api-extractor.json
HarshaNalluru Nov 26, 2024
7d49fc7
Migration: Update test config
HarshaNalluru Nov 26, 2024
b362934
Migration: Clean up files
HarshaNalluru Nov 26, 2024
60be93b
Migration: Apply codemod: "fixSourceFile"
HarshaNalluru Nov 26, 2024
8619fcc
Migration: Apply codemod: "fixTestingImports"
HarshaNalluru Nov 26, 2024
99885af
Migration: Apply codemod: "replaceAssertIsRejected"
HarshaNalluru Nov 26, 2024
7fc33b2
Migration: Apply codemod: "replaceSinonStub"
HarshaNalluru Nov 26, 2024
9b713d6
Migration: Apply codemod: "addViHelper"
HarshaNalluru Nov 26, 2024
436fcdc
Migration: Apply codemod: "replaceSupportTracing"
HarshaNalluru Nov 26, 2024
ef828ba
Migration: Apply codemod: "replaceTestUtils"
HarshaNalluru Nov 26, 2024
468cbc2
Migration: rushx format
HarshaNalluru Nov 26, 2024
1b90d3d
lock file
HarshaNalluru Nov 26, 2024
c6d303b
package.json
HarshaNalluru Nov 26, 2024
45415f3
fix tests
HarshaNalluru Nov 26, 2024
485904a
Merge branch 'main' of https://github.com/azure/azure-sdk-for-js into…
HarshaNalluru Dec 4, 2024
74d3c9d
fix build
HarshaNalluru Dec 4, 2024
f11ecd9
lock file
HarshaNalluru Dec 4, 2024
71202c8
Merge branch 'main' of https://github.com/azure/azure-sdk-for-js into…
HarshaNalluru Dec 4, 2024
0869604
lock file
HarshaNalluru Dec 4, 2024
7187bed
feedbakc
HarshaNalluru Dec 10, 2024
367da4a
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Dec 10, 2024
5ffda6c
lock file
HarshaNalluru Dec 10, 2024
d87cd11
fix package.json
HarshaNalluru Dec 10, 2024
079abd4
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-js into…
HarshaNalluru Dec 10, 2024
4657384
lock file
HarshaNalluru Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions common/config/rush/pnpm-lock.yaml

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

27 changes: 20 additions & 7 deletions sdk/anomalydetector/ai-anomaly-detector-rest/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./types/src/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/ai-anomaly-detector.d.ts"
"publicTrimmedFilePath": "dist/ai-anomaly-detector.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
130 changes: 0 additions & 130 deletions sdk/anomalydetector/ai-anomaly-detector-rest/karma.conf.js

This file was deleted.

94 changes: 57 additions & 37 deletions sdk/anomalydetector/ai-anomaly-detector-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,28 @@
"isomorphic"
],
"license": "MIT",
"main": "dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/ai-anomaly-detector.d.ts",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/commonjs/index.d.ts",
"repository": "github:Azure/azure-sdk-for-js",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/",
"dist-esm/src/",
"types/ai-anomaly-detector.d.ts",
"README.md",
"LICENSE",
"review/*"
"LICENSE"
],
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
"build:browser": "tsc -p . && dev-tool run bundle",
"build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
"build:node": "tsc -p . && dev-tool run bundle --browser-test false",
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
"build:browser": "dev-tool run build-package && dev-tool run bundle",
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved
"build:debug": "dev-tool run build-package && dev-tool run bundle && dev-tool run extract-api",
"build:node": "dev-tool run build-package && dev-tool run bundle --browser-test false",
"build:samples": "echo skipped.",
"build:test": "tsc -p . && dev-tool run bundle",
"build:test": "dev-tool run build-package && dev-tool run bundle",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "dev-tool samples run samples-dev",
Expand All @@ -54,8 +51,8 @@
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "dev-tool run test:browser",
"unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved
"unit-test:node": "dev-tool run test:vitest",
"update-snippets": "echo skipped"
},
"sideEffects": false,
Expand All @@ -70,34 +67,22 @@
"tslib": "^2.2.0"
},
"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/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/identity": "^4.0.1",
"@types/chai": "^4.2.8",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"@vitest/browser": "^2.1.5",
"@vitest/coverage-istanbul": "^2.1.5",
"autorest": "latest",
"chai": "^4.2.0",
"csv-parse": "^5.0.3",
"dotenv": "^16.0.0",
"eslint": "^9.9.0",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
"karma-env-preprocessor": "^0.1.1",
"karma-firefox-launcher": "^2.1.3",
"karma-junit-reporter": "^2.0.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"nyc": "^17.0.0",
"source-map-support": "^0.5.9",
"ts-node": "^10.0.0",
"typescript": "~5.6.2"
"playwright": "^1.49.0",
"typescript": "~5.6.2",
"vitest": "^2.1.5"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/anomalydetector/ai-anomaly-detector-rest/README.md",
"//metadata": {
Expand All @@ -108,15 +93,50 @@
}
]
},
"browser": {
"./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
},
"browser": "./dist/browser/index.js",
"//sampleConfiguration": {
"productName": "AnomalyDetectorRest",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/ai-anomaly-detector?view=azure-node-preview"
},
"type": "module",
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"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 @@ -15,7 +15,7 @@ import AnomalyDetector, {
import { AzureKeyCredential } from "@azure/core-auth";

import { parse } from "csv-parse/sync";
import * as fs from "fs";
import * as fs from "node:fs";

// Load the .env file if it exists
import * as dotenv from "dotenv";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import AnomalyDetector, {
import { AzureKeyCredential } from "@azure/core-auth";

import { parse } from "csv-parse/sync";
import * as fs from "fs";
import * as fs from "node:fs";

// Load the .env file if it exists
import * as dotenv from "dotenv";
Expand Down
Loading
Loading