scripts/generate-changeset-feedback: fix json output & path matching

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-03-24 15:00:55 +01:00
parent e2282b79bc
commit e1f14f4be8
+2 -1
View File
@@ -97,6 +97,7 @@ async function loadChangesets(filePaths) {
);
const bumps = new Map();
bumps.toJSON = () => Object.fromEntries(bumps);
for (const line of lines) {
const match = line.match(/^'(.*)': (patch|minor|major)$/);
if (!match) {
@@ -124,7 +125,7 @@ async function listChangedPackages(changedFiles, packages) {
const changedPackageMap = new Map();
for (const filePath of changedFiles) {
for (const pkg of packages) {
if (filePath.startsWith(pkg.path)) {
if (filePath.startsWith(`${pkg.path}/`)) {
const pkgPath = relativePath(pkg.path, filePath);
if (!isPublishedPath(pkgPath)) {
break;