Skip to content

Commit

Permalink
fix(manifest): do not group changes under "." (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe authored Mar 25, 2021
1 parent 183b235 commit 47b8b43
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 46 deletions.
78 changes: 39 additions & 39 deletions __snapshots__/manifest.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
exports['Manifest pullRequest allows root module to be published, via special "." path: changes'] = `
filename: node/pkg1/CHANGELOG.md
filename: CHANGELOG.md
# Changelog
## [4.0.0](https://github.com/fake/repo/compare/pkg1-v3.2.1...pkg1-v4.0.0) (1983-10-10)
## [3.0.0](https://github.com/fake/repo/compare/googleapis-v2.0.0...googleapis-v3.0.0) (1983-10-10)
### ⚠ BREAKING CHANGES
* **@node/pkg1:** major new feature
* **@node/pkg2:** major new feature
### Features
* **@node/pkg1:** major new feature ([e3ab0ab](https://github.com/fake/repo/commit/e3ab0abfd66e66324f685ceeececf35c))
* **@node/pkg2:** major new feature ([72f962d](https://github.com/fake/repo/commit/72f962d44ba0bcee15594ea6bdc67d8b))
filename: node/pkg1/package.json
### Bug Fixes
* **root:** root only change ([8b55db3](https://github.com/fake/repo/commit/8b55db3f6115306cc9c132bec0bb1447))
filename: package.json
{
"name": "@node/pkg1",
"version": "4.0.0"
"name": "googleapis",
"version": "3.0.0"
}
filename: node/pkg2/CHANGELOG.md
filename: node/pkg1/CHANGELOG.md
# Changelog
## [2.0.0](https://github.com/fake/repo/compare/pkg2-v1.2.3...pkg2-v2.0.0) (1983-10-10)
## [4.0.0](https://github.com/fake/repo/compare/pkg1-v3.2.1...pkg1-v4.0.0) (1983-10-10)
### ⚠ BREAKING CHANGES
* **@node/pkg2:** major new feature
* **@node/pkg1:** major new feature
### Features
* **@node/pkg2:** major new feature ([72f962d](https://github.com/fake/repo/commit/72f962d44ba0bcee15594ea6bdc67d8b))
* **@node/pkg1:** major new feature ([e3ab0ab](https://github.com/fake/repo/commit/e3ab0abfd66e66324f685ceeececf35c))
filename: node/pkg2/package.json
filename: node/pkg1/package.json
{
"name": "@node/pkg2",
"version": "2.0.0"
"name": "@node/pkg1",
"version": "4.0.0"
}
filename: CHANGELOG.md
filename: node/pkg2/CHANGELOG.md
# Changelog
## [3.0.0](https://github.com/fake/repo/compare/googleapis-v2.0.0...googleapis-v3.0.0) (1983-10-10)
## [2.0.0](https://github.com/fake/repo/compare/pkg2-v1.2.3...pkg2-v2.0.0) (1983-10-10)
### ⚠ BREAKING CHANGES
* **@node/pkg1:** major new feature
* **@node/pkg2:** major new feature
### Features
* **@node/pkg1:** major new feature ([e3ab0ab](https://github.com/fake/repo/commit/e3ab0abfd66e66324f685ceeececf35c))
* **@node/pkg2:** major new feature ([72f962d](https://github.com/fake/repo/commit/72f962d44ba0bcee15594ea6bdc67d8b))
### Bug Fixes
* **root:** root only change ([8b55db3](https://github.com/fake/repo/commit/8b55db3f6115306cc9c132bec0bb1447))
filename: package.json
filename: node/pkg2/package.json
{
"name": "googleapis",
"version": "3.0.0"
"name": "@node/pkg2",
"version": "2.0.0"
}
filename: .release-please-manifest.json
Expand All @@ -85,54 +85,54 @@ branch: release-please/branches/main
description: :robot: I have created a release \\*beep\\* \\*boop\\*
---
@node/pkg1: 4.0.0
## [4.0.0](https://github.com/fake/repo/compare/pkg1-v3.2.1...pkg1-v4.0.0) (1983-10-10)
googleapis: 3.0.0
## [3.0.0](https://github.com/fake/repo/compare/googleapis-v2.0.0...googleapis-v3.0.0) (1983-10-10)
### ⚠ BREAKING CHANGES
* **@node/pkg1:** major new feature
* **@node/pkg2:** major new feature
### Features
* **@node/pkg1:** major new feature ([e3ab0ab](https://github.com/fake/repo/commit/e3ab0abfd66e66324f685ceeececf35c))
* **@node/pkg2:** major new feature ([72f962d](https://github.com/fake/repo/commit/72f962d44ba0bcee15594ea6bdc67d8b))
### Bug Fixes
* **root:** root only change ([8b55db3](https://github.com/fake/repo/commit/8b55db3f6115306cc9c132bec0bb1447))
---
---
@node/pkg2: 2.0.0
## [2.0.0](https://github.com/fake/repo/compare/pkg2-v1.2.3...pkg2-v2.0.0) (1983-10-10)
@node/pkg1: 4.0.0
## [4.0.0](https://github.com/fake/repo/compare/pkg1-v3.2.1...pkg1-v4.0.0) (1983-10-10)
### ⚠ BREAKING CHANGES
* **@node/pkg2:** major new feature
* **@node/pkg1:** major new feature
### Features
* **@node/pkg2:** major new feature ([72f962d](https://github.com/fake/repo/commit/72f962d44ba0bcee15594ea6bdc67d8b))
* **@node/pkg1:** major new feature ([e3ab0ab](https://github.com/fake/repo/commit/e3ab0abfd66e66324f685ceeececf35c))
---
---
googleapis: 3.0.0
## [3.0.0](https://github.com/fake/repo/compare/googleapis-v2.0.0...googleapis-v3.0.0) (1983-10-10)
@node/pkg2: 2.0.0
## [2.0.0](https://github.com/fake/repo/compare/pkg2-v1.2.3...pkg2-v2.0.0) (1983-10-10)
### ⚠ BREAKING CHANGES
* **@node/pkg1:** major new feature
* **@node/pkg2:** major new feature
### Features
* **@node/pkg1:** major new feature ([e3ab0ab](https://github.com/fake/repo/commit/e3ab0abfd66e66324f685ceeececf35c))
* **@node/pkg2:** major new feature ([72f962d](https://github.com/fake/repo/commit/72f962d44ba0bcee15594ea6bdc67d8b))
### Bug Fixes
* **root:** root only change ([8b55db3](https://github.com/fake/repo/commit/8b55db3f6115306cc9c132bec0bb1447))
---
Expand Down
6 changes: 5 additions & 1 deletion src/commit-split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export class CommitSplit {
let pkgName;
if (this.packagePaths) {
// only track paths under this.packagePaths
pkgName = this.packagePaths.find(p => file.indexOf(p) >= 0);
pkgName = this.packagePaths.find(p => {
// The special "." path, representing the root of the module
// should be ignored by commit-split:
return file.indexOf(p) >= 0 && p !== '.';
});
} else {
// track paths by top level folder
pkgName = splitPath[0];
Expand Down
12 changes: 6 additions & 6 deletions test/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ describe('Manifest', () => {

it('allows root module to be published, via special "." path', async function () {
const manifest = JSON.stringify({
'.': '2.0.0',
'node/pkg1': '3.2.1',
'node/pkg2': '1.2.3',
'.': '2.0.0',
});
const config = JSON.stringify({
packages: {
'.': {},
'node/pkg1': {},
'node/pkg2': {},
'.': {},
},
});
const commits = [
Expand Down Expand Up @@ -341,20 +341,20 @@ describe('Manifest', () => {
expect(pr).to.equal(22);
expect(logs).to.eql([
[
'Found version 3.2.1 for node/pkg1 in .release-please-manifest.json at abc123 of main',
'Found version 2.0.0 for . in .release-please-manifest.json at abc123 of main',
CheckpointType.Success,
],
[
'Found version 1.2.3 for node/pkg2 in .release-please-manifest.json at abc123 of main',
'Found version 3.2.1 for node/pkg1 in .release-please-manifest.json at abc123 of main',
CheckpointType.Success,
],
[
'Found version 2.0.0 for . in .release-please-manifest.json at abc123 of main',
'Found version 1.2.3 for node/pkg2 in .release-please-manifest.json at abc123 of main',
CheckpointType.Success,
],
['Processing package: Node(googleapis)', CheckpointType.Success],
['Processing package: Node(@node/pkg1)', CheckpointType.Success],
['Processing package: Node(@node/pkg2)', CheckpointType.Success],
['Processing package: Node(googleapis)', CheckpointType.Success],
]);
});

Expand Down

0 comments on commit 47b8b43

Please sign in to comment.