monorepo-next 12.4.0 → 12.5.0
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/README.md +6 -0
- package/package.json +1 -1
- package/src/build-change-graph.js +1 -0
- package/src/releasable.js +9 -10
package/README.md
CHANGED
@@ -10,6 +10,12 @@ Each package can have a `monorepo-next.config.js` with the following options:
|
|
10
10
|
module.exports = {
|
11
11
|
// Set this to false to opt-out of change detection and versioning.
|
12
12
|
shouldBumpVersion: true,
|
13
|
+
|
14
|
+
// If your package has a build step, your package.json/files array
|
15
|
+
// will be a git-ignored dir, so we can't use that. Use this to
|
16
|
+
// allow us to still find changes to your package. This appends
|
17
|
+
// to your existing NPM tracked files.
|
18
|
+
changeTrackingFiles: ['src'],
|
13
19
|
}
|
14
20
|
```
|
15
21
|
|
package/package.json
CHANGED
package/src/releasable.js
CHANGED
@@ -111,7 +111,10 @@ async function prepareTmpPackage({
|
|
111
111
|
async function _getChangedReleasableFiles({
|
112
112
|
cwd,
|
113
113
|
changedFiles,
|
114
|
+
nextConfig = {},
|
114
115
|
}) {
|
116
|
+
const { minimatch } = await import('minimatch');
|
117
|
+
|
115
118
|
let tmpDir = await createTmpDir();
|
116
119
|
|
117
120
|
// This is all because `npm-packlist`/`ignore-walk`
|
@@ -128,22 +131,16 @@ async function _getChangedReleasableFiles({
|
|
128
131
|
|
129
132
|
let changedPublishedFilesOld = new Set(changedPublishedFiles);
|
130
133
|
|
131
|
-
let changedPublishedFilesNew = new Set();
|
132
|
-
|
133
134
|
for (let file of changedFiles) {
|
134
|
-
if (
|
135
|
-
|
135
|
+
if (nextConfig.changeTrackingFiles?.some(glob => minimatch(file, glob, { dot: true }))) {
|
136
|
+
changedPublishedFilesOld.add(file);
|
136
137
|
}
|
138
|
+
}
|
137
139
|
|
140
|
+
let changedPublishedFilesNew = changedPublishedFilesOld
|
138
141
|
// these files may not show up in the bundle, but
|
139
142
|
// contribute to what goes in the bundle, so we must preserve
|
140
143
|
// the changed status to know if the package is invalidated or not
|
141
|
-
if (filesContributingToReleasability.has(file)) {
|
142
|
-
changedPublishedFilesNew.add(file);
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
changedPublishedFilesNew = changedPublishedFilesOld
|
147
144
|
.union(filesContributingToReleasability)
|
148
145
|
.intersect(changedFiles);
|
149
146
|
|
@@ -176,6 +173,7 @@ async function getChangedReleasableFiles({
|
|
176
173
|
workspacesCwd,
|
177
174
|
shouldExcludeDevChanges,
|
178
175
|
fromCommit,
|
176
|
+
nextConfig,
|
179
177
|
}) {
|
180
178
|
changedFiles = new Set(changedFiles);
|
181
179
|
|
@@ -188,6 +186,7 @@ async function getChangedReleasableFiles({
|
|
188
186
|
let changedPublishedFiles = await _getChangedReleasableFiles({
|
189
187
|
cwd: packageCwd,
|
190
188
|
changedFiles: changedFiles.map(file => path.relative(packageCwd, path.join(workspacesCwd, file))),
|
189
|
+
nextConfig,
|
191
190
|
});
|
192
191
|
|
193
192
|
let relative = path.relative(workspacesCwd, packageCwd);
|