Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Upgrade to commander 13.0.0 #9574

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 */
Loading