Skip to content

Commit

Permalink
refactor: Upgrade to commander 13.0.0 (#9574)
Browse files Browse the repository at this point in the history
  • Loading branch information
dblythy authored Jan 29, 2025
1 parent ea5ee68 commit a68f71b
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 10 deletions.
139 changes: 132 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@parse/push-adapter": "6.8.0",
"bcryptjs": "2.4.3",
"body-parser": "1.20.3",
"commander": "12.1.0",
"commander": "13.0.0",
"cors": "2.8.5",
"deepcopy": "2.1.0",
"express": "4.21.2",
Expand Down
8 changes: 7 additions & 1 deletion spec/CLI.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const commander = require('../lib/cli/utils/commander').default;
let commander;
const definitions = require('../lib/cli/definitions/parse-server').default;
const liveQueryDefinitions = require('../lib/cli/definitions/parse-live-query-server').default;
const path = require('path');
Expand Down Expand Up @@ -28,6 +28,12 @@ const testDefinitions = {
};

describe('commander additions', () => {
beforeEach(() => {
const command = require('../lib/cli/utils/commander').default;
commander = new command.constructor();
commander.storeOptionsAsProperties();
commander.allowExcessArguments();
});
afterEach(done => {
commander.options = [];
delete commander.arg0;
Expand Down
5 changes: 4 additions & 1 deletion src/cli/utils/commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,8 @@ Command.prototype.getOptions = function () {
}, {});
};

export default new Command().storeOptionsAsProperties();
const commander = new Command()
commander.storeOptionsAsProperties();
commander.allowExcessArguments();
export default commander;
/* eslint-enable no-console */

0 comments on commit a68f71b

Please sign in to comment.