-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add prompts to ask user about installing additional but required packages #653
Conversation
@microsoft-github-policy-service agree |
cli/src/packageInstaller.ts
Outdated
let resolve: () => void | ||
let reject: () => void | ||
|
||
const installProcess = spawn('npm', ['install', '--save', '--no-workspaces', packageName], { |
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.
I think we have some code to detect users that rely on yarn
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.
@@ -573,7 +591,7 @@ async function buildOnce(file: string, options: BuildOptions) { | |||
.forEach(fn => { | |||
log(` ${fn.name} (${prettySize(fn.size)})`) | |||
fn.users.forEach(user => | |||
debug(` <-- ${resolver.posToString(user[0])}`) | |||
debug(` <-- ${resolver.posToString(user[0])}`), |
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.
is this , added by prettier? it kind of add noise to the PR
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.
yeah, must be prettier. Do you want to remove it?
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.
Yes, in general this kind of formatting changes really add noise to a PR and makes the review harder. If you have user settings overriding the repo .prettierrc file, you should disable them.
function createSPI() { | ||
log(`adding SPI transport (requires "rpio" package)`) | ||
async function createSPI() { | ||
await askForPackageInstallation('rpio'); |
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.
We need a non-interactive mode in CI build mode.
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.
Good point! Flag added globally to the cli in this commit ddf9c15
This is a great start! My advice is to keep you PRs very focused on a single feature. If you find a bug along the way, move it out to a different PR so that it can be merged separately. The formatting issue is annoying (the added ,) maybe we can fix this before this PR so that it is "just a formatting PR". A few more comments:
👍 keep going! |
sure, I can add this communication in next pr. Maybe you know, when cli is in vscode mode it opens some additional socket channel to communicate with plugin? |
Search for |
I've added a common linting task in package.json and also a dep on prettier so that we run the same version. You should be able to merge |
_ => null | ||
) | ||
if (prelude[fn] != ex) await writeFile(fnpath, prelude[fn]) | ||
if (!existsSync(libpath)) |
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.
don't sneak in unrelated changes.
cli/src/build.ts
Outdated
const converter = converters()[lang] | ||
let constants = "" | ||
for (const srv of customServices) { | ||
constants += converter(srv) + "\n" | ||
} | ||
const dir = join(pref, GENDIR, lang) | ||
await mkdirp(dir) | ||
return writeFile(join(dir, `constants.${lang}`), constants, { | ||
if (!existsSync(dir)) |
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.
unrelated changes, move to differfent PR
encoding: "utf-8", | ||
}) | ||
})) | ||
// json specs | ||
{ | ||
const dir = join(pref, GENDIR) | ||
await mkdirp(dir) | ||
if (!existsSync(dir)) |
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.
unrelated changes, move to different PR
@@ -430,6 +430,8 @@ async function rebuild(args: BuildReqArgs) { | |||
opts.verify = false | |||
opts.quiet = true | |||
|
|||
await compileFile(args.filename, opts); |
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.
are we compiling twice now?
Merge |
It's just a small change but can improve flow while using cli.
When using
devs devtools src/main.ts
with "native" OS transports (eg: usb or serial - not via dashboard and WebUSB) user must specify transport by passing one of the following optionsall the above options require additional packages, that's why now you can install required package without leaving current process. Cli will detect if any of native transports is enabled and if required package is not installed will prompt question like the below one:
after installation normal process flow will be restored with installed dependencies ready to use.