npm-workspaces-publish-tool 0.0.4 → 0.0.5
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/build/package.json +1 -1
- package/build/src/cli.js +5 -4
- package/package.json +1 -1
package/build/package.json
CHANGED
package/build/src/cli.js
CHANGED
|
@@ -56,14 +56,14 @@ function getReleaseOrderFromInDegree(inDegree, dependencies) {
|
|
|
56
56
|
}
|
|
57
57
|
return order;
|
|
58
58
|
}
|
|
59
|
-
function getDirtyMap(workspaces, lastTag) {
|
|
59
|
+
function getDirtyMap(workspaces, lastTag, cwd) {
|
|
60
60
|
const dirtyMap = new Map();
|
|
61
61
|
const changedFiles = lastTag
|
|
62
62
|
? getChangesBetweenRefs(lastTag, 'HEAD', [], '', cwd)
|
|
63
63
|
: [];
|
|
64
64
|
for (const ws of workspaces) {
|
|
65
65
|
const isNew = !lastTag;
|
|
66
|
-
const isDirty = changedFiles.some((f) => f.
|
|
66
|
+
const isDirty = changedFiles.some((f) => resolve(cwd, f).includes(ws.path));
|
|
67
67
|
if (isNew) {
|
|
68
68
|
dirtyMap.set(ws.name, 'new');
|
|
69
69
|
}
|
|
@@ -123,7 +123,8 @@ function getDirtyPackagesVersionChanges(workspaces, dirtyMap, lastTag, cwd) {
|
|
|
123
123
|
});
|
|
124
124
|
continue;
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const relativeWsPath = relative(cwd, ws.path);
|
|
127
|
+
const previousPkgRaw = git(['show', `${lastTag}:${relativeWsPath}/package.json`], {
|
|
127
128
|
cwd,
|
|
128
129
|
});
|
|
129
130
|
if (!previousPkgRaw.success) {
|
|
@@ -352,7 +353,7 @@ function validatePublish() {
|
|
|
352
353
|
const { dependencies } = createDependencyMap(packageInfos);
|
|
353
354
|
const inDegree = calculateWorkspaceInDegree(workspaces, dependencies);
|
|
354
355
|
const releaseOrder = getReleaseOrderFromInDegree(inDegree, dependencies);
|
|
355
|
-
const dirtyMap = getDirtyMap(workspaces, lastMonoRepoTag);
|
|
356
|
+
const dirtyMap = getDirtyMap(workspaces, lastMonoRepoTag, cwd);
|
|
356
357
|
const dirtyVersionChanges = getDirtyPackagesVersionChanges(workspaces, dirtyMap, lastMonoRepoTag, cwd);
|
|
357
358
|
console.log('🏗️ Building packages...');
|
|
358
359
|
for (const pkgName of releaseOrder) {
|