Skip to content

Commit a68f71b

Browse files
authored
refactor: Upgrade to commander 13.0.0 (#9574)
1 parent ea5ee68 commit a68f71b

File tree

4 files changed

+144
-10
lines changed

4 files changed

+144
-10
lines changed

package-lock.json

+132-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@parse/push-adapter": "6.8.0",
2929
"bcryptjs": "2.4.3",
3030
"body-parser": "1.20.3",
31-
"commander": "12.1.0",
31+
"commander": "13.0.0",
3232
"cors": "2.8.5",
3333
"deepcopy": "2.1.0",
3434
"express": "4.21.2",

spec/CLI.spec.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const commander = require('../lib/cli/utils/commander').default;
2+
let commander;
33
const definitions = require('../lib/cli/definitions/parse-server').default;
44
const liveQueryDefinitions = require('../lib/cli/definitions/parse-live-query-server').default;
55
const path = require('path');
@@ -28,6 +28,12 @@ const testDefinitions = {
2828
};
2929

3030
describe('commander additions', () => {
31+
beforeEach(() => {
32+
const command = require('../lib/cli/utils/commander').default;
33+
commander = new command.constructor();
34+
commander.storeOptionsAsProperties();
35+
commander.allowExcessArguments();
36+
});
3137
afterEach(done => {
3238
commander.options = [];
3339
delete commander.arg0;

src/cli/utils/commander.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,8 @@ Command.prototype.getOptions = function () {
136136
}, {});
137137
};
138138

139-
export default new Command().storeOptionsAsProperties();
139+
const commander = new Command()
140+
commander.storeOptionsAsProperties();
141+
commander.allowExcessArguments();
142+
export default commander;
140143
/* eslint-enable no-console */

0 commit comments

Comments
 (0)