Skip to content

Commit cbb0d0b

Browse files
authored
feat!: remove deprecated camelCase option variants (#7046)
* feat!: remove deprecated camelCase options These commands option have been deprecated since 12.8.0 (25 months ago): https://github.com/netlify/cli/releases/tag/v12.8.0. Removes: - `--httpProxyCertificateFilename` - `--prodIfUnlocked` - `--functionsPort` - `--targetPort` - `--edgeInspect` - `--edgeInspectBrk` - `--replaceExisting` - `--gitRemoteName` The change in 12.8.0 also intended to rename `--httpProxy` to `--http-proxy` but there was a typo resulting in that never happening. To err on the safe side, this fixes that change without removing the camel case variant yet. * fix: update references to renamed options * feat!: rename `--httpProxy` to `--http-proxy` This was not a documented option, so this is arguably not breaking, but marking as breaking to err on the side of caution.
1 parent b693ba7 commit cbb0d0b

File tree

9 files changed

+8
-79
lines changed

9 files changed

+8
-79
lines changed

src/commands/base-command.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,10 @@ export default class BaseCommand extends Command {
191191
.addOption(new Option('-o, --offline').hideHelp(true))
192192
.addOption(new Option('--auth <token>', 'Netlify auth token').hideHelp(true))
193193
.addOption(
194-
new Option('--httpProxy [address]', 'Old, prefer --http-proxy. Proxy server address to route requests through.')
194+
new Option('--http-proxy [address]', 'Proxy server address to route requests through.')
195195
.default(process.env.HTTP_PROXY || process.env.HTTPS_PROXY)
196196
.hideHelp(true),
197197
)
198-
.addOption(
199-
new Option(
200-
'--httpProxyCertificateFilename [file]',
201-
'Old, prefer --http-proxy-certificate-filename. Certificate file to use when connecting using a proxy server.',
202-
)
203-
.default(process.env.NETLIFY_PROXY_CERTIFICATE_FILENAME)
204-
.hideHelp(true),
205-
)
206198
.addOption(
207199
new Option(
208200
'--http-proxy-certificate-filename [file]',
@@ -211,11 +203,6 @@ export default class BaseCommand extends Command {
211203
.default(process.env.NETLIFY_PROXY_CERTIFICATE_FILENAME)
212204
.hideHelp(true),
213205
)
214-
.addOption(
215-
new Option('--httpProxy [address]', 'Proxy server address to route requests through.')
216-
.default(process.env.HTTP_PROXY || process.env.HTTPS_PROXY)
217-
.hideHelp(true),
218-
)
219206
.option('--debug', 'Print debugging information')
220207

221208
// only add the `--filter` option to commands that are workspace aware

src/commands/deploy/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,15 @@ Support for package.json's main field, and intrinsic index.js entrypoints are co
8080
.option('-d, --dir <path>', 'Specify a folder to deploy')
8181
.option('-f, --functions <folder>', 'Specify a functions folder to deploy')
8282
.addOption(
83-
new Option('-p, --prod', 'Deploy to production').default(false).conflicts(['alias', 'branch', 'prodIfUnlocked']),
83+
new Option('-p, --prod', 'Deploy to production')
84+
.default(false)
85+
.conflicts(['alias', 'branch', 'prod-if-unlocked']),
8486
)
8587
.addOption(
86-
new Option(
87-
'--prodIfUnlocked',
88-
'Old, prefer --prod-if-unlocked. Deploy to production if unlocked, create a draft otherwise',
89-
)
88+
new Option('--prod-if-unlocked', 'Deploy to production if unlocked, create a draft otherwise')
9089
.default(false)
91-
.hideHelp(true)
9290
.conflicts(['alias', 'branch', 'prod']),
9391
)
94-
.option('--prod-if-unlocked', 'Deploy to production if unlocked, create a draft otherwise', false)
9592
.option(
9693
'--alias <name>',
9794
'Specifies the alias for deployment, the string at the beginning of the deploy subdomain. Useful for creating predictable deployment URLs. Avoid setting an alias string to the same value as a deployed branch. `alias` doesn’t create a branch deploy and can’t be used in conjunction with the branch subdomain feature. Maximum 37 characters.',

src/commands/dev/dev.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,6 @@ export const createDevCommand = (program: BaseCommand) => {
266266
normalizeContext,
267267
)
268268
.option('-p ,--port <port>', 'port of netlify dev', (value) => Number.parseInt(value))
269-
.addOption(
270-
new Option('--targetPort <port>', 'Old, prefer --target-port. Port of target app server')
271-
.argParser((value) => Number.parseInt(value))
272-
.hideHelp(true),
273-
)
274269
.addOption(new Option('--skip-wait-port', 'disables waiting for target port to become available').hideHelp(true))
275270
.addOption(new Option('--no-open', 'disables the automatic opening of a browser window'))
276271
.option('--target-port <port>', 'port of target app server', (value) => Number.parseInt(value))
@@ -292,11 +287,6 @@ export const createDevCommand = (program: BaseCommand) => {
292287
'start a public live session; optionally, supply a subdomain to generate a custom URL',
293288
false,
294289
)
295-
.addOption(
296-
new Option('--functionsPort <port>', 'Old, prefer --functions-port. Port of functions server')
297-
.argParser((value) => Number.parseInt(value))
298-
.hideHelp(true),
299-
)
300290
.option('--functions-port <port>', 'port of functions server', (value) => Number.parseInt(value))
301291
.addOption(
302292
new Option(
@@ -317,15 +307,6 @@ export const createDevCommand = (program: BaseCommand) => {
317307
.argParser((value) => Number.parseInt(value))
318308
.hideHelp(),
319309
)
320-
.addOption(
321-
new Option(
322-
'-e, --edgeInspect [address]',
323-
'Old, prefer --edge-inspect. Enable the V8 Inspector Protocol for Edge Functions, with an optional address in the host:port format',
324-
)
325-
.conflicts('edgeInspectBrk')
326-
.argParser(validateShortFlagArgs)
327-
.hideHelp(true),
328-
)
329310
.addOption(
330311
new Option(
331312
'-e, --edge-inspect [address]',
@@ -334,15 +315,6 @@ export const createDevCommand = (program: BaseCommand) => {
334315
.conflicts('edgeInspectBrk')
335316
.argParser(validateShortFlagArgs),
336317
)
337-
.addOption(
338-
new Option(
339-
'-E, --edgeInspectBrk [address]',
340-
'Old, prefer --edge-inspect-brk. Enable the V8 Inspector Protocol for Edge Functions and pause execution on the first line of code, with an optional address in the host:port format',
341-
)
342-
.conflicts('edgeInspect')
343-
.hideHelp(true)
344-
.argParser(validateShortFlagArgs),
345-
)
346318
.addOption(
347319
new Option(
348320
'-E, --edge-inspect-brk [address]',

src/commands/env/env.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ export const createEnvCommand = (program: BaseCommand) => {
3737
program
3838
.command('env:import')
3939
.argument('<fileName>', '.env file to import')
40-
.addOption(
41-
new Option(
42-
'-r --replaceExisting',
43-
'Old, prefer --replace-existing. Replace all existing variables instead of merging them with the current ones',
44-
)
45-
.default(false)
46-
.hideHelp(true),
47-
)
4840
.option(
4941
'-r, --replace-existing',
5042
'Replace all existing variables instead of merging them with the current ones',

src/commands/init/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ export const createInitCommand = (program: BaseCommand) =>
99
'Configure continuous deployment for a new or existing site. To create a new site without continuous deployment, use `netlify sites:create`',
1010
)
1111
.option('-m, --manual', 'Manually configure a git remote for CI')
12-
.addOption(
13-
new Option(
14-
'--gitRemoteName <name>',
15-
'Old, prefer --git-remote-name. Name of Git remote to use. e.g. "origin"',
16-
).hideHelp(true),
17-
)
1812
.option('--git-remote-name <name>', 'Name of Git remote to use. e.g. "origin"')
1913
.action(async (options: OptionValues, command: BaseCommand) => {
2014
const { init } = await import('./init.js')

src/commands/link/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ export const createLinkCommand = (program: BaseCommand) =>
88
.description('Link a local repo or project folder to an existing site on Netlify')
99
.option('--id <id>', 'ID of site to link to')
1010
.option('--name <name>', 'Name of site to link to')
11-
.addOption(
12-
new Option(
13-
'--gitRemoteName <name>',
14-
'Old, prefer --git-remote-name. Name of Git remote to use. e.g. "origin"',
15-
).hideHelp(true),
16-
)
1711
.option('--git-remote-name <name>', 'Name of Git remote to use. e.g. "origin"')
1812
.addExamples(['netlify link', 'netlify link --id 123-123-123-123', 'netlify link --name my-site-name'])
1913
.action(async (options: OptionValues, command: BaseCommand) => {

src/commands/serve/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ export const createServeCommand = (program: BaseCommand) =>
2525
"disables edge functions. use this if your environment doesn't support Deno. This option is internal and should not be used by end users.",
2626
).hideHelp(true),
2727
)
28-
.addOption(
29-
new Option('--functionsPort <port>', 'Old, prefer --functions-port. Port of functions server')
30-
.argParser((value) => Number.parseInt(value))
31-
.hideHelp(true),
32-
)
3328
.option('--functions-port <port>', 'port of functions server', (value) => Number.parseInt(value))
3429
.addOption(
3530
new Option(

src/utils/command-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const version = packageVersion
5757
export const USER_AGENT = `${name}/${version} ${platform}-${arch} node-${process.version}`
5858

5959
/** A list of base command flags that needs to be sorted down on documentation and on help pages */
60-
const BASE_FLAGS = new Set(['--debug', '--httpProxy', '--httpProxyCertificateFilename'])
60+
const BASE_FLAGS = new Set(['--debug', '--http-proxy', '--http-proxy-certificate-filename'])
6161

6262
export const NETLIFY_CYAN = chalk.rgb(40, 180, 170)
6363

tests/integration/commands/deploy/deploy.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,14 +1046,12 @@ describe.skipIf(process.env.NETLIFY_TEST_DISABLE_LIVE === 'true').concurrent('co
10461046
await withSiteBuilder(t, async (builder) => {
10471047
await builder.build()
10481048
try {
1049-
await callCli(['deploy', '--prodIfUnlocked', '--prod'], {
1049+
await callCli(['deploy', '--prod-if-unlocked', '--prod'], {
10501050
cwd: builder.directory,
10511051
env: { NETLIFY_SITE_ID: context.siteId },
10521052
})
10531053
} catch (error) {
1054-
expect(error.stderr.includes(`Error: option '-p, --prod' cannot be used with option '--prodIfUnlocked`)).toBe(
1055-
true,
1056-
)
1054+
expect(error.stderr).toContain(`Error: option '--prod-if-unlocked' cannot be used with option '-p, --prod'`)
10571055
}
10581056
})
10591057
})

0 commit comments

Comments
 (0)