New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

release-please

Package Overview
Dependencies
Maintainers
2
Versions
387
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

release-please - npm Package Compare versions

Comparing version

to
13.1.1

19

build/src/plugins/cargo-workspace.js

@@ -29,2 +29,3 @@ "use strict";

const versioning_strategy_1 = require("../versioning-strategy");
const cargo_lock_1 = require("../updaters/rust/cargo-lock");
/**

@@ -54,3 +55,5 @@ * The plugin analyzed a cargo workspace and will bump dependencies

const candidatesByPackage = {};
for (const path of cargoManifest.workspace.members) {
const members = cargoManifest.workspace.members;
members.push(manifest_1.ROOT_PROJECT_PATH);
for (const path of members) {
const manifestPath = addPath(path, 'Cargo.toml');

@@ -65,3 +68,4 @@ logger_1.logger.info(`looking for candidate with path: ${path}`);

if (!packageName) {
throw new Error(`package manifest at ${manifestPath} is missing [package.name]`);
logger_1.logger.warn(`package manifest at ${manifestPath} is missing [package.name]`);
continue;
}

@@ -111,5 +115,11 @@ if (candidate) {

}
else if (update.updater instanceof changelog_1.Changelog) {
else if (update.updater instanceof changelog_1.Changelog && dependencyNotes) {
update.updater.changelogEntry = appendDependenciesSectionToChangelog(update.updater.changelogEntry, dependencyNotes);
}
else if (update.path === addPath(existingCandidate.path, 'Cargo.lock')) {
update.updater = new cargo_lock_1.CargoLock({
version,
versionsMap: updatedVersions,
});
}
return update;

@@ -202,4 +212,3 @@ });

inScope(candidate) {
return (candidate.config.releaseType === 'rust' &&
candidate.path !== manifest_1.ROOT_PROJECT_PATH);
return candidate.config.releaseType === 'rust';
}

@@ -206,0 +215,0 @@ packageNameFromPackage(pkg) {

@@ -15,7 +15,4 @@ import { CargoManifest } from '../updaters/rust/common';

protected getPackageManifest(): Promise<CargoManifest | null>;
/**
* @returns the workspace's manifest, ie. `Cargo.toml` (top-level)
*/
protected getWorkspaceManifest(): Promise<CargoManifest | null>;
private getContent;
protected getManifest(path: string): Promise<CargoManifest | null>;
}

@@ -28,2 +28,3 @@ "use strict";

async buildUpdates(options) {
var _a, _b, _c;
const updates = [];

@@ -39,14 +40,52 @@ const version = options.newVersion;

});
const workspaceManifest = await this.getWorkspaceManifest();
const manifestPaths = [];
let lockPath;
if (workspaceManifest &&
workspaceManifest.workspace &&
workspaceManifest.workspace.members) {
const workspaceManifest = await this.getPackageManifest();
const versionsMap = new Map();
if ((_a = workspaceManifest === null || workspaceManifest === void 0 ? void 0 : workspaceManifest.workspace) === null || _a === void 0 ? void 0 : _a.members) {
const members = workspaceManifest.workspace.members;
if ((_b = workspaceManifest.package) === null || _b === void 0 ? void 0 : _b.name) {
versionsMap.set(workspaceManifest.package.name, version);
}
else {
logger_1.logger.warn('No workspace manifest package name found');
}
logger_1.logger.info(`found workspace with ${members.length} members, upgrading all`);
// Collect submodule names to update
const manifestsByPath = new Map();
for (const member of members) {
manifestPaths.push(`${member}/Cargo.toml`);
const manifestPath = `${member}/Cargo.toml`;
const manifestContent = await this.getContent(manifestPath);
if (!manifestContent) {
logger_1.logger.warn(`member ${member} declared but did not find Cargo.toml`);
continue;
}
const manifest = common_1.parseCargoManifest(manifestContent.parsedContent);
manifestsByPath.set(manifestPath, manifestContent);
if (!((_c = manifest.package) === null || _c === void 0 ? void 0 : _c.name)) {
logger_1.logger.warn(`member ${member} has no package name`);
continue;
}
versionsMap.set(manifest.package.name, version);
}
lockPath = 'Cargo.lock';
logger_1.logger.info(`updating ${manifestsByPath.size} submodules`);
logger_1.logger.debug('versions map:', versionsMap);
for (const [manifestPath, manifestContent] of manifestsByPath) {
updates.push({
path: this.addPath(manifestPath),
createIfMissing: false,
cachedFileContents: manifestContent,
updater: new cargo_toml_1.CargoToml({
version,
versionsMap,
}),
});
}
// Update root Cargo.toml
updates.push({
path: this.addPath('Cargo.toml'),
createIfMissing: false,
updater: new cargo_toml_1.CargoToml({
version,
versionsMap,
}),
});
}

@@ -56,10 +95,4 @@ else {

logger_1.logger.info(`single crate found, updating ${manifestPath}`);
manifestPaths.push(manifestPath);
lockPath = this.addPath('Cargo.lock');
}
const versionsMap = new Map();
versionsMap.set(this.component || '', version);
for (const path of manifestPaths) {
updates.push({
path,
path: manifestPath,
createIfMissing: false,

@@ -73,3 +106,3 @@ updater: new cargo_toml_1.CargoToml({

updates.push({
path: lockPath,
path: this.addPath('Cargo.lock'),
createIfMissing: false,

@@ -99,19 +132,9 @@ updater: new cargo_lock_1.CargoLock({

if (this.packageManifest === undefined) {
this.packageManifest = await this.getManifest(this.addPath('Cargo.toml'));
this.packageManifest = await this.getManifest('Cargo.toml');
}
return this.packageManifest;
}
/**
* @returns the workspace's manifest, ie. `Cargo.toml` (top-level)
*/
async getWorkspaceManifest() {
if (this.workspaceManifest === undefined) {
this.workspaceManifest = await this.getManifest('Cargo.toml');
}
return this.workspaceManifest;
}
async getManifest(path) {
let content;
async getContent(path) {
try {
content = await this.github.getFileContentsOnBranch(path, this.targetBranch);
return await this.github.getFileContentsOnBranch(this.addPath(path), this.targetBranch);
}

@@ -121,6 +144,9 @@ catch (e) {

}
return common_1.parseCargoManifest(content.parsedContent);
}
async getManifest(path) {
const content = await this.getContent(path);
return content ? common_1.parseCargoManifest(content.parsedContent) : null;
}
}
exports.Rust = Rust;
//# sourceMappingURL=rust.js.map

@@ -31,3 +31,2 @@ "use strict";

updateContent(content) {
var _a;
let payload = content;

@@ -43,8 +42,4 @@ if (!this.versionsMap) {

}
payload = toml_edit_1.replaceTomlValue(payload, ['package', 'version'], this.version.toString());
for (const [pkgName, pkgVersion] of this.versionsMap) {
if (parsed.package.name === pkgName) {
logger_1.logger.info(`updating own version from ${(_a = parsed.package) === null || _a === void 0 ? void 0 : _a.version} to ${pkgVersion}`);
payload = toml_edit_1.replaceTomlValue(payload, ['package', 'version'], pkgVersion.toString());
continue; // to next [pkgName, pkgVersion] pair
}
for (const depKind of common_1.DEP_KINDS) {

@@ -51,0 +46,0 @@ const deps = parsed[depKind];

{
"name": "release-please",
"version": "13.1.0",
"version": "13.1.1",
"description": "generate release PRs based on the conventionalcommits.org spec",

@@ -5,0 +5,0 @@ "main": "./build/src/index.js",

@@ -94,2 +94,20 @@ <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

## How can I fix release notes?
If you have merged a pull request and you would like to amend the commit message
used to generate the release notes for that commit, you can edit the body of
the merged pull requests and add a section like:
```
BEGIN_COMMIT_OVERRIDE
feat: add ability to override merged commit message
fix: another message
chore: a third message
END_COMMIT_OVERRIDE
```
The next time release please runs, it will use that override section as the
commit message instead of the merged commit message.
## Strategy (Language) types supported

@@ -96,0 +114,0 @@

Sorry, the diff of this file is too big to display