├── .editorconfig ├── .gitignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── package.json └── snippets ├── Aurelia(html).cson └── Aurelia.cson /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All Notable changes to `atom-aurelia-snippets` will be documented in this file. 4 | 5 | Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. 6 | 7 | ## NEXT - 2016-07-09 8 | 9 | ### Added 10 | - Nothing 11 | 12 | ### Deprecated 13 | - Nothing 14 | 15 | ### Fixed 16 | - Nothing 17 | 18 | ### Removed 19 | - Nothing 20 | 21 | ### Security 22 | - Nothing 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Prosper Otemuyiwa 4 | 5 | > Permission is hereby granted, free of charge, to any person obtaining a copy 6 | > of this software and associated documentation files (the "Software"), to deal 7 | > in the Software without restriction, including without limitation the rights 8 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | > copies of the Software, and to permit persons to whom the Software is 10 | > furnished to do so, subject to the following conditions: 11 | > 12 | > The above copyright notice and this permission notice shall be included in 13 | > all copies or substantial portions of the Software. 14 | > 15 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | > THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Atom AureliaJS Snippets ![](https://img.shields.io/badge/unicodeveloper-approved-brightgreen.svg) 2 | 3 | An [Atom](https://atom.io/) snippet library for Aurelia JS framework. This library uses ES6 syntax. 4 | 5 | Install 6 | ------- 7 | 8 | Go to `Packages > Settings View > Open` once in settings go to the Install tab and search for **aurelia-snippets** 9 | 10 | Restart Atom 11 | 12 | Documentation 13 | -------- 14 | 15 | - [Aurelia Snippets](https://github.com/unicodeveloper/atom-aurelia-snippets/wiki/Aurelia-Snippets) 16 | 17 | 18 | Development 19 | ----------- 20 | 21 | ```sh 22 | $ cd ~/.atom/packages 23 | $ git clone https://github.com/unicodeveloper/atom-aurelia-snippets.git 24 | $ cd atom-aurelia-snippets 25 | $ apm install 26 | $ apm link 27 | ``` 28 | 29 | ## Change log 30 | 31 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 32 | 33 | ## Contributing 34 | 35 | 1. Fork it! 36 | 2. Create your feature branch: `git checkout -b my-new-feature` 37 | 3. Commit your changes: `git commit -m 'Add some feature'` 38 | 4. Push to the branch: `git push origin my-new-feature` 39 | 5. Submit a pull request 40 | 41 | ## How can I thank you? 42 | 43 | Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word! 44 | 45 | Don't forget to [follow me on twitter](https://twitter.com/unicodeveloper)! 46 | 47 | Thanks! 48 | Prosper Otemuyiwa. 49 | 50 | ## License 51 | 52 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 53 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-snippets", 3 | "version": "1.3.1", 4 | "description": "Atom Snippets for Aurelia", 5 | "main": "./snippets", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "aurelia", 11 | "aurelia snippets", 12 | "snippets", 13 | "es6" 14 | ], 15 | "engines": { 16 | "atom": ">0.50.0" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/unicodeveloper/atom-aurelia-snippets.git" 21 | }, 22 | "author": "Prosper Otemuyiwa", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/unicodeveloper/atom-aurelia-snippets/issues" 26 | }, 27 | "homepage": "https://github.com/unicodeveloper/atom-aurelia-snippets#readme" 28 | } 29 | -------------------------------------------------------------------------------- /snippets/Aurelia(html).cson: -------------------------------------------------------------------------------- 1 | ".text.html": 2 | "Aurelia: if binding": 3 | prefix: "_if" 4 | body: "if.bind=\"${expression}\"" 5 | 6 | "Aurelia: with binding": 7 | prefix: "_with" 8 | body: "with.bind=\"${expression}\"" 9 | 10 | "Aurelia: value binding": 11 | prefix: "_value" 12 | body: "value.bind=\"${binding}\"" 13 | 14 | "Aurelia: input binding": 15 | prefix: "_input" 16 | body: "input.bind=\"${binding}\"" 17 | 18 | "Aurelia: href binding": 19 | prefix: "_value" 20 | body: "href.bind=\"${url}\"" 21 | 22 | "Aurelia: router binding": 23 | prefix: "_router" 24 | body: "router.bind=\"${router}\"" 25 | 26 | "Aurelia: click triggering": 27 | prefix: "_clt" 28 | body: "click.trigger=\"${trigger}\"" 29 | 30 | "Aurelia: click delegate": 31 | prefix: "_cld" 32 | body: "click.delegate=\"${delegate}\"" 33 | 34 | "Aurelia: repeat for": 35 | prefix: "_rpf" 36 | body: "repeat.for=\"${item} of ${collection}\"" 37 | 38 | "Aurelia: value two way binding": 39 | prefix: "_vtw" 40 | body: "value.two-way=\"${binding}\"" 41 | 42 | "Aurelia: value one way binding": 43 | prefix: "_vow" 44 | body: "click.one-way=\"${binding}\"" 45 | 46 | "Aurelia: value one time binding": 47 | prefix: "_vot" 48 | body: "value.one-time=\"${binding}\"" 49 | 50 | "Aurelia: model binding": 51 | prefix: "_mob" 52 | body: "model.bind=\"${binding}\"" 53 | 54 | "Aurelia: model two way binding": 55 | prefix: "_mtw" 56 | body: "model.two-way=\"${binding}\"" 57 | 58 | "Aurelia: model one way binding": 59 | prefix: "_mow" 60 | body: "model.one-way=\"${binding}\"" 61 | 62 | "Aurelia: model one time binding": 63 | prefix: "_mot" 64 | body: "model.one-time=\"${binding}\"" 65 | 66 | "Aurelia: checked binding": 67 | prefix: "_chb" 68 | body: "checked.bind=\"${binding}\"" 69 | 70 | "Aurelia: innerhtml binding": 71 | prefix: "_ihb" 72 | body: "innerhtml.bind=\"${binding}\"" 73 | 74 | "Aurelia: textcontent binding": 75 | prefix: "_tcb" 76 | body: "textcontent.bind=\"${binding}\"" 77 | 78 | "Aurelia: style binding": 79 | prefix: "_stb" 80 | body: "style.bind=\"${binding}\"" 81 | 82 | "Aurelia: show binding": 83 | prefix: "_shb" 84 | body: "show.bind=\"${binding}\"" 85 | 86 | "Aurelia: view-model binding": 87 | prefix: "_vmb" 88 | body: "view-model.bind=\"${binding}\"" 89 | 90 | "Aurelia: compose": 91 | prefix: "_cmp" 92 | body: "" 93 | 94 | "Aurelia: template": 95 | prefix: "_tmp" 96 | body: """ 97 | 100 | """ 101 | 102 | "Aurelia: require": 103 | prefix: "_req" 104 | body: "" 105 | 106 | "Aurelia: bindable": 107 | prefix: "_bnd" 108 | body: "bindable=\"${name}\"" 109 | 110 | "Aurelia: to binding": 111 | prefix: "_tob" 112 | body: "to.bind=\"${binding}\"" 113 | 114 | "Aurelia: template replaceable": 115 | prefix: "_trp" 116 | body: """ 117 | 120 | """ 121 | 122 | "Aurelia: template replace part": 123 | prefix: "_trpp" 124 | body: """ 125 | 128 | """ 129 | 130 | "Aurelia: view references": 131 | prefix: "_vref" 132 | body: "view.ref=\"${someIdentifier}\"" 133 | 134 | "Aurelia: view-model references": 135 | prefix: "_vref" 136 | body: "view-model.ref=\"${someIdentifier}\"" 137 | 138 | "Aurelia: controller references": 139 | prefix: "_cref" 140 | body: "controller.ref=\"${someIdentifier}\"" 141 | 142 | "Aurelia: attribute-name references": 143 | prefix: "_aref" 144 | body: "attribute-name.ref=\"${someIdentifier}\"" 145 | 146 | "Aurelia: element references": 147 | prefix: "_eref" 148 | body: "element.ref=\"${someIdentifier}\"" 149 | 150 | "Aurelia: producer.bind": 151 | prefix: "_pref" 152 | body: "producer.ref=\"${producerVMurl}\"" 153 | -------------------------------------------------------------------------------- /snippets/Aurelia.cson: -------------------------------------------------------------------------------- 1 | ".source.js": 2 | "Aurelia: canActivate() { ... }": 3 | prefix: "_cat" 4 | body: "canActivate() {\n\t${1}\n}${2}" 5 | 6 | "Aurelia: activate() { ... }": 7 | prefix: "_act" 8 | body: "activate() {\n\t${1}\n}${2}" 9 | 10 | "Aurelia: deactivate() { ... }": 11 | prefix: "_dct" 12 | body: "deactivate() {\n\t${1}\n}${2}" 13 | 14 | "Aurelia: canDeactivate() { ... }": 15 | prefix: "_cda" 16 | body: "canDeactivate() {\n\t${1}\n}${2}" 17 | 18 | "Aurelia: created(ov, mv) { ... }": 19 | prefix: "_cre" 20 | body: "created(owningView: View, myView: View) {\n\t${1}\n}${2}" 21 | 22 | "Aurelia: bind(bc, oc) { ... }": 23 | prefix: "_bin" 24 | body: "bind(bindingContext: Object, overrideContext: Object) {\n\t${1}\n}${2}" 25 | 26 | "Aurelia: attached() { ... }": 27 | prefix: "_att" 28 | body: "attached() {\n\t${1}\n}${2}" 29 | 30 | "Aurelia: detached() { ... }": 31 | prefix: "_det" 32 | body: "detached() {\n\t${1}\n}${2}" 33 | 34 | "Aurelia: unbind() { ... }": 35 | prefix: "_unb" 36 | body: "unbind() {\n\t${1}\n}${2}" 37 | 38 | "Aurelia: use plugin": 39 | prefix: "_aup" 40 | body: "aurelia.use.plugin(${1})" 41 | 42 | "Aurelia decorators: @syncChildren(pp, cH, sl)": 43 | prefix: "_sc" 44 | body: "@syncChildren(property, changeHandler, selector)" 45 | 46 | "Aurelia decorators: @skipContentProcessing": 47 | prefix: "_sp" 48 | body: "@skipContentProcessing" 49 | 50 | "Aurelia decorators: @useView(path)": 51 | prefix: "_uv" 52 | body: "@useView('${1}')" 53 | 54 | "Aurelia decorators: @noView": 55 | prefix: "_nv" 56 | body: "@noView" 57 | 58 | "Aurelia decorators: @inject": 59 | prefix: "_ij" 60 | body: "@inject('${1}')" 61 | 62 | "Aurelia decorators: @customAttribute": 63 | prefix: "_ca" 64 | body: "@customAttribute('${1}')" 65 | 66 | "Aurelia decorators: @bindable": 67 | prefix: "_bd" 68 | body: "@bindable('${1}')" 69 | 70 | "Aurelia: Logging": 71 | prefix: '_log' 72 | body: """ 73 | import {LogManager} from 'aurelia-framework'; 74 | import {ConsoleAppender} from 'aurelia-logging-console'; 75 | 76 | LogManager.addAppender(new ConsoleAppender()); 77 | LogManager.setLevel(LogManager.logLevel.debug); 78 | 79 | export function configure(aurelia) { 80 | aurelia.use 81 | .standardConfiguration; 82 | 83 | aurelia.start().then(() => aurelia.setRoot()); 84 | } 85 | """ 86 | 87 | "Aurelia: configure": 88 | prefix: '_cnf' 89 | body: """ 90 | export function configure(aurelia) { 91 | aurelia.use 92 | .standardConfiguration() 93 | .developmentLogging(); 94 | 95 | \n\t${1} 96 | }; 97 | """ 98 | 99 | "Aurelia: configure globalResources": 100 | prefix: '_cfg' 101 | body: """ 102 | export function configure(aurelia) { 103 | aurelia.use 104 | .standardConfiguration() 105 | .developmentLogging() 106 | .globalResources('${1}'); 107 | 108 | aurelia.start().then(() => aurelia.setRoot()); 109 | 110 | \n\t${2} 111 | }; 112 | """ 113 | 114 | "Aurelia: configureRouter() { ... }": 115 | prefix: "_cfr" 116 | body: """ 117 | configureRouter(config, router) { 118 | config.title = '${1}'; 119 | config.map([ 120 | { route: ['','${2}'], name: '${3}', moduleId: '${4}', nav: true, title:'${5}' }, 121 | ]); 122 | 123 | this.router = router; 124 | } 125 | """ 126 | 127 | "Aurelia: class Skeleton": 128 | prefix: "_class" 129 | body: """ 130 | import { ${1} } from 'aurelia-framework'; 131 | 132 | export class ${2} { 133 | constructor(){ 134 | 135 | } 136 | } 137 | """ 138 | --------------------------------------------------------------------------------