mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Merge pull request #1012 from atom/ks-atom-dot-io
Install packages from atom.io
This commit is contained in:
119
package.json
119
package.json
@@ -39,12 +39,34 @@
|
||||
"space-pen": "2.0.0",
|
||||
"telepath": "0.8.1",
|
||||
"temp": "0.5.0",
|
||||
"underscore-plus": "0.2.0",
|
||||
|
||||
"atom-light-ui": "0.4.0",
|
||||
"atom-light-syntax": "0.4.0",
|
||||
"atom-dark-ui": "0.4.0",
|
||||
"atom-dark-syntax": "0.4.0",
|
||||
"underscore-plus": "0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"biscotto": "0.0.17",
|
||||
"formidable": "~1.0.14",
|
||||
"fstream": "0.1.24",
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-cli": "~0.1.9",
|
||||
"grunt-coffeelint": "0.0.6",
|
||||
"grunt-lesslint": "0.13.0",
|
||||
"grunt-cson": "0.5.0",
|
||||
"grunt-contrib-csslint": "~0.1.2",
|
||||
"grunt-contrib-coffee": "~0.7.0",
|
||||
"grunt-contrib-less": "~0.6.4",
|
||||
"walkdir": "0.0.7",
|
||||
"ws": "0.4.27",
|
||||
"js-yaml": "~2.1.0",
|
||||
"grunt-markdown": "~0.4.0",
|
||||
"json-front-matter": "~0.1.3",
|
||||
"grunt-shell": "~0.3.1",
|
||||
"jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks",
|
||||
"request": "~2.27.0"
|
||||
},
|
||||
"packageDependencies" : {
|
||||
"atom-light-ui": "0.5.0",
|
||||
"atom-light-syntax": "0.5.0",
|
||||
"atom-dark-ui": "0.5.0",
|
||||
"atom-dark-syntax": "0.5.0",
|
||||
"base16-tomorrow-dark-theme": "0.2.0",
|
||||
"solarized-dark-syntax": "0.3.0",
|
||||
|
||||
@@ -53,7 +75,7 @@
|
||||
"autoflow": "0.5.0",
|
||||
"bookmarks": "0.8.0",
|
||||
"bracket-matcher": "0.7.0",
|
||||
"collaboration": "0.26.0",
|
||||
"collaboration": "0.28.0",
|
||||
"command-logger": "0.6.0",
|
||||
"command-palette": "0.5.0",
|
||||
"dev-live-reload": "0.8.0",
|
||||
@@ -88,58 +110,37 @@
|
||||
"whitespace": "0.7.0",
|
||||
"wrap-guide": "0.4.0",
|
||||
|
||||
"c-tmbundle": "1.0.0",
|
||||
"coffee-script-tmbundle": "1.0.0",
|
||||
"css-tmbundle": "1.0.0",
|
||||
"git-tmbundle": "1.0.0",
|
||||
"go-tmbundle": "1.0.0",
|
||||
"html-tmbundle": "1.0.0",
|
||||
"hyperlink-helper-tmbundle": "1.0.0",
|
||||
"java-tmbundle": "1.0.0",
|
||||
"javascript-tmbundle": "2.0.0",
|
||||
"json-tmbundle": "1.0.0",
|
||||
"less-tmbundle": "1.0.0",
|
||||
"make-tmbundle": "1.0.0",
|
||||
"mustache-tmbundle": "1.0.0",
|
||||
"objective-c-tmbundle": "1.0.0",
|
||||
"pegjs-tmbundle": "1.0.0",
|
||||
"perl-tmbundle": "1.0.0",
|
||||
"php-tmbundle": "1.0.0",
|
||||
"property-list-tmbundle": "1.0.0",
|
||||
"puppet-textmate-tmbundle": "1.0.0",
|
||||
"python-tmbundle": "1.0.0",
|
||||
"ruby-on-rails-tmbundle": "1.0.0",
|
||||
"ruby-tmbundle": "1.0.0",
|
||||
"sass-tmbundle": "1.0.0",
|
||||
"shellscript-tmbundle": "1.0.0",
|
||||
"source-tmbundle": "1.0.0",
|
||||
"sql-tmbundle": "1.0.0",
|
||||
"text-tmbundle": "1.0.0",
|
||||
"textmate-clojure": "1.0.0",
|
||||
"todo-tmbundle": "1.0.0",
|
||||
"xml-tmbundle": "1.0.0",
|
||||
"yaml-tmbundle": "1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"biscotto": "0.0.17",
|
||||
"formidable": "~1.0.14",
|
||||
"fstream": "0.1.24",
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-cli": "~0.1.9",
|
||||
"grunt-coffeelint": "0.0.6",
|
||||
"grunt-lesslint": "0.13.0",
|
||||
"grunt-cson": "0.5.0",
|
||||
"grunt-contrib-csslint": "~0.1.2",
|
||||
"grunt-contrib-coffee": "~0.7.0",
|
||||
"grunt-contrib-less": "~0.6.4",
|
||||
"walkdir": "0.0.7",
|
||||
"ws": "0.4.27",
|
||||
"js-yaml": "~2.1.0",
|
||||
"grunt-markdown": "~0.4.0",
|
||||
"json-front-matter": "~0.1.3",
|
||||
"grunt-shell": "~0.3.1",
|
||||
"jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks",
|
||||
"request": "~2.27.0"
|
||||
"language-c": "0.1.0",
|
||||
"language-clojure": "0.1.0",
|
||||
"language-coffee-script": "0.1.0",
|
||||
"language-css": "0.1.0",
|
||||
"language-git": "0.1.0",
|
||||
"language-go": "0.2.0",
|
||||
"language-html": "0.1.0",
|
||||
"language-hyperlink": "0.2.0",
|
||||
"language-java": "0.1.0",
|
||||
"language-javascript": "0.1.0",
|
||||
"language-json": "0.1.0",
|
||||
"language-less": "0.1.0",
|
||||
"language-make": "0.1.0",
|
||||
"language-mustache": "0.1.0",
|
||||
"language-objective-c": "0.1.0",
|
||||
"language-pegjs": "0.1.0",
|
||||
"language-perl": "0.1.0",
|
||||
"language-php": "0.1.0",
|
||||
"language-property-list": "0.2.0",
|
||||
"language-puppet": "0.1.0",
|
||||
"language-python": "0.1.0",
|
||||
"language-ruby-on-rails": "0.2.0",
|
||||
"language-ruby": "0.2.0",
|
||||
"language-sass": "0.2.0",
|
||||
"language-shellscript": "0.1.0",
|
||||
"language-source": "0.1.0",
|
||||
"language-sql": "0.1.0",
|
||||
"language-text": "0.1.0",
|
||||
"language-todo": "0.2.0",
|
||||
"language-xml": "0.1.0",
|
||||
"language-yaml": "0.1.0"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -27,15 +27,14 @@ function readEnvironmentVariables(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
cp.safeExec('node script/bootstrap', function() {
|
||||
var async = require('async');
|
||||
async.series([
|
||||
readEnvironmentVariables,
|
||||
require('rimraf').bind(global, path.join(homeDir, '.atom')),
|
||||
cp.safeExec.bind(global, 'git clean -dff'),
|
||||
cp.safeExec.bind(global, 'node node_modules/.bin/apm clean'),
|
||||
cp.safeExec.bind(global, 'node node_modules/.bin/grunt ci --stack --no-color'),
|
||||
], function(error) {
|
||||
process.exit(error ? 1 : 0);
|
||||
});
|
||||
var async = require('async');
|
||||
async.series([
|
||||
readEnvironmentVariables,
|
||||
cp.safeExec.bind(global, 'node script/bootstrap'),
|
||||
require('rimraf').bind(global, path.join(homeDir, '.atom')),
|
||||
cp.safeExec.bind(global, 'git clean -dff'),
|
||||
cp.safeExec.bind(global, 'node node_modules/.bin/apm clean'),
|
||||
cp.safeExec.bind(global, 'node node_modules/.bin/grunt ci --stack --no-color'),
|
||||
], function(error) {
|
||||
process.exit(error ? 1 : 0);
|
||||
});
|
||||
|
||||
@@ -239,12 +239,12 @@ describe "the `atom` global", ->
|
||||
describe "textmate packages", ->
|
||||
it "loads the package's grammars", ->
|
||||
expect(syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
expect(syntax.selectGrammar("file.rb").name).toBe "Ruby"
|
||||
|
||||
it "translates the package's scoped properties to Atom terms", ->
|
||||
expect(syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBeUndefined()
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
expect(syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBe '# '
|
||||
|
||||
describe "when the package has no grammars but does have preferences", ->
|
||||
@@ -327,12 +327,12 @@ describe "the `atom` global", ->
|
||||
describe "textmate packages", ->
|
||||
it "removes the package's grammars", ->
|
||||
expect(syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
expect(syntax.selectGrammar("file.rb").name).toBe "Ruby"
|
||||
atom.deactivatePackage('ruby-tmbundle')
|
||||
atom.deactivatePackage('language-ruby')
|
||||
expect(syntax.selectGrammar("file.rb").name).toBe "Null Grammar"
|
||||
|
||||
it "removes the package's scoped properties", ->
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.deactivatePackage('ruby-tmbundle')
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
atom.deactivatePackage('language-ruby')
|
||||
expect(syntax.getProperty(['.source.ruby'], 'editor.commentStart')).toBeUndefined()
|
||||
|
||||
@@ -5,7 +5,7 @@ describe "DisplayBuffer", ->
|
||||
[displayBuffer, buffer, changeHandler, tabLength] = []
|
||||
beforeEach ->
|
||||
tabLength = 2
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
buffer = project.bufferForPathSync('sample.js')
|
||||
displayBuffer = new DisplayBuffer({buffer, tabLength})
|
||||
changeHandler = jasmine.createSpy 'changeHandler'
|
||||
|
||||
@@ -16,7 +16,7 @@ describe "EditSession", ->
|
||||
|
||||
describe "with default options", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
editSession = project.openSync('sample.js', autoIndent: false)
|
||||
buffer = editSession.buffer
|
||||
lineLengths = buffer.getLines().map (line) -> line.length
|
||||
|
||||
@@ -6,8 +6,8 @@ describe "Editor", ->
|
||||
[buffer, editor, editSession, cachedLineHeight, cachedCharWidth] = []
|
||||
|
||||
beforeEach ->
|
||||
atom.activatePackage('text-tmbundle', sync: true)
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-text', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
editSession = project.openSync('sample.js')
|
||||
buffer = editSession.buffer
|
||||
editor = new Editor(editSession)
|
||||
|
||||
@@ -6,7 +6,7 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "javascript", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
editSession = project.openSync('sample.js', autoIndent: false)
|
||||
{buffer, languageMode} = editSession
|
||||
|
||||
@@ -97,7 +97,7 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "coffeescript", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('coffee-script-tmbundle', sync: true)
|
||||
atom.activatePackage('language-coffee-script', sync: true)
|
||||
editSession = project.openSync('coffee.coffee', autoIndent: false)
|
||||
{buffer, languageMode} = editSession
|
||||
|
||||
@@ -144,7 +144,7 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "css", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('css-tmbundle', sync: true)
|
||||
atom.activatePackage('language-css', sync: true)
|
||||
editSession = project.openSync('css.css', autoIndent: false)
|
||||
{buffer, languageMode} = editSession
|
||||
|
||||
@@ -185,8 +185,8 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "less", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('less-tmbundle', sync: true)
|
||||
atom.activatePackage('css-tmbundle', sync: true)
|
||||
atom.activatePackage('language-less', sync: true)
|
||||
atom.activatePackage('language-css', sync: true)
|
||||
editSession = project.openSync('sample.less', autoIndent: false)
|
||||
{buffer, languageMode} = editSession
|
||||
|
||||
@@ -197,7 +197,7 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "folding", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
editSession = project.openSync('sample.js', autoIndent: false)
|
||||
{buffer, languageMode} = editSession
|
||||
|
||||
@@ -287,7 +287,7 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "folding with comments", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
editSession = project.openSync('sample-with-comments.js', autoIndent: false)
|
||||
{buffer, languageMode} = editSession
|
||||
|
||||
@@ -340,8 +340,8 @@ describe "LanguageMode", ->
|
||||
|
||||
describe "css", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('source-tmbundle', sync: true)
|
||||
atom.activatePackage('css-tmbundle', sync: true)
|
||||
atom.activatePackage('language-source', sync: true)
|
||||
atom.activatePackage('language-css', sync: true)
|
||||
editSession = project.openSync('css.css', autoIndent: true)
|
||||
|
||||
describe "suggestedIndentForBufferRow", ->
|
||||
|
||||
@@ -5,10 +5,10 @@ TextMateGrammar = require '../src/text-mate-grammar'
|
||||
|
||||
describe "the `syntax` global", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('text-tmbundle', sync: true)
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('coffee-script-tmbundle', sync: true)
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.activatePackage('language-text', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
atom.activatePackage('language-coffee-script', sync: true)
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
|
||||
describe "serialization", ->
|
||||
it "remembers grammar overrides by path", ->
|
||||
@@ -21,7 +21,7 @@ describe "the `syntax` global", ->
|
||||
|
||||
describe ".selectGrammar(filePath)", ->
|
||||
it "can use the filePath to load the correct grammar based on the grammar's filetype", ->
|
||||
atom.activatePackage('git-tmbundle', sync: true)
|
||||
atom.activatePackage('language-git', sync: true)
|
||||
|
||||
expect(syntax.selectGrammar("file.js").name).toBe "JavaScript" # based on extension (.js)
|
||||
expect(syntax.selectGrammar(path.join(temp.dir, '.git', 'config')).name).toBe "Git Config" # based on end of the path (.git/config)
|
||||
@@ -34,7 +34,7 @@ describe "the `syntax` global", ->
|
||||
expect(syntax.selectGrammar(filePath).name).toBe "Ruby"
|
||||
|
||||
it "uses the number of newlines in the first line regex to determine the number of lines to test against", ->
|
||||
atom.activatePackage('property-list-tmbundle', sync: true)
|
||||
atom.activatePackage('language-property-list', sync: true)
|
||||
|
||||
fileContent = "first-line\n<html>"
|
||||
expect(syntax.selectGrammar("dummy.coffee", fileContent).name).toBe "CoffeeScript"
|
||||
|
||||
@@ -6,13 +6,13 @@ describe "TextMateGrammar", ->
|
||||
grammar = null
|
||||
|
||||
beforeEach ->
|
||||
atom.activatePackage('text-tmbundle', sync: true)
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('coffee-script-tmbundle', sync: true)
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.activatePackage('html-tmbundle', sync: true)
|
||||
atom.activatePackage('php-tmbundle', sync: true)
|
||||
atom.activatePackage('python-tmbundle', sync: true)
|
||||
atom.activatePackage('language-text', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
atom.activatePackage('language-coffee-script', sync: true)
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
atom.activatePackage('language-html', sync: true)
|
||||
atom.activatePackage('language-php', sync: true)
|
||||
atom.activatePackage('language-python', sync: true)
|
||||
grammar = syntax.selectGrammar("hello.coffee")
|
||||
|
||||
describe "@loadSync(path)", ->
|
||||
@@ -211,8 +211,8 @@ describe "TextMateGrammar", ->
|
||||
describe "when the pattern includes rules from another grammar", ->
|
||||
describe "when a grammar matching the desired scope is available", ->
|
||||
it "parses tokens inside the begin/end patterns based on the included grammar's rules", ->
|
||||
atom.activatePackage('html-tmbundle', sync: true)
|
||||
atom.activatePackage('ruby-on-rails-tmbundle', sync: true)
|
||||
atom.activatePackage('language-html', sync: true)
|
||||
atom.activatePackage('language-ruby-on-rails', sync: true)
|
||||
|
||||
grammar = syntax.grammarForScopeName('text.html.ruby')
|
||||
{tokens} = grammar.tokenizeLine("<div class='name'><%= User.find(2).full_name %></div>")
|
||||
@@ -242,8 +242,8 @@ describe "TextMateGrammar", ->
|
||||
expect(tokens[22]).toEqual value: '>', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.end.html"]
|
||||
|
||||
it "updates the grammar if the included grammar is updated later", ->
|
||||
atom.activatePackage('html-tmbundle', sync: true)
|
||||
atom.activatePackage('ruby-on-rails-tmbundle', sync: true)
|
||||
atom.activatePackage('language-html', sync: true)
|
||||
atom.activatePackage('language-ruby-on-rails', sync: true)
|
||||
|
||||
grammar = syntax.selectGrammar('foo.html.erb')
|
||||
grammarUpdatedHandler = jasmine.createSpy("grammarUpdatedHandler")
|
||||
@@ -252,7 +252,7 @@ describe "TextMateGrammar", ->
|
||||
{tokens} = grammar.tokenizeLine("<div class='name'><% <<-SQL select * from users;")
|
||||
expect(tokens[12].value).toBe " select * from users;"
|
||||
|
||||
atom.activatePackage('sql-tmbundle', sync: true)
|
||||
atom.activatePackage('language-sql', sync: true)
|
||||
expect(grammarUpdatedHandler).toHaveBeenCalled()
|
||||
{tokens} = grammar.tokenizeLine("<div class='name'><% <<-SQL select * from users;")
|
||||
expect(tokens[12].value).toBe " "
|
||||
@@ -260,8 +260,8 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "when a grammar matching the desired scope is unavailable", ->
|
||||
it "updates the grammar if a matching grammar is added later", ->
|
||||
atom.deactivatePackage('html-tmbundle')
|
||||
atom.activatePackage('ruby-on-rails-tmbundle', sync: true)
|
||||
atom.deactivatePackage('language-html')
|
||||
atom.activatePackage('language-ruby-on-rails', sync: true)
|
||||
|
||||
grammar = syntax.grammarForScopeName('text.html.ruby')
|
||||
{tokens} = grammar.tokenizeLine("<div class='name'><%= User.find(2).full_name %></div>")
|
||||
@@ -270,7 +270,7 @@ describe "TextMateGrammar", ->
|
||||
expect(tokens[2]).toEqual value: ' ', scopes: ["text.html.ruby","source.ruby.rails.embedded.html"]
|
||||
expect(tokens[3]).toEqual value: 'User', scopes: ["text.html.ruby","source.ruby.rails.embedded.html","support.class.ruby"]
|
||||
|
||||
atom.activatePackage('html-tmbundle', sync: true)
|
||||
atom.activatePackage('language-html', sync: true)
|
||||
{tokens} = grammar.tokenizeLine("<div class='name'><%= User.find(2).full_name %></div>")
|
||||
expect(tokens[0]).toEqual value: '<', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.begin.html"]
|
||||
expect(tokens[1]).toEqual value: 'div', scopes: ["text.html.ruby","meta.tag.block.any.html","entity.name.tag.block.any.html"]
|
||||
@@ -314,7 +314,7 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "when inside a C block", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('c-tmbundle', sync: true)
|
||||
atom.activatePackage('language-c', sync: true)
|
||||
|
||||
it "correctly parses a method. (regression)", ->
|
||||
grammar = syntax.selectGrammar("hello.c")
|
||||
@@ -339,7 +339,7 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "when a grammar has a pattern that has back references in the match value", ->
|
||||
it "does not special handle the back references and instead allows oniguruma to resolve them", ->
|
||||
atom.activatePackage('sass-tmbundle', sync: true)
|
||||
atom.activatePackage('language-sass', sync: true)
|
||||
grammar = syntax.selectGrammar("style.scss")
|
||||
{tokens} = grammar.tokenizeLine("@mixin x() { -moz-selector: whatever; }")
|
||||
expect(tokens[9]).toEqual value: "-moz-selector", scopes: ["source.css.scss", "meta.property-list.scss", "meta.property-name.scss"]
|
||||
@@ -428,14 +428,14 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "when the grammar's pattern name has a group number in it", ->
|
||||
it "replaces the group number with the matched captured text", ->
|
||||
atom.activatePackage('hyperlink-helper-tmbundle', sync: true)
|
||||
atom.activatePackage('language-hyperlink', sync: true)
|
||||
grammar = syntax.grammarForScopeName("text.hyperlink")
|
||||
{tokens} = grammar.tokenizeLine("https://github.com")
|
||||
expect(tokens[0].scopes).toEqual ["text.hyperlink", "markup.underline.link.https.hyperlink"]
|
||||
|
||||
describe "when the grammar has an injection selector", ->
|
||||
it "includes the grammar's patterns when the selector matches the current scope in other grammars", ->
|
||||
atom.activatePackage('hyperlink-helper-tmbundle', sync: true)
|
||||
atom.activatePackage('language-hyperlink', sync: true)
|
||||
grammar = syntax.selectGrammar("text.js")
|
||||
{tokens} = grammar.tokenizeLine("var i; // http://github.com")
|
||||
|
||||
@@ -454,7 +454,7 @@ describe "TextMateGrammar", ->
|
||||
expect(tokens[1].value).toBe " http://github.com"
|
||||
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
|
||||
|
||||
atom.activatePackage('hyperlink-helper-tmbundle', sync: true)
|
||||
atom.activatePackage('language-hyperlink', sync: true)
|
||||
|
||||
{tokens} = editSession.lineForScreenRow(0)
|
||||
expect(tokens[2].value).toBe "http://github.com"
|
||||
@@ -481,7 +481,7 @@ describe "TextMateGrammar", ->
|
||||
expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS"
|
||||
expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"]
|
||||
|
||||
atom.activatePackage('sql-tmbundle', sync: true)
|
||||
atom.activatePackage('language-sql', sync: true)
|
||||
|
||||
{tokens} = editSession.lineForScreenRow(0)
|
||||
expect(tokens[2].value).toBe "SELECT"
|
||||
@@ -514,7 +514,7 @@ describe "TextMateGrammar", ->
|
||||
lines = null
|
||||
|
||||
beforeEach ->
|
||||
atom.activatePackage('todo-tmbundle', sync: true)
|
||||
atom.activatePackage('language-todo', sync: true)
|
||||
grammar = syntax.selectGrammar('main.rb')
|
||||
lines = grammar.tokenizeLines "# TODO be nicer"
|
||||
|
||||
@@ -528,7 +528,7 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "Git commit messages", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('git-tmbundle', sync: true)
|
||||
atom.activatePackage('language-git', sync: true)
|
||||
grammar = syntax.selectGrammar('COMMIT_EDITMSG')
|
||||
lines = grammar.tokenizeLines """
|
||||
longggggggggggggggggggggggggggggggggggggggggggggggg
|
||||
@@ -547,7 +547,7 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "C++", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('c-tmbundle', sync: true)
|
||||
atom.activatePackage('language-c', sync: true)
|
||||
grammar = syntax.selectGrammar('includes.cc')
|
||||
lines = grammar.tokenizeLines """
|
||||
#include "a.h"
|
||||
@@ -585,8 +585,8 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "Objective-C", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('c-tmbundle', sync: true)
|
||||
atom.activatePackage('objective-c-tmbundle', sync: true)
|
||||
atom.activatePackage('language-c', sync: true)
|
||||
atom.activatePackage('language-objective-c', sync: true)
|
||||
grammar = syntax.selectGrammar('function.mm')
|
||||
lines = grammar.tokenizeLines """
|
||||
void test() {
|
||||
@@ -612,7 +612,7 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "Java", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('java-tmbundle', sync: true)
|
||||
atom.activatePackage('language-java', sync: true)
|
||||
grammar = syntax.selectGrammar('Function.java')
|
||||
|
||||
it "correctly parses single line comments", ->
|
||||
@@ -664,7 +664,7 @@ describe "TextMateGrammar", ->
|
||||
|
||||
describe "when the line contains unicode characters", ->
|
||||
it "correctly parses tokens starting after them", ->
|
||||
atom.activatePackage('json-tmbundle', sync: true)
|
||||
atom.activatePackage('language-json', sync: true)
|
||||
grammar = syntax.selectGrammar('package.json')
|
||||
{tokens} = grammar.tokenizeLine '{"\u2026": 1}'
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ describe "TokenizedBuffer", ->
|
||||
[tokenizedBuffer, buffer, changeHandler] = []
|
||||
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
# enable async tokenization
|
||||
TokenizedBuffer.prototype.chunkSize = 5
|
||||
jasmine.unspy(TokenizedBuffer.prototype, 'tokenizeInBackground')
|
||||
@@ -319,7 +319,7 @@ describe "TokenizedBuffer", ->
|
||||
|
||||
describe "when the buffer contains hard-tabs", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('coffee-script-tmbundle', sync: true)
|
||||
atom.activatePackage('language-coffee-script', sync: true)
|
||||
buffer = project.bufferForPathSync('sample-with-tabs.coffee')
|
||||
tokenizedBuffer = new TokenizedBuffer({buffer})
|
||||
startTokenizing(tokenizedBuffer)
|
||||
@@ -349,7 +349,7 @@ describe "TokenizedBuffer", ->
|
||||
|
||||
describe "when the buffer contains surrogate pairs", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript-tmbundle', sync: true)
|
||||
atom.activatePackage('language-javascript', sync: true)
|
||||
buffer = project.buildBufferSync 'sample-with-pairs.js', """
|
||||
'abc\uD835\uDF97def'
|
||||
//\uD835\uDF97xyz
|
||||
@@ -386,8 +386,8 @@ describe "TokenizedBuffer", ->
|
||||
|
||||
describe "when the grammar is updated because a grammar it includes is activated", ->
|
||||
it "retokenizes the buffer", ->
|
||||
atom.activatePackage('ruby-on-rails-tmbundle', sync: true)
|
||||
atom.activatePackage('ruby-tmbundle', sync: true)
|
||||
atom.activatePackage('language-ruby-on-rails', sync: true)
|
||||
atom.activatePackage('language-ruby', sync: true)
|
||||
|
||||
buffer = project.bufferForPathSync(null, "<div class='name'><%= User.find(2).full_name %></div>")
|
||||
tokenizedBuffer = new TokenizedBuffer({buffer})
|
||||
@@ -397,7 +397,7 @@ describe "TokenizedBuffer", ->
|
||||
{tokens} = tokenizedBuffer.lineForScreenRow(0)
|
||||
expect(tokens[0]).toEqual value: "<div class='name'>", scopes: ["text.html.ruby"]
|
||||
|
||||
atom.activatePackage('html-tmbundle', sync: true)
|
||||
atom.activatePackage('language-html', sync: true)
|
||||
fullyTokenize(tokenizedBuffer)
|
||||
{tokens} = tokenizedBuffer.lineForScreenRow(0)
|
||||
expect(tokens[0]).toEqual value: '<', scopes: ["text.html.ruby","meta.tag.block.any.html","punctuation.definition.tag.begin.html"]
|
||||
|
||||
@@ -94,6 +94,13 @@ class PackageManager
|
||||
packagePath = path.join(@resourcePath, 'node_modules', name)
|
||||
return packagePath if @isInternalPackage(packagePath)
|
||||
|
||||
#TODO Remove once all package specs have been updated
|
||||
if match = /(.+)-tmbundle$/.exec(name)
|
||||
if name is 'hyperlink-helper-tmbundle'
|
||||
@resolvePackagePath('language-hyperlink')
|
||||
else
|
||||
@resolvePackagePath("language-#{match[1]}")
|
||||
|
||||
isInternalPackage: (packagePath) ->
|
||||
{engines} = Package.loadMetadata(packagePath, true)
|
||||
engines?.atom?
|
||||
|
||||
@@ -10,7 +10,8 @@ async = require 'async'
|
||||
module.exports =
|
||||
class TextMatePackage extends Package
|
||||
@testName: (packageName) ->
|
||||
/(\.|_|-)tmbundle$/.test(packageName)
|
||||
packageName = path.basename(packageName)
|
||||
/(^language-.+)|((\.|_|-)tmbundle$)/.test(packageName)
|
||||
|
||||
@getLoadQueue: ->
|
||||
return @loadQueue if @loadQueue
|
||||
|
||||
98
tasks/publish-packages.coffee
Normal file
98
tasks/publish-packages.coffee
Normal file
@@ -0,0 +1,98 @@
|
||||
async = require 'async'
|
||||
request = require 'request'
|
||||
|
||||
# Configure and publish all packages in package.json to atom.io
|
||||
#
|
||||
# This task should be run whenever you want to be sure that atom.io contains
|
||||
# all the packages and versions referenced in Atom's package.json file.
|
||||
module.exports = (grunt) ->
|
||||
baseUrl = "https://www.atom.io/api/packages"
|
||||
|
||||
packageExists = (packageName, token, callback) ->
|
||||
requestSettings =
|
||||
url: "#{baseUrl}/#{packageName}"
|
||||
json: true
|
||||
headers:
|
||||
authorization: token
|
||||
request.get requestSettings, (error, response, body={}) ->
|
||||
if error?
|
||||
callback(error)
|
||||
else
|
||||
callback(null, response.statusCode is 404)
|
||||
|
||||
createPackage = (packageName, token, callback) ->
|
||||
requestSettings =
|
||||
url: baseUrl
|
||||
json: true
|
||||
headers:
|
||||
authorization: token
|
||||
method: 'POST'
|
||||
body:
|
||||
repository: "atom/#{packageName}"
|
||||
|
||||
request.get requestSettings, (error, response, body={}) ->
|
||||
if error?
|
||||
callback(error)
|
||||
else if response.statusCode isnt 201
|
||||
message = body.message ? body.error ? body
|
||||
callback(new Error("Creating package failed: #{message}"))
|
||||
else
|
||||
callback()
|
||||
|
||||
createPackageVersion = (packageName, tag, token, callback) ->
|
||||
requestSettings =
|
||||
url: "#{baseUrl}/#{packageName}/versions"
|
||||
json: true
|
||||
method: 'POST'
|
||||
headers:
|
||||
authorization: token
|
||||
body:
|
||||
tag: tag
|
||||
|
||||
request.get requestSettings, (error, response, body={}) ->
|
||||
if error?
|
||||
callback(error)
|
||||
else if response.statusCode isnt 201
|
||||
message = body.message ? body.error ? body
|
||||
if message is 'Version exists'
|
||||
callback()
|
||||
else
|
||||
callback(new Error("Creating new version failed: #{message}"))
|
||||
else
|
||||
callback()
|
||||
|
||||
grunt.registerTask 'publish-packages', 'Publish all bundled packages', ->
|
||||
token = process.env.ATOM_ACCESS_TOKEN
|
||||
unless token
|
||||
grunt.log.error('Must set ATOM_ACCESS_TOKEN environment variable')
|
||||
return false
|
||||
|
||||
{packageDependencies} = grunt.file.readJSON('package.json') ? {}
|
||||
done = @async()
|
||||
|
||||
tasks = []
|
||||
for name, version of packageDependencies
|
||||
do (name, version) ->
|
||||
tasks.push (callback) ->
|
||||
grunt.log.writeln("Publishing #{name}@#{version}")
|
||||
tag = "v#{version}"
|
||||
packageExists name, token, (error, exists) ->
|
||||
if error?
|
||||
callback(error)
|
||||
return
|
||||
|
||||
if exists
|
||||
createPackage name, token, (error) ->
|
||||
if error?
|
||||
callback(error)
|
||||
else
|
||||
createPackageVersion(name, tag, token, callback)
|
||||
else
|
||||
createPackageVersion(name, tag, token, callback)
|
||||
|
||||
async.waterfall tasks, (error) ->
|
||||
if error?
|
||||
grunt.log.error(error.message)
|
||||
done(false)
|
||||
else
|
||||
done()
|
||||
2
vendor/apm
vendored
2
vendor/apm
vendored
Submodule vendor/apm updated: 6ef00ae8b1...3d64c688c5
Reference in New Issue
Block a user