Skip to content

Commit

Permalink
[template] Upgrade @azure/template-dpg to ESM/vitest (#31837)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR

- @azure/template-dpg

### Issues associated with this PR

- #31338

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

Upgrades @azure/template-dpg to ESM/vitest

### 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)

---------

Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com>
  • Loading branch information
mpodwysocki and jeremymeng authored Nov 19, 2024
1 parent 8b7de5b commit faa0046
Show file tree
Hide file tree
Showing 22 changed files with 343 additions and 258 deletions.
149 changes: 141 additions & 8 deletions common/config/rush/pnpm-lock.yaml

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

18 changes: 9 additions & 9 deletions sdk/template/perf-tests/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
"version": "1.0.0",
"description": "Template project demonstrating use of the perf framework.",
"main": "",
"type": "module",
"keywords": [],
"author": "",
"license": "ISC",
"license": "MIT",
"dependencies": {
"@azure-tools/test-perf": "^1.0.0",
"@azure/app-configuration": "1.5.0-beta.2",
"@azure/core-util": "^1.6.1",
"@azure/identity": "^4.0.1",
"@azure/template": "^1.0.11-beta.1 || ^1.0.12-beta.1",
"@azure/app-configuration": "1.8.0",
"@azure/core-util": "^1.11.0",
"@azure/identity": "^4.5.0",
"@azure/template": "^1.0.11",
"dotenv": "^16.0.0"
},
"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",
"tslib": "^2.8.1",
"typescript": "~5.6.2"
},
"private": true,
Expand All @@ -34,8 +34,8 @@
"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 test",
"lint:fix": "dev-tool run vendored eslint -c ../../../../common/tools/eslint-plugin-azure-sdk/eslint.perftests.config.mjs test --fix --fix-type [problem,suggestion]",
"pack": "npm pack 2>&1",
"perf-test:node": "npm run build && node dist-esm/index.spec.js",
"test": "echo skipped",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { randomUUID } from "@azure/core-util";
import { PerfOptionDictionary } from "@azure-tools/test-perf";
import { TemplateTest } from "./templateBase.spec";
import { TemplateTest } from "./templateBase.spec.js";

interface GetConfigurationSettingTestOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/template/perf-tests/template/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { createPerfProgram } from "@azure-tools/test-perf";
import { GetConfigurationSettingTest } from "./getConfigurationSetting.spec";
import { GetConfigurationSettingTest } from "./getConfigurationSetting.spec.js";

const perfProgram = createPerfProgram(GetConfigurationSettingTest);

Expand Down
5 changes: 1 addition & 4 deletions sdk/template/perf-tests/template/test/templateBase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { AppConfigurationClient } from "@azure/app-configuration";
import { PerfTest, getEnvVar } from "@azure-tools/test-perf";
import { ConfigurationClient } from "@azure/template";
import { DefaultAzureCredential } from "@azure/identity";

// Expects the .env file at the same level
import * as dotenv from "dotenv";
dotenv.config();
import "dotenv/config";

export abstract class TemplateTest<TOptions> extends PerfTest<TOptions> {
// Since the template project's client is limited in scope (and only supports getConfigurationSetting),
Expand Down
5 changes: 3 additions & 2 deletions sdk/template/perf-tests/template/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "../../../../tsconfig",
"compilerOptions": {
"module": "CommonJS",
"module": "NodeNext",
"moduleResolution": "nodenext",
"declarationDir": "./typings/latest",
"lib": ["ES6", "ESNext.AsyncIterable"],
"noEmit": true
"outDir": "./dist-esm"
},
"compileOnSave": true,
"include": ["./test/**/*.ts"]
Expand Down
5 changes: 0 additions & 5 deletions sdk/template/template-dpg/.mocharc.json

This file was deleted.

15 changes: 13 additions & 2 deletions sdk/template/template-dpg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Release History

## 1.0.0-beta.1 (2023-05-26)
## 1.0.0-beta.2 (unreleased)

### Features Added
- Introducing the Azure SDK for JavaScript Template DPG project
- Test Release Pipeline

### Breaking Changes

### Bugs Fixed

### Other Changes

## 1.0.0-beta.1 (2023-08-11)

### Features Added
- Test Release Pipeline
Loading

0 comments on commit faa0046

Please sign in to comment.