Skip to content

Commit

Permalink
Eliminating the promiseBased setting of commands
Browse files Browse the repository at this point in the history
Now that everything is Promise-based (and anything new should also be), it's
pointless to keep an option for classes to avoid wrapping into Promises.
Nothing should be wrapped anymore.
  • Loading branch information
Polgár Márton authored and DeeDeeG committed Oct 1, 2023
1 parent 71278ea commit 2ba286b
Show file tree
Hide file tree
Showing 29 changed files with 0 additions and 31 deletions.
3 changes: 0 additions & 3 deletions src/apm-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ module.exports = {
return errorHandler();
} else if ((Command = commands[command])) {
const command = new Command();
if (!Command.promiseBased) {
command.run = promisifiedRun(command.run);
}
return command.run(options).then(errorHandler);
} else {
return errorHandler(`Unrecognized command: ${command}`);
Expand Down
1 change: 0 additions & 1 deletion src/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const Command = require('./command');

module.exports =
class Ci extends Command {
static promiseBased = true;
static commandNames = ["ci"];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const fs = require('./fs');

module.exports =
class Clean extends Command {
static promiseBased = true;
static commandNames = ["clean", "prune"];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const Command = require('./command');

module.exports =
class Config extends Command {
static promiseBased = true;
static commandNames = [ "config" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/dedupe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const fs = require('./fs');

module.exports =
class Dedupe extends Command {
static promiseBased = true;
static commandNames = [ "dedupe" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const request = require('./request');

module.exports =
class Develop extends Command {
static promiseBased = true;
static commandNames = [ "dev", "develop" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const List = require('./list');

module.exports =
class Disable extends Command {
static promiseBased = true;
static commandNames = [ "disable" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const config = require('./apm');

module.exports =
class Docs extends View {
static promiseBased = true;
static commandNames = [ "docs", "home", "open" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Command = require('./command');

module.exports =
class Enable extends Command {
static promiseBased = true;
static commandNames = [ "enable" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/featured.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const tree = require('./tree');

module.exports =
class Featured extends Command {
static promiseBased = true;
static commandNames = [ "featured" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const fs = require('./fs');

module.exports =
class Init extends Command {
static promiseBased = true;
static commandNames = [ "init" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const {isDeprecatedPackage} = require('./deprecated-packages');

module.exports =
class Install extends Command {
static promiseBased = true;
static commandNames = [ "install", "i" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const fs = require('./fs');

module.exports =
class Link extends Command {
static promiseBased = true;
static commandNames = [ "link", "ln" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const tree = require('./tree');

module.exports =
class Links extends Command {
static promiseBased = true;
static commandNames = [ "linked", "links", "lns" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const {getRepository} = require("./packages");

module.exports =
class List extends Command {
static promiseBased = true;
static commandNames = [ "list", "ls" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Command = require('./command');

module.exports =
class Login extends Command {
static promiseBased = true;
static commandNames = [ "login" ];

static async getTokenOrLogin() {
Expand Down
1 change: 0 additions & 1 deletion src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const request = require('./request');

module.exports =
class Publish extends Command {
static promiseBased = true;
static commandNames = [ "publish" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/rebuild-module-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const fs = require('./fs');

module.exports =
class RebuildModuleCache extends Command {
static promiseBased = true;
static commandNames = [ "rebuild-module-cache" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/rebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const fs = require('./fs');

module.exports =
class Rebuild extends Command {
static promiseBased = true;
static commandNames = [ "rebuild" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {isDeprecatedPackage} = require('./deprecated-packages');

module.exports =
class Search extends Command {
static promiseBased = true;
static commandNames = [ "search" ];


Expand Down
1 change: 0 additions & 1 deletion src/star.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const request = require('./request');

module.exports =
class Star extends Command {
static promiseBased = true;
static commandNames = [ "star" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/stars.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const tree = require('./tree');

module.exports =
class Stars extends Command {
static promiseBased = true;
static commandNames = [ "stars", "starred" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const fs = require('./fs');

module.exports =
class Test extends Command {
static promiseBased = true;
static commandNames = [ "test" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const request = require('./request');

module.exports =
class Uninstall extends Command {
static promiseBased = true;
static commandNames = [ "deinstall", "delete", "erase", "remove", "rm", "uninstall" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/unlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const fs = require('./fs');

module.exports =
class Unlink extends Command {
static promiseBased = true;
static commandNames = [ "unlink" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/unpublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const request = require('./request');

module.exports =
class Unpublish extends Command {
static promiseBased = true;
static commandNames = [ "unpublish" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/unstar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const request = require('./request');

module.exports =
class Unstar extends Command {
static promiseBased = true;
static commandNames = [ "unstar" ];

parseOptions(argv) {
Expand Down
1 change: 0 additions & 1 deletion src/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const git = require('./git');

module.exports =
class Upgrade extends Command {
static promiseBased = true;
static commandNames = [ "upgrade", "outdated", "update" ];

constructor() {
Expand Down
1 change: 0 additions & 1 deletion src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const tree = require('./tree');

module.exports =
class View extends Command {
static promiseBased = true;
static commandNames = [ "view", "show" ];

parseOptions(argv) {
Expand Down

0 comments on commit 2ba286b

Please sign in to comment.