diff --git a/.eslintrc.json b/.eslintrc.json index 8a461266e..3050b2b9e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -24,14 +24,7 @@ }, "rules": { "standard/no-callback-literal": ["off"], - "no-mixed-operators": ["off"], - "no-useless-escape": ["off"], - "no-return-await": ["off"], "node/no-deprecated-api": ["off"], - "prefer-promise-reject-errors": ["off"], - "no-unused-expressions": ["off"], - "symbol-description": ["off"], - "no-use-before-define": ["off"], "prettier/prettier": ["off"] // disable prettier rules for now. }, "overrides": [ diff --git a/package-lock.json b/package-lock.json index 30bde3375..046cf99f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,446 +21,32 @@ } }, "@atom/fuzzy-native": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@atom/fuzzy-native/-/fuzzy-native-1.0.1.tgz", - "integrity": "sha512-qqpUL9NpR7Ee04CNoHK8eOXx3ON4e2AbxMFA4v1Ch6lCb7//K9YsJKTmTNT9W49dF9snV+hdgF4TNYD1gY7Qpg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@atom/fuzzy-native/-/fuzzy-native-1.0.3.tgz", + "integrity": "sha512-bpFKY270m+1JVZ5xEn1RIFo44ZwIYww0o/MZnev/SyMXZSuQEcJcgXbvz8mBAOK9Tpce4iDgRWcBLuBOoMbJSw==", "requires": { - "nan": "^2.0.0", - "node-pre-gyp": "^0.10.0", - "semver": "^5.0.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "iconv-lite": { - "version": "0.4.23", - "bundled": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "minipass": { - "version": "2.3.0", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.1", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "needle": { - "version": "2.2.1", - "bundled": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "bundled": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true - }, - "sax": { - "version": "1.2.4", - "bundled": true - }, - "semver": { - "version": "5.7.0", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - }, - "dependencies": { - "minipass": { - "version": "2.3.5", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true - } + "nan": "^2.0.0" } }, "@atom/nsfw": { - "version": "1.0.22", - "resolved": "https://registry.npmjs.org/@atom/nsfw/-/nsfw-1.0.22.tgz", - "integrity": "sha512-D1yp+X31Jed/2xkGXTurC9CGZO4d2WzEr5Rxi1elzv7bipqtIcM7HmxV0gK+WceeEj2+V1lrIINhU6mbXsJ69w==", + "version": "1.0.23", + "resolved": "https://registry.npmjs.org/@atom/nsfw/-/nsfw-1.0.23.tgz", + "integrity": "sha512-mo6G3eYzQzmdUWjCHO/2a4dWPPYYOZjAXjA4QtLGVXlnTMn08gC7JUEuztjAld1Qk+MYyV613O3ACj8xZ4KEog==", "requires": { + "fs-extra": "^7.0.0", "nan": "^2.10.0" + }, + "dependencies": { + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } } }, "@atom/source-map-support": { @@ -1529,11 +1115,11 @@ "dependencies": { "etch": { "version": "0.9.0", - "resolved": false + "bundled": true }, "semver": { "version": "5.5.1", - "resolved": false + "bundled": true } } }, @@ -1709,16 +1295,16 @@ } }, "atom-keymap": { - "version": "8.2.13", - "resolved": "https://registry.npmjs.org/atom-keymap/-/atom-keymap-8.2.13.tgz", - "integrity": "sha512-RNf+5KbAiXpNV2KZT0+XYpTRFE8rhq7NrBryghJAOlwayY3g3z6Kp9tMfaPJ05BkPo9mChcaFO6SKUL8LTQcBg==", + "version": "8.2.14", + "resolved": "https://registry.npmjs.org/atom-keymap/-/atom-keymap-8.2.14.tgz", + "integrity": "sha512-9ofjA8IG/RNJcqvMvYglc0l7DljavIUQvGs5xdEtd5dEYX4rCQo9coeBfGaC0YM7FB0SBHPZy39QYFROkOzTOw==", "requires": { "clear-cut": "^2", "emissary": "^1.1.0", "event-kit": "^1.0.0", "fs-plus": "^3.0.0", "grim": "^1.2.1", - "keyboard-layout": "2.0.14", + "keyboard-layout": "2.0.16", "pathwatcher": "^8.0.0", "property-accessors": "^1", "season": "^6.0.2" @@ -1819,11 +1405,11 @@ "dependencies": { "underscore": { "version": "1.9.1", - "resolved": false + "bundled": true }, "underscore-plus": { "version": "1.7.0", - "resolved": false, + "bundled": true, "requires": { "underscore": "^1.9.1" } @@ -2115,7 +1701,6 @@ "version": "2.10.1", "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "optional": true, "requires": { "hoek": "2.x.x" } @@ -2675,7 +2260,7 @@ "dependencies": { "grim": { "version": "2.0.2", - "resolved": false, + "bundled": true, "requires": { "event-kit": "^2.0.0" } @@ -2828,22 +2413,22 @@ "dependencies": { "etch": { "version": "0.9.0", - "resolved": false + "bundled": true }, "grim": { "version": "2.0.2", - "resolved": false, + "bundled": true, "requires": { "event-kit": "^2.0.0" } }, "underscore": { "version": "1.9.1", - "resolved": false + "bundled": true }, "underscore-plus": { "version": "1.7.0", - "resolved": false, + "bundled": true, "requires": { "underscore": "^1.9.1" } @@ -3180,11 +2765,11 @@ "dependencies": { "underscore": { "version": "1.9.1", - "resolved": false + "bundled": true }, "underscore-plus": { "version": "1.7.0", - "resolved": false, + "bundled": true, "requires": { "underscore": "^1.9.1" } @@ -3288,8 +2873,8 @@ } }, "find-and-replace": { - "version": "https://www.atom.io/api/packages/find-and-replace/versions/0.218.10/tarball", - "integrity": "sha512-P9pFWPlUIUO+COMR6VdTQa7Q4JUcrSS8NALq5Pc0RI8scoMoLnZ5RSReKgYp5Gnc7kshPPa09agw3GitLFmorw==", + "version": "https://www.atom.io/api/packages/find-and-replace/versions/0.218.11/tarball", + "integrity": "sha512-STNDeRCSXCV5YjfrWbS5X4TfOFnNX7Z1k96POk3uPoPN8aQvkAIUflT7h6p0MClR9E2/I2O7nYKbYzNqBflZ6Q==", "requires": { "binary-search": "^1.3.3", "element-resize-detector": "^1.1.10", @@ -3547,10 +3132,10 @@ "integrity": "sha1-gy9kifvodnaUWVmckUpnDsIpR+4=" }, "fuzzy-finder": { - "version": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.13.3/tarball", - "integrity": "sha512-wVj9JkOZaeK26OtuTi3bMr8TlZ0srwmf3avtvMBnYjza4eueHOrRM6i+yxgoaPqv2ODQl1T33IldXFo1z5YWMw==", + "version": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.13.5/tarball", + "integrity": "sha512-YGWs7O5f2H0An7wTKet9yst+EngKCMBMzI6E68UyM5qGs+1cEyOo4j5JEB3RtHpzsBDv+aYhT0C/WoXuOh+B/g==", "requires": { - "@atom/fuzzy-native": "^1.0.1", + "@atom/fuzzy-native": "^1.0.3", "async": "0.2.6", "atom-select-list": "^0.7.0", "fs-plus": "^3.0.0", @@ -3656,11 +3241,11 @@ "dependencies": { "rimraf": { "version": "2.2.8", - "resolved": false + "bundled": true }, "temp": { "version": "0.8.3", - "resolved": false, + "bundled": true, "requires": { "os-tmpdir": "^1.0.0", "rimraf": "~2.2.6" @@ -3863,8 +3448,7 @@ "hoek": { "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "optional": true + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" }, "home-or-tmp": { "version": "1.0.0", @@ -4133,7 +3717,7 @@ "resolved": "https://registry.npmjs.org/jasmine-focused/-/jasmine-focused-1.0.7.tgz", "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=", "requires": { - "jasmine-node": "jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", + "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef", "underscore-plus": "1.x", "walkdir": "0.0.7" } @@ -4334,12 +3918,19 @@ } }, "keyboard-layout": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/keyboard-layout/-/keyboard-layout-2.0.14.tgz", - "integrity": "sha512-QuCfpEC8oai6F8oaNQdxi5+1QIpaQu9HSVI9yzkC2HbIXeBnahzHFDRVGUtwwAWiNnzjNBjUI/djsrMGUTgK1w==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/keyboard-layout/-/keyboard-layout-2.0.16.tgz", + "integrity": "sha512-eGrxmlV6jbm/mbPEOpYGuH53XEC7wIUj9ZxKcT2z9QHJ/RwrT9iVkvxka9zRxqHZHwQzcffgsa5OxoVAKnhK9w==", "requires": { "event-kit": "^2.0.0", - "nan": "^2.10.0" + "nan": "^2.13.2" + }, + "dependencies": { + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + } } }, "keytar": { @@ -4470,8 +4061,8 @@ "integrity": "sha512-HD6HI41u57i0/Tu9catiriURhJsef0RDrzJDkGDtdFkE9F9KPxC9Fayq2JBLJrhIyADRVXFxwxsfwQ2Jmh6hxg==" }, "language-python": { - "version": "https://www.atom.io/api/packages/language-python/versions/0.53.1/tarball", - "integrity": "sha512-yu2DU+Lqy0dzyMwzBIa6Oz6yvQiOeqwwnXl8Gbw4CasnTiAnEW9fk0wFOsUZOs1veqkZqP6Mdd5Zu7n5p1gLcw==", + "version": "https://www.atom.io/api/packages/language-python/versions/0.53.2/tarball", + "integrity": "sha512-ACNHWQWlRUfWrOb5MTvjP2wMTFdAq8Wnd3tWXYEd/TcfECtmCGy+6h33dt9X6SmAZz6OGKQ7V8lnVbOlh3X+Fw==", "requires": { "atom-grammar-test": "^0.6.4", "tree-sitter-python": "^0.14.0" @@ -4526,10 +4117,10 @@ "integrity": "sha512-6xFDqM6nZpynmxGKUS85iUWY0yeub7GYvLyzSOqDejMuOL5UXAITnSNcb7jhr+hQA8KTj5dCmRjphkAQER4Ucg==" }, "language-typescript": { - "version": "https://www.atom.io/api/packages/language-typescript/versions/0.4.11/tarball", - "integrity": "sha512-Qz57rNC2jzo3IPRrz6LzKoHExqw1jk/UE52QmbSIziCyoOw8G1LPobpY+XpxVLW68Mh7Ad2gAmdRj1d3oeWswg==", + "version": "https://www.atom.io/api/packages/language-typescript/versions/0.5.0/tarball", + "integrity": "sha512-rRArdgBSjIxfMceapfPil4n5fraIr3lBWGWuXpRqGvYkmB7scvt01MpbCvdKlJGz/KAd7wKG8criIYqBvy2QDg==", "requires": { - "tree-sitter-typescript": "^0.13.6" + "tree-sitter-typescript": "^0.14.0" } }, "language-xml": { @@ -4716,11 +4307,11 @@ "dependencies": { "underscore": { "version": "1.9.1", - "resolved": false + "bundled": true }, "underscore-plus": { "version": "1.7.0", - "resolved": false, + "bundled": true, "requires": { "underscore": "^1.9.1" } @@ -4743,11 +4334,11 @@ "dependencies": { "underscore": { "version": "1.9.1", - "resolved": false + "bundled": true }, "underscore-plus": { "version": "1.7.0", - "resolved": false, + "bundled": true, "requires": { "underscore": "^1.9.1" } @@ -5066,8 +4657,8 @@ } }, "metrics": { - "version": "https://www.atom.io/api/packages/metrics/versions/1.7.4/tarball", - "integrity": "sha512-o4ggvI17jLKgKw7i8TIE81vLSlRv1YSjHEckQ2ZlzzTIppM3wkcNkWpmTQl+Rwpn/xwnopiz66YXN6G5XgJ0Jg==", + "version": "https://www.atom.io/api/packages/metrics/versions/1.7.5/tarball", + "integrity": "sha512-HcA9QKEJAdQi1p6ppk48BKsBGv5E/bLK2rlNUQZJvCPIvPAM/ufFjnqlzujQbZ1/2VFvfXIh4EgQUyS2Hkm1+w==", "requires": { "fs-plus": "^3.0.0", "grim": "^2.0.1", @@ -6954,15 +6545,15 @@ } }, "text-buffer": { - "version": "13.15.3", - "resolved": "https://registry.npmjs.org/text-buffer/-/text-buffer-13.15.3.tgz", - "integrity": "sha512-H2fz/N15g0fBP7R33FUFLnIyND+Lji/xmuvHg9rKgmfCh7NAVxiFIvnZTabuBhL9InqPrtV5t4hkUy+r3dNXMg==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/text-buffer/-/text-buffer-13.16.0.tgz", + "integrity": "sha512-J00KcJDKvV87I/4o7F6LYu+2/fzmuEb7liBbZsIeCUM+T0kwqW7k0R7ddyk9EJR2Nqq7asng2/hVIBNYldIfEg==", "requires": { "delegato": "^1.0.0", "diff": "^2.2.1", "emissary": "^1.0.0", "event-kit": "^2.4.0", - "fs-admin": "^0.1.7", + "fs-admin": "^0.5.0", "fs-plus": "^3.0.0", "grim": "^2.0.2", "mkdirp": "^0.5.1", @@ -6977,6 +6568,14 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz", "integrity": "sha1-YOr9DSjukG5Oj/ClLBIpUhAzv5k=" }, + "fs-admin": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fs-admin/-/fs-admin-0.5.0.tgz", + "integrity": "sha512-jU0x86bI6wmhdGGcpaO1rI7EpNx/44cEXPsHqFIRgs9SVsk3HSWn9Zd5fd7bdDw3LcmdnazOcJFK9PZsoNecAA==", + "requires": { + "nan": "^2.13.2" + } + }, "grim": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/grim/-/grim-2.0.2.tgz", @@ -6984,6 +6583,11 @@ "requires": { "event-kit": "^2.0.0" } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" } } }, @@ -7186,9 +6790,9 @@ } }, "tree-sitter-typescript": { - "version": "0.13.6", - "resolved": "https://registry.npmjs.org/tree-sitter-typescript/-/tree-sitter-typescript-0.13.6.tgz", - "integrity": "sha512-1csvCrW5gf4d4D0ZXCctsVDr0M+fOCXYfX/Tve6OAeHUdFu0JsI+CEsS6X3VH7umX5/62RDYe1cwbvOhCuIiXA==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/tree-sitter-typescript/-/tree-sitter-typescript-0.14.0.tgz", + "integrity": "sha512-gx54LvIbjIdqSYGwau5G4Kr7j1oEwfWoZDKrR3jUlINEwskNOXaOzgsSdIM92JnFyqdBU+N6mBHpzjafbJ8EFw==", "requires": { "nan": "^2.10.0" } diff --git a/package.json b/package.json index 724648a82..b26e1c0fd 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "2.0.18", + "electronVersion": "3.1.10", "dependencies": { - "@atom/nsfw": "1.0.22", + "@atom/nsfw": "1.0.23", "@atom/source-map-support": "^0.3.4", "@atom/watcher": "1.3.1", "about": "file:packages/about", @@ -22,7 +22,7 @@ "async": "0.2.6", "atom-dark-syntax": "file:packages/atom-dark-syntax", "atom-dark-ui": "file:packages/atom-dark-ui", - "atom-keymap": "8.2.13", + "atom-keymap": "8.2.14", "atom-light-syntax": "file:packages/atom-light-syntax", "atom-light-ui": "file:packages/atom-light-ui", "atom-select-list": "^0.7.2", @@ -54,7 +54,7 @@ "etch": "^0.12.6", "event-kit": "^2.5.3", "exception-reporting": "file:packages/exception-reporting", - "find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.218.10/tarball", + "find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.218.11/tarball", "find-parent-dir": "^0.3.0", "first-mate": "7.3.0", "focus-trap": "2.4.5", @@ -62,7 +62,7 @@ "fs-plus": "^3.1.1", "fstream": "0.1.24", "fuzzaldrin": "^2.1", - "fuzzy-finder": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.13.3/tarball", + "fuzzy-finder": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.13.5/tarball", "git-diff": "file:packages/git-diff", "git-utils": "5.5.0", "github": "https://www.atom.io/api/packages/github/versions/0.29.0/tarball", @@ -97,7 +97,7 @@ "language-perl": "https://www.atom.io/api/packages/language-perl/versions/0.38.1/tarball", "language-php": "https://www.atom.io/api/packages/language-php/versions/0.44.1/tarball", "language-property-list": "https://www.atom.io/api/packages/language-property-list/versions/0.9.1/tarball", - "language-python": "https://www.atom.io/api/packages/language-python/versions/0.53.1/tarball", + "language-python": "https://www.atom.io/api/packages/language-python/versions/0.53.2/tarball", "language-ruby": "https://www.atom.io/api/packages/language-ruby/versions/0.72.16/tarball", "language-ruby-on-rails": "https://www.atom.io/api/packages/language-ruby-on-rails/versions/0.25.3/tarball", "language-rust-bundled": "file:packages/language-rust-bundled", @@ -108,7 +108,7 @@ "language-text": "https://www.atom.io/api/packages/language-text/versions/0.7.4/tarball", "language-todo": "https://www.atom.io/api/packages/language-todo/versions/0.29.4/tarball", "language-toml": "https://www.atom.io/api/packages/language-toml/versions/0.20.0/tarball", - "language-typescript": "https://www.atom.io/api/packages/language-typescript/versions/0.4.11/tarball", + "language-typescript": "https://www.atom.io/api/packages/language-typescript/versions/0.5.0/tarball", "language-xml": "https://www.atom.io/api/packages/language-xml/versions/0.35.3/tarball", "language-yaml": "https://www.atom.io/api/packages/language-yaml/versions/0.32.0/tarball", "less-cache": "1.1.0", @@ -117,7 +117,7 @@ "link": "file:packages/link", "markdown-preview": "https://www.atom.io/api/packages/markdown-preview/versions/0.160.0/tarball", "marked": "^0.3.12", - "metrics": "https://www.atom.io/api/packages/metrics/versions/1.7.4/tarball", + "metrics": "https://www.atom.io/api/packages/metrics/versions/1.7.5/tarball", "minimatch": "^3.0.3", "mocha": "2.5.1", "mocha-junit-reporter": "^1.13.0", @@ -155,7 +155,7 @@ "symbols-view": "https://www.atom.io/api/packages/symbols-view/versions/0.118.2/tarball", "tabs": "https://www.atom.io/api/packages/tabs/versions/0.110.0/tarball", "temp": "^0.9.0", - "text-buffer": "13.15.3", + "text-buffer": "13.16.0", "timecop": "https://www.atom.io/api/packages/timecop/versions/0.36.2/tarball", "tree-sitter": "0.15.0", "tree-sitter-css": "^0.13.7", @@ -200,8 +200,8 @@ "dev-live-reload": "file:./packages/dev-live-reload", "encoding-selector": "0.23.9", "exception-reporting": "file:./packages/exception-reporting", - "find-and-replace": "0.218.10", - "fuzzy-finder": "1.13.3", + "find-and-replace": "0.218.11", + "fuzzy-finder": "1.13.5", "github": "0.29.0", "git-diff": "file:./packages/git-diff", "go-to-line": "file:./packages/go-to-line", @@ -212,7 +212,7 @@ "line-ending-selector": "file:./packages/line-ending-selector", "link": "file:./packages/link", "markdown-preview": "0.160.0", - "metrics": "1.7.4", + "metrics": "1.7.5", "notifications": "0.70.6", "open-on-github": "1.3.1", "package-generator": "1.3.0", @@ -249,7 +249,7 @@ "language-perl": "0.38.1", "language-php": "0.44.1", "language-property-list": "0.9.1", - "language-python": "0.53.1", + "language-python": "0.53.2", "language-ruby": "0.72.16", "language-ruby-on-rails": "0.25.3", "language-rust-bundled": "file:./packages/language-rust-bundled", @@ -260,7 +260,7 @@ "language-text": "0.7.4", "language-todo": "0.29.4", "language-toml": "0.20.0", - "language-typescript": "0.4.11", + "language-typescript": "0.5.0", "language-xml": "0.35.3", "language-yaml": "0.32.0" }, diff --git a/resources/linux/atom.policy b/resources/linux/atom.policy new file mode 100644 index 000000000..0dd19d216 --- /dev/null +++ b/resources/linux/atom.policy @@ -0,0 +1,18 @@ + + + + Atom + + Admin privileges required + Please enter your password to save this file + /bin/dd + true + + auth_admin_keep + auth_admin_keep + auth_admin_keep + + + diff --git a/resources/linux/debian/control.in b/resources/linux/debian/control.in index 43ccef9af..4e33e5823 100644 --- a/resources/linux/debian/control.in +++ b/resources/linux/debian/control.in @@ -1,6 +1,6 @@ Package: <%= appFileName %> Version: <%= version %> -Depends: git, libgconf-2-4 (>= 3.2.5) | libgconf2-4, libgtk-3-0 (>= 3.9.10), libgcrypt11 | libgcrypt20, libnotify4, libxtst6, libnss3 (>= 2:3.22), python, gvfs-bin, xdg-utils, libx11-xcb1, libxss1, libasound2 (>= 1.0.16), libxkbfile1, libcurl3 | libcurl4 +Depends: git, libgconf-2-4 (>= 3.2.5) | libgconf2-4, libgtk-3-0 (>= 3.9.10), libgcrypt11 | libgcrypt20, libnotify4, libxtst6, libnss3 (>= 2:3.22), python, gvfs-bin, xdg-utils, libx11-xcb1, libxss1, libasound2 (>= 1.0.16), libxkbfile1, libcurl3 | libcurl4, policykit-1 Recommends: lsb-release Suggests: libsecret-1-0, gir1.2-gnomekeyring-1.0 Section: devel diff --git a/resources/linux/redhat/atom.spec.in b/resources/linux/redhat/atom.spec.in index 471d4b82a..7a4888895 100644 --- a/resources/linux/redhat/atom.spec.in +++ b/resources/linux/redhat/atom.spec.in @@ -8,9 +8,9 @@ AutoReqProv: no # Avoid libchromiumcontent.so missing dependency Prefix: <%= installDir %> %ifarch i386 i486 i586 i686 -Requires: lsb-core-noarch, libXss.so.1 libsecret-1.so.0 +Requires: lsb-core-noarch, libXss.so.1 libsecret-1.so.0, polkit %else -Requires: lsb-core-noarch, libXss.so.1()(64bit) libsecret-1.so.0()(64bit) +Requires: lsb-core-noarch, libXss.so.1()(64bit) libsecret-1.so.0()(64bit), polkit %endif %description @@ -25,6 +25,8 @@ cp atom.sh "%{buildroot}/<%= installDir %>/bin/<%= appFileName %>" chmod 755 "%{buildroot}/<%= installDir %>/bin/<%= appFileName %>" mkdir -p "%{buildroot}/<%= installDir %>/share/applications/" cp "<%= appFileName %>.desktop" "%{buildroot}/<%= installDir %>/share/applications/" +mkdir -p "%{buildroot}/<%= installDir %>/share/polkit-1/actions/" +cp "atom.policy" "%{buildroot}/<%= installDir %>/share/polkit-1/actions/atom.policy" mkdir -p "%{buildroot}/<%= installDir %>/share/icons/hicolor/1024x1024/apps" cp "icons/1024.png" "%{buildroot}/<%= installDir %>/share/icons/hicolor/1024x1024/apps/<%= appFileName %>.png" @@ -50,4 +52,5 @@ cp "icons/16.png" "%{buildroot}/<%= installDir %>/share/icons/hicolor/16x16/apps <%= installDir %>/bin/<%= apmFileName %> <%= installDir %>/share/<%= appFileName %>/ <%= installDir %>/share/applications/<%= appFileName %>.desktop +<%= installDir %>/share/polkit-1/actions/atom.policy <%= installDir %>/share/icons/hicolor/ diff --git a/script/lib/check-chromedriver-version.js b/script/lib/check-chromedriver-version.js index 1659f093c..f5cada045 100644 --- a/script/lib/check-chromedriver-version.js +++ b/script/lib/check-chromedriver-version.js @@ -5,17 +5,17 @@ const CONFIG = require('../config') const semver = require('semver') module.exports = function () { - // Chromedriver should be specified as ~x.y where x and y match Electron major/minor + // Chromedriver should be specified as ^n.x where n matches the Electron major version const chromedriverVer = buildMetadata.dependencies['electron-chromedriver'] const mksnapshotVer = buildMetadata.dependencies['electron-mksnapshot'] - // Always use tilde on electron-chromedriver so that it can pick up the best patch version - if (!chromedriverVer.startsWith('~')) { - throw new Error(`electron-chromedriver version in script/package.json should start with a tilde to match latest patch version.`) + // Always use caret on electron-chromedriver so that it can pick up the best minor/patch versions + if (!chromedriverVer.startsWith('^')) { + throw new Error(`electron-chromedriver version in script/package.json should start with a caret to match latest patch version.`) } - if (!mksnapshotVer.startsWith('~')) { - throw new Error(`electron-mksnapshot version in script/package.json should start with a tilde to match latest patch version.`) + if (!mksnapshotVer.startsWith('^')) { + throw new Error(`electron-mksnapshot version in script/package.json should start with a caret to match latest patch version.`) } const electronVer = CONFIG.appMetadata.electronVersion diff --git a/script/lib/create-debian-package.js b/script/lib/create-debian-package.js index 1aa179b70..cf5aaecf8 100644 --- a/script/lib/create-debian-package.js +++ b/script/lib/create-debian-package.js @@ -113,6 +113,12 @@ module.exports = function (packagedAppPath) { path.join(debianPackageLintianOverridesDirPath, atomExecutableName) ) + console.log(`Copying polkit configuration into "${debianPackageShareDirPath}"`) + fs.copySync( + path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'atom.policy'), + path.join(debianPackageShareDirPath, 'polkit-1', 'actions', 'atom.policy') + ) + console.log(`Generating .deb file from ${debianPackageDirPath}`) spawnSync('fakeroot', ['dpkg-deb', '-b', debianPackageDirPath], {stdio: 'inherit'}) diff --git a/script/lib/create-rpm-package.js b/script/lib/create-rpm-package.js index cdef23300..22068dcd3 100644 --- a/script/lib/create-rpm-package.js +++ b/script/lib/create-rpm-package.js @@ -76,6 +76,12 @@ module.exports = function (packagedAppPath) { path.join(rpmPackageBuildDirPath, 'atom.sh') ) + console.log(`Copying atom.policy into "${rpmPackageBuildDirPath}"`) + fs.copySync( + path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'atom.policy'), + path.join(rpmPackageBuildDirPath, 'atom.policy') + ) + console.log(`Generating .rpm package from "${rpmPackageDirPath}"`) spawnSync('rpmbuild', ['-ba', '--clean', rpmPackageSpecFilePath]) for (let generatedArch of fs.readdirSync(rpmPackageRpmsDirPath)) { diff --git a/script/lib/generate-startup-snapshot.js b/script/lib/generate-startup-snapshot.js index 3ac5eb3b8..359ab3321 100644 --- a/script/lib/generate-startup-snapshot.js +++ b/script/lib/generate-startup-snapshot.js @@ -105,22 +105,36 @@ module.exports = function (packagedAppPath) { {env: Object.assign({}, process.env, {ELECTRON_RUN_AS_NODE: 1})} ) - const generatedStartupBlobPath = path.join(CONFIG.buildOutputPath, 'snapshot_blob.bin') - console.log(`Generating startup blob at "${generatedStartupBlobPath}"`) - childProcess.execFileSync( - path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'bin', 'mksnapshot'), - ['--no-use_ic', snapshotScriptPath, '--startup_blob', generatedStartupBlobPath] + console.log('Generating startup blob with mksnapshot') + childProcess.spawnSync( + process.execPath, [ + path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'mksnapshot.js'), + snapshotScriptPath, + '--output_dir', + CONFIG.buildOutputPath + ] ) let startupBlobDestinationPath if (process.platform === 'darwin') { - startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin` + startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources` } else { - startupBlobDestinationPath = path.join(packagedAppPath, 'snapshot_blob.bin') + startupBlobDestinationPath = packagedAppPath } - console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`) - fs.unlinkSync(startupBlobDestinationPath) - fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath) + const snapshotBinaries = ['v8_context_snapshot.bin', 'snapshot_blob.bin'] + for (let snapshotBinary of snapshotBinaries) { + const destinationPath = path.join(startupBlobDestinationPath, snapshotBinary) + console.log(`Moving generated startup blob into "${destinationPath}"`) + try { + fs.unlinkSync(destinationPath) + } catch (err) { + // Doesn't matter if the file doesn't exist already + if (!err.code || err.code !== 'ENOENT') { + throw err + } + } + fs.renameSync(path.join(CONFIG.buildOutputPath, snapshotBinary), destinationPath) + } }) } diff --git a/script/lib/test-sign-on-mac.js b/script/lib/test-sign-on-mac.js index 1cd0efadd..eb64b8c0d 100644 --- a/script/lib/test-sign-on-mac.js +++ b/script/lib/test-sign-on-mac.js @@ -6,7 +6,7 @@ module.exports = function (packagedAppPath) { 'find-certificate', '-c', 'Mac Developer' ]) - const certMatch = (result.stdout || '').toString().match(/\"(Mac Developer.*\))\"/) + const certMatch = (result.stdout || '').toString().match(/"(Mac Developer.*\))"/) if (!certMatch || !certMatch[1]) { console.error('A "Mac Developer" certificate must be configured to perform test signing') } else { diff --git a/script/package-lock.json b/script/package-lock.json index 4c8ad5fe2..568d7d622 100644 --- a/script/package-lock.json +++ b/script/package-lock.json @@ -901,7 +901,6 @@ "version": "0.4.2", "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", - "optional": true, "requires": { "hoek": "0.9.x" } @@ -1912,9 +1911,9 @@ } }, "electron-chromedriver": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-2.0.0.tgz", - "integrity": "sha512-kERk/Wzhc9RzW9jUKXA5kJc4m8BlL6c9p5QH+CrIlst0saeqZL1Up7vzD4ZOnuBDpAVBBYJ4jhkAKIssf8ZlXg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-3.0.0.tgz", + "integrity": "sha512-xWivZRiPTtDFJt+qXv7Ax/Dmhxj0iqESOxoLZ2szu3fv6k1vYDUDJUMHfdfVAke9D2gBRIgChuGb5j3YEt6hxQ==", "requires": { "electron-download": "^4.1.0", "extract-zip": "^1.6.5" @@ -2009,12 +2008,34 @@ } }, "electron-mksnapshot": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/electron-mksnapshot/-/electron-mksnapshot-2.0.0.tgz", - "integrity": "sha512-OoZwZJNKgHP+DwhCGVTJEuDSeb478hOzAbHeg7dKGCHDbKKmUWmjGc+pEjxGutpqQ3Mn8hCdLzdx2c/lAJcTLA==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/electron-mksnapshot/-/electron-mksnapshot-3.1.10.tgz", + "integrity": "sha512-hPbFENfbUNrgOsLMja3nUFbneBxgXowmfztmRdr+a7yW6X6/d9YAGw23b9kugBNDFTKcuuTo825zVpBRwjSYRQ==", "requires": { "electron-download": "^4.1.0", - "extract-zip": "^1.6.5" + "extract-zip": "^1.6.5", + "fs-extra": "^7.0.1", + "temp": "^0.8.3" + }, + "dependencies": { + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + } } }, "electron-osx-sign": { @@ -3991,8 +4012,7 @@ "hoek": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", - "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", - "optional": true + "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=" }, "home-or-tmp": { "version": "1.0.0", diff --git a/script/package.json b/script/package.json index 1076c63a9..c6ed49977 100644 --- a/script/package.json +++ b/script/package.json @@ -10,9 +10,9 @@ "coffeelint": "1.15.7", "colors": "1.1.2", "donna": "1.0.16", - "electron-chromedriver": "~2.0", + "electron-chromedriver": "^3.0.0", "electron-link": "0.4.0", - "electron-mksnapshot": "~2.0", + "electron-mksnapshot": "^3.1.10", "electron-packager": "12.2.0", "electron-winstaller": "2.6.4", "eslint": "^5.16.0", diff --git a/spec/atom-environment-spec.js b/spec/atom-environment-spec.js index 9a34bb009..5ca2a8761 100644 --- a/spec/atom-environment-spec.js +++ b/spec/atom-environment-spec.js @@ -66,7 +66,7 @@ describe('AtomEnvironment', () => { it('will open the dev tools when an error is triggered', async () => { try { - a + 1 // eslint-disable-line no-undef + a + 1 // eslint-disable-line no-undef, no-unused-expressions } catch (e) { window.onerror(e.toString(), 'abc', 2, 3, e) } @@ -87,7 +87,7 @@ describe('AtomEnvironment', () => { let error = null atom.onWillThrowError(willThrowSpy) try { - a + 1 // eslint-disable-line no-undef + a + 1 // eslint-disable-line no-undef, no-unused-expressions } catch (e) { error = e window.onerror(e.toString(), 'abc', 2, 3, e) @@ -108,7 +108,7 @@ describe('AtomEnvironment', () => { atom.onWillThrowError(willThrowSpy) try { - a + 1 // eslint-disable-line no-undef + a + 1 // eslint-disable-line no-undef, no-unused-expressions } catch (e) { window.onerror(e.toString(), 'abc', 2, 3, e) } @@ -127,7 +127,7 @@ describe('AtomEnvironment', () => { let error = null atom.onDidThrowError(didThrowSpy) try { - a + 1 // eslint-disable-line no-undef + a + 1 // eslint-disable-line no-undef, no-unused-expressions } catch (e) { error = e window.onerror(e.toString(), 'abc', 2, 3, e) @@ -545,7 +545,7 @@ describe('AtomEnvironment', () => { spyOn(atom, 'confirm').andReturn(1) spyOn(atom.project, 'addPath') spyOn(atom.workspace, 'open') - const state = Symbol() + const state = Symbol('state') atom.attemptRestoreProjectStateForPaths( state, [__dirname], @@ -560,7 +560,7 @@ describe('AtomEnvironment', () => { spyOn(atom, 'confirm').andCallFake((options, callback) => callback(1)) spyOn(atom.project, 'addPath') spyOn(atom.workspace, 'open') - const state = Symbol() + const state = Symbol('state') atom.attemptRestoreProjectStateForPaths( state, @@ -579,7 +579,7 @@ describe('AtomEnvironment', () => { jasmine.useRealClock() spyOn(atom, 'confirm').andCallFake((options, callback) => callback(0)) spyOn(atom, 'open') - const state = Symbol() + const state = Symbol('state') atom.attemptRestoreProjectStateForPaths( state, diff --git a/spec/command-registry-spec.js b/spec/command-registry-spec.js index 597a72c35..86a5f7101 100644 --- a/spec/command-registry-spec.js +++ b/spec/command-registry-spec.js @@ -414,7 +414,7 @@ describe('CommandRegistry', () => { () => new Promise((resolve, reject) => { setTimeout(() => { - reject(3) + reject(3) // eslint-disable-line prefer-promise-reject-errors }, 1) }) ) diff --git a/spec/fixtures/dir/file-detected-as-binary b/spec/fixtures/dir/file-detected-as-binary new file mode 100644 index 000000000..b1eaaa651 --- /dev/null +++ b/spec/fixtures/dir/file-detected-as-binary @@ -0,0 +1,3 @@ +asciiProperty=Foo +utf8Property=Fòò +latin1Property=Fòò diff --git a/spec/style-manager-spec.js b/spec/style-manager-spec.js index b27ea97ad..88560e989 100644 --- a/spec/style-manager-spec.js +++ b/spec/style-manager-spec.js @@ -57,7 +57,7 @@ describe('StyleManager', () => { atom-text-editor::shadow .class-1, atom-text-editor::shadow .class-2 { color: red } atom-text-editor::shadow > .class-3 { color: yellow } atom-text-editor .class-4 { color: blue } - atom-text-editor[data-grammar*=\"js\"]::shadow .class-6 { color: green; } + atom-text-editor[data-grammar*="js"]::shadow .class-6 { color: green; } atom-text-editor[mini].is-focused::shadow .class-7 { color: green; } `) expect( diff --git a/spec/theme-manager-spec.js b/spec/theme-manager-spec.js index 2e4f74b50..a146d1486 100644 --- a/spec/theme-manager-spec.js +++ b/spec/theme-manager-spec.js @@ -319,9 +319,9 @@ h2 { it('returns a disposable allowing styles applied by the given path to be removed', function () { const cssPath = require.resolve('./fixtures/css.css') - expect(getComputedStyle(document.body).fontWeight).not.toBe('bold') + expect(getComputedStyle(document.body).fontWeight).not.toBe('700') const disposable = atom.themes.requireStylesheet(cssPath) - expect(getComputedStyle(document.body).fontWeight).toBe('bold') + expect(getComputedStyle(document.body).fontWeight).toBe('700') let styleElementRemovedHandler atom.styles.onDidRemoveStyleElement( diff --git a/spec/workspace-spec.js b/spec/workspace-spec.js index 4dd8fef54..1b84553b1 100644 --- a/spec/workspace-spec.js +++ b/spec/workspace-spec.js @@ -2424,7 +2424,7 @@ describe('Workspace', () => { results.sort((a, b) => a.filePath.localeCompare(b.filePath)) - expect(results).toHaveLength(3) + expect(results.length).toBeGreaterThan(0) expect(results[0].filePath).toBe( atom.project.getDirectories()[0].resolve('a') ) @@ -2669,6 +2669,33 @@ describe('Workspace', () => { }) }) + it('returns results on files detected as binary', async () => { + const results = [] + + await scan( + /asciiProperty=Foo/, + { + trailingContextLineCount: 2 + }, + result => results.push(result) + ) + expect(results.length).toBe(1) + const { filePath, matches } = results[0] + expect(filePath).toBe(atom.project.getDirectories()[0].resolve('file-detected-as-binary')) + expect(matches).toHaveLength(1) + expect(matches[0]).toEqual({ + matchText: 'asciiProperty=Foo', + lineText: 'asciiProperty=Foo', + lineTextOffset: 0, + range: [[0, 0], [0, 17]], + leadingContextLines: [], + trailingContextLines: [ + 'utf8Property=Fòò', + 'latin1Property=F��' + ] + }) + }) + describe('when the core.excludeVcsIgnoredPaths config is truthy', () => { let projectPath let ignoredPath @@ -2777,7 +2804,7 @@ describe('Workspace', () => { await scan(/a|Elephant/, {}, result => results.push(result)) - expect(results).toHaveLength(3) + expect(results.length).toBeGreaterThan(0) const resultForA = _.find( results, ({ filePath }) => path.basename(filePath) === 'a' diff --git a/src/buffered-process.js b/src/buffered-process.js index c82c78fac..21872d7d4 100644 --- a/src/buffered-process.js +++ b/src/buffered-process.js @@ -88,18 +88,18 @@ class BufferedProcess { return arg } else { // Escape double quotes by putting a backslash in front of them - return `\"${arg.toString().replace(/"/g, '\\"')}\"` + return `"${arg.toString().replace(/"/g, '\\"')}"` } }) } // The command itself is quoted if it contains spaces, &, ^, | or # chars - cmdArgs.unshift(/\s|&|\^|\(|\)|\||#/.test(command) ? `\"${command}\"` : command) + cmdArgs.unshift(/\s|&|\^|\(|\)|\||#/.test(command) ? `"${command}"` : command) const cmdOptions = _.clone(options) cmdOptions.windowsVerbatimArguments = true - this.spawn(this.getCmdPath(), ['/s', '/d', '/c', `\"${cmdArgs.join(' ')}\"`], cmdOptions) + this.spawn(this.getCmdPath(), ['/s', '/d', '/c', `"${cmdArgs.join(' ')}"`], cmdOptions) } /* diff --git a/src/compile-cache.js b/src/compile-cache.js index f2f5aade3..bf9a0771c 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -221,7 +221,7 @@ exports.install = function (resourcesPath, nodeRequire) { Error.prototype.getRawStack = function () { // Access this.stack to ensure prepareStackTrace has been run on this error // because it assigns this.rawStack as a side-effect - this.stack + this.stack // eslint-disable-line no-unused-expressions return this.rawStack } diff --git a/src/default-directory-searcher.js b/src/default-directory-searcher.js index 2f0889b0a..5dca54a55 100644 --- a/src/default-directory-searcher.js +++ b/src/default-directory-searcher.js @@ -98,7 +98,7 @@ module.exports = class DefaultDirectorySearcher { if (isCancelled) { resolve() } else { - reject() + reject() // eslint-disable-line prefer-promise-reject-errors } }) }) diff --git a/src/git-repository-provider.js b/src/git-repository-provider.js index 9785a88ee..827523b71 100644 --- a/src/git-repository-provider.js +++ b/src/git-repository-provider.js @@ -87,7 +87,7 @@ async function findGitDirectory (directory) { } else if (directory.isRoot()) { return null } else { - return await findGitDirectory(directory.getParent()) + return findGitDirectory(directory.getParent()) } } @@ -117,7 +117,7 @@ async function isValidGitDirectory (directory) { return ( (await directory.getSubdirectory('objects').exists()) && (await directory.getFile('HEAD').exists()) && - (await directory.getSubdirectory('refs').exists()) + directory.getSubdirectory('refs').exists() ) } diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index e74a3d463..e66509e5e 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -1230,7 +1230,7 @@ class AtomApplication extends EventEmitter { } else if (state.version === undefined) { // Atom <= 1.36.0 // Schema: [{initialPaths: ['', ...]}, ...] - return await Promise.all( + return Promise.all( state.map(async windowState => { // Classify each window's initialPaths as directories or non-directories const classifiedPaths = await Promise.all( diff --git a/src/main-process/squirrel-update.js b/src/main-process/squirrel-update.js index 0d8174f47..deb25e4eb 100644 --- a/src/main-process/squirrel-update.js +++ b/src/main-process/squirrel-update.js @@ -34,19 +34,19 @@ const addCommandsToPath = callback => { const installCommands = callback => { const atomCommandPath = path.join(binFolder, 'atom.cmd') const relativeAtomPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'atom.cmd')) - const atomCommand = `@echo off\r\n\"%~dp0\\${relativeAtomPath}\" %*` + const atomCommand = `@echo off\r\n"%~dp0\\${relativeAtomPath}" %*` const atomShCommandPath = path.join(binFolder, 'atom') const relativeAtomShPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'atom.sh')) - const atomShCommand = `#!/bin/sh\r\n\"$(dirname \"$0\")/${relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\"\r\necho` + const atomShCommand = `#!/bin/sh\r\n"$(dirname "$0")/${relativeAtomShPath.replace(/\\/g, '/')}" "$@"\r\necho` const apmCommandPath = path.join(binFolder, 'apm.cmd') const relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd')) - const apmCommand = `@echo off\r\n\"%~dp0\\${relativeApmPath}\" %*` + const apmCommand = `@echo off\r\n"%~dp0\\${relativeApmPath}" %*` const apmShCommandPath = path.join(binFolder, 'apm') const relativeApmShPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'apm.sh')) - const apmShCommand = `#!/bin/sh\r\n\"$(dirname \"$0\")/${relativeApmShPath.replace(/\\/g, '/')}\" \"$@\"` + const apmShCommand = `#!/bin/sh\r\n"$(dirname "$0")/${relativeApmShPath.replace(/\\/g, '/')}" "$@"` fs.writeFile(atomCommandPath, atomCommand, () => fs.writeFile(atomShCommandPath, atomShCommand, () => diff --git a/src/main-process/win-shell.js b/src/main-process/win-shell.js index dd694b9dd..f27c2d6c0 100644 --- a/src/main-process/win-shell.js +++ b/src/main-process/win-shell.js @@ -2,8 +2,8 @@ const Registry = require('winreg') const Path = require('path') let exeName = Path.basename(process.execPath) -let appPath = `\"${process.execPath}\"` -let fileIconPath = `\"${Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}\"` +let appPath = `"${process.execPath}"` +let fileIconPath = `"${Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}"` let isBeta = appPath.includes(' Beta') let appName = exeName.replace('atom', isBeta ? 'Atom Beta' : 'Atom').replace('.exe', '') @@ -56,14 +56,14 @@ exports.appName = appName exports.fileHandler = new ShellOption(`\\Software\\Classes\\Applications\\${exeName}`, [ - {key: 'shell\\open\\command', name: '', value: `${appPath} \"%1\"`}, + {key: 'shell\\open\\command', name: '', value: `${appPath} "%1"`}, {key: 'shell\\open', name: 'FriendlyAppName', value: `${appName}`}, {key: 'DefaultIcon', name: '', value: `${fileIconPath}`} ] ) let contextParts = [ - {key: 'command', name: '', value: `${appPath} \"%1\"`}, + {key: 'command', name: '', value: `${appPath} "%1"`}, {name: '', value: `Open with ${appName}`}, {name: 'Icon', value: `${appPath}`} ] diff --git a/src/package.js b/src/package.js index 56764a86a..37afb30b5 100644 --- a/src/package.js +++ b/src/package.js @@ -648,16 +648,15 @@ class Package { }) } - return new Promise(resolve => { - if (this.preloadedPackage && this.packageManager.packagesCache[this.name]) { - for (let settingsPath in this.packageManager.packagesCache[this.name].settings) { - const properties = this.packageManager.packagesCache[this.name].settings[settingsPath] - const settingsFile = new SettingsFile(`core:${settingsPath}`, properties || {}) - this.settings.push(settingsFile) - if (this.settingsActivated) settingsFile.activate(this.config) - } - return resolve() - } else { + if (this.preloadedPackage && this.packageManager.packagesCache[this.name]) { + for (let settingsPath in this.packageManager.packagesCache[this.name].settings) { + const properties = this.packageManager.packagesCache[this.name].settings[settingsPath] + const settingsFile = new SettingsFile(`core:${settingsPath}`, properties || {}) + this.settings.push(settingsFile) + if (this.settingsActivated) settingsFile.activate(this.config) + } + } else { + return new Promise(resolve => { const settingsDirPath = path.join(this.path, 'settings') fs.exists(settingsDirPath, (settingsDirExists) => { if (!settingsDirExists) return resolve() @@ -666,8 +665,8 @@ class Package { async.each(settingsPaths, loadSettingsFile, () => resolve()) }) }) - } - }) + }) + } } serialize () { diff --git a/src/pane.js b/src/pane.js index 943a12589..ac36f39f7 100644 --- a/src/pane.js +++ b/src/pane.js @@ -949,7 +949,7 @@ class Pane { } }) - return await saveDialogPromise + return saveDialogPromise } // Public: Save all items. diff --git a/src/path-watcher.js b/src/path-watcher.js index 6693489ef..0cde2f535 100644 --- a/src/path-watcher.js +++ b/src/path-watcher.js @@ -55,7 +55,7 @@ class NativeWatcher { } doStart () { - return Promise.reject('doStart() not overridden') + return Promise.reject(new Error('doStart() not overridden')) } // Private: Return true if the underlying watcher is actively listening for filesystem events. diff --git a/src/ripgrep-directory-searcher.js b/src/ripgrep-directory-searcher.js index fd33d5a3a..ffb0f8614 100644 --- a/src/ripgrep-directory-searcher.js +++ b/src/ripgrep-directory-searcher.js @@ -50,7 +50,7 @@ function updateLeadingContext (message, pendingLeadingContext, options) { } if (options.leadingContextLineCount) { - pendingLeadingContext.push(cleanResultLine(message.data.lines.text)) + pendingLeadingContext.push(cleanResultLine(message.data.lines)) if (pendingLeadingContext.length > options.leadingContextLineCount) { pendingLeadingContext.shift() @@ -65,7 +65,7 @@ function updateTrailingContexts (message, pendingTrailingContexts, options) { if (options.trailingContextLineCount) { for (const trailingContextLines of pendingTrailingContexts) { - trailingContextLines.push(cleanResultLine(message.data.lines.text)) + trailingContextLines.push(cleanResultLine(message.data.lines)) if (trailingContextLines.length === options.trailingContextLineCount) { pendingTrailingContexts.delete(trailingContextLines) @@ -75,6 +75,8 @@ function updateTrailingContexts (message, pendingTrailingContexts, options) { } function cleanResultLine (resultLine) { + resultLine = getText(resultLine) + return resultLine[resultLine.length - 1] === '\n' ? resultLine.slice(0, -1) : resultLine } @@ -93,12 +95,14 @@ function getPositionFromColumn (lines, column) { } function processUnicodeMatch (match) { - if (match.lines.text.length === Buffer.byteLength(match.lines.text)) { + const text = getText(match.lines) + + if (text.length === Buffer.byteLength(text)) { // fast codepath for lines that only contain characters of 1 byte length. return } - let remainingBuffer = Buffer.from(match.lines.text) + let remainingBuffer = Buffer.from(text) let currentLength = 0 let previousPosition = 0 @@ -146,10 +150,14 @@ function processSubmatch (submatch, lineText, offsetRow) { return { range: [start, end], - lineText: cleanResultLine(lineParts.join('\n')) + lineText: cleanResultLine({ text: lineParts.join('\n') }) } } +function getText (input) { + return input.text ? input.text : Buffer.from(input.bytes, 'base64').toString() +} + module.exports = class RipgrepDirectorySearcher { canSearchDirectory () { return true @@ -280,7 +288,7 @@ module.exports = class RipgrepDirectorySearcher { if (message.type === 'begin') { pendingEvent = { - filePath: message.data.path.text, + filePath: getText(message.data.path), matches: [] } pendingLeadingContext = [] @@ -294,12 +302,12 @@ module.exports = class RipgrepDirectorySearcher { for (const submatch of message.data.submatches) { const { lineText, range } = processSubmatch( submatch, - message.data.lines.text, + getText(message.data.lines), message.data.line_number - 1 ) pendingEvent.matches.push({ - matchText: submatch.match.text, + matchText: getText(submatch.match), lineText, lineTextOffset: 0, range, diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 7db399713..30af9fd38 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -4449,7 +4449,7 @@ class NodePool { if (element) { element.className = className || '' - element.styleMap.forEach((value, key) => { + element.attributeStyleMap.forEach((value, key) => { if (!style || style[key] == null) element.style[key] = '' }) if (style) Object.assign(element.style, style) diff --git a/src/tree-sitter-language-mode.js b/src/tree-sitter-language-mode.js index f0645c580..d282e083c 100644 --- a/src/tree-sitter-language-mode.js +++ b/src/tree-sitter-language-mode.js @@ -197,7 +197,7 @@ class TreeSitterLanguageMode { ) } - indentLevelForLine (line, tabLength = tabLength) { + indentLevelForLine (line, tabLength) { let indentLength = 0 for (let i = 0, {length} = line; i < length; i++) { const char = line[i]