Skip to content

Commit

Permalink
The final output has into account explicitly disabled packages in the…
Browse files Browse the repository at this point in the history
… config, instead of leaving them in the config.
  • Loading branch information
sneridagh committed Jun 5, 2023
1 parent 9fcbadb commit 200997a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,19 @@ async function develop(options) {
}
}

function disabledPackages(options) {
const mrsDeveloperJSON = JSON.parse(
fs.readFileSync(path.join(options.root || '.', 'mrs.developer.json')),
);

return Object.entries(mrsDeveloperJSON || {})
.filter(([name, config]) => config.develop === false)
.reduce((acc, [name, config]) => {
acc.push(config.package || name);
return acc;
}, []);
}

function writeConfigFile(paths, options, developedPackages) {
// update paths in configFile
const defaultConfigFile = fs.existsSync('./tsconfig.base.json')
Expand All @@ -336,6 +349,7 @@ function writeConfigFile(paths, options, developedPackages) {
: `src/${DEVELOP_DIRECTORY}`,
),
)
.filter(([pkg, path]) => !disabledPackages(options).includes(pkg))
.reduce((acc, [pkg, path]) => {
acc[pkg] = path;
return acc;
Expand Down

0 comments on commit 200997a

Please sign in to comment.