From cfcf397546081aaf5237d4a8b465c9252c54f20f Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 21:46:54 -0500 Subject: [PATCH 01/35] :arrow_up: notifications@0.62.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c2678a21a..9c469f3f5 100644 --- a/package.json +++ b/package.json @@ -97,9 +97,9 @@ "keybinding-resolver": "0.33.0", "line-ending-selector": "0.3.0", "link": "0.31.0", - "markdown-preview": "0.156.1", + "markdown-preview": "0.156.2", "metrics": "0.53.0", - "notifications": "0.61.0", + "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", From ce60e07d7c65cada5c20e767e3e687b5d7e79ca4 Mon Sep 17 00:00:00 2001 From: Wliu Date: Tue, 24 Nov 2015 15:54:06 -0500 Subject: [PATCH 02/35] Revert ":arrow_up: notifications@0.62.1" This reverts commit cfcf397546081aaf5237d4a8b465c9252c54f20f. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9c469f3f5..c2678a21a 100644 --- a/package.json +++ b/package.json @@ -97,9 +97,9 @@ "keybinding-resolver": "0.33.0", "line-ending-selector": "0.3.0", "link": "0.31.0", - "markdown-preview": "0.156.2", + "markdown-preview": "0.156.1", "metrics": "0.53.0", - "notifications": "0.62.1", + "notifications": "0.61.0", "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", From d1d0ca1355487d87829684b8823955af2de9485e Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 21:46:54 -0500 Subject: [PATCH 03/35] :arrow_up: notifications@0.62.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c2678a21a..40ffe8b81 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "link": "0.31.0", "markdown-preview": "0.156.1", "metrics": "0.53.0", - "notifications": "0.61.0", + "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", From b391671a188c472051382b507a81043153ff3581 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 16:06:22 -0500 Subject: [PATCH 04/35] :arrow_up: language-coffee-script@0.45.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40ffe8b81..008ea6b77 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "wrap-guide": "0.38.1", "language-c": "0.49.0", "language-clojure": "0.18.0", - "language-coffee-script": "0.43.0", + "language-coffee-script": "0.45.0", "language-csharp": "0.11.0", "language-css": "0.35.0", "language-gfm": "0.81.0", From 5dfd765bcf6328f0edaa870ce0b59202ae95689b Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 26 Nov 2015 10:39:47 +0100 Subject: [PATCH 05/35] Do not override user-defined keymaps when reloading packages --- spec/package-manager-spec.coffee | 51 ++++++++++++++++++++++++++++++++ src/keymap-extensions.coffee | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index 4b5f3c26d..19f9b0648 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -1,6 +1,9 @@ path = require 'path' Package = require '../src/package' +temp = require 'temp' +fs = require 'fs-plus' {Disposable} = require 'atom' +{buildKeydownEvent} = require '../src/keymap-extensions' describe "PackageManager", -> workspaceElement = null @@ -456,6 +459,54 @@ describe "PackageManager", -> atom.config.set("core.packagesWithKeymapsDisabled", []) expect(atom.keymaps.findKeyBindings(keystrokes: 'ctrl-z', target: element1)[0].command).toBe 'keymap-1' + describe "when the package is de-activated and re-activated", -> + [element, events, userKeymapPath] = [] + + beforeEach -> + userKeymapPath = path.join(temp.path(), "user-keymaps.cson") + spyOn(atom.keymaps, "getUserKeymapPath").andReturn(userKeymapPath) + + element = createTestElement('test-1') + jasmine.attachToDOM(element) + + events = [] + element.addEventListener 'user-command', (e) -> events.push(e) + element.addEventListener 'test-1', (e) -> events.push(e) + + afterEach -> + element.remove() + + # Avoid leaking user keymap subscription + atom.keymaps.watchSubscriptions[userKeymapPath].dispose() + delete atom.keymaps.watchSubscriptions[userKeymapPath] + + it "doesn't override user-defined keymaps", -> + fs.writeFileSync userKeymapPath, """ + ".test-1": + "ctrl-z": "user-command" + """ + atom.keymaps.loadUserKeymap() + + waitsForPromise -> + atom.packages.activatePackage("package-with-keymaps") + + runs -> + atom.keymaps.handleKeyboardEvent(buildKeydownEvent("z", ctrl: true, target: element)) + + expect(events.length).toBe(1) + expect(events[0].type).toBe("user-command") + + atom.packages.deactivatePackage("package-with-keymaps") + + waitsForPromise -> + atom.packages.activatePackage("package-with-keymaps") + + runs -> + atom.keymaps.handleKeyboardEvent(buildKeydownEvent("z", ctrl: true, target: element)) + + expect(events.length).toBe(2) + expect(events[1].type).toBe("user-command") + describe "menu loading", -> beforeEach -> atom.contextMenu.definitions = [] diff --git a/src/keymap-extensions.coffee b/src/keymap-extensions.coffee index 82f2e8b99..b5c3964f9 100644 --- a/src/keymap-extensions.coffee +++ b/src/keymap-extensions.coffee @@ -32,7 +32,7 @@ KeymapManager::loadUserKeymap = -> return unless fs.isFileSync(userKeymapPath) try - @loadKeymap(userKeymapPath, watch: true, suppressErrors: true) + @loadKeymap(userKeymapPath, watch: true, suppressErrors: true, priority: 100) catch error if error.message.indexOf('Unable to watch path') > -1 message = """ From d34fec20d046dcde0201d5bd1260380390222b73 Mon Sep 17 00:00:00 2001 From: Josh Abernathy Date: Mon, 30 Nov 2015 16:00:30 -0500 Subject: [PATCH 06/35] Merge pull request #9729 from atom/upload-to-s3 Upload releases to s3 --- build/package.json | 1 + build/tasks/publish-build-task.coffee | 35 ++++++++++++++++++++++++--- script/cibuild | 4 +++ script/cibuild-atom-linux | 3 +++ script/cibuild-atom-rpm | 3 +++ 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/build/package.json b/build/package.json index 2ce92de17..3e97d57d1 100644 --- a/build/package.json +++ b/build/package.json @@ -8,6 +8,7 @@ "dependencies": { "asar": "^0.8.0", "async": "~0.2.9", + "aws-sdk": "^2.2.18", "donna": "^1.0.13", "formidable": "~1.0.14", "fs-plus": "2.x", diff --git a/build/tasks/publish-build-task.coffee b/build/tasks/publish-build-task.coffee index fc96121ae..4f8df6336 100644 --- a/build/tasks/publish-build-task.coffee +++ b/build/tasks/publish-build-task.coffee @@ -6,6 +6,7 @@ async = require 'async' fs = require 'fs-plus' GitHub = require 'github-releases' request = require 'request' +AWS = require 'aws-sdk' grunt = null @@ -210,7 +211,7 @@ deleteExistingAssets = (release, assetNames, callback) -> async.parallel(tasks, callback) uploadAssets = (release, buildDir, assets, callback) -> - upload = (release, assetName, assetPath, callback) -> + uploadToReleases = (release, assetName, assetPath, callback) -> options = uri: release.upload_url.replace(/\{.*$/, "?name=#{assetName}") method: 'POST' @@ -221,15 +222,43 @@ uploadAssets = (release, buildDir, assets, callback) -> assetRequest = request options, (error, response, body='') -> if error? or response.statusCode >= 400 - logError("Upload release asset #{assetName} failed", error, body) + logError("Upload release asset #{assetName} to Releases failed", error, body) callback(error ? new Error(response.statusCode)) else callback(null, release) fs.createReadStream(assetPath).pipe(assetRequest) + uploadToS3 = (release, assetName, assetPath, callback) -> + s3Key = process.env.BUILD_ATOM_RELEASES_S3_KEY + s3Secret = process.env.BUILD_ATOM_RELEASES_S3_SECRET + s3Bucket = process.env.BUILD_ATOM_RELEASES_S3_BUCKET + + unless s3Key and s3Secret and s3Bucket + callback(new Error('BUILD_ATOM_RELEASES_S3_KEY, BUILD_ATOM_RELEASES_S3_SECRET, and BUILD_ATOM_RELEASES_S3_BUCKET environment variables must be set.')) + return + + s3Info = + accessKeyId: s3Key + secretAccessKey: s3Secret + s3 = new AWS.S3 s3Info + + key = "releases/#{release.tag_name}/#{assetName}" + uploadParams = + Bucket: s3Bucket + ACL: 'public-read' + Key: key + Body: fs.createReadStream(assetPath) + s3.upload uploadParams, (error, data) -> + if error? + logError("Upload release asset #{assetName} to S3 failed", error) + callback(error) + else + callback(null, release) + tasks = [] for {assetName} in assets assetPath = path.join(buildDir, assetName) - tasks.push(upload.bind(this, release, assetName, assetPath)) + tasks.push(uploadToReleases.bind(this, release, assetName, assetPath)) + tasks.push(uploadToS3.bind(this, release, assetName, assetPath)) async.parallel(tasks, callback) diff --git a/script/cibuild b/script/cibuild index c1aedddc8..8b8e64c12 100755 --- a/script/cibuild +++ b/script/cibuild @@ -38,6 +38,10 @@ function setEnvironmentVariables() { process.env.CC = 'clang'; process.env.CXX = 'clang++'; process.env.npm_config_clang = '1'; + } else if (process.platform === 'win32') { + process.env.BUILD_ATOM_RELEASES_S3_KEY = process.env.BUILD_ATOM_WIN_RELEASES_S3_KEY + process.env.BUILD_ATOM_RELEASES_S3_SECRET = process.env.BUILD_ATOM_WIN_RELEASES_S3_SECRET + process.env.BUILD_ATOM_RELEASES_S3_BUCKET = process.env.BUILD_ATOM_WIN_RELEASES_S3_BUCKET } } diff --git a/script/cibuild-atom-linux b/script/cibuild-atom-linux index c4e957189..2c3395608 100755 --- a/script/cibuild-atom-linux +++ b/script/cibuild-atom-linux @@ -3,6 +3,9 @@ set -e export ATOM_ACCESS_TOKEN=$BUILD_ATOM_LINUX_ACCESS_TOKEN +export BUILD_ATOM_RELEASES_S3_KEY=$BUILD_ATOM_LINUX_RELEASES_S3_KEY +export BUILD_ATOM_RELEASES_S3_SECRET=$BUILD_ATOM_LINUX_RELEASES_S3_SECRET +export BUILD_ATOM_RELEASES_S3_BUCKET=$BUILD_ATOM_LINUX_RELEASES_S3_BUCKET if [ -d /usr/local/share/nodenv ]; then export NODENV_ROOT=/usr/local/share/nodenv diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm index a861a068b..2faa89347 100755 --- a/script/cibuild-atom-rpm +++ b/script/cibuild-atom-rpm @@ -8,5 +8,8 @@ docker run \ --env JANKY_SHA1="$JANKY_SHA1" \ --env JANKY_BRANCH="$JANKY_BRANCH" \ --env ATOM_ACCESS_TOKEN="$BUILD_ATOM_RPM_ACCESS_TOKEN" \ + --env BUILD_ATOM_RELEASES_S3_KEY="$BUILD_ATOM_RPM_RELEASES_S3_KEY" \ + --env BUILD_ATOM_RELEASES_S3_SECRET="$BUILD_ATOM_RPM_RELEASES_S3_SECRET" \ + --env BUILD_ATOM_RELEASES_S3_BUCKET="$BUILD_ATOM_RPM_RELEASES_S3_BUCKET" \ atom-rpm /atom/script/rpmbuild docker rmi atom-rpm From 8697bdaf674885cdbe39a4cffdf6f71aca529b7a Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 30 Nov 2015 17:11:13 -0500 Subject: [PATCH 07/35] 1.3.0-beta7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 008ea6b77..66d85ffad 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.0-beta6", + "version": "1.3.0-beta7", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From 948aaa0652c55a793af6acdb2766ae0b1c9f2cfc Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sun, 15 Nov 2015 20:51:07 +0100 Subject: [PATCH 08/35] Add opened files and folders to recent documents menu --- src/application-delegate.coffee | 3 +++ src/atom-environment.coffee | 4 +++- src/browser/atom-application.coffee | 3 +++ src/workspace.coffee | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index d6937f2d3..59259d223 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -109,6 +109,9 @@ class ApplicationDelegate setRepresentedFilename: (filename) -> ipc.send("call-window-method", "setRepresentedFilename", filename) + addRecentDocument: (filename) -> + ipc.send("add-recent-document", filename) + setRepresentedDirectoryPaths: (paths) -> loadSettings = getWindowLoadSettings() loadSettings['initialPaths'] = paths diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index e8d656a43..bd3d88fc8 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -885,7 +885,9 @@ class AtomEnvironment extends Model else @project.addPath(pathToOpen) - unless fs.isDirectorySync(pathToOpen) + if fs.isDirectorySync(pathToOpen) + @applicationDelegate.addRecentDocument(pathToOpen) + else @workspace?.open(pathToOpen, {initialLine, initialColumn}) return diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 1987f9dec..e720597e3 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -281,6 +281,9 @@ class AtomApplication ipc.on 'write-to-stderr', (event, output) -> process.stderr.write(output) + ipc.on 'add-recent-document', (event, filename) -> + app.addRecentDocument(filename) + setupDockMenu: -> if process.platform is 'darwin' dockMenu = Menu.buildFromTemplate [ diff --git a/src/workspace.coffee b/src/workspace.coffee index 04feef61e..3057a9047 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -488,6 +488,9 @@ class Workspace extends Model if initialLine >= 0 or initialColumn >= 0 item.setCursorBufferPosition?([initialLine, initialColumn]) + path = item.getPath?() + @applicationDelegate.addRecentDocument(path) if path? + index = pane.getActiveItemIndex() @emitter.emit 'did-open', {uri, pane, item, index} item From 2f78a274a124245442264e95bf9b55d45a2277fd Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sun, 15 Nov 2015 22:47:50 +0100 Subject: [PATCH 09/35] Only add explicitly opened files/folders as recent documents --- src/atom-environment.coffee | 6 +++--- src/workspace.coffee | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index bd3d88fc8..de52fe55c 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -885,9 +885,9 @@ class AtomEnvironment extends Model else @project.addPath(pathToOpen) - if fs.isDirectorySync(pathToOpen) - @applicationDelegate.addRecentDocument(pathToOpen) - else + @applicationDelegate.addRecentDocument(pathToOpen) + + unless fs.isDirectorySync(pathToOpen) @workspace?.open(pathToOpen, {initialLine, initialColumn}) return diff --git a/src/workspace.coffee b/src/workspace.coffee index 3057a9047..04feef61e 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -488,9 +488,6 @@ class Workspace extends Model if initialLine >= 0 or initialColumn >= 0 item.setCursorBufferPosition?([initialLine, initialColumn]) - path = item.getPath?() - @applicationDelegate.addRecentDocument(path) if path? - index = pane.getActiveItemIndex() @emitter.emit 'did-open', {uri, pane, item, index} item From 7c657b08cc175041245885576c64a5cc72d54d91 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 4 Dec 2015 18:42:43 +0100 Subject: [PATCH 10/35] :arrow_up: atom-keymap --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ca330287..b4dcdc9f6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "electronVersion": "0.34.5", "dependencies": { "async": "0.2.6", - "atom-keymap": "^6.1.1", + "atom-keymap": "^6.2.0", "babel-core": "^5.8.21", "bootstrap": "^3.3.4", "cached-run-in-this-context": "0.4.0", From 96e0deb3c2bbbaef72768ca2fb1bc561a1125db1 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 4 Dec 2015 09:47:05 -0800 Subject: [PATCH 11/35] :arrow_up: github-releases --- build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package.json b/build/package.json index 40e5b309a..fd7d29d80 100644 --- a/build/package.json +++ b/build/package.json @@ -12,7 +12,7 @@ "donna": "^1.0.13", "formidable": "~1.0.14", "fs-plus": "2.x", - "github-releases": "~0.3.0", + "github-releases": "~0.3.1", "glob": "^5.0.14", "grunt": "~0.4.1", "grunt-babel": "^5.0.1", From 6e2061c0760b9015cd5285d53cba174d763494c2 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Sun, 6 Dec 2015 17:15:13 -0800 Subject: [PATCH 12/35] :white_check_mark: add spec for ordered config.cson --- spec/config-spec.coffee | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index e00cee789..eab2f6f04 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -679,6 +679,26 @@ describe "Config", -> writtenConfig = CSON.writeFileSync.argsForCall[0][1] expect(writtenConfig).toEqual '*': atom.config.settings + it 'writes properties in alphabetical order', -> + atom.config.set('foo', 1) + atom.config.set('bar', 2) + atom.config.set('baz.foo', 3) + atom.config.set('baz.bar', 4) + + CSON.writeFileSync.reset() + atom.config.save() + + expect(CSON.writeFileSync.argsForCall[0][0]).toBe atom.config.configFilePath + writtenConfig = CSON.writeFileSync.argsForCall[0][1] + expect(writtenConfig).toEqual '*': atom.config.settings + + expectedKeys = ['bar', 'baz', 'foo'] + foundKeys = (key for key of writtenConfig['*'] when key in expectedKeys) + expect(foundKeys).toEqual expectedKeys + expectedKeys = ['bar', 'foo'] + foundKeys = (key for key of writtenConfig['*']['baz'] when key in expectedKeys) + expect(foundKeys).toEqual expectedKeys + describe "when ~/.atom/config.json doesn't exist", -> it "writes any non-default properties to ~/.atom/config.cson", -> atom.config.set("a.b.c", 1) From 80fdfb9280e94ca4ecbe8a5c02fa946dd54389d5 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 7 Dec 2015 09:34:34 -0800 Subject: [PATCH 13/35] :arrow_up: find-and-replace --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b4dcdc9f6..6beba336d 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "dev-live-reload": "0.47.0", "encoding-selector": "0.21.0", "exception-reporting": "0.37.0", - "find-and-replace": "0.192.0", + "find-and-replace": "0.193.0", "fuzzy-finder": "0.93.0", "git-diff": "0.57.0", "go-to-line": "0.30.0", From fbbcdbf5185f2a08dd1705d7a11767920e662f71 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Sun, 6 Dec 2015 17:20:06 -0800 Subject: [PATCH 14/35] order keys in config.cson alphabetically --- src/config.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/config.coffee b/src/config.coffee index d2759fcb4..2e4387732 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -827,6 +827,7 @@ class Config allSettings = {'*': @settings} allSettings = _.extend allSettings, @scopedSettingsStore.propertiesForSource(@getUserConfigPath()) + allSettings = sortObject(allSettings) try CSON.writeFileSync(@configFilePath, allSettings) catch error @@ -1190,6 +1191,13 @@ Config.addSchemaEnforcers isPlainObject = (value) -> _.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value) and not (value instanceof Color) +sortObject = (value) -> + return value unless isPlainObject(value) + result = {} + for key in Object.keys(value).sort() + result[key] = sortObject(value[key]) + result + withoutEmptyObjects = (object) -> resultObject = undefined if isPlainObject(object) From 4f9e1a8ca3939f887a0c516c1ebe384247faed1e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 7 Dec 2015 14:25:11 -0700 Subject: [PATCH 15/35] Increase stack trace size limit to 30 --- src/compile-cache.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compile-cache.js b/src/compile-cache.js index f7726b4b3..f11856a47 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -158,6 +158,8 @@ require('source-map-support').install({ } }) +Error.stackTraceLimit = 30 + var sourceMapPrepareStackTrace = Error.prepareStackTrace var prepareStackTrace = sourceMapPrepareStackTrace From ec759f1322fab123da8785616f290e3623a03661 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 7 Dec 2015 16:49:55 -0800 Subject: [PATCH 16/35] Clear out loaded packages in PackageManager.prototype.reset This way, when the AtomEnvironment is reset, packages will have .load() called on them again, so their config schemas will be registered again. --- src/package-manager.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 5b0264212..5ef0d2a46 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -62,6 +62,7 @@ class PackageManager reset: -> @serviceHub.clear() @deactivatePackages() + @loadedPackages = {} @packageStates = {} ### From 05e10bfaeb9d22c2d871148f75158ad22d7c156a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 7 Dec 2015 16:52:33 -0800 Subject: [PATCH 17/35] Register config schemas from package.json in theme packages --- src/theme-package.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/theme-package.coffee b/src/theme-package.coffee index 084728869..502fbd52b 100644 --- a/src/theme-package.coffee +++ b/src/theme-package.coffee @@ -14,6 +14,7 @@ class ThemePackage extends Package load: -> @loadTime = 0 + @configSchemaRegisteredOnLoad = @registerConfigSchemaFromMetadata() this activate: -> From 03a2846eb5b741ffe0b6900ee1a41acc1f12bebb Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 7 Dec 2015 17:24:34 -0800 Subject: [PATCH 18/35] Remove redundant unloadPackage call in spec --- spec/package-manager-spec.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index b504f676f..e7f4214a9 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -167,7 +167,6 @@ describe "PackageManager", -> describe "when a package does not have deserializers, view providers or a config schema in its package.json", -> beforeEach -> - atom.packages.unloadPackage('package-with-main') mockLocalStorage() it "defers loading the package's main module if the package previously used no Atom APIs when its main module was required", -> From 82c27e896e8fd0437c05538ff6d749253ef5a34a Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 8 Dec 2015 09:35:14 -0500 Subject: [PATCH 19/35] :arrow_up: language-xml@0.34.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6beba336d..2a6582d4b 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "language-text": "0.7.0", "language-todo": "0.27.0", "language-toml": "0.18.0", - "language-xml": "0.34.1", + "language-xml": "0.34.2", "language-yaml": "0.25.0" }, "private": true, From 314a1234f498ca4945b80a36c1f44f880c82e2aa Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 8 Dec 2015 11:09:52 -0800 Subject: [PATCH 20/35] Track which packages are in the process of activating This fixes a race condition where a package's activation promise resolves asynchronously after it has been deactivated, causing it to stay in the package manager's @activePackages object. --- src/package-manager.coffee | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 5ef0d2a46..6772178af 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -47,6 +47,7 @@ class PackageManager @packagesCache = require('../package.json')?._atomPackages ? {} @loadedPackages = {} @activePackages = {} + @activatingPackages = {} @packageStates = {} @serviceHub = new ServiceHub @@ -437,9 +438,12 @@ class PackageManager if pack = @getActivePackage(name) Promise.resolve(pack) else if pack = @loadPackage(name) + @activatingPackages[pack.name] = pack pack.activate().then => - @activePackages[pack.name] = pack - @emitter.emit 'did-activate-package', pack + if @activatingPackages[pack.name]? + delete @activatingPackages[pack.name] + @activePackages[pack.name] = pack + @emitter.emit 'did-activate-package', pack pack else Promise.reject(new Error("Failed to load package '#{name}'")) @@ -475,6 +479,7 @@ class PackageManager @setPackageState(pack.name, state) if state = pack.serialize?() pack.deactivate() delete @activePackages[pack.name] + delete @activatingPackages[pack.name] @emitter.emit 'did-deactivate-package', pack handleMetadataError: (error, packagePath) -> From d835ac0ac849a398d63ec0beaac1361aec2cd248 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 8 Dec 2015 11:27:20 -0800 Subject: [PATCH 21/35] Add spec for re-registering schema after unloading package --- spec/package-manager-spec.coffee | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index e7f4214a9..e6848ef03 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -154,7 +154,6 @@ describe "PackageManager", -> it "registers the config schema in the package's metadata, if present", -> pack = atom.packages.loadPackage("package-with-json-config-schema") - expect(atom.config.getSchema('package-with-json-config-schema')).toEqual { type: 'object' properties: { @@ -165,6 +164,18 @@ describe "PackageManager", -> expect(pack.mainModule).toBeNull() + atom.packages.unloadPackage('package-with-json-config-schema') + atom.config.clear() + + pack = atom.packages.loadPackage("package-with-json-config-schema") + expect(atom.config.getSchema('package-with-json-config-schema')).toEqual { + type: 'object' + properties: { + a: {type: 'number', default: 5} + b: {type: 'string', default: 'five'} + } + } + describe "when a package does not have deserializers, view providers or a config schema in its package.json", -> beforeEach -> mockLocalStorage() From 916da68ee5b71204e71aa77659759d95bdf60de2 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 8 Dec 2015 14:11:14 -0700 Subject: [PATCH 22/35] :arrow_up: find-and-replace for layer service --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66d85ffad..48a1431f6 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "dev-live-reload": "0.47.0", "encoding-selector": "0.21.0", "exception-reporting": "0.37.0", - "find-and-replace": "0.191.0", + "find-and-replace": "0.194.0", "fuzzy-finder": "0.93.0", "git-diff": "0.57.0", "go-to-line": "0.30.0", From 54169b53a8ccbe69a37baa4d4f765a2b34739f4a Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 8 Dec 2015 14:11:39 -0700 Subject: [PATCH 23/35] 1.3.0-beta8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 48a1431f6..29a0c59a2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.0-beta7", + "version": "1.3.0-beta8", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From 7718d5cb56692a7eb102a2e158e5d7aa9a8e77e4 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 24 Nov 2015 11:59:53 -0700 Subject: [PATCH 24/35] Merge pull request #9773 from atom/mb-ns-prepare-stack-trace-fixes Allow Error.prepareStackTrace to be temporarily reassigned --- spec/compile-cache-spec.coffee | 15 ++++++++++++++ src/compile-cache.js | 38 ++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/spec/compile-cache-spec.coffee b/spec/compile-cache-spec.coffee index d80e05fc5..8a6cc214e 100644 --- a/spec/compile-cache-spec.coffee +++ b/spec/compile-cache-spec.coffee @@ -69,3 +69,18 @@ describe 'CompileCache', -> CompileCache.addPathToCache(path.join(fixtures, 'cson.cson'), atomHome) expect(CSONParser.parse.callCount).toBe 1 + + describe 'overriding Error.prepareStackTrace', -> + it 'removes the override on the next tick, and always assigns the raw stack', -> + Error.prepareStackTrace = -> 'a-stack-trace' + + error = new Error("Oops") + expect(error.stack).toBe 'a-stack-trace' + expect(Array.isArray(error.getRawStack())).toBe true + + waits(1) + runs -> + error = new Error("Oops again") + console.log error.stack + expect(error.stack).toContain('compile-cache-spec.coffee') + expect(Array.isArray(error.getRawStack())).toBe true diff --git a/src/compile-cache.js b/src/compile-cache.js index f11856a47..aed72ee36 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -160,25 +160,33 @@ require('source-map-support').install({ Error.stackTraceLimit = 30 -var sourceMapPrepareStackTrace = Error.prepareStackTrace -var prepareStackTrace = sourceMapPrepareStackTrace +var prepareStackTraceWithSourceMapping = Error.prepareStackTrace -// Prevent coffee-script from reassigning Error.prepareStackTrace -Object.defineProperty(Error, 'prepareStackTrace', { - get: function () { return prepareStackTrace }, - set: function (newValue) {} -}) +let prepareStackTrace = prepareStackTraceWithSourceMapping -// Enable Grim to access the raw stack without reassigning Error.prepareStackTrace -Error.prototype.getRawStack = function () { // eslint-disable-line no-extend-native - prepareStackTrace = getRawStack - var result = this.stack - prepareStackTrace = sourceMapPrepareStackTrace - return result +function prepareStackTraceWithRawStackAssignment (error, frames) { + error.rawStack = frames + return prepareStackTrace(error, frames) } -function getRawStack (_, stack) { - return stack +Object.defineProperty(Error, 'prepareStackTrace', { + get: function () { + return prepareStackTraceWithRawStackAssignment + }, + + set: function (newValue) { + prepareStackTrace = newValue + process.nextTick(function () { + prepareStackTrace = prepareStackTraceWithSourceMapping + }) + } +}) + +Error.prototype.getRawStack = function () { // eslint-disable-line no-extend-native + // Access this.stack to ensure prepareStackTrace has been run on this error + // because it assigns this.rawStack as a side-effect + this.stack + return this.rawStack } Object.keys(COMPILERS).forEach(function (extension) { From 3567d477903d837ad68d8f828696d8a93fc7a356 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 30 Nov 2015 12:32:06 -0800 Subject: [PATCH 25/35] Merge pull request #9878 from atom/ns-mb-fix-prepare-stack-trace-recursion Avoid infinite recursion in Error.prepareStackTrace --- spec/compile-cache-spec.coffee | 23 ++++++++++++++++++++++- src/compile-cache.js | 8 ++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/spec/compile-cache-spec.coffee b/spec/compile-cache-spec.coffee index 8a6cc214e..848da6b49 100644 --- a/spec/compile-cache-spec.coffee +++ b/spec/compile-cache-spec.coffee @@ -81,6 +81,27 @@ describe 'CompileCache', -> waits(1) runs -> error = new Error("Oops again") - console.log error.stack expect(error.stack).toContain('compile-cache-spec.coffee') expect(Array.isArray(error.getRawStack())).toBe true + + it 'does not infinitely loop when the original prepareStackTrace value is reassigned', -> + originalPrepareStackTrace = Error.prepareStackTrace + + Error.prepareStackTrace = -> 'a-stack-trace' + Error.prepareStackTrace = originalPrepareStackTrace + + error = new Error('Oops') + expect(error.stack).toContain('compile-cache-spec.coffee') + expect(Array.isArray(error.getRawStack())).toBe true + + it 'does not infinitely loop when the assigned prepareStackTrace calls the original prepareStackTrace', -> + originalPrepareStackTrace = Error.prepareStackTrace + + Error.prepareStackTrace = (error, stack) -> + error.foo = 'bar' + originalPrepareStackTrace(error, stack) + + error = new Error('Oops') + expect(error.stack).toContain('compile-cache-spec.coffee') + expect(error.foo).toBe('bar') + expect(Array.isArray(error.getRawStack())).toBe true diff --git a/src/compile-cache.js b/src/compile-cache.js index aed72ee36..fde04a2f4 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -165,8 +165,12 @@ var prepareStackTraceWithSourceMapping = Error.prepareStackTrace let prepareStackTrace = prepareStackTraceWithSourceMapping function prepareStackTraceWithRawStackAssignment (error, frames) { - error.rawStack = frames - return prepareStackTrace(error, frames) + if (error.rawStack) { // avoid infinite recursion + return prepareStackTraceWithSourceMapping(error, frames) + } else { + error.rawStack = frames + return prepareStackTrace(error, frames) + } } Object.defineProperty(Error, 'prepareStackTrace', { From cd9bf67d988bc988a7ff90562762f11c19c91a66 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 8 Dec 2015 14:32:32 -0700 Subject: [PATCH 26/35] Fix bad merge. Oops. --- package.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/package.json b/package.json index 4904554c4..da93467d6 100644 --- a/package.json +++ b/package.json @@ -87,11 +87,7 @@ "dev-live-reload": "0.47.0", "encoding-selector": "0.21.0", "exception-reporting": "0.37.0", -<<<<<<< HEAD - "find-and-replace": "0.193.0", -======= "find-and-replace": "0.194.0", ->>>>>>> beta "fuzzy-finder": "0.93.0", "git-diff": "0.57.0", "go-to-line": "0.30.0", @@ -101,13 +97,8 @@ "keybinding-resolver": "0.33.0", "line-ending-selector": "0.3.0", "link": "0.31.0", -<<<<<<< HEAD "markdown-preview": "0.157.0", "metrics": "0.53.1", -======= - "markdown-preview": "0.156.1", - "metrics": "0.53.0", ->>>>>>> beta "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", @@ -125,15 +116,9 @@ "welcome": "0.33.0", "whitespace": "0.32.1", "wrap-guide": "0.38.1", -<<<<<<< HEAD "language-c": "0.51.0", "language-clojure": "0.19.0", "language-coffee-script": "0.46.0", -======= - "language-c": "0.49.0", - "language-clojure": "0.18.0", - "language-coffee-script": "0.45.0", ->>>>>>> beta "language-csharp": "0.11.0", "language-css": "0.36.0", "language-gfm": "0.82.0", From 14a440e0f1f43d3b174d3192d29e9f764ff6fc0f Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 8 Dec 2015 13:57:33 -0800 Subject: [PATCH 27/35] :arrow_up: one-dark/light-ui@v1.1.8 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index da93467d6..b002b05fd 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "atom-light-ui": "0.43.0", "base16-tomorrow-dark-theme": "1.0.0", "base16-tomorrow-light-theme": "1.0.0", - "one-dark-ui": "1.1.7", + "one-dark-ui": "1.1.8", "one-dark-syntax": "1.1.1", "one-light-syntax": "1.1.1", - "one-light-ui": "1.1.7", + "one-light-ui": "1.1.8", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", "about": "1.1.0", From bef0e5c99457811f0aa14349683cf24f093820d9 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 8 Dec 2015 14:39:14 -0800 Subject: [PATCH 28/35] Set mac version properly on beta --- build/tasks/set-version-task.coffee | 3 ++- script/set-version | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build/tasks/set-version-task.coffee b/build/tasks/set-version-task.coffee index 28abb6493..fc2382476 100644 --- a/build/tasks/set-version-task.coffee +++ b/build/tasks/set-version-task.coffee @@ -29,6 +29,7 @@ module.exports = (grunt) -> return appDir = grunt.config.get('atom.appDir') + shellAppDir = grunt.config.get('atom.shellAppDir') # Replace version field of package.json. packageJsonPath = path.join(appDir, 'package.json') @@ -39,7 +40,7 @@ module.exports = (grunt) -> if process.platform is 'darwin' cmd = 'script/set-version' - args = [grunt.config.get('atom.buildDir'), version] + args = [shellAppDir, version] spawn {cmd, args}, (error, result, code) -> done(error) else if process.platform is 'win32' shellAppDir = grunt.config.get('atom.shellAppDir') diff --git a/script/set-version b/script/set-version index 7cad26799..33dec9d77 100755 --- a/script/set-version +++ b/script/set-version @@ -2,10 +2,11 @@ set -e -BUILT_PRODUCTS_DIR=$1 +SHELL_APP_DIR=$1 VERSION=$2 -PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Info.plist" -HELPER_PLIST_PATH="$BUILT_PRODUCTS_DIR/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/Info.plist" + +PLIST_PATH="$SHELL_APP_DIR/Contents/Info.plist" +HELPER_PLIST_PATH="$SHELL_APP_DIR/Contents/Frameworks/Atom Helper.app/Contents/Info.plist" # Update version /usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$PLIST_PATH" From efe33d69fd2be94f5bbff22d4700e6a59c8781b9 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 8 Dec 2015 16:09:58 -0700 Subject: [PATCH 29/35] Back to 1.3.0-beta7 because it wasn't published --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29a0c59a2..48a1431f6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.0-beta8", + "version": "1.3.0-beta7", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From 80faae4add608029a79edf8df5f9c277420f4c13 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 8 Dec 2015 22:30:28 -0500 Subject: [PATCH 30/35] :arrow_up: language-c@0.51.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b002b05fd..30452701a 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "welcome": "0.33.0", "whitespace": "0.32.1", "wrap-guide": "0.38.1", - "language-c": "0.51.0", + "language-c": "0.51.1", "language-clojure": "0.19.0", "language-coffee-script": "0.46.0", "language-csharp": "0.11.0", From b3b8b8d5639bb88eac296a0a29a7ae02c4b1d55e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 9 Dec 2015 08:31:31 +0100 Subject: [PATCH 31/35] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 30452701a..50e4d4d09 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "service-hub": "^0.7.0", "source-map-support": "^0.3.2", "temp": "0.8.1", - "text-buffer": "8.0.9", + "text-buffer": "8.1.1", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 9dd61ca7e6466eae22f434a26389eb3c6bd98238 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 9 Dec 2015 08:37:54 +0100 Subject: [PATCH 32/35] :memo: Mention switching encoding speedup --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 057b8bcf3..f983b699c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,3 +10,4 @@ See https://atom.io/releases * Fixed an issue where characters were inserted when toggling the settings view on some keyboard layouts. * Modules can now temporarily override `Error.prepareStackTrace`. There is also an `Error.prototype.getRawStack()` method if you just need access to the raw v8 trace structure. * Fixed a problem that caused blurry fonts on monitors that have a slightly higher resolution than 96 DPI. +* Switching encoding is now fast also with large files. From 02b2f06ae1006c98572431ff2f6a719acf7ec63d Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 9 Dec 2015 08:38:35 +0100 Subject: [PATCH 33/35] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f983b699c..68113c1ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,4 +10,7 @@ See https://atom.io/releases * Fixed an issue where characters were inserted when toggling the settings view on some keyboard layouts. * Modules can now temporarily override `Error.prepareStackTrace`. There is also an `Error.prototype.getRawStack()` method if you just need access to the raw v8 trace structure. * Fixed a problem that caused blurry fonts on monitors that have a slightly higher resolution than 96 DPI. + +## 1.4.0 + * Switching encoding is now fast also with large files. From f709c43159df2702d0763b7ab631b8d05c8ceb49 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 9 Dec 2015 08:40:06 +0100 Subject: [PATCH 34/35] Reorder changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68113c1ec..b841c0e78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ See https://atom.io/releases +## 1.4.0 + +* Switching encoding is now fast also with large files. + ## 1.3.0 * The tree-view now sorts directory entries more naturally, in a locale-sensitive way. @@ -10,7 +14,3 @@ See https://atom.io/releases * Fixed an issue where characters were inserted when toggling the settings view on some keyboard layouts. * Modules can now temporarily override `Error.prepareStackTrace`. There is also an `Error.prototype.getRawStack()` method if you just need access to the raw v8 trace structure. * Fixed a problem that caused blurry fonts on monitors that have a slightly higher resolution than 96 DPI. - -## 1.4.0 - -* Switching encoding is now fast also with large files. From 38b72dc156112eb5d836f94ec924abbd3a09e553 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 9 Dec 2015 08:41:34 +0100 Subject: [PATCH 35/35] :memo: Mention reloading keymaps fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b841c0e78..e00c92c86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ See https://atom.io/releases ## 1.4.0 * Switching encoding is now fast also with large files. +* Fixed an issue where disabling and re-enabling a package caused custom keymaps to be overridden. ## 1.3.0