Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .chronus/changes/upgrade-deps-feb-2026-2026-1-17-16-41-15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: dependencies
packages:
- "@azure-tools/azure-http-specs"
- "@azure-tools/typespec-autorest-canonical"
- "@azure-tools/typespec-autorest"
- "@azure-tools/typespec-azure-core"
- "@azure-tools/typespec-azure-portal-core"
- "@azure-tools/typespec-azure-resource-manager"
- "@azure-tools/typespec-azure-rulesets"
- "@azure-tools/typespec-client-generator-core"
- "@azure-tools/typespec-metadata"
---

Upgrade dependencies
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"prettier.prettierPath": "./core/packages/compiler/node_modules/prettier/index.cjs",
"prettier.documentSelectors": ["**/*.tsp"],
"typespec.tsp-server.path": "${workspaceRoot}/core/packages/compiler",
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"cSpell.words": ["autorest", "typespec"],
"dotnet.defaultSolution": "disable",
"eslint.useFlatConfig": true
Expand Down
2 changes: 1 addition & 1 deletion core
Submodule core updated 106 files
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"type": "module",
"packageManager": "pnpm@10.23.0",
"packageManager": "pnpm@10.30.2",
"scripts": {
"run-all": "pnpm -r --filter=!./core/",
"run-azure-only": "pnpm -r --filter=\"!./core/**\"",
Expand Down Expand Up @@ -42,15 +42,15 @@
"devDependencies": {
"@chronus/chronus": "^1.0.1",
"@chronus/github": "^1.0.1",
"@eslint/js": "^9.39.2",
"@eslint/js": "^10.0.1",
"@pnpm/workspace.find-packages": "^1000.0.24",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@vitest/coverage-v8": "^4.0.15",
"c8": "^10.1.3",
"cspell": "^9.4.0",
"eslint": "^9.39.2",
"eslint": "^10.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-unicorn": "^62.0.0",
"eslint-plugin-unicorn": "^63.0.0",
"@vitest/eslint-plugin": "^1.5.2",
"playwright": "^1.57.0",
"prettier": "~3.8.0",
Expand All @@ -61,7 +61,7 @@
"syncpack": "^13.0.3",
"tsx": "^4.21.0",
"typescript": "~5.9.2",
"typescript-eslint": "^8.49.0",
"typescript-eslint": "^8.56.0",
"vitest": "^4.0.15"
},
"syncpack": {
Expand Down
2 changes: 1 addition & 1 deletion packages/azure-http-specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@azure-tools/typespec-azure-resource-manager": "workspace:^",
"@azure-tools/typespec-client-generator-core": "workspace:^",
"@types/multer": "^2.0.0",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/openapi": "workspace:^",
"@typespec/openapi3": "workspace:^",
"concurrently": "^9.1.2",
Expand Down
157 changes: 157 additions & 0 deletions packages/integration-tester/src/find-packages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import { findWorkspacePackagesNoCheck } from "@pnpm/workspace.find-packages";
import { readdir } from "node:fs/promises";
import { relative, resolve } from "pathe";
import pc from "picocolors";
import * as tar from "tar";
import { log } from "./utils.js";

/**
* Collection of packages indexed by package name.
*/
export interface Packages {
[key: string]: {
/** The package name (e.g., "@typespec/compiler") */
name: string;
/** Absolute path to the package directory or .tgz file */
path: string;
};
}

/**
* Options for {@link findPackages}
*/
export interface FindPackageOptions {
/** Directory containing PNPM workspace to scan for packages */
wsDir?: string;
/** Directory containing .tgz artifact files */
tgzDir?: string;
}

/**
* Finds packages from either a workspace directory or tgz artifact directory.
*
* @param options - Configuration specifying the source to find packages from
* @returns Promise resolving to a collection of discovered packages
* @throws Error if neither wsDir nor tgzDir is provided
*/
export function findPackages(options: FindPackageOptions): Promise<Packages> {
if (options.tgzDir) {
return findPackagesFromTgzArtifactDir(options.tgzDir);
}
if (options.wsDir) {
return findPackagesFromWorkspace(options.wsDir);
} else {
throw new Error("Either wsDir or tgzDir must be provided to findPackages");
}
}

/**
* Prints a formatted list of discovered packages to the console.
*
* @param packages - Collection of packages to display
*/
export function printPackages(packages: Packages): void {
log("Found packages:");
for (const [name, pkg] of Object.entries(packages)) {
log(` ${pc.green(name)}: ${pc.cyan(relative(process.cwd(), pkg.path))}`);
}
}

/**
* Discovers packages from a directory containing .tgz artifact files.
*
* This function scans a directory for .tgz files and extracts package information
* by reading the package.json from within each tar file.
*
* @param tgzDir - Directory containing .tgz artifact files
* @returns Promise resolving to discovered packages with paths pointing to .tgz files
*/
export async function findPackagesFromTgzArtifactDir(tgzDir: string): Promise<Packages> {
const packages: Packages = {};

const items = await readdir(tgzDir, { withFileTypes: true });
const tgzFiles = items
.filter((item) => item.isFile() && item.name.endsWith(".tgz"))
.map((item) => item.name);

// Process tar files in parallel
await Promise.all(
tgzFiles.map(async (tgzFile) => {
const fullPath = resolve(tgzDir, tgzFile);
const packageName = await extractPackageNameFromTgzFile(fullPath);

if (packageName) {
packages[packageName] = {
name: packageName,
path: fullPath,
};
}
}),
);

return packages;
}

/**
* Extracts the package name by reading package.json from a .tgz file.
*
* This function reads the package.json file from the root of the tar archive
* to get the accurate package name, which is more reliable than parsing filenames.
*
* @param tgzFilePath - Path to the .tgz file
* @returns Promise resolving to the package name, or null if not found
*/
async function extractPackageNameFromTgzFile(tgzFilePath: string): Promise<string | null> {
try {
let packageJsonContent: string | null = null;

await tar.t({
file: tgzFilePath,
// cspell:ignore onentry
onentry: (entry) => {
if (entry.path === "package/package.json") {
entry.on("data", (chunk) => {
if (packageJsonContent === null) {
packageJsonContent = "";
}
packageJsonContent += chunk.toString();
});
}
},
});

if (packageJsonContent) {
const packageJson = JSON.parse(packageJsonContent);
return packageJson.name || null;
}

return null;
} catch (error) {
throw new Error(`Failed to read package.json from ${tgzFilePath}: ${error}`, { cause: error });
}
}

/**
* Discovers packages from a PNPM workspace configuration.
*
* This function uses PNPM's workspace discovery to find all packages in a monorepo.
* It filters out private packages and packages without names.
*
* @param root - Root directory of the PNPM workspace
* @returns Promise resolving to discovered packages with paths pointing to package directories
*/
export async function findPackagesFromWorkspace(root: string): Promise<Packages> {
const pnpmPackages = await findWorkspacePackagesNoCheck(root);
const packages: Packages = {};

for (const pkg of pnpmPackages) {
if (!pkg.manifest.name || pkg.manifest.private) continue;

packages[pkg.manifest.name] = {
name: pkg.manifest.name,
path: pkg.rootDirRealPath,
};
}

return packages;
}
2 changes: 1 addition & 1 deletion packages/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@typespec/xml": "workspace:^"
},
"devDependencies": {
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/internal-build-utils": "workspace:^",
"@typespec/samples": "workspace:^",
"@vitest/coverage-v8": "^4.0.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-autorest-canonical/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@azure-tools/typespec-azure-core": "workspace:^",
"@azure-tools/typespec-azure-resource-manager": "workspace:^",
"@azure-tools/typespec-client-generator-core": "workspace:^",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
"@typespec/library-linter": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-autorest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@azure-tools/typespec-azure-core": "workspace:^",
"@azure-tools/typespec-azure-resource-manager": "workspace:^",
"@azure-tools/typespec-client-generator-core": "workspace:^",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
"@typespec/json-schema": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-azure-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@typespec/rest": "workspace:^"
},
"devDependencies": {
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
"@typespec/library-linter": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-azure-core/src/decorators/lro-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export const $lroStatus: LroStatusDecorator = (
*/
export function findLroStatusProperty(program: Program, target: Model): ModelProperty | undefined {
function getProvisioningState(props: Map<string, ModelProperty>): ModelProperty | undefined {
let innerProps: Map<string, ModelProperty> | undefined = undefined;
let result: ModelProperty | undefined = undefined;
let innerProps: Map<string, ModelProperty> | undefined;
let result: ModelProperty | undefined;
const innerProperty = props.get("properties");
result = props.get("provisioningState");
if (
Expand Down
4 changes: 1 addition & 3 deletions packages/typespec-azure-core/src/lro-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
type PollingLocationInfo,
pollingOptionsKind,
type StatusMonitorMetadata,
type StatusMonitorPollingLocationInfo,
} from "./decorators/polling-location.js";
import { PollingOperationKey } from "./decorators/polling-operation.js";
import type { PropertyMap } from "./lro-info.js";
Expand Down Expand Up @@ -841,7 +840,6 @@ function getStatusMonitorLinksFromModel(
program: Program,
model: Model,
): StatusMonitorLinkData | undefined {
let pollingData: StatusMonitorPollingLocationInfo | undefined = undefined;
let pollingLinks: ModelProperty[] | undefined = filterModelProperties(model, (prop) =>
isPollingLocation(program, prop),
);
Expand All @@ -851,7 +849,7 @@ function getStatusMonitorLinksFromModel(
pollingLinks = pollingLinks.filter((p) => !isBody(program, p) && !isBodyRoot(program, p));
}
const pollingProperty = pollingLinks[0];
pollingData = getPollingLocationInfo(program, pollingProperty);
const pollingData = getPollingLocationInfo(program, pollingProperty);
const pollingLink = createOperationLink(program, pollingProperty);
const monitorInfo = getStatusMonitorInfo(program, pollingLink, pollingData);
if (monitorInfo === undefined) return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const responseSchemaMultiStatusCodeRule = createRule({
if (body === undefined) continue;
const bodyType = body.type;

let currResponse: Type | undefined = undefined;
let currResponse: Type | undefined;
switch (bodyType.kind) {
case "Model":
const effModel = metadataInfo.getEffectivePayloadType(bodyType, Visibility.Read);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test.describe("typespec-azure-playground-website UI tests", () => {
const samplesButton = page.locator('button[aria-label="Browse samples"]');
await samplesButton.click();
await page.locator("text=Azure Resource Manager framework").first().click();
const outputContainer = page.locator("_react=FileOutput");
await expect(outputContainer).toContainText(`"title": "ContosoProviderHubClient"`);
await expect(page.getByText(`"title": "ContosoProviderHubClient"`)).toBeVisible();
});
});
2 changes: 1 addition & 1 deletion packages/typespec-azure-playground-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
},
"devDependencies": {
"@playwright/test": "^1.57.0",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@types/react-dom": "~19.2.2",
"@typespec/bundler": "workspace:^",
"@typespec/playground": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-azure-portal-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@azure-tools/typespec-azure-core": "workspace:^",
"@azure-tools/typespec-azure-resource-manager": "workspace:^",
"@azure-tools/typespec-client-generator-core": "workspace:^",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
"@typespec/library-linter": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-azure-resource-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
"devDependencies": {
"@azure-tools/typespec-azure-core": "workspace:^",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@types/pluralize": "^0.0.33",
"@typespec/compiler": "workspace:^",
"@typespec/http": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ export function registerArmResource(
return;
}

let keyName: string | undefined = undefined;
let collectionName: string | undefined = undefined;
let kind: ArmResourceKind | undefined = undefined;
let keyName: string | undefined;
let collectionName: string | undefined;
let kind: ArmResourceKind | undefined;

if (type !== undefined && nameParameter !== undefined) {
keyName = nameParameter;
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-azure-rulesets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@azure-tools/typespec-azure-core": "workspace:^",
"@azure-tools/typespec-azure-resource-manager": "workspace:^",
"@azure-tools/typespec-client-generator-core": "workspace:^",
"@types/node": "~25.0.2",
"@types/node": "~25.2.3",
"@typespec/compiler": "workspace:^",
"@typespec/tspd": "workspace:^",
"@vitest/coverage-v8": "^4.0.15",
Expand Down
6 changes: 3 additions & 3 deletions packages/typespec-azure-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "git+https://github.com/Azure/typespec-azure.git"
},
"engines": {
"vscode": "^1.108.0"
"vscode": "^1.109.0"
},
"extensionDependencies": [
"typespec.typespec-vscode"
Expand All @@ -35,8 +35,8 @@
"lint:fix": "eslint . --fix "
},
"devDependencies": {
"@types/node": "~25.0.2",
"@types/vscode": "~1.108.1",
"@types/node": "~25.2.3",
"@types/vscode": "~1.109.0",
"@vscode/vsce": "~3.7.1",
"esbuild": "^0.27.0",
"typescript": "~5.9.2"
Expand Down
Loading
Loading