-
Notifications
You must be signed in to change notification settings - Fork 11
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
postinstall
script: support monorepos
#191
Conversation
This happens in monorepo setups where `cds-types` is alreday installed.
b53e613
to
a325593
Compare
a325593
to
44750e5
Compare
@joergmann my new monorepo test fails on Windows with Can you make any sense out of it? Does the test run for you locally? |
postinstall
script finds existing cds-types
installationpostinstall
script
postinstall
scriptpostinstall
script: support monorepos
@joergmann please make sure to have the latest non 10.8.2 installed. |
@chgeo fixed, will revistit to make it more robust |
@daogrady this is the PR by Joerg and me, targeting the next cds-types patch. |
name: 'project1' | ||
}, null, 2)) | ||
{ | ||
// const {stdout, stderr} = |
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.
// const {stdout, stderr} = |
{ | ||
// const {stdout, stderr} = | ||
await execAsync(`npm i --foreground-scripts -dd -D ${cdsTypesRoot}`, { cwd: project1 }) | ||
// console.log(stdout, stderr) |
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.
// console.log(stdout, stderr) |
} | ||
}, null, 2)) | ||
{ | ||
// const {stdout, stderr} = |
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.
// const {stdout, stderr} = |
{ | ||
// const {stdout, stderr} = | ||
await execAsync(`npm i --foreground-scripts -dd`, { cwd: project2 }) | ||
// console.log(stdout, stderr) |
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.
// console.log(stdout, stderr) |
@@ -16,6 +16,7 @@ describe('postinstall', () => { | |||
|
|||
beforeEach(async () => { | |||
tempFolder = await fs.mkdtemp(path.join(os.tmpdir(), 'postinstall-')) | |||
// console.log(`tempFolder: ${tempFolder}`) |
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.
// console.log(`tempFolder: ${tempFolder}`) |
Very valuable contribution, thank you both! I only added some minor nits, but I think this is good to go. |
Co-authored-by: Daniel O'Grady <[email protected]>
In monorepo setups
cds-types
might already be installed elsewhere (higher up), so find and use it as link target.