Merge remote-tracking branch 'origin/master' into ns-teleditor

This commit is contained in:
Nathan Sobo
2013-12-10 19:10:09 -08:00
10 changed files with 187 additions and 60 deletions

View File

@@ -66,7 +66,7 @@ directory, which contains CoffeeScript-style JSON:
```coffeescript
core:
hideGitIgnoredFiles: true
excludeVcsIgnoredPaths: true
editor:
fontSize: 18
```
@@ -79,7 +79,6 @@ namespaces: `core` and `editor`.
- `core`
- `disabledPackages`: An array of package names to disable
- `excludeVcsIgnoredPaths`: Don't search within files specified by _.gitignore_
- `hideGitIgnoredFiles`: Whether files in the _.gitignore_ should be hidden
- `ignoredNames`: File names to ignore across all of Atom
- `projectHome`: The directory where projects are assumed to be located
- `themes`: An array of theme names to load, in cascading order

39
docs/setting-up-travis.md Normal file
View File

@@ -0,0 +1,39 @@
# Setting up Travis CI
Packages under the [atom org][atom-org] should use [Travis CI][travis-ci] for
builds.
Currently we have a [Travis Pro][travis-pro] account since the repositories
are private. This process will be simpler and have fewer steps once the
package repos are made public.
Each package builds using the [build-package][build-package] script, any
changes to the build should be made in that script and will affect all
package builds immediately.
Each package builds against the latest successful build of atom@master. The
master builds are stored in the [atom-master-builds][atom-master-builds] repo
as releases named by the SHA-1 built.
## Configuring a package
* Run `cd ~/github/my-package` to navigate to the package repo locally
* Run `apm test` to verify that the package currently builds via [apm][apm]
* Add the package repo to the [Travis CI team][travis-ci-team]
* Run `gem install travis` to install the [travis gem][travis-gem]
* Run `travis login --pro` and log in using the [atom-build][atom-build] user
and the password from the *Shared-Developers* folder in LastPass
* Run `apm ci` to add a `.travis.yml` file to the repo and to configure Travis
* Log into [Travis][travis-ci] as the `atom-build` user and you should now see
the package listed and building
[apm]: https://github.com/atom/apm
[build-package]: https://github.com/atom/apm/blob/master/script/build-package
[atom-build]: https://github.com/atom-build
[atom-master-builds]: https://github.com/atom/atom-master-builds/releases
[atom-org]: https://github.com/atom
[travis-ci]: https://magnum.travis-ci.com
[travis-ci-team]: https://github.com/organizations/atom/teams/596636
[travis-gem]: https://rubygems.org/gems/travis
[travis-pro]: http://about.travis-ci.org/docs/user/travis-pro

View File

@@ -45,7 +45,7 @@
"space-pen": "2.0.1",
"telepath": "0.66.0",
"temp": "0.5.0",
"underscore-plus": "0.3.0"
"underscore-plus": "0.5.0"
},
"devDependencies": {
"biscotto": "0.0.17",
@@ -69,13 +69,14 @@
"request": "~2.27.0",
"unzip": "~0.1.9",
"rcedit": "~0.1.2",
"rimraf": "~2.2.2"
"rimraf": "~2.2.2",
"github-releases": "~0.2.0"
},
"packageDependencies": {
"atom-dark-syntax": "0.8.0",
"atom-dark-ui": "0.13.0",
"atom-dark-ui": "0.15.0",
"atom-light-syntax": "0.9.0",
"atom-light-ui": "0.13.0",
"atom-light-ui": "0.15.0",
"base16-tomorrow-dark-theme": "0.7.0",
"solarized-dark-syntax": "0.5.0",
"archive-view": "0.16.0",
@@ -85,7 +86,7 @@
"bookmarks": "0.15.0",
"bracket-matcher": "0.15.0",
"command-logger": "0.8.0",
"command-palette": "0.11.0",
"command-palette": "0.13.0",
"dev-live-reload": "0.18.0",
"editor-stats": "0.8.0",
"exception-reporting": "0.8.0",
@@ -101,14 +102,14 @@
"keybinding-resolver": "0.6.0",
"link": "0.11.0",
"markdown-preview": "0.22.0",
"metrics": "0.14.0",
"metrics": "0.15.0",
"package-generator": "0.23.0",
"release-notes": "0.15.0",
"settings-view": "0.50.0",
"snippets": "0.17.0",
"spell-check": "0.17.0",
"status-bar": "0.24.0",
"styleguide": "0.17.0",
"styleguide": "0.18.0",
"symbols-view": "0.27.0",
"tabs": "0.15.0",
"terminal": "0.23.0",
@@ -129,7 +130,7 @@
"language-html": "0.2.0",
"language-hyperlink": "0.3.0",
"language-java": "0.2.0",
"language-javascript": "0.3.0",
"language-javascript": "0.4.0",
"language-json": "0.2.0",
"language-less": "0.1.0",
"language-make": "0.1.0",
@@ -152,7 +153,7 @@
"language-toml": "0.7.0",
"language-xml": "0.2.0",
"language-yaml": "0.1.0",
"grunt-download-atom-shell": "0.1.3"
"grunt-download-atom-shell": "0.2.0"
},
"private": true,
"scripts": {

View File

@@ -22,17 +22,11 @@ function executeCommands(commands, done, index) {
done(null);
}
// Join multiple commands into one line.
function joinCommands() {
var commandSeparator = process.platform == 'win32' ? '&' : ';';
return Array.prototype.slice.call(arguments, 0).join(commandSeparator);
}
var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
'git submodule --quiet update --recursive --init',
{command: joinCommands('cd vendor/apm', 'npm install --silent .'), options: {ignoreStdout: true}},
{command: 'npm install --silent .', options: {cwd: path.resolve(__dirname, '..', 'vendor', 'apm'), ignoreStdout: true}},
{command: 'npm install --silent vendor/apm', options: {ignoreStdout: true}},
echoNewLine,
'node node_modules/atom-package-manager/bin/apm clean',

View File

@@ -33,6 +33,7 @@ cp.safeExec.bind(global, 'node script/bootstrap', function(error) {
require('rimraf').bind(global, path.join(homeDir, '.atom')),
cp.safeExec.bind(global, 'git clean -dff'),
cp.safeExec.bind(global, 'node node_modules/grunt-cli/bin/grunt ci --stack --no-color'),
cp.safeExec.bind(global, 'node_modules/.bin/coffee script/upload-release')
], function(error) {
process.exit(error ? 1 : 0);
});

122
script/upload-release Executable file
View File

@@ -0,0 +1,122 @@
#!/usr/bin/env coffee
return if process.env.JANKY_SHA1 and process.env.JANKY_BRANCH isnt 'master'
child_process = require 'child_process'
path = require 'path'
_ = require 'underscore-plus'
fs = require 'fs-plus'
GitHub = require 'github-releases'
request = require 'request'
assetName = 'atom-mac.zip'
assetPath = "/tmp/atom-build/#{assetName}"
commitSha = process.env.JANKY_SHA1
token = process.env.ATOM_ACCESS_TOKEN
defaultHeaders =
Authorization: "token #{token}"
'User-Agent': 'Atom'
zipApp = (callback) ->
fs.removeSync(assetPath)
options = {cwd: path.dirname(assetPath), maxBuffer: Infinity}
child_process.exec "zip -r --symlinks #{assetName} Atom.app", options, (error, stdout, stderr) ->
if error?
console.error('Zipping Atom.app failed', error, stderr)
process.exit(1)
else
callback()
getRelease = (callback) ->
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'GET'
headers: defaultHeaders
json: true
request options, (error, response, releases=[]) ->
if error? or response.statusCode isnt 200
console.error('Fetching releases failed', error, releases)
process.exit(1)
else
for release in releases when release.name is commitSha
callback(release)
return
callback()
deleteExistingAsset = (release, callback) ->
for asset in release.assets when asset.name is assetName
options =
uri: asset.url
method: 'DELETE'
headers: defaultHeaders
request options, (error, response, body='') ->
if error? or response.statusCode isnt 204
console.error('Deleting existing release asset failed', error, body)
process.exit(1)
else
callback()
return
callback()
createRelease = (callback) ->
getRelease (release) ->
if release?
deleteExistingAsset release, ->
callback(release)
return
options =
uri: 'https://api.github.com/repos/atom/atom-master-builds/releases'
method: 'POST'
headers: defaultHeaders
json:
tag_name: "v#{commitSha}"
target_commitish: 'master'
name: commitSha
body: "Build of [atom@#{commitSha.substring(0, 7)}](https://github.com/atom/atom/commit/#{commitSha})"
draft: true
request options, (error, response, release={}) ->
if error? or response.statusCode isnt 201
console.error('Creating release failed', error, release)
process.exit(1)
else
callback(release)
uploadAsset = (release, callback) ->
options =
uri: "https://uploads.github.com/repos/atom/atom-master-builds/releases/#{release.id}/assets?name=#{assetName}"
method: 'POST'
headers: _.extend({
'Content-Type': 'application/zip'
'Content-Length': fs.getSizeSync(assetPath)
}, defaultHeaders)
assetRequest = request options, (error, response, body='') ->
if error? or response.statusCode >= 400
console.error('Upload release asset failed', error, body)
process.exit(1)
else
callback(release)
fs.createReadStream(assetPath).pipe(assetRequest)
publishRelease = (release) ->
options =
uri: release.url
method: 'POST'
headers: defaultHeaders
json:
draft: false
request options, (error, response, body={}) ->
if error? or response.statusCode isnt 200
console.error('Creating release failed', error, body)
process.exit(1)
createRelease (release) ->
zipApp ->
uploadAsset release, ->
publishRelease release

View File

@@ -53,15 +53,15 @@ describe "SpacePen extensions", ->
expect(eventHandler).toHaveBeenCalled()
describe "tooltips", ->
describe "replaceModifiers", ->
replaceModifiers = $.fn.setTooltip.replaceModifiers
describe "humanizeKeystrokes", ->
humanizeKeystrokes = $.fn.setTooltip.humanizeKeystrokes
it "replaces single keystroke", ->
expect(replaceModifiers('cmd-O')).toEqual '⌘⇧O'
expect(replaceModifiers('cmd-shift-up')).toEqual '⌘⇧↑'
expect(replaceModifiers('cmd-option-down')).toEqual '⌘⌥↓'
expect(replaceModifiers('cmd-option-left')).toEqual '⌘⌥←'
expect(replaceModifiers('cmd-option-right')).toEqual '⌘⌥→'
expect(humanizeKeystrokes('cmd-O')).toEqual '⌘⇧O'
expect(humanizeKeystrokes('cmd-shift-up')).toEqual '⌘⇧↑'
expect(humanizeKeystrokes('cmd-option-down')).toEqual '⌘⌥↓'
expect(humanizeKeystrokes('cmd-option-left')).toEqual '⌘⌥←'
expect(humanizeKeystrokes('cmd-option-right')).toEqual '⌘⌥→'
it "replaces multiple keystroke", ->
expect(replaceModifiers('cmd-o ctrl-2')).toEqual '⌘O ⌃2'
expect(humanizeKeystrokes('cmd-o ctrl-2')).toEqual '⌘O ⌃2'

View File

@@ -24,41 +24,14 @@ tooltipDefaults =
placement: 'auto top'
viewportPadding: 2
modifiers =
cmd: ''
ctrl: ''
alt: ''
option: ''
shift: ''
enter: ''
left: ''
right: ''
up: ''
down: ''
replaceKey = (key) ->
if modifiers[key]
modifiers[key]
else if key.length == 1 and key == key.toUpperCase() and key.toUpperCase() != key.toLowerCase()
[modifiers.shift, key.toUpperCase()]
else if key.length == 1
key.toUpperCase()
else
key
replaceModifiersInSingleKeystroke = (keystroke) ->
keys = keystroke.split('-')
keys = _.flatten(replaceKey(key) for key in keys)
keys.join('')
replaceModifiers = (keystroke) ->
humanizeKeystrokes = (keystroke) ->
keystrokes = keystroke.split(' ')
keystrokes = (replaceModifiersInSingleKeystroke(stroke) for stroke in keystrokes)
keystrokes = (_.humanizeKeystroke(stroke) for stroke in keystrokes)
keystrokes.join(' ')
getKeystroke = (bindings) ->
if bindings?.length
"<span class=\"keystroke\">#{replaceModifiers(bindings[0].keystroke)}</span>"
"<span class=\"keystroke\">#{humanizeKeystrokes(bindings[0].keystroke)}</span>"
else
''
# options from http://getbootstrap.com/javascript/#tooltips
@@ -87,6 +60,6 @@ jQuery.fn.destroyTooltip = ->
@tooltip('destroy')
jQuery.fn.setTooltip.getKeystroke = getKeystroke
jQuery.fn.setTooltip.replaceModifiers = replaceModifiers
jQuery.fn.setTooltip.humanizeKeystrokes = humanizeKeystrokes
module.exports = spacePen

View File

@@ -122,8 +122,6 @@ class WorkspaceView extends View
@command 'window:save-all', => @saveAll()
@command 'window:toggle-invisibles', =>
atom.config.toggle("editor.showInvisibles")
@command 'window:toggle-ignored-files', =>
atom.config.toggle("core.hideGitIgnoredFiles")
@command 'window:toggle-auto-indent', =>
atom.config.toggle("editor.autoIndent")

2
vendor/apm vendored

Submodule vendor/apm updated: 007cf26433...82f6475111