diff --git a/checkChangedWorkspaces.js b/checkChangedWorkspaces.js index 707545df204..f0ced7cea04 100644 --- a/checkChangedWorkspaces.js +++ b/checkChangedWorkspaces.js @@ -1,19 +1,12 @@ const getPackages = require('./repotools.js'); -const stdout = JSON.stringify(getPackages('./', 'origin/master')) -const all = getPackages('./', null) - try { - // remove last line of stdout - const updatedPackages = JSON.parse(stdout); - // if (stdout.includes("cypress")) { - // TODO filter for "@" added temporary to not to add packages wich are not automated and formated yet. +const changedPackages = getPackages('./', 'origin/master'); +const allPackages = getPackages('./', null); - const newPackages = all.filter(x => !x.name?.includes("_") && !updatedPackages?.includes(x) && !x.name?.includes("cypress") && !x.name?.includes("@")); - console.log(JSON.stringify({ container: newPackages.map(x => x.name)})); - // } else { - // console.log(JSON.stringify({ container: updatedPackages.filter(x => !x.name.includes("_") && !x.name.includes("@")).map(x => x.name) - // })) - // } - } catch (e) { - console.error(e); - } +try { + const updatedPackages = changedPackages; + const newPackages = changedPackages + console.log(JSON.stringify({ container: newPackages.map(package => package.name)})); +} catch (e) { + console.error(e); +} diff --git a/native-federation-core-microfrontend b/native-federation-core-microfrontend index 461c49e1986..c5678afa037 160000 --- a/native-federation-core-microfrontend +++ b/native-federation-core-microfrontend @@ -1 +1 @@ -Subproject commit 461c49e1986971305a3d3beae29f898b5d0fd452 +Subproject commit c5678afa03773ce6cbc4b40c6ae0fb1f839fa538 diff --git a/repotools.js b/repotools.js index 50032f98109..9d4bf0cc76c 100644 --- a/repotools.js +++ b/repotools.js @@ -17,7 +17,8 @@ function getPackages(dir, since) { if (fs.existsSync(packageJsonPath)) { const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); if (since) { - const result = execSync(`git log --since="${since}" -- ${nestedDir}`, { encoding: 'utf8' }); + const result = execSync(`git diff --name-only ${since}..HEAD -- ${nestedDir}`, { encoding: 'utf8' }); + if (result) { packages.push({ name: packageJson.name, @@ -42,6 +43,6 @@ function getPackages(dir, since) { } const since = process.argv[2] === '--since' ? process.argv[3] : null; -const packages = getPackages('./', since); // start from current directory +// const packages = getPackages('./', since); // start from current directory // console.log(JSON.stringify(packages, null, 2)); module.exports = getPackages