Closed ktfleming closed 2 years ago
Hey, thanks for the feature request!
I can definitely see it being useful to set the affected branch :) defaultReleaseBranch
could be a good candidate, though it could also be added to the nxConfig
option so it's colocated with other NX options. I'll discuss with dimecha@ when he's back!
As a workaround you can actually customise your nx.json
(or other projen managed files) prior to the call to synth()
. For example:
const monorepo = new NxMonorepoProject({
...
});
monorepo.tryFindObjectFile('nx.json')!.addOverride('affected.defaultBase', 'my-branch');
monorepo.synth();
Hope that helps!
Thanks, Jack
Describe the feature
Right now
affected.defaultBase
in the generatednx.json
is hardcoded tomainline
:https://github.com/aws/aws-prototyping-sdk/blob/4881808bdccb2f3e53df5fc96acc186612634bed/packages/nx-monorepo/src/nx-monorepo.ts#L300-L302
It would be nice if this could be configured in the projen config file.
Use Case
When not using a
mainline
branch, some nx commands will fail. For example,npx nx print-affected
fails withProposed Solution
The branch could be specified as a new parameter in the projen file, or it could be set to
options.defaultReleaseBranch
(I'm new to nx and not sure which is more appropriate).Other Information
No response
Acknowledgements
PDK version used
v0.11.1
What languages will this feature affect?
No response
Environment details (OS name and version, etc.)
Mac OS 12.3.1