monorepo-next 8.3.0 → 8.3.1
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 +1 -1
- package/src/build-change-graph.js +8 -3
- package/src/build-dep-graph.js +1 -6
- package/src/path.js +13 -0
package/package.json
CHANGED
@@ -9,10 +9,11 @@ const {
|
|
9
9
|
getCommitSinceLastRelease,
|
10
10
|
} = require('./git');
|
11
11
|
const { collectPackages } = require('./build-dep-graph');
|
12
|
-
const
|
12
|
+
const { isSubDir } = require('./path');
|
13
13
|
const { getChangedReleasableFiles } = require('./releasable');
|
14
14
|
const Set = require('superset');
|
15
15
|
const { loadPackageConfig } = require('./config');
|
16
|
+
const path = require('path');
|
16
17
|
|
17
18
|
async function getPackageChangedFiles({
|
18
19
|
fromCommit,
|
@@ -72,6 +73,10 @@ async function buildChangeGraph({
|
|
72
73
|
let packagesWithChanges = {};
|
73
74
|
let sinceBranchCommit;
|
74
75
|
|
76
|
+
let packagePaths = Object.values(workspaceMeta.packages).map(({ cwd }) => {
|
77
|
+
return path.relative(workspaceMeta.cwd, cwd);
|
78
|
+
});
|
79
|
+
|
75
80
|
for (let _package of collectPackages(workspaceMeta)) {
|
76
81
|
if (!_package.packageName || !_package.version) {
|
77
82
|
continue;
|
@@ -136,8 +141,8 @@ async function buildChangeGraph({
|
|
136
141
|
// remove package changes from the workspace root's changed files
|
137
142
|
if (_package.cwd === workspaceMeta.cwd) {
|
138
143
|
newFiles = newFiles.filter(file => {
|
139
|
-
return !
|
140
|
-
return
|
144
|
+
return !packagePaths.some((packagePath) => {
|
145
|
+
return isSubDir(packagePath, file);
|
141
146
|
});
|
142
147
|
});
|
143
148
|
}
|
package/src/build-dep-graph.js
CHANGED
@@ -81,17 +81,13 @@ async function buildDepGraph({
|
|
81
81
|
|
82
82
|
let { workspaces } = workspacePackageJson;
|
83
83
|
|
84
|
-
let packagesGlobs;
|
85
|
-
|
86
84
|
let _1dFilesArray;
|
87
85
|
if (!workspaces) {
|
88
86
|
_1dFilesArray = (await execa('pnpm', ['recursive', 'exec', '--', 'node', '-e', 'console.log(process.cwd())'], { cwd: workspaceCwd })).stdout
|
89
87
|
.split(/\r?\n/)
|
90
88
|
.map(workspace => path.relative(workspaceCwd, workspace));
|
91
|
-
|
92
|
-
packagesGlobs = [];
|
93
89
|
} else {
|
94
|
-
packagesGlobs = workspaces.packages || workspaces;
|
90
|
+
let packagesGlobs = workspaces.packages || workspaces;
|
95
91
|
|
96
92
|
let _2dFilesArray = await Promise.all(packagesGlobs.map(packagesGlob => {
|
97
93
|
return glob(packagesGlob, {
|
@@ -108,7 +104,6 @@ async function buildDepGraph({
|
|
108
104
|
|
109
105
|
let workspaceMeta = {
|
110
106
|
cwd: workspaceCwd,
|
111
|
-
packagesGlobs,
|
112
107
|
};
|
113
108
|
|
114
109
|
await firstPass(workspaceMeta, workspacePackageJson, packageDirs);
|