Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: get npm client from storage #2473

Merged
merged 5 commits into from
Jul 17, 2019

Conversation

ClarkXia
Copy link
Collaborator

No description provided.

@ClarkXia ClarkXia requested a review from chenbin92 July 17, 2019 06:00
@@ -186,7 +187,8 @@ export default class Dependency implements IDependencyModule {

socket.emit('adapter.dependency.upgrade.data', i18n.format('baseAdapter.dependency.reset.startInstall', {packageName}));

const childProcess = execa('npm', ['update', packageName, '--silent'], {
const npmClient = this.storage.get('npmClient');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

两个获取可以提到最上面吗,只写一行?

@@ -0,0 +1,13 @@
import { checkAliInternal } from 'ice-npm-utils';

const getStorageNpmClient = async (storage: any) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑在这里直接引入 storage 文件,不用在每个调用的地方都去传一遍?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@chenbin92 chenbin92 merged commit 36608fd into iceworks/release-3.0.0-beta.6 Jul 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the iceworks/fix-npm-client branch July 17, 2019 08:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants