Skip to content

Commit

Permalink
deps: Upgrade yargs to v17.3.1
Browse files Browse the repository at this point in the history
  For some reason we need to both ignore the module's folder in
  `.flowconfig` and stub its types via `flow-typed` (no defnitions for
  v17.x are available at the moment) for flow to stop giving the
  following error on the `require` call:

  Cannot resolve module /home/erwan/repositories/cozy/desktop/node_modules/yargs/index.cjs
  • Loading branch information
taratatach committed Jan 11, 2022
1 parent a60ffa8 commit a89f7f1
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 198 deletions.
5 changes: 1 addition & 4 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
<PROJECT_ROOT>/build/.*
<PROJECT_ROOT>/coverage/.*
<PROJECT_ROOT>/tmp/.*
<PROJECT_ROOT>/node_modules/ach/.*
<PROJECT_ROOT>/node_modules/config-chain/test/broken.json
<PROJECT_ROOT>/node_modules/elm-test/.*
<PROJECT_ROOT>/node_modules/jsverify/.*
<PROJECT_ROOT>/node_modules/resolve/.*
<PROJECT_ROOT>/node_modules/yargs/.*

[include]

Expand Down
175 changes: 175 additions & 0 deletions flow-typed/npm/yargs_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
// flow-typed signature: 0e40564d80be151a7cd75d1f853019bb
// flow-typed version: <<STUB>>/yargs_v17.3.1/flow_v0.98.0

/**
* This is an autogenerated libdef stub for:
*
* 'yargs'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/

declare module 'yargs' {
declare module.exports: any;
}

/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'yargs/build/lib/argsert' {
declare module.exports: any;
}

declare module 'yargs/build/lib/command' {
declare module.exports: any;
}

declare module 'yargs/build/lib/completion-templates' {
declare module.exports: any;
}

declare module 'yargs/build/lib/completion' {
declare module.exports: any;
}

declare module 'yargs/build/lib/middleware' {
declare module.exports: any;
}

declare module 'yargs/build/lib/parse-command' {
declare module.exports: any;
}

declare module 'yargs/build/lib/typings/common-types' {
declare module.exports: any;
}

declare module 'yargs/build/lib/typings/yargs-parser-types' {
declare module.exports: any;
}

declare module 'yargs/build/lib/usage' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/apply-extends' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/is-promise' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/levenshtein' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/maybe-async-result' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/obj-filter' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/process-argv' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/set-blocking' {
declare module.exports: any;
}

declare module 'yargs/build/lib/utils/which-module' {
declare module.exports: any;
}

declare module 'yargs/build/lib/validation' {
declare module.exports: any;
}

declare module 'yargs/build/lib/yargs-factory' {
declare module.exports: any;
}

declare module 'yargs/build/lib/yerror' {
declare module.exports: any;
}

declare module 'yargs/helpers' {
declare module.exports: any;
}

// Filename aliases
declare module 'yargs/build/lib/argsert.js' {
declare module.exports: $Exports<'yargs/build/lib/argsert'>;
}
declare module 'yargs/build/lib/command.js' {
declare module.exports: $Exports<'yargs/build/lib/command'>;
}
declare module 'yargs/build/lib/completion-templates.js' {
declare module.exports: $Exports<'yargs/build/lib/completion-templates'>;
}
declare module 'yargs/build/lib/completion.js' {
declare module.exports: $Exports<'yargs/build/lib/completion'>;
}
declare module 'yargs/build/lib/middleware.js' {
declare module.exports: $Exports<'yargs/build/lib/middleware'>;
}
declare module 'yargs/build/lib/parse-command.js' {
declare module.exports: $Exports<'yargs/build/lib/parse-command'>;
}
declare module 'yargs/build/lib/typings/common-types.js' {
declare module.exports: $Exports<'yargs/build/lib/typings/common-types'>;
}
declare module 'yargs/build/lib/typings/yargs-parser-types.js' {
declare module.exports: $Exports<'yargs/build/lib/typings/yargs-parser-types'>;
}
declare module 'yargs/build/lib/usage.js' {
declare module.exports: $Exports<'yargs/build/lib/usage'>;
}
declare module 'yargs/build/lib/utils/apply-extends.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/apply-extends'>;
}
declare module 'yargs/build/lib/utils/is-promise.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/is-promise'>;
}
declare module 'yargs/build/lib/utils/levenshtein.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/levenshtein'>;
}
declare module 'yargs/build/lib/utils/maybe-async-result.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/maybe-async-result'>;
}
declare module 'yargs/build/lib/utils/obj-filter.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/obj-filter'>;
}
declare module 'yargs/build/lib/utils/process-argv.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/process-argv'>;
}
declare module 'yargs/build/lib/utils/set-blocking.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/set-blocking'>;
}
declare module 'yargs/build/lib/utils/which-module.js' {
declare module.exports: $Exports<'yargs/build/lib/utils/which-module'>;
}
declare module 'yargs/build/lib/validation.js' {
declare module.exports: $Exports<'yargs/build/lib/validation'>;
}
declare module 'yargs/build/lib/yargs-factory.js' {
declare module.exports: $Exports<'yargs/build/lib/yargs-factory'>;
}
declare module 'yargs/build/lib/yerror.js' {
declare module.exports: $Exports<'yargs/build/lib/yerror'>;
}
declare module 'yargs/helpers/index' {
declare module.exports: $Exports<'yargs/helpers'>;
}
declare module 'yargs/helpers/index.js' {
declare module.exports: $Exports<'yargs/helpers'>;
}
42 changes: 28 additions & 14 deletions gui/js/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,34 @@ const config = (argv /*: Array<*> */ = process.argv) => {
const config = yargs
.env('COZY_DRIVE')
.conflicts('proxy-script', 'proxy-rules')
.describe('proxy-script', 'The URL associated with the PAC file.')
.describe('proxy-rules', 'Rules indicating which proxies to use.')
.describe(
'proxy-bypassrules',
'Rules indicating which URLs should bypass the proxy settings. ' +
'See https://github.com/electron/electron/blob/master/docs/api/session.md#sessetproxyconfig-callback'
)
.default('proxy-ntlm-domains', '*')
.describe(
'proxy-ntlm-domains',
'A comma-separated list of servers for which integrated authentication is enabled. ' +
'Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication.'
)
.describe('login-by-realm', 'comma-separated list of realm:user:password')
.option('proxy-script', {
describe: 'The URL associated with the PAC file.',
type: 'string',
default: undefined
})
.option('proxy-rules', {
describe: 'Rules indicating which proxies to use.',
type: 'string',
default: undefined
})
.option('proxy-bypassrules', {
describe:
'Rules indicating which URLs should bypass the proxy settings. ' +
'See https://github.com/electron/electron/blob/master/docs/api/session.md#sessetproxyconfig-callback',
type: 'string',
default: undefined
})
.option('proxy-ntlm-domains', {
describe:
'A comma-separated list of servers for which integrated authentication is enabled. ' +
'Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate authentication.',
default: '*'
})
.option('login-by-realm', {
describe: 'comma-separated list of realm:user:password',
type: 'string',
default: undefined
})
.help('help')
.parse(argv)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"semver": "7.3.5",
"tar": "6.1.11",
"uuid": "8.3.2",
"yargs": "^11.0.0"
"yargs": "17.3.1"
},
"devDependencies": {
"@babel/core": "7.16.7",
Expand Down
Loading

0 comments on commit a89f7f1

Please sign in to comment.