Skip to content

Commit

Permalink
Q package removal (#728)
Browse files Browse the repository at this point in the history
* Remove Q usages from common and utils folders (#722)

* Remove Q usages from the debugger folder (#723)

* Remove Q usages from the extension folder (#725)

* Remove Q usages from the test folder (#727)

* Remove mockery dependency

* Remove q dependency

* Remove Q promises from gulpfile

* Bump cordova-simulate to 1.1.0

Co-authored-by: etatanova <77284023+etatanova@users.noreply.github.com>
  • Loading branch information
RedMickey and etatanova committed Aug 19, 2021
1 parent 763a65a commit e2041ec
Show file tree
Hide file tree
Showing 27 changed files with 785 additions and 898 deletions.
57 changes: 31 additions & 26 deletions gulpfile.js
Expand Up @@ -9,7 +9,6 @@ const ts = require("gulp-typescript");
const log = require("fancy-log");
const os = require("os");
const path = require("path");
const Q = require("q");
const typescript = require("typescript");
const del = require("del");
const nls = require("vscode-nls-dev");
Expand All @@ -26,32 +25,32 @@ function executeCordovaCommand(cwd, command) {
}

function executeCommand(cwd, commandToExecute) {
var deferred = Q.defer();
var process = child_process.exec(
commandToExecute,
{ cwd: cwd },
(error, stdout, stderr) => {
if (error) {
console.error("An error occurred: " + error);
return;
return new Promise((resolve, reject) => {
let process = child_process.exec(
commandToExecute,
{ cwd: cwd },
(error, stdout, stderr) => {
if (error) {
console.error("An error occurred: " + error);
return;
}
console.log(stderr);
console.log(stdout);
}
console.log(stderr);
console.log(stdout);
}
);
process.on("error", function (err) {
console.log("Command failed with error: " + err);
deferred.reject(err);
});
process.stdout.on("close", function (exitCode) {
if (exitCode) {
console.log("Command failed with exit code " + exitCode);
deferred.reject(exitCode);
} else {
deferred.resolve({});
}
);
process.on("error", function (err) {
console.log("Command failed with error: " + err);
reject(err);
});
process.stdout.on("close", function (exitCode) {
if (exitCode) {
console.log("Command failed with exit code " + exitCode);
reject(exitCode);
} else {
resolve({});
}
});
});
return deferred.promise;
}

var sources = ["src/**/*.ts"];
Expand Down Expand Up @@ -341,7 +340,7 @@ gulp.task("release", function () {
fs.mkdirSync(backupFolder);
}

return Q({})
return Promise.resolve()
.then(function () {
/* back up LICENSE.txt, ThirdPartyNotices.txt, README.md */
console.log("Backing up license files to " + backupFolder + "...");
Expand Down Expand Up @@ -393,6 +392,12 @@ gulp.task("clean-test", function () {
var pathsToDelete = [
"test/**/*.js",
"test/**/*.js.map",
"test/resources/testCordovaProject/.vscode",
"test/resources/testCordovaProject/node_modules",
"test/resources/testCordovaProject/plugins",
"test/resources/testCordovaProject/typings",
"test/resources/testCordovaProject/jsconfig.json",
"test/resources/testCordovaProject/package-lock.json",
"!test/resources/testCordovaProject/**/*.js",
"!test/resources/testCordovaProject/**/*.js.map",
];
Expand Down
149 changes: 20 additions & 129 deletions package-lock.json

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

7 changes: 2 additions & 5 deletions package.json
Expand Up @@ -381,7 +381,7 @@
"devServerTimeout": {
"type": "number",
"description": "%cordova.properties.launch.devServerTimeout%",
"default": 20000
"default": 60000
},
"simulatePort": {
"type": "number",
Expand Down Expand Up @@ -604,7 +604,6 @@
"execa": "^4.0.0",
"ip": "^1.1.5",
"plist": "^3.0.2",
"q": "^1.4.1",
"semver": "5.1.0",
"socket.io-client": "^2.4.0",
"uuid": "^8.3.1",
Expand All @@ -622,7 +621,6 @@
"@types/fancy-log": "^1.3.1",
"@types/mocha": "^8.0.3",
"@types/node": "^10.17.17",
"@types/q": "^1.0.3",
"@types/rimraf": "^2.0.3",
"@types/semver": "^5.5.0",
"@types/sinon": "^9.0.7",
Expand All @@ -631,7 +629,7 @@
"@types/vscode": "1.40.0",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"@typescript-eslint/parser": "^4.2.0",
"cordova-simulate": "^1.0.1",
"cordova-simulate": "^1.1.0",
"del": "^2.2.2",
"devtools-protocol": "0.0.760817",
"eslint": "^7.9.0",
Expand All @@ -645,7 +643,6 @@
"gulp-typescript": "^5.0.1",
"minimist": "^1.2.5",
"mocha": "^8.1.3",
"mockery": "^1.4.0",
"rimraf": "^2.7.1",
"should": "^13.2.1",
"sinon": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/common/customRequire.ts
Expand Up @@ -11,7 +11,7 @@ try {
: eval("require"); // tslint:disable-line:no-eval
} catch {
// Use a noop in case both `__non_webpack_require__` and `require` does not exist
customRequire = () => { }; // tslint:disable-line:no-empty
customRequire = () => {}; // eslint-disable-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-empty-function
}

export default customRequire;

0 comments on commit e2041ec

Please sign in to comment.