-
Notifications
You must be signed in to change notification settings - Fork 622
[rush-lib] support users to provide their own assets file for init subspace #5134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… a new subspace beside the default rush-init/assets folder
c2f952e
to
a8edb30
Compare
...chore-support-users-to-provide-their-own-assets-file-for-init-subspace_2025-02-25-07-23.json
Outdated
Show resolved
Hide resolved
/** | ||
* the starting assets folder relative to rush.json location you want to use when init a subspace | ||
*/ | ||
// "subspaceInitAssetsFolder": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this design, it seems that a given monorepo can have at most one set of custom file templates to use with rush init-subspace
. Therefore, why do we need to configure its location?
We could instead designate a standard location, e.g. common/config-templates/rush-init-subspace
. Then everyone will know that is where to find it, without having to read subspaces.json to find the particular location for a particular repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks! I’ll update it accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe common/templates/config
. We could eventually have other kinds of templates (project templates?)
if (userDefinedAssetsFolder) { | ||
// if user provided their own assets file for subspace initiation | ||
// we just copy and overwrite the default files | ||
await copyTemplateFileAsync(userDefinedAssetsFolder, destinationPath, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach seems like it will (1) try to copy a file that doesn't exist and (2) print a notice like Overwriting: .pnpmfile.js
when really it is just overwriting its own file that it wrote on line 79.
Both issues could be avoided using FileSystem.existsAsync()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, userDefinedAssetsFolder
is the path of a directory. Shouldn't copyTemplateFileAsync()
receive a file path?
Please fill out the How it was tested PR notes 😸
…their-own-assets-file-for-init-subspace_2025-02-25-07-23.json Co-authored-by: Pete Gonzalez <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
5b78458
to
ccbaf8b
Compare
Summary
support users to provide their own assets file when init subspace beside using the default one provided by Rush Engine
Details
How it was tested
Impacted documentation
updated schema template of subspace as well