Merge branch 'master' into electron-6.1.12-bump-electron-packager-from-git

This commit is contained in:
Mazen El-Kashef 2020-07-16 11:18:24 -05:00
parent bc952d5a3f
commit 4bdeb86c83
37 changed files with 2910 additions and 127 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ Thumbs.db
.svn
.nvm-version
.vscode
.python-version
node_modules
npm-debug.log
debug.log

View File

@ -1 +0,0 @@
2.7.13

View File

@ -59,7 +59,8 @@ An archive is available for people who don't want to install `atom` as root.
This version enables you to install multiple Atom versions in parallel. It has been built on Ubuntu 64-bit,
but should be compatible with other Linux distributions.
1. Install dependencies (on Ubuntu): `sudo apt install git gconf2 gconf-service libgtk2.0-0 libudev1 libgcrypt20 libnotify4 libxtst6 libnss3 python gvfs-bin xdg-utils libcap2`
1. Install dependencies (on Ubuntu): `sudo apt install git gconf2 gconf-service libgtk2.0-0 libudev1 libgcrypt20 libnotify4 libxtst6 libnss3 python3 gvfs-bin xdg-utils libcap2`
1. (If the `python3` package isn't available, or is too old (Python 3 should be >= 3.5), either `python2` or `python` (2.6 or 2.7) will work in its place.)
2. Download `atom-amd64.tar.gz` from the [Atom releases page](https://github.com/atom/atom/releases/latest).
3. Run `tar xf atom-amd64.tar.gz` in the directory where you want to extract the Atom folder.
4. Launch Atom using the installed `atom` command from the newly extracted directory.

View File

@ -60,7 +60,7 @@ The primary drawback of this approach is that Updatable bundled packages might e
### Increased Atom startup time
Another major drawback is that the snapshotted code for the bundled package will no longer be used since a newer version has been installed. This updated version of the package cannot be easily added back into Atom's snapshot so it could cause a noticable drag on Atom's startup time. Some quick measurements with Timecop show a 10x increase in GitHub package load time for bundled (snapshot) vs updated (non-snapshot) package code:
Another major drawback is that the snapshotted code for the bundled package will no longer be used since a newer version has been installed. This updated version of the package cannot be easily added back into Atom's snapshot so it could cause a noticeable drag on Atom's startup time. Some quick measurements with Timecop show a 10x increase in GitHub package load time for bundled (snapshot) vs updated (non-snapshot) package code:
| GitHub Package Code | Load Time |
|----------------------------------|-----------|

108
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "atom",
"version": "1.49.0-dev",
"version": "1.50.0-dev",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1858,6 +1858,15 @@
"node-releases": "^1.1.50"
}
},
"buffer": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
"requires": {
"base64-js": "^1.0.2",
"ieee754": "^1.1.4"
}
},
"buffer-alloc": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
@ -3811,6 +3820,11 @@
"resolved": "https://registry.npmjs.org/idb/-/idb-4.0.5.tgz",
"integrity": "sha512-P+Fk9HT2h1DhXoE1YNK183SY+CRh2GHNh28de94sGwhe0bUA75JJeVJWt3SenE5p0BXK7maflIq29dl6UZHrFw=="
},
"ieee754": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
"image-size": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
@ -4301,8 +4315,8 @@
}
},
"language-gfm": {
"version": "https://www.atom.io/api/packages/language-gfm/versions/0.90.7/tarball",
"integrity": "sha512-4be6dv7Nm0mzSdL9LUioMNZ4V+EQ7z9xUq+kAO+nWHjfUvTW3wOEdWAHLjRGDHDLkIa+M4YJaw20nsYC2YFhkg=="
"version": "https://www.atom.io/api/packages/language-gfm/versions/0.90.8/tarball",
"integrity": "sha512-YQ13ypnfPvQTcZ/8j6cUuLsYBoU88qqPlFTRXNXa72L1HVaahFDgG0d0a/QOdOnxrYBtmEWR/5Q3FNPwPpSehw=="
},
"language-git": {
"version": "https://www.atom.io/api/packages/language-git/versions/0.19.1/tarball",
@ -4369,8 +4383,8 @@
"integrity": "sha512-XXHULyFvbxAiRoj+MxIXoeO//in3bQctHZbaD72p3vFxm3klxe2ebx7b3cFmFYqf/g0eajmLrR3tR5m1Rmz1XQ=="
},
"language-php": {
"version": "https://www.atom.io/api/packages/language-php/versions/0.44.4/tarball",
"integrity": "sha512-DmXEgSt32uqyrd9Fj9rDqqsmRzX7pDdYZAxO+COXVvTWvgbQPTf1Id3fwg2KxVYhXCUwVfdGVez5Xe/1OvYcCQ=="
"version": "https://www.atom.io/api/packages/language-php/versions/0.44.5/tarball",
"integrity": "sha512-MYs1c5EFZjpAJttQOD2YM+bHbeBFQXZkoeTumegMP4fa5U3mNHYraLjXZKXKggoF5Ba0DKFRV3izhf22pYAJ7A=="
},
"language-property-list": {
"version": "https://www.atom.io/api/packages/language-property-list/versions/0.9.1/tarball",
@ -4433,8 +4447,8 @@
"integrity": "sha512-6xFDqM6nZpynmxGKUS85iUWY0yeub7GYvLyzSOqDejMuOL5UXAITnSNcb7jhr+hQA8KTj5dCmRjphkAQER4Ucg=="
},
"language-typescript": {
"version": "https://www.atom.io/api/packages/language-typescript/versions/0.6.2/tarball",
"integrity": "sha512-aSqO4xj5plYfgDcYVZBxC431h1RRkR8U4tSEgw9dFehYnxh5WHLELhsQXoLC6uwGnEen5PD7dTtKy4Qs6ZSTQw==",
"version": "https://www.atom.io/api/packages/language-typescript/versions/0.6.3/tarball",
"integrity": "sha512-F/ZnFXEF7C14/8JQ3T1kiCKVff+AB043LE5i0k3m86YsVl6IrjK6ElBNu5TsmUd7Se3STmqPfjn0Pf3280AZmg==",
"requires": {
"tree-sitter-typescript": "^0.16.1"
}
@ -4931,6 +4945,11 @@
}
}
},
"mkdirp-classic": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
},
"mocha": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/mocha/-/mocha-2.5.1.tgz",
@ -5167,6 +5186,13 @@
"resolve": "^1.10.0",
"semver": "2 || 3 || 4 || 5",
"validate-npm-package-license": "^3.0.1"
},
"dependencies": {
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
}
}
},
"normalize-url": {
@ -5195,6 +5221,11 @@
"glob": "^7.1.3"
}
},
"semver": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
"integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto="
},
"temp": {
"version": "0.8.4",
"resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz",
@ -5536,14 +5567,14 @@
}
},
"prebuild-install": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz",
"integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==",
"version": "5.3.5",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.5.tgz",
"integrity": "sha512-YmMO7dph9CYKi5IR/BzjOJlRzpxGGVo1EsLSUZ0mt/Mq0HWZIHOKHHcHdT69yG54C9m6i45GpItwRHpk0Py7Uw==",
"requires": {
"detect-libc": "^1.0.3",
"expand-template": "^2.0.3",
"github-from-package": "0.0.0",
"minimist": "^1.2.0",
"minimist": "^1.2.3",
"mkdirp": "^0.5.1",
"napi-build-utils": "^1.0.1",
"node-abi": "^2.7.0",
@ -5558,11 +5589,13 @@
},
"dependencies": {
"bl": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz",
"integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz",
"integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==",
"requires": {
"readable-stream": "^3.0.1"
"buffer": "^5.5.0",
"inherits": "^2.0.4",
"readable-stream": "^3.4.0"
}
},
"decompress-response": {
@ -5574,9 +5607,14 @@
}
},
"mimic-response": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz",
"integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ=="
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
"integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA=="
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"pump": {
"version": "3.0.0",
@ -5588,9 +5626,9 @@
}
},
"readable-stream": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz",
"integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==",
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
@ -5608,22 +5646,22 @@
}
},
"tar-fs": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.0.tgz",
"integrity": "sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.0.tgz",
"integrity": "sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==",
"requires": {
"chownr": "^1.1.1",
"mkdirp": "^0.5.1",
"mkdirp-classic": "^0.5.2",
"pump": "^3.0.0",
"tar-stream": "^2.0.0"
}
},
"tar-stream": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz",
"integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==",
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz",
"integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==",
"requires": {
"bl": "^3.0.0",
"bl": "^4.0.1",
"end-of-stream": "^1.4.1",
"fs-constants": "^1.0.0",
"inherits": "^2.0.3",
@ -5998,9 +6036,9 @@
"integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg=="
},
"resolve": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz",
"integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==",
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"requires": {
"path-parse": "^1.0.6"
}
@ -6268,9 +6306,9 @@
}
},
"semver": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
"integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto="
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
},
"serializable": {
"version": "1.0.3",

View File

@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "1.50.0-dev",
"version": "1.51.0-dev",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/main-process/main.js",
"repository": {
@ -84,7 +84,7 @@
"language-coffee-script": "https://www.atom.io/api/packages/language-coffee-script/versions/0.50.0/tarball",
"language-csharp": "https://www.atom.io/api/packages/language-csharp/versions/1.1.0/tarball",
"language-css": "https://www.atom.io/api/packages/language-css/versions/0.44.4/tarball",
"language-gfm": "https://www.atom.io/api/packages/language-gfm/versions/0.90.7/tarball",
"language-gfm": "https://www.atom.io/api/packages/language-gfm/versions/0.90.8/tarball",
"language-git": "https://www.atom.io/api/packages/language-git/versions/0.19.1/tarball",
"language-go": "https://www.atom.io/api/packages/language-go/versions/0.47.2/tarball",
"language-html": "https://www.atom.io/api/packages/language-html/versions/0.53.1/tarball",
@ -97,7 +97,7 @@
"language-mustache": "https://www.atom.io/api/packages/language-mustache/versions/0.14.5/tarball",
"language-objective-c": "https://www.atom.io/api/packages/language-objective-c/versions/0.16.0/tarball",
"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.4/tarball",
"language-php": "https://www.atom.io/api/packages/language-php/versions/0.44.5/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.4/tarball",
"language-ruby": "https://www.atom.io/api/packages/language-ruby/versions/0.72.23/tarball",
@ -110,7 +110,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.6.2/tarball",
"language-typescript": "https://www.atom.io/api/packages/language-typescript/versions/0.6.3/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",
@ -137,15 +137,15 @@
"pathwatcher": "8.1.0",
"postcss": "5.2.4",
"postcss-selector-parser": "2.2.1",
"prebuild-install": "^5.3.3",
"prebuild-install": "5.3.5",
"property-accessors": "^1.1.3",
"random-words": "0.0.1",
"resolve": "^1.1.6",
"resolve": "1.17.0",
"scandal": "^3.2.0",
"scoped-property-store": "^0.17.0",
"scrollbar-style": "3.2.1",
"season": "^6.0.2",
"semver": "^4.3.3",
"semver": "7.3.2",
"service-hub": "^0.7.4",
"settings-view": "https://www.atom.io/api/packages/settings-view/versions/0.261.4/tarball",
"sinon": "1.17.4",
@ -236,7 +236,7 @@
"language-coffee-script": "0.50.0",
"language-csharp": "1.1.0",
"language-css": "0.44.4",
"language-gfm": "0.90.7",
"language-gfm": "0.90.8",
"language-git": "0.19.1",
"language-go": "0.47.2",
"language-html": "0.53.1",
@ -249,7 +249,7 @@
"language-mustache": "0.14.5",
"language-objective-c": "0.16.0",
"language-perl": "0.38.1",
"language-php": "0.44.4",
"language-php": "0.44.5",
"language-property-list": "0.9.1",
"language-python": "0.53.4",
"language-ruby": "0.72.23",
@ -262,7 +262,7 @@
"language-text": "0.7.4",
"language-todo": "0.29.4",
"language-toml": "0.20.0",
"language-typescript": "0.6.2",
"language-typescript": "0.6.3",
"language-xml": "0.35.3",
"language-yaml": "0.32.0"
},

View File

@ -131,6 +131,8 @@ scopes:
'"where"': 'keyword.control'
'"ref"': 'keyword.control'
'"macro_rules!"': 'keyword.control'
'"async"': 'keyword.control'
'"await"': 'keyword.control'
'"as"': 'keyword.operator'

View File

@ -1,7 +0,0 @@
atom: arch-dependent-file-in-usr-share
atom: changelog-file-missing-in-native-package
atom: copyright-file-contains-full-apache-2-license
atom: copyright-should-refer-to-common-license-file-for-apache-2
atom: embedded-library
atom: package-installs-python-bytecode
atom: unstripped-binary-or-object

View File

@ -54,11 +54,6 @@ module.exports = function(packagedAppPath) {
debianPackageShareDirPath,
'pixmaps'
);
const debianPackageLintianOverridesDirPath = path.join(
debianPackageShareDirPath,
'lintian',
'overrides'
);
const debianPackageDocsDirPath = path.join(
debianPackageShareDirPath,
'doc',
@ -93,7 +88,6 @@ module.exports = function(packagedAppPath) {
fs.mkdirpSync(debianPackageShareDirPath);
fs.mkdirpSync(debianPackageApplicationsDirPath);
fs.mkdirpSync(debianPackageIconsDirPath);
fs.mkdirpSync(debianPackageLintianOverridesDirPath);
fs.mkdirpSync(debianPackageDocsDirPath);
fs.mkdirpSync(debianPackageBinDirPath);
@ -192,20 +186,6 @@ module.exports = function(packagedAppPath) {
path.join(debianPackageDocsDirPath, 'copyright')
);
console.log(
`Copying lintian overrides into "${debianPackageLintianOverridesDirPath}"`
);
fs.copySync(
path.join(
CONFIG.repositoryRootPath,
'resources',
'linux',
'debian',
'lintian-overrides'
),
path.join(debianPackageLintianOverridesDirPath, atomExecutableName)
);
console.log(
`Copying polkit configuration into "${debianPackageShareDirPath}"`
);

View File

@ -0,0 +1,80 @@
const fetch = require('node-fetch');
const npmCheck = require('npm-check');
// this may be updated to use github releases instead
const apm = async function({ dependencies, packageDependencies }) {
try {
console.log('Checking apm registry...');
const coreDependencies = Object.keys(dependencies).filter(dependency => {
// all core packages point to a remote url
return dependencies[dependency].match(new RegExp('^https?://'));
});
const promises = coreDependencies.map(async dependency => {
return fetch(`https://atom.io/api/packages/${dependency}`)
.then(res => res.json())
.then(res => res)
.catch(ex => console.log(ex.message));
});
const packages = await Promise.all(promises);
const outdatedPackages = [];
packages.map(dependency => {
if (dependency.hasOwnProperty('name')) {
const latestVersion = dependency.releases.latest;
const installed = packageDependencies[dependency.name];
if (latestVersion > installed) {
outdatedPackages.push({
moduleName: dependency.name,
latest: dependency.releases.latest,
isCorePackage: true,
installed
});
}
}
});
console.log(`${outdatedPackages.length} outdated package(s) found`);
return outdatedPackages;
} catch (ex) {
console.error(`An error occured: ${ex.message}`);
}
};
const npm = async function(cwd) {
try {
console.log('Checking npm registry...');
const currentState = await npmCheck({
cwd,
ignoreDev: true,
skipUnused: true
});
const outdatedPackages = currentState
.get('packages')
.filter(p => {
if (p.packageJson && p.latest && p.installed) {
return p.latest > p.installed;
}
})
.map(({ packageJson, installed, moduleName, latest }) => ({
packageJson,
installed,
moduleName,
latest,
isCorePackage: false
}));
console.log(`${outdatedPackages.length} outdated package(s) found`);
return outdatedPackages;
} catch (ex) {
console.error(`An error occured: ${ex.message}`);
}
};
module.exports = {
apm,
npm
};

View File

@ -0,0 +1,67 @@
const git = (git, repositoryRootPath) => {
const path = require('path');
const packageJsonFilePath = path.join(repositoryRootPath, 'package.json');
const packageLockFilePath = path.join(
repositoryRootPath,
'package-lock.json'
);
try {
git.getRemotes((err, remotes) => {
if (!err && !remotes.map(({ name }) => name).includes('ATOM')) {
git.addRemote(
'ATOM',
`https://atom:${process.env.AUTH_TOKEN}@github.com/atom/atom.git/`
);
}
});
} catch (ex) {
console.log(ex.message);
}
return {
switchToMaster: async function() {
const { current } = await git.branch();
if (current !== 'master') {
await git.checkout('master');
}
},
makeBranch: async function(dependency) {
const newBranch = `${dependency.moduleName}-${dependency.latest}`;
const { branches } = await git.branch();
const { files } = await git.status();
if (files.length > 0) {
await git.reset('hard');
}
const found = Object.keys(branches).find(
branch => branch.indexOf(newBranch) > -1
);
found
? await git.checkout(found)
: await git.checkoutLocalBranch(newBranch);
return { found, newBranch };
},
createCommit: async function({ moduleName, latest }) {
try {
const commitMessage = `:arrow_up: ${moduleName}@${latest}`;
await git.add([packageJsonFilePath, packageLockFilePath]);
await git.commit(commitMessage);
} catch (ex) {
throw Error(ex.message);
}
},
publishBranch: async function(branch) {
try {
await git.push('ATOM', branch);
} catch (ex) {
throw Error(ex.message);
}
},
deleteBranch: async function(branch) {
try {
await git.deleteLocalBranch(branch, true);
} catch (ex) {
throw Error(ex.message);
}
}
};
};
module.exports = git;

View File

@ -0,0 +1,3 @@
const run = require('./main');
run();

View File

@ -0,0 +1,97 @@
/* eslint-disable camelcase */
const simpleGit = require('simple-git');
const path = require('path');
const { repositoryRootPath } = require('../../config');
const packageJSON = require(path.join(repositoryRootPath, 'package.json'));
const git = simpleGit(repositoryRootPath);
const { createPR, findPR, addLabel } = require('./pull-request');
const runApmInstall = require('../run-apm-install');
const {
makeBranch,
createCommit,
switchToMaster,
publishBranch,
deleteBranch
} = require('./git')(git, repositoryRootPath);
const { updatePackageJson, sleep } = require('./util')(repositoryRootPath);
const fetchOutdatedDependencies = require('./fetch-outdated-dependencies');
module.exports = async function() {
try {
// ensure we are on master
await switchToMaster();
const failedBumps = [];
const successfullBumps = [];
const outdateDependencies = [
...(await fetchOutdatedDependencies.npm(repositoryRootPath)),
...(await fetchOutdatedDependencies.apm(packageJSON))
];
const totalDependencies = outdateDependencies.length;
const pendingPRs = [];
for (const dependency of outdateDependencies) {
const { found, newBranch } = await makeBranch(dependency);
if (found) {
console.log(`Branch was found ${found}`);
console.log('checking if a PR already exists');
const {
data: { total_count }
} = await findPR(dependency, newBranch);
if (total_count > 0) {
console.log(`pull request found!`);
} else {
console.log(`pull request not found!`);
const pr = { dependency, branch: newBranch, branchIsRemote: false };
// confirm if branch found is a local branch
if (found.indexOf('remotes') === -1) {
await publishBranch(found);
} else {
pr.branchIsRemote = true;
}
pendingPRs.push(pr);
}
} else {
await updatePackageJson(dependency);
runApmInstall(repositoryRootPath, false);
await createCommit(dependency);
await publishBranch(newBranch);
pendingPRs.push({
dependency,
branch: newBranch,
branchIsRemote: false
});
}
await switchToMaster();
}
// create PRs here
for (const { dependency, branch, branchIsRemote } of pendingPRs) {
const { status, data = {} } = await createPR(dependency, branch);
if (status === 201) {
successfullBumps.push(dependency);
await addLabel(data.number);
} else {
failedBumps.push(dependency);
}
if (!branchIsRemote) {
await deleteBranch(branch);
}
// https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits
await sleep(2000);
}
console.table([
{
totalDependencies,
totalSuccessfullBumps: successfullBumps.length,
totalFailedBumps: failedBumps.length
}
]);
console.log('Successfull bumps');
console.table(successfullBumps);
console.log('Failed bumps');
console.table(failedBumps);
} catch (ex) {
console.log(ex.message);
}
};

View File

@ -0,0 +1,40 @@
const { request } = require('@octokit/request');
const requestWithAuth = request.defaults({
baseUrl: 'https://api.github.com',
headers: {
'user-agent': 'atom',
authorization: `token ${process.env.AUTH_TOKEN}`
},
owner: 'atom',
repo: 'atom'
});
module.exports = {
createPR: async (
{ moduleName, isCorePackage, latest, installed },
branch
) => {
let description = `Bumps ${moduleName} from ${installed} to ${latest}`;
if (isCorePackage) {
description = `*List of changes between ${moduleName}@${installed} and ${moduleName}@${latest}: https://github.com/atom/${moduleName}/compare/v${installed}...v${latest}*`;
}
return requestWithAuth('POST /repos/:owner/:repo/pulls', {
title: `⬆️ ${moduleName}@${latest}`,
body: description,
base: 'master',
head: branch
});
},
findPR: async ({ moduleName, latest }, branch) => {
return requestWithAuth('GET /search/issues', {
q: `${moduleName} type:pr ${moduleName}@${latest} in:title repo:atom/atom head:${branch} state:open`
});
},
addLabel: async pullRequestNumber => {
return requestWithAuth('PATCH /repos/:owner/:repo/issues/:issue_number', {
labels: ['depency ⬆️'],
issue_number: pullRequestNumber
});
}
};

View File

@ -0,0 +1,27 @@
const path = require('path');
const fetchOutdatedDependencies = require('../fetch-outdated-dependencies');
const { nativeDependencies } = require('./helpers');
const repositoryRootPath = path.resolve('.', 'fixtures', 'dummy');
const packageJSON = require(path.join(repositoryRootPath, 'package.json'));
describe('Fetch outdated dependencies', function() {
it('should fetch outdated native dependencies', async () => {
spyOn(fetchOutdatedDependencies, 'npm').andReturn(
Promise.resolve(nativeDependencies)
);
expect(await fetchOutdatedDependencies.npm(repositoryRootPath)).toEqual(
nativeDependencies
);
});
it('should fetch outdated core dependencies', async () => {
spyOn(fetchOutdatedDependencies, 'apm').andReturn(
Promise.resolve(nativeDependencies)
);
expect(await fetchOutdatedDependencies.apm(packageJSON)).toEqual(
nativeDependencies
);
});
});

View File

@ -0,0 +1,524 @@
{
"url": "https://api.github.com/repos/atom/octocat/pulls/1347",
"id": 1,
"node_id": "MDExOlB1bGxSZXF1ZXN0MQ==",
"html_url": "https://github.com/atom/octocat/pull/1347",
"diff_url": "https://github.com/atom/octocat/pull/1347.diff",
"patch_url": "https://github.com/atom/octocat/pull/1347.patch",
"issue_url": "https://api.github.com/repos/atom/octocat/issues/1347",
"commits_url": "https://api.github.com/repos/atom/octocat/pulls/1347/commits",
"review_comments_url": "https://api.github.com/repos/atom/octocat/pulls/1347/comments",
"review_comment_url": "https://api.github.com/repos/atom/octocat/pulls/comments{/number}",
"comments_url": "https://api.github.com/repos/atom/octocat/issues/1347/comments",
"statuses_url": "https://api.github.com/repos/atom/octocat/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"number": 1347,
"state": "open",
"locked": true,
"title": "⬆️ octocat@2.0.0",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Bumps octocat from 1.0.0 to 2.0.0",
"labels": [
{
"id": 208045946,
"node_id": "MDU6TGFiZWwyMDgwNDU5NDY=",
"url": "https://api.github.com/repos/atom/octocat/labels/bug",
"name": "bug",
"description": "Something isn't working",
"color": "f29513",
"default": true
}
],
"milestone": {
"url": "https://api.github.com/repos/atom/octocat/milestones/1",
"html_url": "https://github.com/atom/octocat/milestones/v1.0",
"labels_url": "https://api.github.com/repos/atom/octocat/milestones/1/labels",
"id": 1002604,
"node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==",
"number": 1,
"state": "open",
"title": "v1.0",
"description": "Tracking milestone for version 1.0",
"creator": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"open_issues": 4,
"closed_issues": 8,
"created_at": "2011-04-10T20:09:31Z",
"updated_at": "2014-03-03T18:58:10Z",
"closed_at": "2013-02-12T13:22:01Z",
"due_on": "2012-10-09T23:39:01Z"
},
"active_lock_reason": "too heated",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:01:12Z",
"closed_at": "2011-01-26T19:01:12Z",
"merged_at": "2011-01-26T19:01:12Z",
"merge_commit_sha": "e5bd3914e2e596debea16f433f57875b5b90bcd6",
"assignee": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"assignees": [
{
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
{
"login": "hubot",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/hubot_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/hubot",
"html_url": "https://github.com/hubot",
"followers_url": "https://api.github.com/users/hubot/followers",
"following_url": "https://api.github.com/users/hubot/following{/other_user}",
"gists_url": "https://api.github.com/users/hubot/gists{/gist_id}",
"starred_url": "https://api.github.com/users/hubot/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hubot/subscriptions",
"organizations_url": "https://api.github.com/users/hubot/orgs",
"repos_url": "https://api.github.com/users/hubot/repos",
"events_url": "https://api.github.com/users/hubot/events{/privacy}",
"received_events_url": "https://api.github.com/users/hubot/received_events",
"type": "User",
"site_admin": true
}
],
"requested_reviewers": [
{
"login": "other_user",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/other_user_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/other_user",
"html_url": "https://github.com/other_user",
"followers_url": "https://api.github.com/users/other_user/followers",
"following_url": "https://api.github.com/users/other_user/following{/other_user}",
"gists_url": "https://api.github.com/users/other_user/gists{/gist_id}",
"starred_url": "https://api.github.com/users/other_user/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/other_user/subscriptions",
"organizations_url": "https://api.github.com/users/other_user/orgs",
"repos_url": "https://api.github.com/users/other_user/repos",
"events_url": "https://api.github.com/users/other_user/events{/privacy}",
"received_events_url": "https://api.github.com/users/other_user/received_events",
"type": "User",
"site_admin": false
}
],
"requested_teams": [
{
"id": 1,
"node_id": "MDQ6VGVhbTE=",
"url": "https://api.github.com/teams/1",
"html_url": "https://api.github.com/teams/justice-league",
"name": "Justice League",
"slug": "justice-league",
"description": "A great team.",
"privacy": "closed",
"permission": "admin",
"members_url": "https://api.github.com/teams/1/members{/member}",
"repositories_url": "https://api.github.com/teams/1/repos",
"parent": null
}
],
"head": {
"label": "atom:octocat-2.0.0",
"ref": "octocat-2.0.0",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"repo": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "atom/octocat",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/atom/octocat",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/atom/octocat",
"archive_url": "http://api.github.com/repos/atom/octocat/{archive_format}{/ref}",
"assignees_url": "http://api.github.com/repos/atom/octocat/assignees{/user}",
"blobs_url": "http://api.github.com/repos/atom/octocat/git/blobs{/sha}",
"branches_url": "http://api.github.com/repos/atom/octocat/branches{/branch}",
"collaborators_url": "http://api.github.com/repos/atom/octocat/collaborators{/collaborator}",
"comments_url": "http://api.github.com/repos/atom/octocat/comments{/number}",
"commits_url": "http://api.github.com/repos/atom/octocat/commits{/sha}",
"compare_url": "http://api.github.com/repos/atom/octocat/compare/{base}...{head}",
"contents_url": "http://api.github.com/repos/atom/octocat/contents/{+path}",
"contributors_url": "http://api.github.com/repos/atom/octocat/contributors",
"deployments_url": "http://api.github.com/repos/atom/octocat/deployments",
"downloads_url": "http://api.github.com/repos/atom/octocat/downloads",
"events_url": "http://api.github.com/repos/atom/octocat/events",
"forks_url": "http://api.github.com/repos/atom/octocat/forks",
"git_commits_url": "http://api.github.com/repos/atom/octocat/git/commits{/sha}",
"git_refs_url": "http://api.github.com/repos/atom/octocat/git/refs{/sha}",
"git_tags_url": "http://api.github.com/repos/atom/octocat/git/tags{/sha}",
"git_url": "git:github.com/atom/octocat.git",
"issue_comment_url": "http://api.github.com/repos/atom/octocat/issues/comments{/number}",
"issue_events_url": "http://api.github.com/repos/atom/octocat/issues/events{/number}",
"issues_url": "http://api.github.com/repos/atom/octocat/issues{/number}",
"keys_url": "http://api.github.com/repos/atom/octocat/keys{/key_id}",
"labels_url": "http://api.github.com/repos/atom/octocat/labels{/name}",
"languages_url": "http://api.github.com/repos/atom/octocat/languages",
"merges_url": "http://api.github.com/repos/atom/octocat/merges",
"milestones_url": "http://api.github.com/repos/atom/octocat/milestones{/number}",
"notifications_url": "http://api.github.com/repos/atom/octocat/notifications{?since,all,participating}",
"pulls_url": "http://api.github.com/repos/atom/octocat/pulls{/number}",
"releases_url": "http://api.github.com/repos/atom/octocat/releases{/id}",
"ssh_url": "git@github.com:atom/octocat.git",
"stargazers_url": "http://api.github.com/repos/atom/octocat/stargazers",
"statuses_url": "http://api.github.com/repos/atom/octocat/statuses/{sha}",
"subscribers_url": "http://api.github.com/repos/atom/octocat/subscribers",
"subscription_url": "http://api.github.com/repos/atom/octocat/subscription",
"tags_url": "http://api.github.com/repos/atom/octocat/tags",
"teams_url": "http://api.github.com/repos/atom/octocat/teams",
"trees_url": "http://api.github.com/repos/atom/octocat/git/trees{/sha}",
"clone_url": "https://github.com/atom/octocat.git",
"mirror_url": "git:git.example.com/atom/octocat",
"hooks_url": "http://api.github.com/repos/atom/octocat/hooks",
"svn_url": "https://svn.github.com/atom/octocat",
"homepage": "https://github.com",
"language": null,
"forks_count": 9,
"stargazers_count": 80,
"watchers_count": 80,
"size": 108,
"default_branch": "master",
"open_issues_count": 0,
"is_template": true,
"topics": [
"octocat",
"atom",
"electron",
"api"
],
"has_issues": true,
"has_projects": true,
"has_wiki": true,
"has_pages": false,
"has_downloads": true,
"archived": false,
"disabled": false,
"visibility": "public",
"pushed_at": "2011-01-26T19:06:43Z",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:14:43Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"allow_rebase_merge": true,
"template_repository": null,
"temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
"allow_squash_merge": true,
"delete_branch_on_merge": true,
"allow_merge_commit": true,
"subscribers_count": 42,
"network_count": 0
}
},
"base": {
"label": "octocat:master",
"ref": "master",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"repo": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "atom/octocat",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/atom/octocat",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/atom/octocat",
"archive_url": "http://api.github.com/repos/atom/octocat/{archive_format}{/ref}",
"assignees_url": "http://api.github.com/repos/atom/octocat/assignees{/user}",
"blobs_url": "http://api.github.com/repos/atom/octocat/git/blobs{/sha}",
"branches_url": "http://api.github.com/repos/atom/octocat/branches{/branch}",
"collaborators_url": "http://api.github.com/repos/atom/octocat/collaborators{/collaborator}",
"comments_url": "http://api.github.com/repos/atom/octocat/comments{/number}",
"commits_url": "http://api.github.com/repos/atom/octocat/commits{/sha}",
"compare_url": "http://api.github.com/repos/atom/octocat/compare/{base}...{head}",
"contents_url": "http://api.github.com/repos/atom/octocat/contents/{+path}",
"contributors_url": "http://api.github.com/repos/atom/octocat/contributors",
"deployments_url": "http://api.github.com/repos/atom/octocat/deployments",
"downloads_url": "http://api.github.com/repos/atom/octocat/downloads",
"events_url": "http://api.github.com/repos/atom/octocat/events",
"forks_url": "http://api.github.com/repos/atom/octocat/forks",
"git_commits_url": "http://api.github.com/repos/atom/octocat/git/commits{/sha}",
"git_refs_url": "http://api.github.com/repos/atom/octocat/git/refs{/sha}",
"git_tags_url": "http://api.github.com/repos/atom/octocat/git/tags{/sha}",
"git_url": "git:github.com/atom/octocat.git",
"issue_comment_url": "http://api.github.com/repos/atom/octocat/issues/comments{/number}",
"issue_events_url": "http://api.github.com/repos/atom/octocat/issues/events{/number}",
"issues_url": "http://api.github.com/repos/atom/octocat/issues{/number}",
"keys_url": "http://api.github.com/repos/atom/octocat/keys{/key_id}",
"labels_url": "http://api.github.com/repos/atom/octocat/labels{/name}",
"languages_url": "http://api.github.com/repos/atom/octocat/languages",
"merges_url": "http://api.github.com/repos/atom/octocat/merges",
"milestones_url": "http://api.github.com/repos/atom/octocat/milestones{/number}",
"notifications_url": "http://api.github.com/repos/atom/octocat/notifications{?since,all,participating}",
"pulls_url": "http://api.github.com/repos/atom/octocat/pulls{/number}",
"releases_url": "http://api.github.com/repos/atom/octocat/releases{/id}",
"ssh_url": "git@github.com:atom/octocat.git",
"stargazers_url": "http://api.github.com/repos/atom/octocat/stargazers",
"statuses_url": "http://api.github.com/repos/atom/octocat/statuses/{sha}",
"subscribers_url": "http://api.github.com/repos/atom/octocat/subscribers",
"subscription_url": "http://api.github.com/repos/atom/octocat/subscription",
"tags_url": "http://api.github.com/repos/atom/octocat/tags",
"teams_url": "http://api.github.com/repos/atom/octocat/teams",
"trees_url": "http://api.github.com/repos/atom/octocat/git/trees{/sha}",
"clone_url": "https://github.com/atom/octocat.git",
"mirror_url": "git:git.example.com/atom/octocat",
"hooks_url": "http://api.github.com/repos/atom/octocat/hooks",
"svn_url": "https://svn.github.com/atom/octocat",
"homepage": "https://github.com",
"language": null,
"forks_count": 9,
"stargazers_count": 80,
"watchers_count": 80,
"size": 108,
"default_branch": "master",
"open_issues_count": 0,
"is_template": true,
"topics": [
"octocat",
"atom",
"electron",
"api"
],
"has_issues": true,
"has_projects": true,
"has_wiki": true,
"has_pages": false,
"has_downloads": true,
"archived": false,
"disabled": false,
"visibility": "public",
"pushed_at": "2011-01-26T19:06:43Z",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:14:43Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"allow_rebase_merge": true,
"template_repository": null,
"temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
"allow_squash_merge": true,
"delete_branch_on_merge": true,
"allow_merge_commit": true,
"subscribers_count": 42,
"network_count": 0
}
},
"_links": {
"self": {
"href": "https://api.github.com/repos/atom/octocat/pulls/1347"
},
"html": {
"href": "https://github.com/atom/octocat/pull/1347"
},
"issue": {
"href": "https://api.github.com/repos/atom/octocat/issues/1347"
},
"comments": {
"href": "https://api.github.com/repos/atom/octocat/issues/1347/comments"
},
"review_comments": {
"href": "https://api.github.com/repos/atom/octocat/pulls/1347/comments"
},
"review_comment": {
"href": "https://api.github.com/repos/atom/octocat/pulls/comments{/number}"
},
"commits": {
"href": "https://api.github.com/repos/atom/octocat/pulls/1347/commits"
},
"statuses": {
"href": "https://api.github.com/repos/atom/octocat/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
},
"author_association": "OWNER",
"draft": false,
"merged": false,
"mergeable": true,
"rebaseable": true,
"mergeable_state": "clean",
"merged_by": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"comments": 10,
"review_comments": 0,
"maintainer_can_modify": true,
"commits": 3,
"additions": 100,
"deletions": 3,
"changed_files": 5
}

@ -0,0 +1 @@
Subproject commit 526c50836158b43d38cbaf11ad305fa8a6f43d1f

View File

@ -0,0 +1,28 @@
{
"name": "test",
"version": "1.0.0",
"description": "just test",
"main": "index.js",
"dependencies": {
"spell-check": "https://www.atom.io/api/packages/spell-check/versions/0.79.1/tarball",
"status-bar": "https://www.atom.io/api/packages/status-bar/versions/2.8.17/tarball",
"styleguide": "https://www.atom.io/api/packages/styleguide/versions/1.49.12/tarball",
"symbols-view": "https://www.atom.io/api/packages/symbols-view/versions/0.118.5/tarball",
"@atom/watcher": "1.3.1",
"clear-cut": "^2.0.3",
"dedent": "^1.0.0",
"devtron": "1.2.6"
},
"packageDependencies": {
"spell-check": "0.79.1",
"status-bar": "2.8.17",
"styleguide": "1.49.12",
"symbols-view": "0.118.5"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "darangi",
"license": "ISC"
}

View File

@ -0,0 +1,41 @@
{
"total_count": 40,
"incomplete_results": false,
"items": [
{
"id": 3081286,
"node_id": "MDEwOlJlcG9zaXRvcnkzMDgxMjg2",
"name": "Tetris",
"full_name": "dtrupenn/Tetris",
"owner": {
"login": "dtrupenn",
"id": 872147,
"node_id": "MDQ6VXNlcjg3MjE0Nw==",
"avatar_url": "https://secure.gravatar.com/avatar/e7956084e75f239de85d3a31bc172ace?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
"gravatar_id": "",
"url": "https://api.github.com/users/dtrupenn",
"received_events_url": "https://api.github.com/users/dtrupenn/received_events",
"type": "User"
},
"private": false,
"html_url": "https://github.com/dtrupenn/Tetris",
"description": "A C implementation of Tetris using Pennsim through LC4",
"fork": false,
"url": "https://api.github.com/repos/dtrupenn/Tetris",
"created_at": "2012-01-01T00:31:50Z",
"updated_at": "2013-01-05T17:58:47Z",
"pushed_at": "2012-01-01T00:37:02Z",
"homepage": "",
"size": 524,
"stargazers_count": 1,
"watchers_count": 1,
"language": "Assembly",
"forks_count": 0,
"open_issues_count": 0,
"master_branch": "master",
"default_branch": "master",
"score": 1.0
}
]
}

View File

@ -0,0 +1,94 @@
const path = require('path');
const simpleGit = require('simple-git');
const repositoryRootPath = path.resolve('.', 'fixtures', 'dummy');
const git = simpleGit(repositoryRootPath);
const {
switchToMaster,
makeBranch,
publishBranch,
createCommit,
deleteBranch
} = require('../git')(git, repositoryRootPath);
describe('GIT', () => {
async function findBranch(branch) {
const { branches } = await git.branch();
return Object.keys(branches).find(_branch => _branch.indexOf(branch) > -1);
}
const dependency = {
moduleName: 'atom',
latest: '2.0.0'
};
const branch = `${dependency.moduleName}-${dependency.latest}`;
beforeEach(async () => {
await git.checkout('master');
});
it('remotes should include ATOM', async () => {
const remotes = await git.getRemotes();
expect(remotes.map(({ name }) => name).includes('ATOM')).toBeTruthy();
});
it('current branch should be master', async () => {
const testBranchExists = await findBranch('test');
testBranchExists
? await git.checkout('test')
: await git.checkoutLocalBranch('test');
expect((await git.branch()).current).toBe('test');
await switchToMaster();
expect((await git.branch()).current).toBe('master');
await git.deleteLocalBranch('test', true);
});
it('should make new branch and checkout to the new branch', async () => {
const { found, newBranch } = await makeBranch(dependency);
expect(found).toBe(undefined);
expect(newBranch).toBe(branch);
expect((await git.branch()).current).toBe(branch);
await git.checkout('master');
await git.deleteLocalBranch(branch, true);
});
it('should find an existing branch and checkout to the branch', async () => {
await git.checkoutLocalBranch(branch);
const { found } = await makeBranch(dependency);
expect(found).not.toBe(undefined);
expect((await git.branch()).current).toBe(found);
await git.checkout('master');
await git.deleteLocalBranch(branch, true);
});
it('should create a commit', async () => {
const packageJsonFilePath = path.join(repositoryRootPath, 'package.json');
const packageLockFilePath = path.join(
repositoryRootPath,
'package-lock.json'
);
spyOn(git, 'commit');
spyOn(git, 'add');
await createCommit(dependency);
expect(git.add).toHaveBeenCalledWith([
packageJsonFilePath,
packageLockFilePath
]);
expect(git.commit).toHaveBeenCalledWith(
`${`:arrow_up: ${dependency.moduleName}@${dependency.latest}`}`
);
});
it('should publish branch', async () => {
spyOn(git, 'push');
await publishBranch(branch);
expect(git.push).toHaveBeenCalledWith('ATOM', branch);
});
it('should delete an existing branch', async () => {
await git.checkoutLocalBranch(branch);
await git.checkout('master');
expect(await findBranch(branch)).not.toBe(undefined);
await deleteBranch(branch);
expect(await findBranch(branch)).toBe(undefined);
});
});

View File

@ -0,0 +1,28 @@
const latestPackageJSON = require('./fixtures/latest-package.json');
const packageJSON = require('./fixtures/dummy/package.json');
module.exports = {
coreDependencies: Object.keys(packageJSON.packageDependencies).map(
dependency => {
return {
latest: latestPackageJSON.packageDependencies[dependency],
installed: packageJSON.packageDependencies[dependency],
moduleName: dependency,
isCorePackage: true
};
}
),
nativeDependencies: Object.keys(packageJSON.dependencies)
.filter(
dependency =>
!packageJSON.dependencies[dependency].match(new RegExp('^https?://'))
)
.map(dependency => {
return {
latest: latestPackageJSON.dependencies[dependency],
packageJson: packageJSON.dependencies[dependency],
installed: packageJSON.dependencies[dependency],
moduleName: dependency,
isCorePackage: false
};
})
};

View File

@ -0,0 +1,53 @@
const nock = require('nock');
const { createPR, findPR } = require('../pull-request');
const createPrResponse = require('./fixtures/create-pr-response.json');
const searchResponse = require('./fixtures/search-response.json');
describe('Pull Request', () => {
it('Should create a pull request', async () => {
const scope = nock('https://api.github.com')
.post('/repos/atom/atom/pulls', {
title: '⬆️ octocat@2.0.0',
body: 'Bumps octocat from 1.0.0 to 2.0.0',
head: 'octocat-2.0.0',
base: 'master'
})
.reply(200, createPrResponse);
const response = await createPR(
{
moduleName: 'octocat',
installed: '1.0.0',
latest: '2.0.0',
isCorePackage: false
},
'octocat-2.0.0'
);
scope.done();
expect(response.data).toEqual(createPrResponse);
});
it('Should search for a pull request', async () => {
const scope = nock('https://api.github.com')
.get('/search/issues')
.query({
q:
'octocat type:pr octocat@2.0.0 in:title repo:atom/atom head:octocat-2.0.0 state:open',
owner: 'atom',
repo: 'atom'
})
.reply(200, searchResponse);
const response = await findPR(
{
moduleName: 'octocat',
installed: '1.0.0',
latest: '2.0.0'
},
'octocat-2.0.0'
);
scope.done();
expect(response.data).toEqual(searchResponse);
});
});

View File

@ -0,0 +1,38 @@
const path = require('path');
const fs = require('fs');
const repositoryRootPath = path.resolve('.', 'fixtures', 'dummy');
const packageJsonFilePath = path.join(repositoryRootPath, 'package.json');
const { updatePackageJson } = require('../util')(repositoryRootPath);
const { coreDependencies, nativeDependencies } = require('./helpers');
describe('Update-dependency', function() {
const oldPackageJson = JSON.parse(
JSON.stringify(require(packageJsonFilePath))
);
var packageJson;
it('bumps package.json properly', async function() {
const dependencies = [...coreDependencies, ...nativeDependencies];
for (const dependency of dependencies) {
await updatePackageJson(dependency);
packageJson = JSON.parse(fs.readFileSync(packageJsonFilePath, 'utf-8'));
if (dependency.isCorePackage) {
expect(packageJson.packageDependencies[dependency.moduleName]).toBe(
dependency.latest
);
expect(packageJson.dependencies[dependency.moduleName]).toContain(
dependency.latest
);
} else {
expect(packageJson.dependencies[dependency.moduleName]).toBe(
dependency.latest
);
}
}
fs.writeFileSync(
packageJsonFilePath,
JSON.stringify(oldPackageJson, null, 2)
);
});
});

View File

@ -0,0 +1,61 @@
const fs = require('fs');
const path = require('path');
const util = repositoryRootPath => {
const packageJsonFilePath = path.join(repositoryRootPath, 'package.json');
const packageJSON = require(packageJsonFilePath);
return {
updatePackageJson: async function({
moduleName,
installed,
latest,
isCorePackage = false,
packageJson = ''
}) {
console.log(`Bumping ${moduleName} from ${installed} to ${latest}`);
const updatePackageJson = JSON.parse(JSON.stringify(packageJSON));
if (updatePackageJson.dependencies[moduleName]) {
let searchString = installed;
// gets the exact version installed in package json for native packages
if (!isCorePackage) {
if (/\^|~/.test(packageJson)) {
searchString = new RegExp(`\\${packageJson}`);
} else {
searchString = packageJson;
}
}
updatePackageJson.dependencies[
moduleName
] = updatePackageJson.dependencies[moduleName].replace(
searchString,
latest
);
}
if (updatePackageJson.packageDependencies[moduleName]) {
updatePackageJson.packageDependencies[
moduleName
] = updatePackageJson.packageDependencies[moduleName].replace(
new RegExp(installed),
latest
);
}
return new Promise((resolve, reject) => {
fs.writeFile(
packageJsonFilePath,
JSON.stringify(updatePackageJson, null, 2),
function(err) {
if (err) {
return reject(err);
}
console.log(`Bumped ${moduleName} from ${installed} to ${latest}`);
return resolve();
}
);
});
},
sleep: ms => new Promise(resolve => setTimeout(resolve, ms))
};
};
module.exports = util;

View File

@ -1,7 +1,6 @@
'use strict';
const childProcess = require('child_process');
const fs = require('fs');
const path = require('path');
const CONFIG = require('../config');
@ -9,9 +8,7 @@ const CONFIG = require('../config');
module.exports = function(ci) {
verifyNode();
verifyNpm(ci);
if (process.platform === 'win32') {
verifyPython();
}
verifyPython();
};
function verifyNode() {
@ -50,36 +47,127 @@ function verifyNpm(ci) {
}
function verifyPython() {
const systemDrive = process.env.SystemDrive || 'C:\\';
let pythonExecutable;
if (process.env.PYTHON) {
pythonExecutable = process.env.PYTHON;
} else {
const pythonBinPath = path.join(systemDrive, 'Python27', 'python.exe');
if (fs.existsSync(pythonBinPath)) {
pythonExecutable = pythonBinPath;
} else {
pythonExecutable = 'python';
// This function essentially re-implements node-gyp's "find-python.js" library,
// but in a synchronous, bootstrap-script-friendly way.
// It is based off of the logic of the file from node-gyp v5.x:
// https://github.com/nodejs/node-gyp/blob/v5.1.1/lib/find-python.js
// This node-gyp is the version in use by current npm (in mid 2020).
//
// TODO: If this repo ships a newer version of node-gyp (v6.x or later), please update this script.
// (Currently, the build scripts and apm each depend on npm v6.14, which depends on node-gyp v5.)
// Differences between major versions of node-gyp:
// node-gyp 5.x looks for python, then python2, then python3.
// node-gyp 6.x looks for python3, then python, then python2.)
// node-gyp 5.x accepts Python ^2.6 || >= 3.5, node-gyp 6+ only accepts Python == 2.7 || >= 3.5.
// node-gyp 7.x stopped using the "-2" flag for "py.exe",
// so as to allow finding Python 3 as well, not just Python 2.
// https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md#v700-2020-06-03
let stdout;
let fullVersion;
let usablePythonWasFound;
let triedLog = '';
let binaryPlusFlag;
function verifyBinary(binary, prependFlag) {
if (binary && !usablePythonWasFound) {
// clear re-used "result" variables now that we're checking another python binary.
stdout = '';
fullVersion = '';
let allFlags = [
'-c',
'import platform\nprint(platform.python_version())'
];
if (prependFlag) {
// prependFlag is an optional argument,
// used to prepend "-2" for the "py.exe" launcher.
//
// TODO: Refactor this script by eliminating "prependFlag"
// once we update to node-gyp v7.x or newer;
// the "-2" flag is not used in node-gyp v7.x.
allFlags.unshift(prependFlag);
}
try {
stdout = childProcess.execFileSync(binary, allFlags, {
env: process.env,
stdio: ['ignore', 'pipe', 'ignore']
});
} catch {}
if (stdout) {
if (stdout.indexOf('+') !== -1)
stdout = stdout.toString().replace(/\+/g, '');
if (stdout.indexOf('rc') !== -1)
stdout = stdout.toString().replace(/rc(.*)$/gi, '');
fullVersion = stdout.toString().trim();
}
if (fullVersion) {
let versionComponents = fullVersion.split('.');
let majorVersion = Number(versionComponents[0]);
let minorVersion = Number(versionComponents[1]);
if (
(majorVersion === 2 && minorVersion >= 6) ||
(majorVersion === 3 && minorVersion >= 5)
) {
usablePythonWasFound = true;
}
}
// Prepare to log which commands were tried, and the results, in case no usable Python can be found.
if (prependFlag) {
binaryPlusFlag = binary + ' ' + prependFlag;
} else {
binaryPlusFlag = binary;
}
triedLog = triedLog.concat(
`log message: tried to check version of "${binaryPlusFlag}", got: "${fullVersion}"\n`
);
}
}
let stdout = childProcess.execFileSync(
pythonExecutable,
['-c', 'import platform\nprint(platform.python_version())'],
{ env: process.env }
);
if (stdout.indexOf('+') !== -1) stdout = stdout.replace(/\+/g, '');
if (stdout.indexOf('rc') !== -1) stdout = stdout.replace(/rc(.*)$/gi, '');
const fullVersion = stdout.toString().trim();
const versionComponents = fullVersion.split('.');
const majorVersion = Number(versionComponents[0]);
const minorVersion = Number(versionComponents[1]);
if (majorVersion === 2 && minorVersion === 7) {
function verifyForcedBinary(binary) {
if (typeof binary !== 'undefined' && binary.length > 0) {
verifyBinary(binary);
if (!usablePythonWasFound) {
throw new Error(
`NODE_GYP_FORCE_PYTHON is set to: "${binary}", but this is not a valid Python.\n` +
'Please set NODE_GYP_FORCE_PYTHON to something valid, or unset it entirely.\n' +
'(Python 2.6, 2.7 or 3.5+ is required to build Atom.)\n'
);
}
}
}
// These first two checks do nothing if the relevant
// environment variables aren't set.
verifyForcedBinary(process.env.NODE_GYP_FORCE_PYTHON);
// All the following checks will no-op if a previous check has succeeded.
verifyBinary(process.env.PYTHON);
verifyBinary('python');
verifyBinary('python2');
verifyBinary('python3');
if (process.platform === 'win32') {
verifyBinary('py.exe', '-2');
verifyBinary(
path.join(process.env.SystemDrive || 'C:', 'Python27', 'python.exe')
);
verifyBinary(
path.join(process.env.SystemDrive || 'C:', 'Python37', 'python.exe')
);
}
if (usablePythonWasFound) {
console.log(`Python:\tv${fullVersion}`);
} else {
throw new Error(
`Python 2.7 is required to build Atom. ${pythonExecutable} returns version ${fullVersion}.\n` +
`Set the PYTHON env var to '/path/to/Python27/python.exe' if your python is installed in a non-default location.`
`\n${triedLog}\n` +
'Python 2.6, 2.7 or 3.5+ is required to build Atom.\n' +
'verify-machine-requirements.js was unable to find such a version of Python.\n' +
"Set the PYTHON env var to e.g. 'C:/path/to/Python27/python.exe'\n" +
'if your Python is installed in a non-default location.\n'
);
}
}

1464
script/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,8 @@
"description": "Atom build scripts",
"dependencies": {
"7zip-bin": "^4.0.2",
"@atom/electron-winstaller": "0.0.1",
"@octokit/request": "^5.4.5",
"async": "2.0.1",
"babel-core": "5.8.38",
"babel-eslint": "^10.0.1",
@ -14,7 +16,6 @@
"electron-link": "^0.4.3",
"electron-mksnapshot": "^9.0.2",
"electron-packager": "^15.0.0",
"@atom/electron-winstaller": "0.0.1",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
"eslint-config-standard": "^12.0.0",
@ -33,14 +34,18 @@
"lodash.template": "4.5.0",
"minidump": "0.9.0",
"mkdirp": "0.5.1",
"nock": "^13.0.2",
"node-fetch": "^2.6.0",
"normalize-package-data": "2.3.5",
"npm": "6.14.4",
"npm-check": "^5.9.2",
"passwd-user": "2.1.0",
"pegjs": "0.9.0",
"prettier": "^1.17.0",
"random-seed": "^0.3.0",
"season": "5.3.0",
"semver": "5.3.0",
"simple-git": "^2.7.0",
"stylelint": "^9.0.0",
"stylelint-config-standard": "^18.1.0",
"sync-request": "3.0.1",

View File

@ -58,3 +58,33 @@ jobs:
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
PACKAGE_CLOUD_API_KEY: $(PACKAGE_CLOUD_API_KEY)
displayName: Create Nightly Release
- job: bump_dependencies
displayName: Bump Dependencies
timeoutInMinutes: 180
pool:
vmImage: macos-10.14
steps:
- task: NodeTool@0
inputs:
versionSpec: 12.13.1
displayName: Install Node.js 12.13.1
- script: npm install --global npm@6.12.1
displayName: Update npm
- script: |
script/bootstrap
displayName: Bootstrap
- script: |
cd script/lib
npm install
displayName: npm install
- script: |
cd script/lib/update-dependency
node index.js
displayName: Bump depedencies
env:
AUTH_TOKEN: $(GITHUB_TOKEN)

View File

@ -22,7 +22,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '2.7'
versionSpec: '3.8'
- task: NodeTool@0
inputs:

View File

@ -2,6 +2,7 @@ trigger:
- master
- 1.* # VSTS only supports wildcards at the end
- electron-*
pr: none # no PR triggers
jobs:
- job: GetReleaseVersion

View File

@ -4221,7 +4221,7 @@ describe('TextEditorComponent', () => {
});
it('adds or removes cursors when holding cmd or ctrl when single-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent({ platform: 'darwin' });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0]]);
@ -4302,7 +4302,7 @@ describe('TextEditorComponent', () => {
});
it('adds word selections when holding cmd or ctrl when double-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent();
editor.addCursorAtScreenPosition([1, 16], { autoscroll: false });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0], [1, 16]]);
@ -4329,7 +4329,7 @@ describe('TextEditorComponent', () => {
});
it('adds line selections when holding cmd or ctrl when triple-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent();
editor.addCursorAtScreenPosition([1, 16], { autoscroll: false });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0], [1, 16]]);
@ -4369,7 +4369,7 @@ describe('TextEditorComponent', () => {
});
it('does not add cursors when holding cmd or ctrl when single-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', false);
atom.config.set('editor.multiCursorOnClick', false);
const { component, editor } = buildComponent({ platform: 'darwin' });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0]]);
@ -4411,7 +4411,7 @@ describe('TextEditorComponent', () => {
});
it('does not add word selections when holding cmd or ctrl when double-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', false);
atom.config.set('editor.multiCursorOnClick', false);
const { component, editor } = buildComponent();
component.didMouseDownOnContent(
@ -4435,7 +4435,7 @@ describe('TextEditorComponent', () => {
});
it('does not add line selections when holding cmd or ctrl when triple-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', false);
atom.config.set('editor.multiCursorOnClick', false);
const { component, editor } = buildComponent();
const { clientX, clientY } = clientPositionForCharacter(
@ -4557,7 +4557,7 @@ describe('TextEditorComponent', () => {
});
it('expands the last selection on drag', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent();
spyOn(component, 'handleMouseDragUntilMouseUp');

View File

@ -154,7 +154,7 @@ module.exports = class GrammarRegistry {
// * `buffer` The {TextBuffer} whose grammar will be set.
// * `grammar` The desired {Grammar}.
//
// Returns a {Boolean} that indicates whether the assignment was sucessful
// Returns a {Boolean} that indicates whether the assignment was successful
assignGrammar(buffer, grammar) {
if (!grammar) return false;
if (buffer.getBuffer) buffer = buffer.getBuffer();
@ -547,7 +547,7 @@ module.exports = class GrammarRegistry {
// * `grammarPath` A {String} absolute file path to a grammar file.
// * `callback` A {Function} to call when loaded with the following arguments:
// * `error` An {Error}, may be null.
// * `grammar` A {Grammar} or null if an error occured.
// * `grammar` A {Grammar} or null if an error occurred.
loadGrammar(grammarPath, callback) {
this.readGrammar(grammarPath, (error, grammar) => {
if (error) return callback(error);
@ -572,7 +572,7 @@ module.exports = class GrammarRegistry {
// * `grammarPath` A {String} absolute file path to a grammar file.
// * `callback` A {Function} to call when read with the following arguments:
// * `error` An {Error}, may be null.
// * `grammar` A {Grammar} or null if an error occured.
// * `grammar` A {Grammar} or null if an error occurred.
//
// Returns undefined.
readGrammar(grammarPath, callback) {

View File

@ -419,14 +419,17 @@ module.exports = class PackageManager {
for (const packageDirPath of this.packageDirPaths) {
if (fs.isDirectorySync(packageDirPath)) {
for (let packagePath of fs.readdirSync(packageDirPath)) {
packagePath = path.join(packageDirPath, packagePath);
const packageName = path.basename(packagePath);
const packageNames = fs
.readdirSync(packageDirPath, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name);
for (const packageName of packageNames) {
if (
!packageName.startsWith('.') &&
!packagesByName.has(packageName) &&
fs.isDirectorySync(packagePath)
!packagesByName.has(packageName)
) {
const packagePath = path.join(packageDirPath, packageName);
packages.push({
name: packageName,
path: packagePath,

View File

@ -129,7 +129,7 @@ function processUnicodeMatch(match) {
// This function processes a ripgrep submatch to create the correct
// range. This is mostly needed for multi-line results, since the range
// will have differnt start and end rows and we need to calculate these
// will have different start and end rows and we need to calculate these
// based on the lines that ripgrep returns.
function processSubmatch(submatch, lineText, offsetRow) {
const lineParts = lineText.split('\n');

View File

@ -1868,7 +1868,7 @@ module.exports = class TextEditorComponent {
// keydown(code: X), keypress, keydown(code: X)
//
// The code X must be the same in the keydown events that bracket the
// keypress, meaning we're *holding* the _same_ key we intially pressed.
// keypress, meaning we're *holding* the _same_ key we initially pressed.
// Got that?
didKeydown(event) {
// Stop dragging when user interacts with the keyboard. This prevents
@ -1994,7 +1994,7 @@ module.exports = class TextEditorComponent {
return;
}
const allowMultiCursor = atom.config.get('core.editor.multiCursorOnClick');
const allowMultiCursor = atom.config.get('editor.multiCursorOnClick');
const addOrRemoveSelection =
allowMultiCursor && (metaKey || (ctrlKey && platform !== 'darwin'));

View File

@ -2597,7 +2597,7 @@ module.exports = class TextEditor {
// * __cursor__: Render a cursor at the head of the {DisplayMarker}. If multiple cursor decorations
// are created for the same marker, their class strings and style objects are combined
// into a single cursor. This decoration type may be used to style existing cursors
// by passing in their markers or to render artificial cursors that don't actaully
// by passing in their markers or to render artificial cursors that don't actually
// exist in the model by passing a marker that isn't associated with a real cursor.
//
// ## Arguments

View File

@ -27,7 +27,7 @@ const { Emitter, Disposable } = require('event-kit');
// is triggered. If you need your package to activate right away, you can add
// `"deferActivation": false` to your "uriHandler" configuration object. When activation
// is deferred, once Atom receives a request for a URI in your package's namespace, it will
// activate your pacakge and then call `methodName` on it as before.
// activate your package and then call `methodName` on it as before.
//
// If your package specifies a deprecated `urlMain` property, you cannot register URI handlers
// via the `uriHandler` key.