-
Notifications
You must be signed in to change notification settings - Fork 41
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
Build If-env
#790
Build If-env
#790
Conversation
@manushak still reviewing this - seems good so far but an observation is that it takes quite a while to complete and during that time the user does not know what is happening - can we add some execution logs? |
sure. I'll add logs |
src/env/env.ts
Outdated
/** | ||
* Updates package.json dependencies. | ||
*/ | ||
async function updatePackageJsonDependencies( |
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.
why not arrow function?
src/env/env.ts
Outdated
@@ -0,0 +1,211 @@ | |||
#!/usr/bin/env node | |||
/* eslint-disable no-process-exit */ | |||
import * as fs from 'fs/promises'; |
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.
please move the file to src folder. We don't have specific folders for each script
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 case, where the if-env template manifest be placed?
@jmcook1186 should it be moved to the ./manifests/examples
folder with the name if-env-template.yml
?
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.
no, it should just be saved to the top level src
directory. if-env
is not supposed to be run inside the if
source repository
src/env/env.ts
Outdated
|
||
const FOLDER_NAME = 'if-environment'; | ||
|
||
type EnvironmentOptions = { |
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.
type can be moved
src/env/env.ts
Outdated
): {[path: string]: string} => { | ||
const paths = Object.keys(plugins).map(plugin => plugins[plugin].path); | ||
const uniquePaths = [...new Set(paths)].filter(path => path !== 'builtin'); | ||
const pathsWithVersion: {[path: string]: string} = {}; |
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.
extract as a type
src/env/env.ts
Outdated
/** | ||
* Installs packages from the specified dependencies in the specified folder. | ||
*/ | ||
async function installDependencies( |
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 kind of helpers can be moved to utils
@manushak why in one case we are listing them and in another don't? |
@narekhovhannisyan, we decided that when running with the cc: @jmcook1186 |
Let's bring this to a close asap please. @manushak please address the outstanding comments as your priority task on IF. @narekhovhannisyan please approve unless there are changes that negatively affect the behaviour - no blocking on cosmetic issues that can be tidied up later. |
@jmcook1186, @narekhovhannisyan, I've pushed the latest changes. Some functions don't have unit tests yet, but I'll add them later. I couldn't add the custom Error from if-core for |
@jmcook1186 all my feedback is about the architecture and consequential poor unit test coverage (huge amount of functions were in env.ts which is not covered with unit tests), nothing cosmetic there. |
@MariamKhalatova, @narekhovhannisyan sorry, I got it wrong from the screenshot. I thought the selected dependencies were missing and you wanted them to persist. Thanks for noticing. It's fixed now. |
Signed-off-by: Narek Hovhannisyan <[email protected]>
Types of changes
A description of the changes proposed in the Pull Request