initial comimt

This commit is contained in:
Abigail Watson 2014-10-02 14:31:19 -04:00
commit 264fcb72e0
14 changed files with 1575 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.DS_Store
npm-debug.log
node_modules

20
LICENSE.md Normal file
View file

@ -0,0 +1,20 @@
Copyright (c) 2014 <Your name here>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

5
README.md Normal file
View file

@ -0,0 +1,5 @@
# meteor-api package
A short description of your package.
![A screenshot of your spankin' package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif)

11
keymaps/meteor-api.cson Normal file
View file

@ -0,0 +1,11 @@
# Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'.workspace':
'ctrl-alt-o': 'meteor-api:toggle'

547
lib/grammar.cson Normal file
View file

@ -0,0 +1,547 @@
'scopeName': 'source.js'
'fileTypes': [
'js'
'htc'
'_js'
'es6'
]
'firstLineMatch': '^#!.*\\bnode'
'name': 'JavaScript (Meteor)'
'patterns': [
{
'match': 'Meteor'
'name': 'api.meteor'
}
{
'match': '(isClient|isServer|startup|absolute)'
'name': 'api.meteor.core'
}
{
'match': '(?<!\\.)\\b(Collection)(?!\\s*:)\\b'
'name': 'api.meteor.ddp'
}
{
'match': '(publish|subscribe)'
'name': 'api.meteor.ddp.functions'
}
{
'match': '(?<!\\.)\\b(HTTP)(?!\\s*:)\\b'
'name': 'api.meteor.ddp'
}
{
'match': '(HTTP.get|HTTP.post|HTTP.call|HTTP.put|HTTP.del)'
'name': 'api.meteor.ddp.functions'
}
{
'match': '(?<!\\.)\\b(Collection)(?!\\s*:)\\b'
'name': 'api.meteor.collection'
}
{
'match': '(find|findOne|update|upsert|remove|insert)'
'name': 'api.meteor.collection.function'
}
{
'match': '(?<!\\.)\\b(Template)(?!\\s*:)\\b'
'name': 'api.meteor.template'
}
{
'match': '(events|helpers|registerHelper)'
'name': 'api.meteor.template.api'
}
{
'match': '(events|helpers|rendered|created|destroyed|registerHelper)'
'name': 'api.meteor.template.functions'
}
{
'match': '(?<!\\.)\\b(Blaze)(?!\\s*:)\\b'
'name': 'api.meteor.blaze'
}
{
'match': '(render|renderWithData|remove|getData|toHTML|toHTMLWithData|isTemplate)'
'name': 'api.meteor.blaze.functions'
}
{
'match': '(?<!\\.)\\b(Router)(?!\\s*:)\\b'
'name': 'api.meteor.router'
}
{
'match': '(map|route)'
'name': 'api.meteor.router.functions'
}
{
'captures':
'1':
'name': 'support.class.js'
'2':
'name': 'support.constant.js'
'3':
'name': 'keyword.operator.js'
'comment': 'match stuff like: Sound.prototype = { … } when extending an object'
'match': '([a-zA-Z_?.$][\\w?.$]*)\\.(prototype)\\s*(=)\\s*'
'name': 'meta.class.js'
}
{
'begin': '([a-zA-Z_?.$][\\w?.$]*)\\.(prototype)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*(function\\*?)?\\s*(\\*?)(\\()'
'beginCaptures':
'1':
'name': 'support.class.js'
'2':
'name': 'support.constant.js'
'3':
'name': 'entity.name.function.js'
'4':
'name': 'keyword.operator.js'
'5':
'name': 'storage.type.function.js'
'6':
'name': 'storage.type.function.js'
'7':
'name': 'punctuation.definition.parameters.begin.js'
'comment': 'match stuff like: Sound.prototype.play = function() { … }'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.parameters.end.js'
'name': 'meta.function.prototype.js'
'patterns': [
{
'include': '#function-params'
}
]
}
# {
# 'captures':
# '1':
# 'name': 'support.class.js'
# '2':
# 'name': 'support.constant.js'
# '3':
# 'name': 'entity.name.function.js'
# '4':
# 'name': 'keyword.operator.js'
# 'comment': 'match stuff like: Sound.prototype.play = myfunc'
# 'match': '([a-zA-Z_?.$][\\w?.$]*)\\.(prototype)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*'
# 'name': 'meta.function.js'
# }
{
'begin': '([a-zA-Z_?.$][\\w?.$]*)\\.([a-zA-Z_?.$][\\w?.$]*)\\s*(=)\\s*(function\\*?)\\s*(\\*?)(\\()'
'beginCaptures':
'1':
'name': 'support.class.js'
'2':
'name': 'entity.name.function.js'
'3':
'name': 'keyword.operator.js'
'4':
'name': 'storage.type.function.js'
'5':
'name': 'storage.type.function.js'
'6':
'name': 'punctuation.definition.parameters.begin.js'
'comment': 'match stuff like: Sound.play = function() { … }'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.parameters.end.js'
'name': 'meta.function.js'
'patterns': [
{
'include': '#function-params'
}
]
}
{
'begin': '([a-zA-Z_?$][\\w?$]*)\\s*(=)\\s*(function\\*?)\\s*(\\*?)(\\()'
'beginCaptures':
'1':
'name': 'entity.name.function.js'
'2':
'name': 'keyword.operator.js'
'3':
'name': 'storage.type.function.js'
'4':
'name': 'storage.type.function.js'
'5':
'name': 'punctuation.definition.parameters.begin.js'
'comment': 'match stuff like: play = function() { … }'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.parameters.end.js'
'name': 'meta.function.js'
'patterns': [
{
'include': '#function-params'
}
]
}
# {
# 'begin': '\\b(function\\*?)\\s*((\\*)|(\\*?[a-zA-Z_$]\\w*))?\\s*(\\()'
# 'beginCaptures':
# '1':
# 'name': 'storage.type.function.js'
# '3':
# 'name': 'storage.type.function.js'
# '4':
# 'name': 'entity.name.function.js'
# '5':
# 'name': 'punctuation.definition.parameters.begin.js'
# 'comment': 'match regular function like: function myFunc(arg) { … }'
# 'end': '(\\))'
# 'endCaptures':
# '1':
# 'name': 'punctuation.definition.parameters.end.js'
# 'name': 'meta.function.js'
# 'patterns': [
# {
# 'include': '#function-params'
# }
# ]
# }
{
'begin': '\\b([a-zA-Z_?.$][\\w?.$]*)\\s*:\\s*\\b(function\\*?)?\\s*(\\*?)(\\()'
'beginCaptures':
'1':
'name': 'entity.name.function.js'
'2':
'name': 'storage.type.function.js'
'3':
'name': 'storage.type.function.js'
'4':
'name': 'punctuation.definition.parameters.begin.js'
'comment': 'match stuff like: foobar: function() { … }'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.parameters.end.js'
'name': 'meta.function.json.js'
'patterns': [
{
'include': '#function-params'
}
]
}
# {
# 'begin': '(?:((\')(.*?)(\'))|((")(.*?)(")))\\s*:\\s*\\b(function\\*?)?\\s*(\\*?)(\\()'
# 'beginCaptures':
# '1':
# 'name': 'string.quoted.single.js'
# '2':
# 'name': 'punctuation.definition.string.begin.js'
# '3':
# 'name': 'entity.name.function.js'
# '4':
# 'name': 'punctuation.definition.string.end.js'
# '5':
# 'name': 'string.quoted.double.js'
# '6':
# 'name': 'punctuation.definition.string.begin.js'
# '7':
# 'name': 'entity.name.function.js'
# '8':
# 'name': 'punctuation.definition.string.end.js'
# '9':
# 'name': 'storage.type.function.js'
# '10':
# 'name': 'storage.type.function.js'
# '11':
# 'name': 'punctuation.definition.parameters.begin.js'
# 'comment': 'Attempt to match "foo": function'
# 'end': '(\\))'
# 'endCaptures':
# '1':
# 'name': 'punctuation.definition.parameters.end.js'
# 'name': 'meta.function.json.js'
# 'patterns': [
# {
# 'include': '#function-params'
# }
# ]
# }
# {
# 'captures':
# '1':
# 'name': 'keyword.operator.new.js'
# '2':
# 'name': 'entity.name.type.instance.js'
# 'match': '(new)\\s+(\\w+(?:\\.\\w*)?)'
# 'name': 'meta.class.instance.constructor'
# }
# {
# 'match': '\\b(console)\\b'
# 'name': 'entity.name.type.object.js.firebug'
# }
# {
# 'match': '\\.(warn|info|log|error|time|timeEnd|assert)\\b'
# 'name': 'support.function.js.firebug'
# }
{
'match': '\\b((0(x|X)[0-9a-fA-F]+)|([0-9]+(\\.[0-9]+)?)((e|E)[+-]?[0-9]+)?)\\b'
'name': 'constant.numeric.js'
}
{
'begin': '\''
'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin.js'
'end': '\''
'endCaptures':
'0':
'name': 'punctuation.definition.string.end.js'
'name': 'string.quoted.single.js'
'patterns': [
{
'match': '\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
'name': 'constant.character.escape.js'
}
]
}
{
'begin': '"'
'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin.js'
'end': '"'
'endCaptures':
'0':
'name': 'punctuation.definition.string.end.js'
'name': 'string.quoted.double.js'
'patterns': [
{
'match': '\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
'name': 'constant.character.escape.js'
}
]
}
{
'begin': '`'
'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin.js'
'end': '`'
'endCaptures':
'0':
'name': 'punctuation.definition.string.end.js'
'name': 'string.quoted.template.js'
'patterns': [
{
'match': '\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
'name': 'constant.character.escape.js'
}
{
'include': '#interpolated_js'
}
]
}
{
'begin': '/\\*\\*(?!/)'
'captures':
'0':
'name': 'punctuation.definition.comment.js'
'end': '\\*/'
'name': 'comment.block.documentation.js'
}
{
'begin': '/\\*'
'captures':
'0':
'name': 'punctuation.definition.comment.js'
'end': '\\*/'
'name': 'comment.block.js'
}
{
'begin': '(^[ \\t]+)?(?=//)'
'beginCaptures':
'1':
'name': 'punctuation.whitespace.comment.leading.js'
'end': '(?!\\G)'
'patterns': [
{
'begin': '//'
'beginCaptures':
'0':
'name': 'punctuation.definition.comment.js'
'end': '\\n'
'name': 'comment.line.double-slash.js'
}
]
}
{
'captures':
'0':
'name': 'punctuation.definition.comment.html.js'
'2':
'name': 'punctuation.definition.comment.html.js'
'match': '(<!--|-->)'
'name': 'comment.block.html.js'
}
# {
# 'match': '(?<!\\.)\\b(class|enum|function|interface)(?!\\s*:)\\b'
# 'name': 'storage.type.js'
# }
{
'match': '(?<!\\.)\\b(const|export|extends|implements|let|private|protected|public|static|var)(?!\\s*:)\\b'
'name': 'storage.modifier.js'
}
{
'match': '(?<!\\.)\\b(break|case|catch|continue|default|do|else|finally|for|if|import|package|return|switch|throw|try|while|with|yield)(?!\\s*:)\\b'
'name': 'keyword.control.js'
}
{
'match': '(?<!\\.)\\b(delete|in|instanceof|new|typeof|void)(?!\\s*:)\\b'
'name': 'keyword.operator.js'
}
{
'match': '(?<!\\.)\\btrue(?!\\s*:)\\b'
'name': 'constant.language.boolean.true.js'
}
{
'match': '(?<!\\.)\\bfalse(?!\\s*:)\\b'
'name': 'constant.language.boolean.false.js'
}
{
'match': '(?<!\\.)\\bnull(?!\\s*:)\\b'
'name': 'constant.language.null.js'
}
# {
# 'match': '(?<!\\.)\\b(super|this)(?!\\s*:)\\b'
# 'name': 'variable.language.js'
# }
# {
# 'match': '(?<!\\.)\\b(debugger)(?!\\s*:)\\b'
# 'name': 'keyword.other.js'
# }
# {
# 'match': '\\b(Anchor|Applet|Area|Array|Boolean|Button|Checkbox|Date|document|event|FileUpload|Form|Frame|Function|Hidden|History|Image|JavaArray|JavaClass|JavaObject|JavaPackage|java|Layer|Link|Location|Math|MimeType|Number|navigator|netscape|Object|Option|Packages|Password|Plugin|Radio|RegExp|Reset|Select|String|Style|Submit|screen|sun|Text|Textarea|window|XMLHttpRequest)\\b'
# 'name': 'support.class.js'
# }
# {
# 'match': '\\b(s(h(ift|ow(Mod(elessDialog|alDialog)|Help))|croll(X|By(Pages|Lines)?|Y|To)?|t(op|rike)|i(n|zeToContent|debar|gnText)|ort|u(p|b(str(ing)?)?)|pli(ce|t)|e(nd|t(Re(sizable|questHeader)|M(i(nutes|lliseconds)|onth)|Seconds|Ho(tKeys|urs)|Year|Cursor|Time(out)?|Interval|ZOptions|Date|UTC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(ome|andleEvent)|navigate|c(har(CodeAt|At)|o(s|n(cat|textual|firm)|mpile)|eil|lear(Timeout|Interval)?|a(ptureEvents|ll)|reate(StyleSheet|Popup|EventObject))|t(o(GMTString|S(tring|ource)|U(TCString|pperCase)|Lo(caleString|werCase))|est|a(n|int(Enabled)?))|i(s(NaN|Finite)|ndexOf|talics)|d(isableExternalCapture|ump|etachEvent)|u(n(shift|taint|escape|watch)|pdateCommands)|j(oin|avaEnabled)|p(o(p|w)|ush|lugins.refresh|a(ddings|rse(Int|Float)?)|r(int|ompt|eference))|e(scape|nableExternalCapture|val|lementFromPoint|x(p|ec(Script|Command)?))|valueOf|UTC|queryCommand(State|Indeterm|Enabled|Value)|f(i(nd|le(ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(nt(size|color)|rward)|loor|romCharCode)|watch|l(ink|o(ad|g)|astIndexOf)|a(sin|nchor|cos|t(tachEvent|ob|an(2)?)|pply|lert|b(s|ort))|r(ou(nd|teEvents)|e(size(By|To)|calc|turnValue|place|verse|l(oad|ease(Capture|Events)))|andom)|g(o|et(ResponseHeader|M(i(nutes|lliseconds)|onth)|Se(conds|lection)|Hours|Year|Time(zoneOffset)?|Da(y|te)|UTC(M(i(nutes|lliseconds)|onth)|Seconds|Hours|Da(y|te)|FullYear)|FullYear|A(ttention|llResponseHeaders)))|m(in|ove(B(y|elow)|To(Absolute)?|Above)|ergeAttributes|a(tch|rgins|x))|b(toa|ig|o(ld|rderWidths)|link|ack))\\b(?=\\()'
# 'name': 'support.function.js'
# }
# {
# 'match': '\\b(s(ub(stringData|mit)|plitText|e(t(NamedItem|Attribute(Node)?)|lect))|has(ChildNodes|Feature)|namedItem|c(l(ick|o(se|neNode))|reate(C(omment|DATASection|aption)|T(Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(ntityReference|lement)|Attribute))|tabIndex|i(nsert(Row|Before|Cell|Data)|tem)|open|delete(Row|C(ell|aption)|T(Head|Foot)|Data)|focus|write(ln)?|a(dd|ppend(Child|Data))|re(set|place(Child|Data)|move(NamedItem|Child|Attribute(Node)?)?)|get(NamedItem|Element(sBy(Name|TagName)|ById)|Attribute(Node)?)|blur)\\b(?=\\()'
# 'name': 'support.function.dom.js'
# }
# {
# 'match': '(?<=\\.)(s(ystemLanguage|cr(ipts|ollbars|een(X|Y|Top|Left))|t(yle(Sheets)?|atus(Text|bar)?)|ibling(Below|Above)|ource|uffixes|e(curity(Policy)?|l(ection|f)))|h(istory|ost(name)?|as(h|Focus))|y|X(MLDocument|SLDocument)|n(ext|ame(space(s|URI)|Prop))|M(IN_VALUE|AX_VALUE)|c(haracterSet|o(n(structor|trollers)|okieEnabled|lorDepth|mp(onents|lete))|urrent|puClass|l(i(p(boardData)?|entInformation)|osed|asses)|alle(e|r)|rypto)|t(o(olbar|p)|ext(Transform|Indent|Decoration|Align)|ags)|SQRT(1_2|2)|i(n(ner(Height|Width)|put)|ds|gnoreCase)|zIndex|o(scpu|n(readystatechange|Line)|uter(Height|Width)|p(sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(i(splay|alog(Height|Top|Width|Left|Arguments)|rectories)|e(scription|fault(Status|Ch(ecked|arset)|View)))|u(ser(Profile|Language|Agent)|n(iqueID|defined)|pdateInterval)|_content|p(ixelDepth|ort|ersonalbar|kcs11|l(ugins|atform)|a(thname|dding(Right|Bottom|Top|Left)|rent(Window|Layer)?|ge(X(Offset)?|Y(Offset)?))|r(o(to(col|type)|duct(Sub)?|mpter)|e(vious|fix)))|e(n(coding|abledPlugin)|x(ternal|pando)|mbeds)|v(isibility|endor(Sub)?|Linkcolor)|URLUnencoded|P(I|OSITIVE_INFINITY)|f(ilename|o(nt(Size|Family|Weight)|rmName)|rame(s|Element)|gColor)|E|whiteSpace|l(i(stStyleType|n(eHeight|kColor))|o(ca(tion(bar)?|lName)|wsrc)|e(ngth|ft(Context)?)|a(st(M(odified|atch)|Index|Paren)|yer(s|X)|nguage))|a(pp(MinorVersion|Name|Co(deName|re)|Version)|vail(Height|Top|Width|Left)|ll|r(ity|guments)|Linkcolor|bove)|r(ight(Context)?|e(sponse(XML|Text)|adyState))|global|x|m(imeTypes|ultiline|enubar|argin(Right|Bottom|Top|Left))|L(N(10|2)|OG(10E|2E))|b(o(ttom|rder(Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(Color|Image)))\\b'
# 'name': 'support.constant.js'
# }
# {
# 'match': '(?<=\\.)(s(hape|ystemId|c(heme|ope|rolling)|ta(ndby|rt)|ize|ummary|pecified|e(ctionRowIndex|lected(Index)?)|rc)|h(space|t(tpEquiv|mlFor)|e(ight|aders)|ref(lang)?)|n(o(Resize|tation(s|Name)|Shade|Href|de(Name|Type|Value)|Wrap)|extSibling|ame)|c(h(ildNodes|Off|ecked|arset)?|ite|o(ntent|o(kie|rds)|de(Base|Type)?|l(s|Span|or)|mpact)|ell(s|Spacing|Padding)|l(ear|assName)|aption)|t(ype|Bodies|itle|Head|ext|a(rget|gName)|Foot)|i(sMap|ndex|d|m(plementation|ages))|o(ptions|wnerDocument|bject)|d(i(sabled|r)|o(c(type|umentElement)|main)|e(clare|f(er|ault(Selected|Checked|Value)))|at(eTime|a))|useMap|p(ublicId|arentNode|r(o(file|mpt)|eviousSibling))|e(n(ctype|tities)|vent|lements)|v(space|ersion|alue(Type)?|Link|Align)|URL|f(irstChild|orm(s)?|ace|rame(Border)?)|width|l(ink(s)?|o(ngDesc|wSrc)|a(stChild|ng|bel))|a(nchors|c(ce(ssKey|pt(Charset)?)|tion)|ttributes|pplets|l(t|ign)|r(chive|eas)|xis|Link|bbr)|r(ow(s|Span|Index)|ules|e(v|ferrer|l|adOnly))|m(ultiple|e(thod|dia)|a(rgin(Height|Width)|xLength))|b(o(dy|rder)|ackground|gColor))\\b'
# 'name': 'support.constant.dom.js'
# }
# {
# 'match': '\\b(ELEMENT_NODE|ATTRIBUTE_NODE|TEXT_NODE|CDATA_SECTION_NODE|ENTITY_REFERENCE_NODE|ENTITY_NODE|PROCESSING_INSTRUCTION_NODE|COMMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_FRAGMENT_NODE|NOTATION_NODE|INDEX_SIZE_ERR|DOMSTRING_SIZE_ERR|HIERARCHY_REQUEST_ERR|WRONG_DOCUMENT_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR|NOT_SUPPORTED_ERR|INUSE_ATTRIBUTE_ERR)\\b'
# 'name': 'support.constant.dom.js'
# }
# {
# 'match': '\\bon(R(ow(s(inserted|delete)|e(nter|xit))|e(s(ize(start|end)?|et)|adystatechange))|Mouse(o(ut|ver)|down|up|move)|B(efore(cut|deactivate|u(nload|pdate)|p(aste|rint)|editfocus|activate)|lur)|S(croll|top|ubmit|elect(start|ionchange)?)|H(over|elp)|C(hange|ont(extmenu|rolselect)|ut|ellchange|l(ick|ose))|D(eactivate|ata(setc(hanged|omplete)|available)|r(op|ag(start|over|drop|en(ter|d)|leave)?)|blclick)|Unload|P(aste|ropertychange)|Error(update)?|Key(down|up|press)|Focus|Load|A(ctivate|fter(update|print)|bort))\\b'
# 'name': 'support.function.event-handler.js'
# }
# {
# 'match': '(?<!\\.)\\b(require)(?!\\s*:)\\b'
# 'name': 'support.function.js'
# }
# {
# 'match': '(?<!\\.)\\b(module|exports|__filename|__dirname|global|process)(?!\\s*:)\\b'
# 'name': 'support.variable.js'
# }
# {
# 'match': '!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?|\\:|\\*=|(?<!\\()/=|%=|\\+=|\\-=|&=|\\^='
# 'name': 'keyword.operator.js'
# }
# {
# 'match': '\\b(Infinity|NaN|undefined)\\b'
# 'name': 'constant.language.js'
# }
# {
# 'begin': '(?<=[\\[=(:+]|^|return|&&|\\|\\||!)\\s*(/)(?![/*+{}?])(?=.*/)'
# 'beginCaptures':
# '1':
# 'name': 'punctuation.definition.string.begin.js'
# 'end': '(/)[igm]*'
# 'endCaptures':
# '1':
# 'name': 'punctuation.definition.string.end.js'
# 'name': 'string.regexp.js'
# 'patterns': [
# {
# 'include': 'source.js.regexp'
# }
# ]
# }
{
'match': '\\;'
'name': 'punctuation.terminator.statement.js'
}
{
'match': ',[ |\\t]*'
'name': 'meta.delimiter.object.comma.js'
}
{
'match': '\\.'
'name': 'meta.delimiter.method.period.js'
}
# {
# 'captures':
# '1':
# 'name': 'punctuation.section.scope.begin.js'
# '2':
# 'name': 'punctuation.section.scope.end.js'
# 'comment': 'Allows the special return snippet to fire.'
# 'match': '(\\{)(\\})'
# }
{
'match': '\\{|\\}'
'name': 'meta.brace.curly.js'
}
{
'match': '\\(|\\)'
'name': 'meta.brace.round.js'
}
{
'match': '\\[|\\]'
'name': 'meta.brace.square.js'
}
{
'match': '\\A#!.*$'
'name': 'comment.line.shebang.js'
}
]
'repository':
'function-params':
'patterns': [
{
'begin': '(?=[\\p{L}\\p{Nl}$_])'
'end': '(?=[,)])'
'patterns': [
{
'match': '\\G[\\p{L}\\p{Nl}$_][\\p{L}\\p{Nl}$\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\x{200C}\\x{200D}]*'
'name': 'variable.parameter.function.js'
}
]
}
]
'interpolated_js':
'patterns': [
{
'begin': '\\$\\{'
'captures':
'0':
'name': 'punctuation.section.embedded.js'
'end': '\\}'
'name': 'source.js.embedded.source'
'patterns': [
{
'include': '$self'
}
]
}
]

View file

@ -0,0 +1,24 @@
{View} = require 'atom'
module.exports =
class MeteorApiView extends View
@content: ->
@div class: 'meteor-api overlay from-top', =>
@div "The MeteorApi package is Alive! It's ALIVE!", class: "message"
initialize: (serializeState) ->
atom.workspaceView.command "meteor-api:toggle", => @toggle()
# Returns an object that can be retrieved when package is activated
serialize: ->
# Tear down any state and detach
destroy: ->
@detach()
toggle: ->
console.log "MeteorApiView was toggled!"
if @hasParent()
@detach()
else
atom.workspaceView.append(this)

13
lib/meteor-api.coffee Normal file
View file

@ -0,0 +1,13 @@
MeteorApiView = require './meteor-api-view'
module.exports =
meteorApiView: null
activate: (state) ->
@meteorApiView = new MeteorApiView(state.meteorApiViewState)
deactivate: ->
@meteorApiView.destroy()
serialize: ->
meteorApiViewState: @meteorApiView.serialize()

816
lib/snippets.cson Normal file
View file

@ -0,0 +1,816 @@
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
#===================================================
# HTML / Document Object Model Snippets
'.html':
'Blaze Template':
'prefix': 'template'
'body': '<template name="${1}">\n\t${2}\n</template>',
'Blaze #each':
'prefix': '#each'
'body': '
{{#each ${1:collections}}}\n\t${2}\n{{/each}}
',
'Blaze #if':
'prefix': '#if'
'body': '
{{#if ${1:statement}}}\n\t${2}\n{{/if}}
',
'Blaze #if else':
'prefix': '#ife'
'body': '{{#if ${1:statement}}}\n\t${2}\n{{else}}\n\t${3}\n{{/if}}
'
#===================================================
# Javascript Lanaguage Snippets
'.js':
'if, else if, else':
'prefix': 'ieie'
'body': '
if (${1:true}) {
$2
} else if (${3:false}) {
$4
} else {
$5
}
',
'console.log':
'prefix': 'log'
'body': 'console.log("${1:message}");\n${2:}',
'function()':
'prefix': 'f'
'body': 'function(${1:argument}){\n\t${2:}\n},',
#===================================================
# Meteor Core API
'Meteor.isClient':
'prefix': 'isClient'
'body': 'if(Meteor.isClient){\n\t${1:}\n}',
'Meteor.isServer':
'prefix': 'isServer'
'body': 'if(Meteor.isServer){\n\t${1:}\n}',
'Meteor.isCordova':
'prefix': 'isCordova'
'body': 'if(Meteor.isCordova){\n\t${1:}\n}',
'Meteor.startup':
'prefix': 'startup'
'body': 'Meteor.startup(function(){\n\t${1:}\n});',
'Meteor.absoluteUrl':
'prefix': 'absolute'
'body': 'Meteor.absoluteUrl("${1:}");',
#===================================================
# Publish & Subscribe
'Meteor Publish':
'prefix': 'publish'
'body': 'Meteor.publish("${1:name}", function(${2:argument}){\n\t${3:}\n});',
'Meteor Subscribe':
'prefix': 'subscribe'
'body': 'Meteor.subscribe("${1:name}", ${2:argument});',
#===================================================
# Methods
'Meteor Methods':
'prefix': 'methods'
'body': 'Meteor.methods({
\n\t${1:methodName}:function(){
\n\t\t${2:}
\n\t}
\n});',
'Meteor.Error':
'prefix': 'error'
'body': 'Meteor.Error(${1:Number}, "${2:description}");',
'Meteor.call':
'prefix': 'call'
'body': 'Meteor.call("${1:meteorMethod}", ${2:dataObject}, function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${3:}
\n\t}
\n});',
#===================================================
# Connections
'Meteor.status':
'prefix': 'status'
'body': 'Meteor.status()',
'Meteor.reconnect':
'prefix': 'reconnect'
'body': 'Meteor.reconnect()',
'Meteor.disconnect':
'prefix': 'disconnect'
'body': 'Meteor.disconnect()',
'Meteor.onConnection':
'prefix': 'onConnection'
'body': 'Meteor.onConnection(function(){
\n\t${1:}
\n});',
#===================================================
# Collections
'Meteor.Collection.ObjectID':
'prefix': 'object'
'body': 'new Meteor.Collection.ObjectID("${1:id}")',
'Collection.find':
'prefix': 'find'
'body': '${1:Collection}.find({"${2:field}":${3:value}});\n${4:}',
'Collection.findOne':
'prefix': 'findOne'
'body': '${1:Collection}.findOne({_id:"${2:recordId}"${3:}});\n${4:}',
'Collection.insert':
'prefix': 'insert'
'body': '${1:Collection}.insert(${2:newRecord});\n${3:}',
'Collection.Update':
'prefix': 'update'
'body': '${1:Collection}.update({_id:${2:idSelector}}, {$set:{\n\t${3:}\n}});\n${4:}',
'Collection.Upsert':
'prefix': 'upsert'
'body': '${1:Collection}.upsert({_id:${2:idSelector}}, {$set:{\n\t${3:}\n}});\n${4:}',
'Collection.remove':
'prefix': 'remove'
'body': '${1:Collection}.remove({_id:"${2:recordId}"${3:}});\n${4:}',
'Collection.allow':
'prefix': 'allow'
'body': '${1:Collection}.allow({
\n\tinsert: function(){
\n\t\treturn ${2:true};
\n\t},
\n\tupdate: function(){
\n\t\treturn ${3:true};
\n\t},
\n\tremove: function(){
\n\t\treturn ${4:true};
\n\t}
\n});\n${5:}',
'Collection.deny':
'prefix': 'deny'
'body': '${1:Collection}.deny({
\n\tinsert: function(){
\n\t\treturn ${2:false};
\n\t},
\n\tupdate: function(){
\n\t\treturn ${3:false};
\n\t},
\n\tremove: function(){
\n\t\treturn ${4:false};
\n\t}
\n});\n${5:}',
'Collection':
'prefix': 'Collection'
'body': '${1:CollectionName} = new Meteor.Collection("${2:name}");
\n${3:CollectionName}.allow({
\n\tinsert: function(){
\n\t\treturn ${4:true};
\n\t},
\n\tupdate: function(){
\n\t\treturn ${5:true};
\n\t},
\n\tremove: function(){
\n\t\treturn ${6:true};
\n\t}
\n});\n${7:}',
#===================================================
# Session Snippets
'Session.set':
'prefix': 'set'
'body': 'Session.set("${1:variableName}", ${2:value});\n${3:}',
'Session.get':
'prefix': 'get'
'body': 'Session.get("${1:variableName}");\n${2:}',
'Session.equals':
'prefix': 'equals'
'body': 'Session.equals("${1:variableName}", ${2:value});\n${3:}',
'Session.setDefault':
'prefix': 'setDefault'
'body': 'Session.setDefault("${1:variableName}", ${2:value});\n${3:}',
#===================================================
# Accounts Snippets
'Meteor.user':
'prefix': 'user'
'body': 'Meteor.user()',
'Meteor.user':
'prefix': 'varuser'
'body': 'var user = Meteor.user();',
'Meteor.userId':
'prefix': 'userId'
'body': 'Meteor.userId()',
'Meteor.users':
'prefix': 'users'
'body': 'Meteor.users',
'Meteor.loggingIn':
'prefix': 'loggingIn'
'body': 'Meteor.loggingIn()',
'Meteor.logout':
'prefix': 'logout'
'body': 'Meteor.logout(function(){
\n\t${1:}
\n});',
'Meteor.logoutOtherClients':
'prefix': 'logoutOtherClients'
'body': 'Meteor.logoutOtherClients(function(){
\n\t${1:}
\n});',
'Meteor.loginWithPassword':
'prefix': 'logoutOtherClients'
'body': 'Meteor.logoutOtherClients(${1:user}, ${2:password}, function(){
\n\t${3:}
\n});',
'Accounts':
'prefix': 'Accounts'
'body': '
Accounts.config({
\n\tsendVerificationEmail: ${1:true},
\n\tforbidClientAccountCreation: ${2:true},
\n\trestrictCreationByEmailDomain: "${3:school.edu}",
\n\tloginExpirationDays: ${4:30},
\n\toauthSecretKey: "${5:wgporjigrpqgdfg}",
\n});
\nAccounts.ui.config({
\n\trequestPermissions: ${1:{}},
\n\trequestOfflineToken: ${1:{}},
\n\tpasswordSignupFields: "${3:USERNAME_AND_OPTIONAL_EMAIL}",
\n});
\n${12:}
',
'Accounts.validateNewUser':
'prefix': 'validateNewUser'
'body': 'Meteor.validateNewUser(function(){
\n\t${1:}
\n});',
'Accounts.onCreateUser':
'prefix': 'onCreateUser'
'body': 'Meteor.onCreateUser(function(options, user){
\n\t${1:}
\n\treturn ${1:user}
\n});',
'Accounts.onLogin':
'prefix': 'onLogin'
'body': 'Meteor.onLogin(function(){
\n\t${1:}
\n});',
'Accounts.onLoginFailure':
'prefix': 'onLoginFailure'
'body': 'Meteor.onLoginFailure(function(){
\n\t${1:}
\n});',
#===================================================
# Passwords Snippets
'Accounts.createUser':
'prefix': 'createUser'
'body': '
var userObject = {
\n\tusername: "${1:username}",
\n\tmail: "${1:email}",
\n\tpassword: "${1:password}"
\n};
\n
\nAccounts.createUser(${1:userObject}, function(){
\n\t${1:}
\n});',
'Accounts.changePassword':
'prefix': 'changePassword'
'body': 'Accounts.changePassword(${1:oldPassword}, ${2:newPassword}, function(){
\n\t${1:}
\n});',
'Accounts.forgotPassword':
'prefix': 'forgotPassword'
'body': 'Accounts.forgotPassword({email: "${1:address}"}, function(){
\n\t${2:}
\n});',
'Accounts.resetPassword':
'prefix': 'resetPassword'
'body': 'Accounts.resetPassword(${1:token}, ${2:newPassword}, function(){
\n\t${3:}
\n});',
'Accounts.setPassword':
'prefix': 'setPassword'
'body': 'Accounts.setPassword(${1:userId}, ${2:newPassword});',
'Accounts.verifyEmail':
'prefix': 'verifyEmail'
'body': 'Accounts.verifyEmail(${1:token}, function(){
\n\t${1:}
\n});',
'Accounts.sendResetPasswordEmail':
'prefix': 'sendResetPasswordEmail'
'body': 'Accounts.sendResetPasswordEmail(${1:userId});',
'Accounts.sendEnrollmentEmail':
'prefix': 'sendEnrollmentEmail'
'body': 'Accounts.sendEnrollmentEmail(${1:userId});',
'Accounts.sendVerificationEmail':
'prefix': 'sendVerificationEmail'
'body': 'Accounts.sendVerificationEmail(${1:userId});',
#===================================================
# Match Snippets
'Match.check':
'prefix': 'check'
'body': 'check(${1:variable}, ${2:String});\n${3:}',
'Match.test':
'prefix': 'test'
'body': 'Match.test(${1:variable}, ${2:String});\n${3:}',
#===================================================
# Timers Snippets
'Meteor.setTimeout':
'prefix': 'setTimeout'
'body': 'Match.setTimeout(function(){
\n\t${2:}
\n}, ${1:milliseconds});',
'Meteor.setInterval':
'prefix': 'setInterval'
'body': 'Match.setTimeout(function(){
\n\t${2:}
\n}, ${1:milliseconds});',
'Meteor.clearTimeout':
'prefix': 'clearTimeout'
'body': 'Meteor.clearTimeout(${1:id})',
'Meteor.clearInterval':
'prefix': 'clearInterval'
'body': 'Meteor.clearInterval(${1:id})',
#===================================================
# Tracker
'Tracker.autorun':
'prefix': 'autorun'
'body': 'Tracker.autorun(function(){
\n\t${2:}
\n});',
'Tracker.flush':
'prefix': 'flush'
'body': 'Tracker.flush();',
'Tracker.nonreactive':
'prefix': 'nonreactive'
'body': 'Tracker.nonreactive(function(){
\n\t${2:}
\n});',
'Tracker.onInvalidate':
'prefix': 'onInvalidate'
'body': 'Tracker.onInvalidate(function(){
\n\t${2:}
\n});',
'Tracker.afterFlush':
'prefix': 'afterFlush'
'body': 'Tracker.afterFlush(function(){
\n\t${2:}
\n});',
'Tracker.active':
'prefix': 'active'
'body': 'Tracker.active;',
'Tracker.currentComputation':
'prefix': 'currentComputation'
'body': 'Tracker.currentComputation;',
#===================================================
# Templates Snippets
'Template Rendered':
'prefix': 'rendered'
'body': 'Template.${1:name}.rendered = function(){\n\t${2}\n}',
'Template Events':
'prefix': 'events'
'body': '
Template.${1:name}.events({
\n\t"click ${2:#event}": function(event, template){
\n\t\t${3:}
\n\t}
\n});
',
'Template Created':
'prefix': 'created'
'body': '
Template.${1:name}.created = function(){
\n\t${2:}
\n};
',
'Template Destroyed':
'prefix': 'destroyed'
'body': '
Template.${1:name}.destroyed = function(){
\n\t${2:}
\n};
',
'Template':
'prefix': 'Template'
'body': '
\nTemplate.${1:name}.helpers({
\n\tcreate: function(){
\n\t\t${2:}
\n\t},
\n\trendered: function(){
\n\t\t${3:}
\n\t},
\n\tdestroyed: function(){
\n\t\t${4:}
\n\t},
\n});
\n\nTemplate.${9:name}.events({
\n\t"${5:click #foo}": function(event, template){
\n\t\t${6:}
\n\t}
\n});
\n${7:}
',
'Template Helpers':
'prefix': 'helpers'
'body': 'Template.${1:name}.helpers({\n\trendered: function(){\n\t\t${2}\n\t}\n});',
'Template.registerHelper':
'prefix': 'registerHelper'
'body': 'Template.registerHelper("${1:helperName}", function(${2:argument}){\n\t${3}\n});',
#===================================================
# Blaze Snippets
'Blaze.render':
'prefix': 'render'
'body': 'Blaze.render(${1:templateOrView}, ${2:parentNode});',
'Blaze.renderWithData':
'prefix': 'renderWithData'
'body': 'Blaze.renderWithData(${1:templateOrView}, ${2:data}, ${3:parentNode});',
'Blaze.remove':
'prefix': 'bremove'
'body': 'Blaze.remove(${1:renderedView});',
'Blaze.getData':
'prefix': 'getData'
'body': 'Blaze.getData(${1:elementOrView});',
'Blaze.toHTML':
'prefix': 'toHTML'
'body': 'Blaze.toHTML(${1:templateOrView});',
'Blaze.toHTMLWithData':
'prefix': 'toHTMLWithData'
'body': 'Blaze.toHTMLWithData(${1:templateOrView}, ${2:data});',
'Blaze.toHTMLWithData':
'prefix': 'toHTMLWithData'
'body': 'Blaze.toHTMLWithData(${1:templateOrView}, ${2:data});',
'Blaze.isTemplate':
'prefix': 'isTemplate'
'body': 'Blaze.isTemplate(${1:value});',
#===================================================
# EJSON Snippets
'EJSON.parse':
'prefix': 'parse'
'body': 'EJSON.parse(${1:string});',
'EJSON.stringify':
'prefix': 'stringify'
'body': 'EJSON.stringify(${1:string}, {indent: true});',
'EJSON.clone':
'prefix': 'clone'
'body': 'EJSON.clone(${1:object});',
'EJSON.equals':
'prefix': 'deeequals'
'body': 'EJSON.equals(${1:objectA}, ${2:objectB});',
'EJSON.toJSONValue':
'prefix': 'toJSON'
'body': 'EJSON.toJSONValue(${1:value});',
'EJSON.fromJSONValue':
'prefix': 'fromJSON'
'body': 'EJSON.fromJSONValue(${1:value});',
'EJSON.isBinary':
'prefix': 'isBinary'
'body': 'EJSON.isBinary(${1:value});',
#===================================================
# HTTP Snippets
'HTTP Call':
'prefix': 'httpcall'
'body': 'HTTP.call("${1:meteorMethod}", function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${2:}
\n\t}
\n});',
'HTTP Get':
'prefix': 'httpget'
'body': 'HTTP.get("${1:meteorMethod}", function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${2:}
\n\t}
\n});',
'HTTP.post':
'prefix': 'httppost'
'body': 'HTTP.post("${1:meteorMethod}", ${2:dataObject}, function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${3:}
\n\t}
\n});',
'HTTP.put':
'prefix': 'http.put'
'body': 'HTTP.put("${1:meteorMethod}", ${2:dataObject}, function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${3:}
\n\t}
\n});',
'HTTP.del':
'prefix': 'httpdel'
'body': 'HTTP.del("${1:meteorMethod}", function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${2:}
\n\t}
\n});',
#===================================================
# Email Snippets
'Email.send':
'prefix': 'Email'
'body': 'Email.send({
\n\tfrom: "${1:sender@somewhere.net}",
\n\tto: "${2:receiver@elsewhere.io}",
\n\tcc: "${3:carboncopy@elsewhere.io}",
\n\tbcc: "${4:lurker@somewhere.io}",
\n\treplyTo: "${5:public@somewhere.net}",
\n\tsubject: "${6:Hello Email}",
\n\ttext: "${7:lorem ispum...}",
\n\thtml: "${8:}",
\n\theaders: "${9:}",
\n});',
#===================================================
# Assets Snippets
'Assets.getText':
'prefix': 'getText'
'body': 'Assets.getText("${1:assetPath}", function(error, result){
\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${2:}
\n\t}
\n});',
'Assets.getBinary':
'prefix': 'getBinary'
'body': 'Assets.getBinary("${1:assetPath}", function(error, result){\n\tif(error){
\n\t\tconsole.log("error", error);
\n\t}
\n\tif(result){
\n\t\t${2:}
\n\t}
\n});',
#===================================================
# Router Snippets
'Router':
'prefix': 'Router'
'body': '
Router.map(function(){
\n\tthis.route("${1:routeName}"{
\n\t\t${2}
\n\t});
\n});
',
'route':
'prefix': 'route'
'body': '
this.route("${1:routeName}"{
\n\tpath:"${2}",
\n\ttemplate:"${3}",
\n\twaitOn:function(){
\n\t\t${4}
\n\t},
\n\tdata:function(){
\n\t\t${5}
\n\t},
\n\tonBeforeAction:function(){
\n\t\tsetPageTitle("${6}");
\n\t},
\n\tonAfterAction:function(){
\n\t\t${7}
\n\t},
\n});
',
'Upsert Route':
'prefix': 'UpsertRoute'
'body': '
Router.map(function(){
\n\tthis.route("${1:routeName}"{
\n\t\tpath:"/${2:route}/add",
\n\t\ttemplate:"${3:routeTemplate}",
\n\t\twaitOn:function(){
\n\t\t\t${4}
\n\t\t},
\n\t\tdata:function(){
\n\t\t\treturn {};
\n\t\t},
\n\t\tonBeforeAction:function(){
\n\t\t\tsetPageTitle("${5}");
\n\t\t},
\n\t\tonAfterAction:function(){
\n\t\t\t${6}
\n\t\t},
\n\t});
\n\tthis.route("${7:routeName}"{
\n\t\tpath:"/${8}/edit/${9:paramId}",
\n\t\ttemplate:"${10: routeTemplate}",
\n\t\twaitOn:function(){
\n\t\t\treturn Meteor.subscribe("${11: subscription}");
\n\t\t},
\n\t\tdata:function(){
\n\t\t\treturn ${12: Collection}.findOne(this.params.${13: paramId});
\n\t\t},
\n\t\tonBeforeAction:function(){
\n\t\t\tsetPageTitle("${14}");
\n\t\t},
\n\t\tonAfterAction:function(){
\n\t\t\t${15}
\n\t\t},
\n\t});
\n});
',
#===================================================
# Template + Router
'Page':
'prefix': 'page'
'body': '
Router.map(function(){
\n\tthis.route("${1:routeName}", {
\n\t\tpath: "/${2:route}",
\n\t\ttemplate: "${3:pageTemplate}",
\n\t\tonBeforeAction: function () {
\n\t\t\tsetPageTitle("${4:Page Title}");
\n\t\t}
\n\t});
\n});
\n
\nTemplate.${5:pageTemplate}.helpers({
\n\trendered: function(){
\n\t\t${6:}
\n\t}
\n});
\n\nTemplate.${7:pageTemplate}.events({
\n\t"${8:click #foo}": function(event, template){
\n\t\t${9:}
\n\t}
\n});
',
#===================================================
# Nightwatch
'verify.elementPresent':
'prefix': 'vep'
'body': '.verify.elementPresent("#${1}")${2}',
'verify.elementNotPresent':
'prefix': 'venp'
'body': '.verify.elementNotPresent("#${1}")${2}',
'waitForElementVisible':
'prefix': 'wfev'
'body': '.waitForElementVisible("#${1}", ${2})${3}',
'containsText':
'prefix': 'vct'
'body': '.verify.containsText("#${1}", "${2}")${3}',
'click':
'prefix': 'click'
'body': '.click("#${1}").pause(${2})${3}',
'attributeEquals':
'prefix': 'ae'
'body': '.verify.attributeEquals("#${1}", "value", "${2}")${3}',
#===================================================
# Stylesheet / View Snippets
'.less':
'Responsive Stylesheets':
"prefix": "mobile"
"body": 'media'

63
lib/stylesheet.less Normal file
View file

@ -0,0 +1,63 @@
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
.tree-view {
}
.editor {
//background-color: #222222;
.api.meteor{
color: #ffffff;
}
.api.meteor.core{
color: #E8C6B8;
}
.api.meteor.ddp{
color: #FFA581;
}
.api.meteor.ddp.functions{
color: #E87E75;
}
.api.meteor.http{
color: #FF514F;
}
.api.meteor.template{
color: #FFF443;
}
.api.meteor.template.api{
color: #FFF56D;
}
.api.meteor.template.functions{
color: #B3ABF5;
}
.api.meteor.blaze{
color: #F51B15;
}
.api.meteor.blaze.functions{
color: #F53B27;
}
.api.meteor.router{
color: #52F3F5;
}
.api.meteor.router.functions{
color: #83F5ED;
}
.api.meteor.collection{
color: #E8D361;
}
.api.meteor.collection.functions{
color: #F5EA66;
}
}
.editor .cursor {
}

16
menus/meteor-api.cson Normal file
View file

@ -0,0 +1,16 @@
# See https://atom.io/docs/latest/creating-a-package#menus for more details
'context-menu':
'.overlayer':
'Enable meteor-api': 'meteor-api:toggle'
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'meteor-api'
'submenu': [
{ 'label': 'Toggle', 'command': 'meteor-api:toggle' }
]
]
}
]

14
package.json Normal file
View file

@ -0,0 +1,14 @@
{
"name": "meteor-api",
"main": "./lib/meteor-api",
"version": "0.0.0",
"description": "Meteor API with tab completion and syntax highlighting.",
"activationEvents": ["meteor-api:toggle"],
"repository": "https://github.com/awatson1978/meteor-api",
"license": "MIT",
"engines": {
"atom": ">0.50.0"
},
"dependencies": {
}
}

View file

@ -0,0 +1,29 @@
MeteorApi = require '../lib/meteor-api'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "MeteorApi", ->
activationPromise = null
beforeEach ->
atom.workspaceView = new WorkspaceView
activationPromise = atom.packages.activatePackage('meteorApi')
describe "when the meteor-api:toggle event is triggered", ->
it "attaches and then detaches the view", ->
expect(atom.workspaceView.find('.meteor-api')).not.toExist()
# This is an activation event, triggering it will cause the package to be
# activated.
atom.workspaceView.trigger 'meteor-api:toggle'
waitsForPromise ->
activationPromise
runs ->
expect(atom.workspaceView.find('.meteor-api')).toExist()
atom.workspaceView.trigger 'meteor-api:toggle'
expect(atom.workspaceView.find('.meteor-api')).not.toExist()

View file

@ -0,0 +1,6 @@
MeteorApiView = require '../lib/meteor-api-view'
{WorkspaceView} = require 'atom'
describe "MeteorApiView", ->
it "has one valid test", ->
expect("life").toBe "easy"

View file

@ -0,0 +1,8 @@
// The ui-variables file is provided by base themes provided by Atom.
//
// See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
// for a full listing of what's available.
@import "ui-variables";
.meteor-api {
}