Skip to content

[Infrastructure] Avoid polluting the repo with changes on builds #62399

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ modules/
*.user
*.userprefs
*.vspx
*.json.bak

# Specific files, typically generated by tools
.config/dotnet-tools.json
Expand Down
13 changes: 11 additions & 2 deletions eng/scripts/npm/update-dependency-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ function applyPackageVersion(packagesToPack, defaultPackageVersion) {
renames.push([`${packagePath}.bak`, packagePath]);

process.chdir(packageDir);
execSync(`npm version ${packageVersion} --no-git-tag-version --allow-same-version`, { stdio: 'inherit' });
try {
execSync(`npm version ${packageVersion} --no-git-tag-version --allow-same-version`, { stdio: 'inherit' });
console.log(`Applied version ${packageVersion} to ${packageName} in ${packageDir}...`);
} catch (error) {
console.warn(`Failed to run npm version command for ${packageName}, falling back to manual version update...`);
// Fallback: manually update the version in package.json
const packageJson = fs.readJsonSync(packagePath);
packageJson.version = packageVersion;
fs.writeJsonSync(packagePath, packageJson, { spaces: 2 });
console.log(`Manually applied version ${packageVersion} to ${packageName} in ${packageDir}...`);
}
process.chdir(currentDir);
console.log(`Applied version ${packageVersion} to ${packageName} in ${packageDir}...`);
}

return renames;
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion src/JSInterop/Microsoft.JSInterop.JS/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/signalr-protocol-msgpack",
"version": "5.0.0-dev",
"version": "10.0.0-dev",
"description": "MsgPack Protocol support for ASP.NET Core SignalR",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down Expand Up @@ -41,11 +41,11 @@
"src/**/*"
],
"dependencies": {
"@microsoft/signalr": "*",
"@microsoft/signalr": ">=10.0.0-dev",
"@msgpack/msgpack": "^2.7.0"
},
"overrides": {
"ws": ">=7.4.6",
"tough-cookie": ">=4.1.3"
}
}
}
2 changes: 1 addition & 1 deletion src/SignalR/clients/ts/signalr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/signalr",
"version": "5.0.0-dev",
"version": "10.0.0-dev",
"description": "ASP.NET Core SignalR Client",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
Loading