Merge branch 'master' into electron-4

This commit is contained in:
Rafael Oleza
2019-07-19 17:35:28 +02:00
40 changed files with 860 additions and 563 deletions

View File

@@ -1,67 +0,0 @@
language: python
python:
- '2.7.13'
git:
depth: 10
branches:
only:
- master
- /^[0-9.]+-releases$/
- /.*-test-travis$/
matrix:
include:
- os: linux
dist: trusty
env: NODE_VERSION=10.2.1 DISPLAY=:99.0 CC=clang CXX=clang++ npm_config_clang=1 ATOM_JASMINE_REPORTER=list
before_install:
- '/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16'
install:
- git clone https://github.com/creationix/nvm.git /tmp/.nvm
- source /tmp/.nvm/nvm.sh
- nvm install $NODE_VERSION
- nvm use --delete-prefix $NODE_VERSION
- npm install --global npm@6.2.0
- script/bootstrap
script: >
script/lint &&
script/build --no-bootstrap --create-debian-package --create-rpm-package --compress-artifacts &&
script/test
cache:
directories:
- electron
- node_modules
- apm/node_modules
- script/node_modules
- ~/.atom/compile-cache
- ~/.atom/snapshot-cache
notifications:
email:
on_success: never
on_failure: change
addons:
artifacts:
paths:
- out/atom-amd64.deb
- out/atom.x86_64.rpm
- out/atom-amd64.tar.gz
target_paths: travis-artifacts/$TRAVIS_BUILD_ID
apt:
packages:
- build-essential
- clang-3.3
- fakeroot
- git
- libsecret-1-dev
- rpm
- libx11-dev
- libxkbfile-dev

View File

@@ -1,6 +1,6 @@
# Atom
[![Build status](https://dev.azure.com/github/Atom/_apis/build/status/Atom%20Production%20Branches?branchName=master)](https://dev.azure.com/github/Atom/_build/latest?definitionId=32&branchName=master) [![Linux Build Status](https://travis-ci.org/atom/atom.svg?branch=master)](https://travis-ci.org/atom/atom)
[![Build status](https://dev.azure.com/github/Atom/_apis/build/status/Atom%20Production%20Branches?branchName=master)](https://dev.azure.com/github/Atom/_build/latest?definitionId=32&branchName=master)
[![Dependency Status](https://david-dm.org/atom/atom.svg)](https://david-dm.org/atom/atom)
[![Join the Atom Community on Slack](https://atom-slack.herokuapp.com/badge.svg)](https://atom-slack.herokuapp.com)

104
apm/package-lock.json generated
View File

@@ -4,9 +4,9 @@
"lockfileVersion": 1,
"dependencies": {
"atom-package-manager": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/atom-package-manager/-/atom-package-manager-2.3.1.tgz",
"integrity": "sha512-CAys5szBJbqhkizMm32o0+uOTpT9rgPh9TdFX0R//usjOAgDr8iJ7oGNfULPvJzaKnBhrokuniKNumAxVyuauA==",
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/atom-package-manager/-/atom-package-manager-2.4.2.tgz",
"integrity": "sha512-gX1c9fC4TL00ZfFkYKgFegabSGa7cGh0zzBQf4h8s99a/5pPUMvA0lnhC2/K1eM8XlYbnLwt03U/m6M3PFX/gA==",
"requires": {
"@atom/plist": "0.4.4",
"asar-require": "0.3.0",
@@ -50,9 +50,9 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"ajv": {
"version": "6.10.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
"integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==",
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -98,6 +98,11 @@
"util-deprecate": "~1.0.1"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@@ -212,6 +217,13 @@
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
"string_decoder": {
@@ -220,6 +232,13 @@
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
}
}
@@ -284,9 +303,9 @@
}
},
"chownr": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g=="
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz",
"integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A=="
},
"chromium-pickle-js": {
"version": "0.1.0",
@@ -468,11 +487,12 @@
},
"dependencies": {
"d": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
"integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
"integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
"requires": {
"es5-ext": "^0.10.9"
"es5-ext": "^0.10.50",
"type": "^1.0.1"
}
},
"es6-iterator": {
@@ -701,9 +721,9 @@
}
},
"graceful-fs": {
"version": "4.1.15",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz",
"integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg=="
},
"grim": {
"version": "1.5.0",
@@ -757,9 +777,9 @@
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"ini": {
"version": "1.3.5",
@@ -834,9 +854,9 @@
}
},
"keytar": {
"version": "4.9.0",
"resolved": "https://registry.npmjs.org/keytar/-/keytar-4.9.0.tgz",
"integrity": "sha512-5aKEpnxRWUIhSlRXckqTxomqokV1/tOBe3EdbCDyMjDaoa5AkVHVa1yK+fa2CgJR5MadbJndFWmcDMCq812F4A==",
"version": "4.11.0",
"resolved": "https://registry.npmjs.org/keytar/-/keytar-4.11.0.tgz",
"integrity": "sha512-cGn2xd4NY0yCBrU5zQ/lwIagP1UBOhUEemi6iSJU2gshN1RHkxHekSdLUji9IWNo5B1Va/iwXXWzGD2p8ziqfQ==",
"requires": {
"nan": "2.14.0",
"prebuild-install": "5.3.0"
@@ -970,9 +990,9 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node-abi": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.8.0.tgz",
"integrity": "sha512-1/aa2clS0pue0HjckL62CsbhWWU35HARvBDXcJtYKbYR7LnIutmpxmXbuDMV9kEviD2lP/wACOgWmmwljghHyQ==",
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.9.0.tgz",
"integrity": "sha512-jmEOvv0eanWjhX8dX1pmjb7oJl1U1oR4FOh0b2GnvALwSYoOdU7sj+kLDSAyjo4pfC9aj/IxkloxdLJQhSSQBA==",
"requires": {
"semver": "^5.4.1"
}
@@ -3855,9 +3875,9 @@
}
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"property-accessors": {
"version": "1.1.3",
@@ -3869,9 +3889,9 @@
}
},
"psl": {
"version": "1.1.32",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.32.tgz",
"integrity": "sha512-MHACAkHpihU/REGGPLj4sEfc/XKW2bheigvHO1dUqjaKigMp1C8+WLQYRGgeKFMsw5PMfegZcaN8IDXK/cD0+g=="
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz",
"integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA=="
},
"pump": {
"version": "2.0.1",
@@ -3985,9 +4005,9 @@
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
},
"safer-buffer": {
"version": "2.1.2",
@@ -4174,6 +4194,11 @@
"util-deprecate": "~1.0.1"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@@ -4265,6 +4290,11 @@
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"type": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz",
"integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw=="
},
"underscore": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
@@ -4359,9 +4389,9 @@
"integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk="
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
},
"y18n": {
"version": "3.2.1",

View File

@@ -6,6 +6,6 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "2.3.1"
"atom-package-manager": "2.4.2"
}
}

View File

@@ -1,10 +1,10 @@
# Atom build status
| System | Travis | AppVeyor/Win | VSTS | Dependencies |
| System | Azure Pipelines | Travis | AppVeyor/Win | Dependencies |
|--------|--------|--------------|------------|--------------|
| [Atom](https://github.com/atom/atom) | [![Travis Build Status](https://travis-ci.org/atom/atom.svg?branch=master)](https://travis-ci.org/atom/atom) | | [![Build status](https://github.visualstudio.com/Atom/_apis/build/status/Atom%20Production%20Branches?branch=master)](https://github.visualstudio.com/Atom/_build/latest?definitionId=32&branch=master) | [![Dependency Status](https://david-dm.org/atom/atom.svg)](https://david-dm.org/atom/atom) |
| [APM](https://github.com/atom/apm) | [![Travis Build Status](https://travis-ci.org/atom/apm.svg?branch=master)](https://travis-ci.org/atom/apm) | [![AppVeyor/Wi Build Status](https://ci.appveyor.com/api/projects/status/j6ixw374a397ugkb/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/apm/branch/master) | | [![Dependency Status](https://david-dm.org/atom/apm.svg)](https://david-dm.org/atom/apm) |
| [Electron](https://github.com/electron/electron) | [![Travis Build Status](https://travis-ci.org/electron/electron.svg?branch=master)](https://travis-ci.org/electron/electron) | [![AppVeyor/Wi Build Status](https://ci.appveyor.com/api/projects/status/kvxe4byi7jcxbe26/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/electron) | | [![Dependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron)
| [Atom](https://github.com/atom/atom) | [![Build status](https://github.visualstudio.com/Atom/_apis/build/status/Atom%20Production%20Branches?branch=master)](https://github.visualstudio.com/Atom/_build/latest?definitionId=32&branch=master) | | | [![Dependency Status](https://david-dm.org/atom/atom.svg)](https://david-dm.org/atom/atom) |
| [APM](https://github.com/atom/apm) | | [![Travis Build Status](https://travis-ci.org/atom/apm.svg?branch=master)](https://travis-ci.org/atom/apm) | [![AppVeyor/Wi Build Status](https://ci.appveyor.com/api/projects/status/j6ixw374a397ugkb/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/apm/branch/master) | [![Dependency Status](https://david-dm.org/atom/apm.svg)](https://david-dm.org/atom/apm) |
| [Electron](https://github.com/electron/electron) | | [![Travis Build Status](https://travis-ci.org/electron/electron.svg?branch=master)](https://travis-ci.org/electron/electron) | [![AppVeyor/Wi Build Status](https://ci.appveyor.com/api/projects/status/kvxe4byi7jcxbe26/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/electron) | [![Dependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron)
## Packages

741
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "1.40.0-dev",
"version": "1.41.0-dev",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/main-process/main.js",
"repository": {
@@ -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.14/tarball",
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.219.0/tarball",
"find-parent-dir": "^0.3.0",
"first-mate": "7.4.0",
"focus-trap": "2.4.5",
@@ -62,10 +62,10 @@
"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.8/tarball",
"fuzzy-finder": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.14.0/tarball",
"git-diff": "file:packages/git-diff",
"git-utils": "5.6.1",
"github": "https://www.atom.io/api/packages/github/versions/0.29.0/tarball",
"github": "https://www.atom.io/api/packages/github/versions/0.30.0/tarball",
"glob": "^7.1.1",
"go-to-line": "file:packages/go-to-line",
"grammar-selector": "file:packages/grammar-selector",
@@ -88,14 +88,14 @@
"language-html": "https://www.atom.io/api/packages/language-html/versions/0.52.3/tarball",
"language-hyperlink": "https://www.atom.io/api/packages/language-hyperlink/versions/0.17.1/tarball",
"language-java": "https://www.atom.io/api/packages/language-java/versions/0.31.3/tarball",
"language-javascript": "https://www.atom.io/api/packages/language-javascript/versions/0.130.1/tarball",
"language-javascript": "https://www.atom.io/api/packages/language-javascript/versions/0.132.0/tarball",
"language-json": "https://www.atom.io/api/packages/language-json/versions/1.0.4/tarball",
"language-less": "https://www.atom.io/api/packages/language-less/versions/0.34.3/tarball",
"language-make": "https://www.atom.io/api/packages/language-make/versions/0.23.0/tarball",
"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.1/tarball",
"language-php": "https://www.atom.io/api/packages/language-php/versions/0.44.2/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.3/tarball",
"language-ruby": "https://www.atom.io/api/packages/language-ruby/versions/0.72.17/tarball",
@@ -200,9 +200,9 @@
"dev-live-reload": "file:./packages/dev-live-reload",
"encoding-selector": "0.23.9",
"exception-reporting": "file:./packages/exception-reporting",
"find-and-replace": "0.218.14",
"fuzzy-finder": "1.13.8",
"github": "0.29.0",
"find-and-replace": "0.219.0",
"fuzzy-finder": "1.14.0",
"github": "0.30.0",
"git-diff": "file:./packages/git-diff",
"go-to-line": "file:./packages/go-to-line",
"grammar-selector": "file:./packages/grammar-selector",
@@ -240,14 +240,14 @@
"language-html": "0.52.3",
"language-hyperlink": "0.17.1",
"language-java": "0.31.3",
"language-javascript": "0.130.1",
"language-javascript": "0.132.0",
"language-json": "1.0.4",
"language-less": "0.34.3",
"language-make": "0.23.0",
"language-mustache": "0.14.5",
"language-objective-c": "0.16.0",
"language-perl": "0.38.1",
"language-php": "0.44.1",
"language-php": "0.44.2",
"language-property-list": "0.9.1",
"language-python": "0.53.3",
"language-ruby": "0.72.17",

View File

@@ -41,11 +41,11 @@ IF "%ATOM_ADD%"=="YES" (
IF "%EXPECT_OUTPUT%"=="YES" (
IF "%WAIT%"=="YES" (
powershell -noexit "Start-Process -FilePath \"%~dp0\..\..\atom.exe\" -ArgumentList \"--pid=$pid $env:PSARGS\" ; wait-event"
powershell -noexit "Start-Process -FilePath \"%~dp0\..\..\<%= atomExeName %>\" -ArgumentList \"--pid=$pid $env:PSARGS\" ; wait-event"
exit 0
) ELSE (
"%~dp0\..\..\atom.exe" %*
"%~dp0\..\..\<%= atomExeName %>" %*
)
) ELSE (
"%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %*
"%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" "<%= atomExeName %>" %*
)

View File

@@ -1,8 +1,8 @@
var path = require('path');
var spawn = require('child_process').spawn;
var atomCommandPath = path.resolve(__dirname, '..', '..', 'atom.exe');
var args = process.argv.slice(2);
var atomCommandPath = path.resolve(__dirname, '..', '..', process.argv[2]);
var args = process.argv.slice(3);
args.unshift('--executed-from', process.cwd());
var options = { detached: true, stdio: 'ignore' };
spawn(atomCommandPath, args, options);

View File

@@ -107,7 +107,7 @@ if (!argv.generateApiDocs) {
}
if (argv.codeSign) {
const executablesToSign = [ path.join(packagedAppPath, 'Atom.exe') ]
const executablesToSign = [ path.join(packagedAppPath, CONFIG.executableName) ]
if (argv.createWindowsInstaller) {
executablesToSign.push(path.join(__dirname, 'node_modules', '@atom', 'electron-winstaller', 'vendor', 'Squirrel.exe'))
}

View File

@@ -26,12 +26,16 @@ const computedAppVersion = computeAppVersion(
);
const channel = getChannel(computedAppVersion);
const appName = getAppName(channel);
const executableName = getExecutableName(channel, appName);
const channelName = getChannelName(channel);
module.exports = {
appMetadata,
apmMetadata,
channel,
channelName,
appName,
executableName,
computedAppVersion,
repositoryRootPath,
apmRootPath,
@@ -48,6 +52,10 @@ module.exports = {
snapshotAuxiliaryData: {}
};
function getChannelName(channel) {
return channel === 'stable' ? 'atom' : `atom-${channel}`;
}
function getChannel(version) {
const match = version.match(/\d+\.\d+\.\d+(-([a-z]+)(\d+|-\w{4,})?)?$/);
if (!match) {
@@ -66,6 +74,16 @@ function getAppName(channel) {
channel.charAt(0).toUpperCase() + channel.slice(1)}`;
}
function getExecutableName(channel, appName) {
if (process.platform === 'darwin') {
return appName;
} else if (process.platform === 'win32') {
return channel === 'stable' ? 'atom.exe' : `atom-${channel}.exe`;
} else {
return 'atom';
}
}
function computeAppVersion(version) {
if (version.match(/-dev$/)) {
const result = spawnSync('git', ['rev-parse', '--short', 'HEAD'], {

View File

@@ -12,6 +12,9 @@ module.exports = packagedAppPath => {
const updateUrlPrefix =
process.env.ATOM_UPDATE_URL_PREFIX || 'https://atom.io';
const options = {
name: CONFIG.channelName,
title: CONFIG.appName,
exe: CONFIG.executableName,
appDirectory: packagedAppPath,
authors: 'GitHub Inc.',
iconUrl: `https://raw.githubusercontent.com/atom/atom/master/resources/app-icons/${
@@ -44,7 +47,11 @@ module.exports = packagedAppPath => {
fs.renameSync(releasesPath, `${releasesPath}-x64`);
}
for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/atom-*.nupkg`)) {
let appName =
CONFIG.channel === 'stable' ? 'atom' : `atom-${CONFIG.channel}`;
for (let nupkgPath of glob.sync(
`${CONFIG.buildOutputPath}/${appName}-*.nupkg`
)) {
if (!nupkgPath.includes(CONFIG.computedAppVersion)) {
console.log(
`Deleting downloaded nupkg for previous version at ${nupkgPath} to prevent it from being stored as an artifact`
@@ -53,7 +60,10 @@ module.exports = packagedAppPath => {
} else {
if (process.arch === 'x64') {
// Use the original .nupkg filename to generate the `atom-x64` name by inserting `-x64` after `atom`
const newNupkgPath = nupkgPath.replace('atom-', 'atom-x64-');
const newNupkgPath = nupkgPath.replace(
`${appName}-`,
`${appName}-x64-`
);
fs.renameSync(nupkgPath, newNupkgPath);
}
}

View File

@@ -9,6 +9,34 @@ const semver = require('semver');
const CONFIG = require('../config');
let appName = CONFIG.appMetadata.name;
if (process.platform === 'win32') {
// Use the channel name in the app name on Windows so that the installer will
// place it in a different folder in AppData\Local
appName = CONFIG.channel === 'stable' ? 'atom' : `atom-${CONFIG.channel}`;
}
module.exports = function() {
console.log(
`Generating metadata for ${path.join(
CONFIG.intermediateAppPath,
'package.json'
)}`
);
CONFIG.appMetadata._atomPackages = buildBundledPackagesMetadata();
CONFIG.appMetadata._atomMenu = buildPlatformMenuMetadata();
CONFIG.appMetadata._atomKeymaps = buildPlatformKeymapsMetadata();
CONFIG.appMetadata._deprecatedPackages = deprecatedPackagesMetadata;
CONFIG.appMetadata.version = CONFIG.computedAppVersion;
CONFIG.appMetadata.name = appName;
CONFIG.appMetadata.productName = CONFIG.appName;
checkDeprecatedPackagesMetadata();
fs.writeFileSync(
path.join(CONFIG.intermediateAppPath, 'package.json'),
JSON.stringify(CONFIG.appMetadata)
);
};
module.exports = function() {
console.log(
`Generating metadata for ${path.join(

View File

@@ -258,17 +258,17 @@ module.exports = function(packagedAppPath) {
);
let nodeBundledInElectronPath;
if (process.platform === 'darwin') {
const executableName = CONFIG.appName;
nodeBundledInElectronPath = path.join(
packagedAppPath,
'Contents',
'MacOS',
executableName
CONFIG.executableName
);
} else if (process.platform === 'win32') {
nodeBundledInElectronPath = path.join(packagedAppPath, 'atom.exe');
} else {
nodeBundledInElectronPath = path.join(packagedAppPath, 'atom');
nodeBundledInElectronPath = path.join(
packagedAppPath,
CONFIG.executableName
);
}
childProcess.execFileSync(
nodeBundledInElectronPath,

View File

@@ -15,7 +15,6 @@ const EXCLUDE_REGEXPS_SOURCES = [
escapeRegExp('.jshintrc'),
escapeRegExp('.npmignore'),
escapeRegExp('.pairs'),
escapeRegExp('.travis.yml'),
escapeRegExp('.idea'),
escapeRegExp('.editorconfig'),
escapeRegExp('.lint'),

View File

@@ -5,9 +5,7 @@ const CONFIG = require('../config.js');
module.exports = function() {
if (process.platform === 'win32') {
// Use START as a way to ignore error if Atom.exe isnt running
childProcess.execSync(
`START taskkill /F /IM ${CONFIG.appMetadata.productName}.exe`
);
childProcess.execSync(`START taskkill /F /IM ${CONFIG.executableName}`);
} else {
childProcess.execSync(`pkill -9 ${CONFIG.appMetadata.productName} || true`);
}

View File

@@ -9,6 +9,7 @@ const includePathInPackagedApp = require('./include-path-in-packaged-app');
const getLicenseText = require('./get-license-text');
const path = require('path');
const spawnSync = require('./spawn-sync');
const template = require('lodash.template');
const CONFIG = require('../config');
const HOST_ARCH = hostArch();
@@ -54,7 +55,7 @@ module.exports = function() {
win32metadata: {
CompanyName: 'GitHub, Inc.',
FileDescription: 'Atom',
ProductName: 'Atom'
ProductName: CONFIG.appName
}
}).then(packagedAppPath => {
let bundledResourcesPath;
@@ -131,7 +132,6 @@ function copyNonASARResources(packagedAppPath, bundledResourcesPath) {
);
} else if (process.platform === 'win32') {
[
'atom.cmd',
'atom.sh',
'atom.js',
'apm.cmd',
@@ -144,6 +144,9 @@ function copyNonASARResources(packagedAppPath, bundledResourcesPath) {
path.join(bundledResourcesPath, 'cli', file)
)
);
// Customize atom.cmd for the channel-specific atom.exe name (e.g. atom-beta.exe)
generateAtomCmdForChannel(bundledResourcesPath);
}
console.log(`Writing LICENSE.md to ${bundledResourcesPath}`);
@@ -203,6 +206,8 @@ function buildAsarUnpackGlobExpression() {
function getAppName() {
if (process.platform === 'darwin') {
return CONFIG.appName;
} else if (process.platform === 'win32') {
return CONFIG.channel === 'stable' ? 'atom' : `atom-${CONFIG.channel}`;
} else {
return 'atom';
}
@@ -256,3 +261,16 @@ function renamePackagedAppDir(packageOutputDirPath) {
}
return packagedAppPath;
}
function generateAtomCmdForChannel(bundledResourcesPath) {
const atomCmdTemplate = fs.readFileSync(
path.join(CONFIG.repositoryRootPath, 'resources', 'win', 'atom.cmd')
);
const atomCmdContents = template(atomCmdTemplate)({
atomExeName: CONFIG.executableName
});
fs.writeFileSync(
path.join(bundledResourcesPath, 'cli', 'atom.cmd'),
atomCmdContents
);
}

View File

@@ -56,7 +56,7 @@ if (process.platform === 'darwin') {
assert(executablePaths.length === 1, `More than one application to run tests against was found. ${executablePaths.join(',')}`)
executablePath = executablePaths[0]
} else if (process.platform === 'win32') {
const executablePaths = glob.sync(path.join(CONFIG.buildOutputPath, '**', 'atom.exe'))
const executablePaths = glob.sync(path.join(CONFIG.buildOutputPath, '**', 'atom*.exe'))
assert(executablePaths.length === 1, `More than one application to run tests against was found. ${executablePaths.join(',')}`)
executablePath = executablePaths[0]
} else {

View File

@@ -11,6 +11,17 @@ const argv = yargs
.describe('nightly', 'Indicates that a nightly version should be produced')
.wrap(yargs.terminalWidth()).argv;
function getAppName(version) {
const match = version.match(/\d+\.\d+\.\d+(-([a-z]+)(\d+|-\w{4,})?)?$/);
if (!match) {
throw new Error(`Found incorrectly formatted Atom version ${version}`);
} else if (match[2]) {
return `atom-${match[2]}`;
}
return 'atom';
}
async function getReleaseVersion() {
let releaseVersion = process.env.ATOM_RELEASE_VERSION || appMetadata.version;
if (argv.nightly) {
@@ -67,6 +78,12 @@ async function getReleaseVersion() {
buildBranch.startsWith('electron-') ||
(buildBranch === 'master' &&
!process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER));
console.log(
`##vso[task.setvariable variable=AppName;isOutput=true]${getAppName(
releaseVersion
)}`
);
console.log(
`##vso[task.setvariable variable=IsReleaseBranch;isOutput=true]${isReleaseBranch}`
);

View File

@@ -14,6 +14,7 @@ jobs:
vmImage: vs2015-win2012r2 # needed for python 2.7 and gyp
variables:
AppName: $[ dependencies.GetReleaseVersion.outputs['Version.AppName'] ]
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
@@ -184,18 +185,18 @@ jobs:
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-$(ReleaseVersion)-full.nupkg
ArtifactName: atom-x64-$(ReleaseVersion)-full.nupkg
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-x64-$(ReleaseVersion)-full.nupkg
ArtifactName: $(AppName)-x64-$(ReleaseVersion)-full.nupkg
ArtifactType: Container
displayName: Upload atom-x64-$(ReleaseVersion)-full.nupkg
displayName: Upload $(AppName)-x64-$(ReleaseVersion)-full.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-$(ReleaseVersion)-delta.nupkg
ArtifactName: atom-x64-$(ReleaseVersion)-delta.nupkg
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-x64-$(ReleaseVersion)-delta.nupkg
ArtifactName: $(AppName)-x64-$(ReleaseVersion)-delta.nupkg
ArtifactType: Container
displayName: Upload atom-x64-$(ReleaseVersion)-delta.nupkg
displayName: Upload $(AppName)-x64-$(ReleaseVersion)-delta.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build
@@ -225,18 +226,18 @@ jobs:
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-$(ReleaseVersion)-full.nupkg
ArtifactName: atom-$(ReleaseVersion)-full.nupkg
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-$(ReleaseVersion)-full.nupkg
ArtifactName: $(AppName)-$(ReleaseVersion)-full.nupkg
ArtifactType: Container
displayName: Upload atom-$(ReleaseVersion)-full.nupkg
displayName: Upload $(AppName)-$(ReleaseVersion)-full.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.SourcesDirectory)/out/atom-$(ReleaseVersion)-delta.nupkg
ArtifactName: atom-$(ReleaseVersion)-delta.nupkg
PathtoPublish: $(Build.SourcesDirectory)/out/$(AppName)-$(ReleaseVersion)-delta.nupkg
ArtifactName: $(AppName)-$(ReleaseVersion)-delta.nupkg
ArtifactType: Container
displayName: Upload atom-$(ReleaseVersion)-delta.nupkg
displayName: Upload $(AppName)-$(ReleaseVersion)-delta.nupkg
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build

View File

@@ -97,7 +97,7 @@ describe('AtomWindow', function() {
const { browserWindow } = w;
assert.isFalse(browserWindow.isVisible());
assert.strictEqual(browserWindow.getTitle(), 'Atom');
assert.isTrue(browserWindow.getTitle().startsWith('Atom'));
const settings = JSON.parse(browserWindow.loadSettingsJSON);
assert.strictEqual(settings.userSettings, 'stub-config');

View File

@@ -1,7 +1,15 @@
{EventEmitter} = require 'events'
electron = require 'electron'
fs = require 'fs-plus'
path = require 'path'
temp = require('temp').track()
electron.app = {
getName: -> 'Atom',
getVersion: -> '1.0.0',
getPath: -> '/tmp/atom.exe'
}
SquirrelUpdate = require '../src/main-process/squirrel-update'
Spawner = require '../src/main-process/spawner'
WinShell = require '../src/main-process/win-shell'
@@ -35,42 +43,42 @@ describe "Windows Squirrel Update", ->
WinShell.fileContextMenu = new FakeShellOption()
WinShell.folderContextMenu = new FakeShellOption()
WinShell.folderBackgroundContextMenu = new FakeShellOption()
electron.app.quit = jasmine.createSpy('quit')
afterEach ->
electron.app.quit.reset()
try
temp.cleanupSync()
it "quits the app on all squirrel events", ->
app = quit: jasmine.createSpy('quit')
expect(SquirrelUpdate.handleStartupEvent(app, '--squirrel-install')).toBe true
expect(SquirrelUpdate.handleStartupEvent('--squirrel-install')).toBe true
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 1
runs ->
app.quit.reset()
expect(SquirrelUpdate.handleStartupEvent(app, '--squirrel-updated')).toBe true
electron.app.quit.reset()
expect(SquirrelUpdate.handleStartupEvent('--squirrel-updated')).toBe true
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 1
runs ->
app.quit.reset()
expect(SquirrelUpdate.handleStartupEvent(app, '--squirrel-uninstall')).toBe true
electron.app.quit.reset()
expect(SquirrelUpdate.handleStartupEvent( '--squirrel-uninstall')).toBe true
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 1
runs ->
app.quit.reset()
expect(SquirrelUpdate.handleStartupEvent(app, '--squirrel-obsolete')).toBe true
electron.app.quit.reset()
expect(SquirrelUpdate.handleStartupEvent('--squirrel-obsolete')).toBe true
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 1
runs ->
expect(SquirrelUpdate.handleStartupEvent(app, '--not-squirrel')).toBe false
expect(SquirrelUpdate.handleStartupEvent('--not-squirrel')).toBe false
describe "Desktop shortcut", ->
desktopShortcutPath = '/non/existing/path'
@@ -92,10 +100,9 @@ describe "Windows Squirrel Update", ->
describe "on install", ->
beforeEach ->
app = quit: jasmine.createSpy('quit')
SquirrelUpdate.handleStartupEvent(app, '--squirrel-install')
SquirrelUpdate.handleStartupEvent('--squirrel-install')
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 1
it "creates desktop shortcut", ->
expect(fs.existsSync(desktopShortcutPath)).toBe true
@@ -105,33 +112,18 @@ describe "Windows Squirrel Update", ->
fs.removeSync(desktopShortcutPath)
expect(fs.existsSync(desktopShortcutPath)).toBe false
app = quit: jasmine.createSpy('quit')
SquirrelUpdate.handleStartupEvent(app, '--squirrel-updated')
SquirrelUpdate.handleStartupEvent('--squirrel-updated')
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 2
it "does not recreate shortcut", ->
expect(fs.existsSync(desktopShortcutPath)).toBe false
describe "when shortcut is kept and app is updated", ->
beforeEach ->
app = quit: jasmine.createSpy('quit')
SquirrelUpdate.handleStartupEvent(app, '--squirrel-updated')
SquirrelUpdate.handleStartupEvent('--squirrel-updated')
waitsFor ->
app.quit.callCount is 1
electron.app.quit.callCount is 2
it "still has desktop shortcut", ->
expect(fs.existsSync(desktopShortcutPath)).toBe true
describe ".restartAtom", ->
it "quits the app and spawns a new one", ->
app = new EventEmitter()
app.quit = jasmine.createSpy('quit')
SquirrelUpdate.restartAtom(app)
expect(app.quit.callCount).toBe 1
expect(Spawner.spawn.callCount).toBe 0
app.emit('will-quit')
expect(Spawner.spawn.callCount).toBe 1
expect(path.basename(Spawner.spawn.argsForCall[0][0])).toBe 'atom.cmd'

View File

@@ -1,5 +1,6 @@
const KeymapManager = require('atom-keymap');
const WindowEventHandler = require('../src/window-event-handler');
const { conditionPromise } = require('./async-spec-helpers');
describe('WindowEventHandler', () => {
let windowEventHandler;
@@ -50,10 +51,13 @@ describe('WindowEventHandler', () => {
});
describe('resize event', () =>
it('calls storeWindowDimensions', () => {
it('calls storeWindowDimensions', async () => {
jasmine.useRealClock();
spyOn(atom, 'storeWindowDimensions');
window.dispatchEvent(new CustomEvent('resize'));
expect(atom.storeWindowDimensions).toHaveBeenCalled();
await conditionPromise(() => atom.storeWindowDimensions.callCount > 0);
}));
describe('window:close event', () =>

View File

@@ -2512,6 +2512,34 @@ describe('Workspace', () => {
});
if (ripgrep) {
it('returns empty text matches', async () => {
const results = [];
await scan(
/^\s{0}/,
{
paths: [`oh-git`]
},
result => results.push(result)
);
expect(results.length).toBe(1);
const { filePath, matches } = results[0];
expect(filePath).toBe(
atom.project
.getDirectories()[0]
.resolve(path.join('a-dir', 'oh-git'))
);
expect(matches).toHaveLength(1);
expect(matches[0]).toEqual({
matchText: '',
lineText: 'bbb aaaa',
lineTextOffset: 0,
range: [[0, 0], [0, 0]],
leadingContextLines: [],
trailingContextLines: []
});
});
describe('newlines on regexps', async () => {
it('returns multiline results from regexps', async () => {
const results = [];
@@ -2652,6 +2680,30 @@ describe('Workspace', () => {
});
});
});
describe('pcre2 enabled', async () => {
it('supports lookbehind searches', async () => {
const results = [];
await scan(/(?<!a)aa\b/, { PCRE2: true }, result =>
results.push(result)
);
expect(results.length).toBe(1);
const { filePath, matches } = results[0];
expect(filePath).toBe(
atom.project.getDirectories()[0].resolve('a')
);
expect(matches).toHaveLength(1);
expect(matches[0]).toEqual({
matchText: 'aa',
lineText: 'cc aa cc',
lineTextOffset: 0,
range: [[1, 3], [1, 5]],
leadingContextLines: [],
trailingContextLines: []
});
});
});
}
it('returns results on lines with unicode strings', async () => {

View File

@@ -45,6 +45,7 @@ const TextBuffer = require('text-buffer');
const TextEditorRegistry = require('./text-editor-registry');
const AutoUpdateManager = require('./auto-update-manager');
const StartupTime = require('./startup-time');
const getReleaseChannel = require('./get-release-channel');
const stat = util.promisify(fs.stat);
@@ -550,6 +551,14 @@ class AtomEnvironment {
return this.firstLoad;
}
// Public: Get the full name of this Atom release (e.g. "Atom", "Atom Beta")
//
// Returns the app name {String}.
getAppName() {
if (this.appName == null) this.appName = this.getLoadSettings().appName;
return this.appName;
}
// Public: Get the version of the Atom application.
//
// Returns the version text {String}.
@@ -565,18 +574,7 @@ class AtomEnvironment {
// name like 'beta' or 'nightly' if one is found in the Atom version or 'stable'
// otherwise.
getReleaseChannel() {
// This matches stable, dev (with or without commit hash) and any other
// release channel following the pattern '1.00.0-channel0'
const match = this.getVersion().match(
/\d+\.\d+\.\d+(-([a-z]+)(\d+|-\w{4,})?)?$/
);
if (!match) {
return 'unrecognized';
} else if (match[2]) {
return match[2];
}
return 'stable';
return getReleaseChannel(this.getVersion());
}
// Public: Returns a {Boolean} that is `true` if the current version is an official release.

View File

@@ -1,10 +1,15 @@
module.exports = function(extra) {
module.exports = function(params) {
const { crashReporter } = require('electron');
const os = require('os');
const platformRelease = os.release();
const arch = os.arch();
const { uploadToServer, releaseChannel } = params;
crashReporter.start({
productName: 'Atom',
companyName: 'GitHub',
submitURL: 'https://crashreporter.atom.io',
uploadToServer: false,
extra: extra
submitURL: 'https://atom.io/crash_reports',
uploadToServer,
extra: { platformRelease, arch, releaseChannel }
});
};

19
src/get-app-name.js Normal file
View File

@@ -0,0 +1,19 @@
const { app } = require('electron');
const getReleaseChannel = require('./get-release-channel');
module.exports = function getAppName() {
if (process.type === 'renderer') {
return atom.getAppName();
}
const releaseChannel = getReleaseChannel(app.getVersion());
const appNameParts = [app.getName()];
if (releaseChannel !== 'stable') {
appNameParts.push(
releaseChannel.charAt(0).toUpperCase() + releaseChannel.slice(1)
);
}
return appNameParts.join(' ');
};

View File

@@ -0,0 +1,12 @@
module.exports = function(version) {
// This matches stable, dev (with or without commit hash) and any other
// release channel following the pattern '1.00.0-channel0'
const match = version.match(/\d+\.\d+\.\d+(-([a-z]+)(\d+|-\w{4,})?)?$/);
if (!match) {
return 'unrecognized';
} else if (match[2]) {
return match[2];
}
return 'stable';
};

View File

@@ -6,11 +6,8 @@ cloneObject = (object) ->
clone
module.exports = ({blobStore}) ->
startCrashReporter = require('./crash-reporter-start')
{remote} = require 'electron'
startCrashReporter() # Before anything else
exitWithStatusCode = (status) ->
remote.app.emit('will-quit')
remote.process.exit(status)

View File

@@ -1,4 +1,5 @@
const { BrowserWindow, app, dialog, ipcMain } = require('electron');
const getAppName = require('../get-app-name');
const path = require('path');
const url = require('url');
const { EventEmitter } = require('events');
@@ -35,7 +36,7 @@ module.exports = class AtomWindow extends EventEmitter {
const options = {
show: false,
title: 'Atom',
title: getAppName(),
tabbingIdentifier: 'atom',
webPreferences: {
// Prevent specs from throttling when the window is in the background:
@@ -80,6 +81,7 @@ module.exports = class AtomWindow extends EventEmitter {
this.loadSettings = Object.assign({}, settings);
this.loadSettings.appVersion = app.getVersion();
this.loadSettings.appName = getAppName();
this.loadSettings.resourcePath = this.resourcePath;
this.loadSettings.atomHome = process.env.ATOM_HOME;
if (this.loadSettings.devMode == null) this.loadSettings.devMode = false;

View File

@@ -1,4 +1,5 @@
const { EventEmitter } = require('events');
const os = require('os');
const path = require('path');
const IdleState = 'idle';
@@ -34,14 +35,16 @@ module.exports = class AutoUpdateManager extends EventEmitter {
initialize() {
if (process.platform === 'win32') {
const archSuffix = process.arch === 'ia32' ? '' : `-${process.arch}`;
this.feedUrl = `${
this.updateUrlPrefix
}/api/updates${archSuffix}?version=${this.version}`;
this.feedUrl =
this.updateUrlPrefix +
`/api/updates${archSuffix}?version=${this.version}&os_version=${
os.release
}`;
autoUpdater = require('./auto-updater-win32');
} else {
this.feedUrl = `${this.updateUrlPrefix}/api/updates?version=${
this.version
}`;
this.feedUrl =
this.updateUrlPrefix +
`/api/updates?version=${this.version}&os_version=${os.release}`;
({ autoUpdater } = require('electron'));
}

View File

@@ -8,7 +8,7 @@ class AutoUpdater extends EventEmitter {
quitAndInstall() {
if (SquirrelUpdate.existsSync()) {
SquirrelUpdate.restartAtom(require('electron').app);
SquirrelUpdate.restartAtom();
} else {
require('electron').autoUpdater.quitAndInstall();
}

View File

@@ -1,5 +1,7 @@
let setxPath;
const { app } = require('electron');
const fs = require('fs-plus');
const getAppName = require('../get-app-name');
const path = require('path');
const Spawner = require('./spawner');
const WinShell = require('./win-shell');
@@ -9,7 +11,7 @@ const appFolder = path.resolve(process.execPath, '..');
const rootAtomFolder = path.resolve(appFolder, '..');
const binFolder = path.join(rootAtomFolder, 'bin');
const updateDotExe = path.join(rootAtomFolder, 'Update.exe');
const exeName = path.basename(process.execPath);
const execName = path.basename(app.getPath('exe'));
if (process.env.SystemRoot) {
const system32Path = path.join(process.env.SystemRoot, 'System32');
@@ -32,15 +34,20 @@ const spawnUpdate = (args, callback) =>
// install directory that point to the newly installed versions inside
// the versioned app directories.
const addCommandsToPath = callback => {
const atomCmdName = execName.replace('.exe', '.cmd');
const apmCmdName = atomCmdName.replace('atom', 'apm');
const atomShName = execName.replace('.exe', '');
const apmShName = atomShName.replace('atom', 'apm');
const installCommands = callback => {
const atomCommandPath = path.join(binFolder, 'atom.cmd');
const atomCommandPath = path.join(binFolder, atomCmdName);
const relativeAtomPath = path.relative(
binFolder,
path.join(appFolder, 'resources', 'cli', 'atom.cmd')
);
const atomCommand = `@echo off\r\n"%~dp0\\${relativeAtomPath}" %*`;
const atomShCommandPath = path.join(binFolder, 'atom');
const atomShCommandPath = path.join(binFolder, atomShName);
const relativeAtomShPath = path.relative(
binFolder,
path.join(appFolder, 'resources', 'cli', 'atom.sh')
@@ -50,14 +57,14 @@ const addCommandsToPath = callback => {
'/'
)}" "$@"\r\necho`;
const apmCommandPath = path.join(binFolder, 'apm.cmd');
const apmCommandPath = path.join(binFolder, apmCmdName);
const relativeApmPath = path.relative(
binFolder,
path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd')
);
const apmCommand = `@echo off\r\n"%~dp0\\${relativeApmPath}" %*`;
const apmShCommandPath = path.join(binFolder, 'apm');
const apmShCommandPath = path.join(binFolder, apmShName);
const relativeApmShPath = path.relative(
binFolder,
path.join(appFolder, 'resources', 'cli', 'apm.sh')
@@ -123,7 +130,7 @@ const removeCommandsFromPath = callback =>
// provided by Squirrel's Update.exe
const createShortcuts = (locations, callback) =>
spawnUpdate(
['--createShortcut', exeName, '-l', locations.join(',')],
['--createShortcut', execName, '-l', locations.join(',')],
callback
);
@@ -132,7 +139,11 @@ const createShortcuts = (locations, callback) =>
const updateShortcuts = callback => {
const homeDirectory = fs.getHomeDirectory();
if (homeDirectory) {
const desktopShortcutPath = path.join(homeDirectory, 'Desktop', 'Atom.lnk');
const desktopShortcutPath = path.join(
homeDirectory,
'Desktop',
`${getAppName()}.lnk`
);
// Check if the desktop shortcut has been previously deleted and
// and keep it deleted if it was
fs.exists(desktopShortcutPath, desktopShortcutExists => {
@@ -151,7 +162,7 @@ const updateShortcuts = callback => {
// Remove the desktop and start menu shortcuts by using the command line API
// provided by Squirrel's Update.exe
const removeShortcuts = callback =>
spawnUpdate(['--removeShortcut', exeName], callback);
spawnUpdate(['--removeShortcut', execName], callback);
exports.spawn = spawnUpdate;
@@ -159,15 +170,15 @@ exports.spawn = spawnUpdate;
exports.existsSync = () => fs.existsSync(updateDotExe);
// Restart Atom using the version pointed to by the atom.cmd shim
exports.restartAtom = app => {
exports.restartAtom = () => {
let args;
const atomCmdName = execName.replace('.exe', '.cmd');
if (global.atomApplication && global.atomApplication.lastFocusedWindow) {
const { projectPath } = global.atomApplication.lastFocusedWindow;
if (projectPath) args = [projectPath];
}
app.once('will-quit', () =>
Spawner.spawn(path.join(binFolder, 'atom.cmd'), args)
);
Spawner.spawn(path.join(binFolder, atomCmdName), args);
app.quit();
};
@@ -179,7 +190,7 @@ const updateContextMenus = callback =>
);
// Handle squirrel events denoted by --squirrel-* command line arguments.
exports.handleStartupEvent = (app, squirrelCommand) => {
exports.handleStartupEvent = squirrelCommand => {
switch (squirrelCommand) {
case '--squirrel-install':
createShortcuts(['Desktop', 'StartMenu'], () =>

View File

@@ -4,6 +4,7 @@ const path = require('path');
const temp = require('temp').track();
const parseCommandLine = require('./parse-command-line');
const startCrashReporter = require('../crash-reporter-start');
const getReleaseChannel = require('../get-release-channel');
const atomPaths = require('../atom-paths');
const fs = require('fs');
const CSON = require('season');
@@ -72,8 +73,17 @@ module.exports = function start(resourcePath, devResourcePath, startTime) {
return;
}
// NB: This prevents Win10 from showing dupe items in the taskbar
app.setAppUserModelId('com.squirrel.atom.' + process.arch);
const releaseChannel = getReleaseChannel(app.getVersion());
let appUserModelId = 'com.squirrel.atom.' + process.arch;
// If the release channel is not stable, we append it to the app user model id.
// This allows having the different release channels as separate items in the taskbar.
if (releaseChannel !== 'stable') {
appUserModelId += `-${releaseChannel}`;
}
// NB: This prevents Win10 from showing dupe items in the taskbar.
app.setAppUserModelId(appUserModelId);
function addPathToOpen(event, pathToOpen) {
event.preventDefault();
@@ -87,7 +97,12 @@ module.exports = function start(resourcePath, devResourcePath, startTime) {
app.on('open-file', addPathToOpen);
app.on('open-url', addUrlToOpen);
app.on('will-finish-launching', startCrashReporter);
app.on('will-finish-launching', () =>
startCrashReporter({
uploadToServer: config.get('core.telemetryConsent') === 'limited',
releaseChannel
})
);
if (args.userDataDir != null) {
app.setPath('userData', args.userDataDir);
@@ -117,7 +132,7 @@ function handleStartupEventWithSquirrel() {
const SquirrelUpdate = require('./squirrel-update');
const squirrelCommand = process.argv[1];
return SquirrelUpdate.handleStartupEvent(app, squirrelCommand);
return SquirrelUpdate.handleStartupEvent(squirrelCommand);
}
function getConfig() {

View File

@@ -1,19 +1,17 @@
const Registry = require('winreg');
const Path = require('path');
const getAppName = require('../get-app-name');
let exeName = Path.basename(process.execPath);
let appPath = `"${process.execPath}"`;
let fileIconPath = `"${Path.join(
const appName = getAppName();
const exeName = Path.basename(process.execPath);
const appPath = `"${process.execPath}"`;
const 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', '');
class ShellOption {
constructor(key, parts) {

View File

@@ -157,7 +157,7 @@ function processSubmatch(submatch, lineText, offsetRow) {
}
function getText(input) {
return input.text
return 'text' in input
? input.text
: Buffer.from(input.bytes, 'base64').toString();
}
@@ -269,6 +269,10 @@ module.exports = class RipgrepDirectorySearcher {
args.push('--no-ignore-vcs');
}
if (options.PCRE2) {
args.push('--pcre2');
}
args.push('.');
const child = spawn(this.rgPath, args, {

View File

@@ -4084,7 +4084,9 @@ module.exports = class TextEditor {
}
// Returns an {Object} representing the current invisible character
// substitutions for this editor. See {::setInvisibles}.
// substitutions for this editor, whose keys are names of invisible characters
// and whose values are 1-character {Strings}s that are displayed in place of
// those invisible characters
getInvisibles() {
if (!this.mini && this.showInvisibles && this.invisibles != null) {
return this.invisibles;

View File

@@ -1,5 +1,6 @@
const { Disposable, CompositeDisposable } = require('event-kit');
const listen = require('./delegated-listener');
const { debounce } = require('underscore-plus');
// Handles low-level events related to the `window`.
module.exports = class WindowEventHandler {
@@ -65,7 +66,11 @@ module.exports = class WindowEventHandler {
);
this.addEventListener(this.window, 'focus', this.handleWindowFocus);
this.addEventListener(this.window, 'blur', this.handleWindowBlur);
this.addEventListener(this.window, 'resize', this.handleWindowResize);
this.addEventListener(
this.window,
'resize',
debounce(this.handleWindowResize, 500)
);
this.addEventListener(this.document, 'keyup', this.handleDocumentKeyEvent);
this.addEventListener(

View File

@@ -76,7 +76,7 @@ const ALL_LOCATIONS = ['center', 'left', 'right', 'bottom'];
// Returns a {String} containing a longer version of the title to display in
// places like the window title or on tabs their short titles are ambiguous.
//
// #### `onDidChangeTitle`
// #### `onDidChangeTitle(callback)`
//
// Called by the workspace so it can be notified when the item's title changes.
// Must return a {Disposable}.
@@ -678,7 +678,7 @@ module.exports = class Workspace extends Model {
// open.
updateWindowTitle() {
let itemPath, itemTitle, projectPath, representedPath;
const appName = 'Atom';
const appName = atom.getAppName();
const left = this.project.getPaths();
const projectPaths = left != null ? left : [];
const item = this.getActivePaneItem();
@@ -2104,6 +2104,7 @@ module.exports = class Workspace extends Model {
follow: this.config.get('core.followSymlinks'),
leadingContextLineCount: options.leadingContextLineCount || 0,
trailingContextLineCount: options.trailingContextLineCount || 0,
PCRE2: options.PCRE2,
didMatch: result => {
if (!this.project.isPathModified(result.filePath)) {
return iterator(result);

View File

@@ -7,6 +7,7 @@
const path = require('path');
const Module = require('module');
const getWindowLoadSettings = require('../src/get-window-load-settings');
const getReleaseChannel = require('../src/get-release-channel');
const StartupTime = require('../src/startup-time');
const entryPointDirPath = __dirname;
let blobStore = null;
@@ -143,7 +144,18 @@
const startCrashReporter = useSnapshot
? snapshotResult.customRequire('../src/crash-reporter-start.js')
: require('../src/crash-reporter-start');
startCrashReporter({ _version: getWindowLoadSettings().appVersion });
const { userSettings, appVersion } = getWindowLoadSettings();
const uploadToServer =
userSettings &&
userSettings.core &&
userSettings.core.telemetryConsent === 'limited';
const releaseChannel = getReleaseChannel(appVersion);
startCrashReporter({
uploadToServer,
releaseChannel
});
const CSON = useSnapshot
? snapshotResult.customRequire('../node_modules/season/lib/cson.js')