Skip to content

Commit 1a0b3e9

Browse files
rix0rrrgithub-actions
and
github-actions
authored
feat: allow customizing monorepo references (#829)
* feat: allow customizing monorepo references Instead of monorepo workspaces taking `string | TypeScriptWorkspace`, they now take `string | IWorkspaceReference`. A new method `customizeReference()` can be used to build an `IWorkspaceReference` with non-default behavior. This adds 2 features: - Allow public packages depending on private packages. This is not currently allowed, but makes sense if we are bundling the target package. - Allow customizing the generated version range. We default to `^`, but that may not be desired. Sometimes we want the exact version. * chore: self mutation Signed-off-by: github-actions <[email protected]> * Make it a project-wide option --------- Signed-off-by: github-actions <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent c16377f commit 1a0b3e9

6 files changed

+436
-70
lines changed

API.md

+184-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projenrc/yarn-monorepo-options.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function generateYarnMonorepoOptions(project: typescript.TypeScriptProjec
141141
union: {
142142
types: [
143143
{ primitive: PrimitiveType.String },
144-
{ fqn: 'cdklabs-projen-project-types.yarn.TypeScriptWorkspace' },
144+
{ fqn: 'cdklabs-projen-project-types.yarn.IWorkspaceReference' },
145145
],
146146
},
147147
},
@@ -231,6 +231,20 @@ export function generateYarnMonorepoOptions(project: typescript.TypeScriptProjec
231231
default: '\'lts/*\'',
232232
},
233233
},
234+
{
235+
name: 'allowPrivateDeps',
236+
optional: true,
237+
type: { primitive: PrimitiveType.Boolean },
238+
docs: {
239+
summary: [
240+
'Allow private workspace dependencies in the \'deps\' parameter.',
241+
'',
242+
'By default, private dependencies are not allowed as users will not be able to install',
243+
'your package. It makes sense to relax this check *only* if you are bundling your package.',
244+
].join('\n'),
245+
default: 'false',
246+
},
247+
},
234248
],
235249
});
236250

0 commit comments

Comments
 (0)