monorepo-next 8.3.1 → 8.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monorepo-next",
3
- "version": "8.3.1",
3
+ "version": "8.3.2",
4
4
  "description": "Detach monorepo packages from normal linking",
5
5
  "bin": {
6
6
  "next": "bin/next.js"
@@ -21,22 +21,17 @@ async function getPackageChangedFiles({
21
21
  packageCwd,
22
22
  options,
23
23
  }) {
24
- let isAncestor = await isCommitAncestorOf(fromCommit, toCommit, options);
25
-
26
- let olderCommit;
27
- let newerCommit;
28
- if (isAncestor) {
29
- olderCommit = fromCommit;
30
- newerCommit = toCommit;
31
- } else {
32
- olderCommit = toCommit;
33
- newerCommit = fromCommit;
34
- }
24
+ // Be careful you don't accidentally use `...` instead of `..`.
25
+ // `...` finds the merge-base and uses that instead of `fromCommit`.
26
+ // https://stackoverflow.com/a/60496462
27
+ let committedChanges = await git(['diff', '--name-only', `${fromCommit}..${toCommit}`, packageCwd], options);
35
28
 
36
- let committedChanges = await git(['diff', '--name-only', `${olderCommit}...${newerCommit}`, packageCwd], options);
37
29
  committedChanges = getLinesFromOutput(committedChanges);
30
+
38
31
  let dirtyChanges = await git(['status', '--porcelain', packageCwd, '-u'], options);
32
+
39
33
  dirtyChanges = getLinesFromOutput(dirtyChanges).map(line => line.substr(3));
34
+
40
35
  let changedFiles = Array.from(new Set(committedChanges).union(dirtyChanges));
41
36
 
42
37
  return changedFiles;