Skip to content

Commit

Permalink
fix: remove use npm by proxy option
Browse files Browse the repository at this point in the history
  • Loading branch information
KochiyaOcean committed Oct 23, 2023
1 parent 9c60732 commit 701801a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion lib/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ const defaultConfig = {
},
packageManager: {
enablePluginCheck: true,
proxy: false,
enableBetaPluginCheck: false,
enableAutoUpdate: true,
},
Expand Down
10 changes: 0 additions & 10 deletions views/components/settings/main/plugin-config.es
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ export const PluginConfig = withNamespaces(['setting'])(({ t }) => (
</FormGroup>
</Wrapper>

<Wrapper>
<FormGroup inline>
<SwitchConfig
label={t('Connect to npm server through proxy')}
configName="packageManager.proxy"
defaultValue={false}
/>
</FormGroup>
</Wrapper>

<Wrapper>
<FormGroup inline>
<SwitchConfig
Expand Down
2 changes: 0 additions & 2 deletions views/components/settings/plugin/index.es
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ const PluginList = styled.div`
'config.packageManager.mirrorName',
navigator.language === 'zh-CN' ? 'taobao' : 'npm',
),
proxy: get(state, 'config.packageManager.proxy', false),
betaCheck: get(state, 'config.packageManager.enableBetaPluginCheck', false),
autoUpdate: get(state, 'config.packageManager.enableAutoUpdate', true),
}))
export class PluginConfig extends Component {
static propTypes = {
plugins: PropTypes.array,
mirrorName: PropTypes.string,
proxy: PropTypes.bool,
betaCheck: PropTypes.bool,
autoUpdate: PropTypes.bool,
}
Expand Down
5 changes: 0 additions & 5 deletions views/services/plugin-manager/utils.es
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ export const safePhysicallyRemove = async (packagePath) => {
*/
export const getNpmConfig = (prefix) => {
const mirrorConf = config.get('packageManager.mirrorName')
const useProxy = config.get('packageManager.proxy', false)
const enableBetaPluginCheck = config.get('packageManager.enableBetaPluginCheck')
const mirrorName = Object.keys(MIRRORS).includes(mirrorConf)
? mirrorConf
Expand All @@ -517,10 +516,6 @@ export const getNpmConfig = (prefix) => {
prefix,
enableBetaPluginCheck,
}
if (useProxy) {
const { port } = window.proxy
npmConfig.http_proxy = `http://127.0.0.1:${port}`
}

return npmConfig
}

0 comments on commit 701801a

Please sign in to comment.