-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: add custom npm registry when installing dependencies #994
feat: add custom npm registry when installing dependencies #994
Conversation
@antongolub you can start the review:) |
fc665c3
to
e9d53d2
Compare
src/cli.ts
Outdated
--eval=<js>, -e evaluate script | ||
--ext=<.mjs> default extension | ||
--install, -i install dependencies | ||
--install-registry<path> install install dependencies via custom npm registry URL |
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.
--install-registry= install registry URL
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.
d1
src/cli.ts
Outdated
@@ -208,6 +217,12 @@ export async function importPath( | |||
const deps = parseDeps(await fs.readFile(filepath)) | |||
await installDeps(deps, 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.
Let's just modify the current flow:
if (argv.install) {
const deps = parseDeps(await fs.readFile(filepath))
await installDeps(deps, dir, argv['install-registry'])
}
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 you suggesting to make such a flow? Maybe then replace --install-registry with --registry as in npm?
zx --install --registry='https://npm-proxy.example.com' script.mjs
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.
ok
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.
d1
cb1df6c
to
a13f2c2
Compare
src/cli.ts
Outdated
--eval=<js>, -e evaluate script | ||
--ext=<.mjs> default extension | ||
--install, -i install dependencies | ||
--registry=<npm registry URL> custom npm registry URL dependencies works with install flag |
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'd suggest:
--registry=<URL> npm registry, defaults to https://registry.npmjs.org/
Update also man/zx.1
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.
Cool suggest!
I update man/zx.1
and description for cli
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.
One more suggestion.
src/cli.ts
Outdated
--help, -h print help | ||
--repl start repl | ||
--experimental enables experimental features (deprecated) | ||
--quiet suppress any outputs |
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.
Now we can keep the formatting here for git blame.
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.
Thanks to your suggestion. Revert formatting
cc3fca1
to
0aca5e8
Compare
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.
Seems fine. Thanks for the improvement!
Description
Add custom npm registry with composition install and registry flags.
Fixes #972