├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── dist └── ng-classify-commonjs.js ├── gulpfile.coffee ├── index.coffee ├── index.js ├── lib ├── applyCaseFilters.coffee ├── changeCase.coffee ├── classDetails.coffee ├── formatOptions.coffee ├── moduleDetails.coffee ├── moduleOptions.coffee └── moduleTypes.coffee ├── package.json └── test ├── applyCaseFilters.spec.coffee ├── changeCase.spec.coffee ├── classDetails.spec.coffee ├── formatOptions.spec.coffee └── ng-classify.spec.coffee /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 4 | notifications: 5 | email: 6 | on_success: always -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 4.1.1 (2015-01-31) 2 | 3 | 4 | #### Bug Fixes 5 | 6 | * **dist:** add missing dist to npm ([f7a34214](https://github.com/CaryLandholt/ng-classify/commit/f7a3421491c11240c3abb59514f593bae33e51e3)) 7 | 8 | 9 | ## 4.1.0 (2015-01-31) 10 | 11 | 12 | #### Features 13 | 14 | * **commonjs:** add commonjs bundle ([fe0db907](https://github.com/CaryLandholt/ng-classify/commit/fe0db907692799b0cbc72a07565393e9b6484ff6)) 15 | 16 | 17 | ### 4.0.3 (2014-12-04) 18 | 19 | 20 | #### Bug Fixes 21 | 22 | * **App:** prefix new keyword to App() constructor function ([d8e1c8a4](https://github.com/CaryLandholt/ng-classify/commit/d8e1c8a4b9a00c98ef7f7f0bd760a2cc30cd8dc3), closes [#27](https://github.com/CaryLandholt/ng-classify/issues/27)) 23 | 24 | 25 | #### Features 26 | 27 | * **wrappedClasses:** add support for wrapped classes ([c9a062f0](https://github.com/CaryLandholt/ng-classify/commit/c9a062f0a85b35bec0f4a677ab1e831cf560488c)) 28 | 29 | 30 | ### 4.0.2 (2014-08-17) 31 | 32 | 33 | #### Bug Fixes 34 | 35 | * **eval:** add allowUnsafeEval via loophole ([9d7ebd69](https://github.com/CaryLandholt/ng-classify/commit/9d7ebd69e25ba9b2e377b3b58927bcc0609ae1a0)) 36 | 37 | 38 | ### 4.0.1 (2014-08-14) 39 | 40 | 41 | #### Bug Fixes 42 | 43 | * **ambiguous-coffee-script:** ensure compilation is unambiguous ([a73cedc3](https://github.com/CaryLandholt/ng-classify/commit/a73cedc356afd7705ee8af9fa7c94149a68c41a7), closes [#20](https://github.com/CaryLandholt/ng-classify/issues/20)) 44 | 45 | Although ng-classify produces valid CoffeeScript, other dependencies may use an older version of the CoffeeScript compiler that may not. 46 | This isn't a bug fix as much as a friendly tweak. 47 | 48 | Before: 49 | ```coffee 50 | angular.module 'app' 51 | .controller 'homeController', [Home] 52 | ``` 53 | 54 | After: 55 | ```coffee 56 | angular.module('app') 57 | .controller('homeController', [Home]) 58 | ``` 59 | 60 | 61 | ## 4.0.0 (2014-08-10) 62 | 63 | 64 | #### Features 65 | 66 | * **multipleApps:** 67 | * add newline between app statements ([9b01b5e6](https://github.com/CaryLandholt/ng-classify/commit/9b01b5e61d98d7cb181f9abb1013bf2a719fac2f)) 68 | * add support for multiple apps ([1e719d42](https://github.com/CaryLandholt/ng-classify/commit/1e719d4200c19c649130eccf324bca86a5a8fc88)) 69 | * add support for multiple apps ([2f8f6c8f](https://github.com/CaryLandholt/ng-classify/commit/2f8f6c8ff7bf53db39b7d32613c027dab1acabc9)) 70 | 71 | ```coffee 72 | class Home extends Controller('my.app.name') 73 | ``` 74 | 75 | 76 | ## 3.1.0 (2014-07-04) 77 | 78 | 79 | #### Features 80 | 81 | * **moduleChaining:** chain multiple module declarations ([0e9d4c5e](https://github.com/CaryLandholt/ng-classify/commit/0e9d4c5ea6deb2c4feb5b3e19cd5885d6fbff2a5)) 82 | 83 | Before: 84 | ```coffee 85 | angular.module('app').controller 'homeController', [Home] 86 | angular.module('app').service 'aboutService', [About] 87 | ``` 88 | 89 | After: 90 | ```coffee 91 | angular.module('app') 92 | .controller 'homeController', [Home] 93 | .service 'aboutService', [About] 94 | ``` 95 | 96 | 97 | ### 3.0.1 (2014-07-02) 98 | 99 | 100 | #### Bug Fixes 101 | 102 | * **package.json:** ensure semver compliance ([31166288](https://github.com/CaryLandholt/ng-classify/commit/311662889922f08882dada8090eea020ab39261a)) 103 | 104 | 105 | ## 3.0.0 (2014-06-18) 106 | 107 | 108 | #### Bug Fixes 109 | 110 | * **classDetails:** add support for do in the constructor ([38b088f9](https://github.com/CaryLandholt/ng-classify/commit/38b088f9e40e1c8f6c813cf386614fbfe5d22b4b), closes [#8](https://github.com/CaryLandholt/ng-classify/issues/8)) 111 | 112 | 113 | #### Breaking Changes 114 | 115 | * use return value from constructor 116 | 117 | Before: 118 | ```coffee 119 | class MyValue extends Value 120 | @constructor = 'Hello' 121 | ``` 122 | 123 | After: 124 | ```coffee 125 | class MyValue extends Value 126 | constructor: -> 127 | return 'Hello' 128 | ``` 129 | 130 | ([b9e85814](https://github.com/CaryLandholt/ng-classify/commit/b9e85814f1b9957cf7647df31e9a1695af3ef337)) 131 | * use return value from constructor 132 | 133 | Before: 134 | ```coffee 135 | class MyConst extends Constant 136 | @constructor = [] 137 | ``` 138 | 139 | After: 140 | ```coffee 141 | class MyConst extends Constant 142 | constructor: -> 143 | return [] 144 | ``` 145 | 146 | ([3620e03b](https://github.com/CaryLandholt/ng-classify/commit/3620e03b35f61b6b9670eb1e5b4cc4848224736d)) 147 | * use return value from constructor 148 | 149 | Before: 150 | ```coffee 151 | class App extends App 152 | @constructor = [] 153 | ``` 154 | 155 | After: 156 | ```coffee 157 | class App extends App 158 | constructor: -> 159 | return [] 160 | ``` 161 | 162 | ([fda5a79b](https://github.com/CaryLandholt/ng-classify/commit/fda5a79b12014893110916c10df017fd594fbc65)) 163 | 164 | 165 | ## 2.0.0 (2014-06-13) 166 | 167 | 168 | #### Features 169 | 170 | * **data:** leverage other modules ([ee70d196](https://github.com/CaryLandholt/ng-classify/commit/ee70d196e5671955345a4b5b7c55d86441bce28c)) 171 | * **format:** add * format option ([dcc2029c](https://github.com/CaryLandholt/ng-classify/commit/dcc2029c0cec3ff268e69f1b236a88498e2d58ae)) 172 | 173 | 174 | #### Breaking Changes 175 | 176 | * options.data deprecated 177 | 178 | Use gulp-template or another similar library instead 179 | 180 | ([ee70d196](https://github.com/CaryLandholt/ng-classify/commit/ee70d196e5671955345a4b5b7c55d86441bce28c)) 181 | 182 | 183 | ### 1.0.2 (2014-06-09) 184 | 185 | 186 | #### Bug Fixes 187 | 188 | * **index:** add bridge from js to coffee ([298aad76](https://github.com/CaryLandholt/ng-classify/commit/298aad76d3601b2942c405cb807e021612278fb8)) 189 | 190 | 191 | 192 | ### 1.0.1 (2014-05-04) 193 | 194 | 195 | #### Bug Fixes 196 | 197 | * **moduleTypePrefix:** remove prefix from moduleType when formatting ([f752ca7d](https://github.com/CaryLandholt/ng-classify/commit/f752ca7d4e17e5a6e83d281731f881a94668e3ae), closes [#7](https://github.com/CaryLandholt/ng-classify/issues/7)) 198 | 199 | 200 | 201 | ## 1.0.0 (2014-05-04) 202 | 203 | 204 | #### Bug Fixes 205 | 206 | * **content:** 207 | * allow multiple classes ([253d2d1b](https://github.com/CaryLandholt/ng-classify/commit/253d2d1b43aa0fb8318603199c79a7f5f1c09ada), closes [#5](https://github.com/CaryLandholt/ng-classify/issues/5)) 208 | * allow multiple classes ([3dd0f4e2](https://github.com/CaryLandholt/ng-classify/commit/3dd0f4e25c3127033d29d16d1c94a14bc78e953c)) 209 | 210 | 211 | #### Features 212 | 213 | * **moduleTypePrefix:** enable namespacing of moduleTypes ([49f46653](https://github.com/CaryLandholt/ng-classify/commit/49f46653ef243ac899be76835a8fa1504c638ad4)) 214 | 215 | 216 | 217 | ### 0.5.3 (2014-05-04) 218 | 219 | 220 | #### Bug Fixes 221 | 222 | * **ng-classify:** use recursion to gather nested classes ([079f3404](https://github.com/CaryLandholt/ng-classify/commit/079f34040adab6350262611b1575f50c47d5bf00), closes [#4](https://github.com/CaryLandholt/ng-classify/issues/4)) 223 | 224 | 225 | 226 | ### 0.5.2 (2014-05-03) 227 | 228 | 229 | #### Bug Fixes 230 | 231 | * **comments:** iterate properties properly ([05138b88](https://github.com/CaryLandholt/ng-classify/commit/05138b88432b0266dcd40a07bece8e5426475953), closes [#3](https://github.com/CaryLandholt/ng-classify/issues/3)) 232 | 233 | 234 | 235 | ### 0.5.1 (2014-05-02) 236 | 237 | 238 | #### Bug Fixes 239 | 240 | * **coffee-script:** move coffee-script to dependencies ([a92f54b3](https://github.com/CaryLandholt/ng-classify/commit/a92f54b3fe696250f5807d2b8165a41241418f4a)) 241 | 242 | 243 | 244 | ## 0.5.0 (2014-05-02) 245 | 246 | 247 | #### Bug Fixes 248 | 249 | * **parsing:** remove regex parsing, use coffee-script nodes ([194c5917](https://github.com/CaryLandholt/ng-classify/commit/194c5917b83b3f485d22ef6292797f58d9624fbd)) 250 | 251 | 252 | 253 | ## 0.4.2 (2014-03-20) 254 | 255 | 256 | #### Bug Fixes 257 | 258 | * **format:** screamingSnakeCase and snakeCase missing assignment ([bc977c6b](https://github.com/CaryLandholt/ng-classify/commit/bc977c6b0a95b4ab92e4454db01ddf073a0b4e14)) 259 | * **ngClassify:** Return original content if ng-classify pattern is not found ([5e627075](https://github.com/CaryLandholt/ng-classify/commit/5e62707556306788b57d0a6dd2a42090f5c43ced), closes [#2](https://github.com/CaryLandholt/ng-classify/issues/2)) 260 | 261 | 262 | #### Features 263 | 264 | * **Animation:** add support for Animation class type ([99cdbe01](https://github.com/CaryLandholt/ng-classify/commit/99cdbe01c974ea4f64d146697390a507535eaae7), closes [#1](https://github.com/CaryLandholt/ng-classify/issues/1)) 265 | * **App:** add support for app module ([2907c997](https://github.com/CaryLandholt/ng-classify/commit/2907c99704e85de92c5e96586c588265ca465c55)) 266 | * **options:** format, prefix, and suffix are configurable ([aa7a047e](https://github.com/CaryLandholt/ng-classify/commit/aa7a047e2b4a1666d5f67f83991b63bce1cb1d0c)) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to ng-classify 2 | 3 | 4 | ## Table of Contents 5 | * [Issues](#issues) 6 | * [Pull Requests](#pull-requests) 7 | * [Commit Message Guidelines](#commit-message-guidelines) 8 | 9 | 10 | ## Issues 11 | If you find a bug in the source code or a mistake in the documentation, you can help by submitting an [issue](https://github.com/CaryLandholt/ng-classify/issues) to the repository. Even better, you can submit a [Pull Request](#pull-requests) with a fix. 12 | 13 | Before you submit your issue, search the [archive](https://github.com/CaryLandholt/ng-classify/issues). Maybe your question was already answered. 14 | 15 | If your issue appears to be a bug, and hasn't been reported, open a new issue. Help to maximize the effort spent fixing issues and adding new features, by not reporting duplicate issues. Providing the following information will increase the chances of your issue being dealt with quickly: 16 | 17 | * **Overview of the issue** - if an error is being thrown a non-minified stack trace helps 18 | * **Motivation for or Use Case** - explain why this is a bug for you 19 | * **Version(s)** - is it a regression? 20 | * **Operating System** - is this a problem with only Windows? 21 | * **Reproduce the error** - provide a live example (using [Plunker](http://plnkr.co/edit) or [JSFiddle](http://jsfiddle.net/)) or an unambiguous set of steps. 22 | * **Related issues** - has a similar issue been reported before? 23 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit) 24 | 25 | 26 | ## Pull Requests 27 | Before you submit your pull request, consider the following guidelines: 28 | 29 | * Search for an open or closed [Pull Request](https://github.com/CaryLandholt/ng-classify/pulls) that relates to your submission. You don't want to duplicate effort. 30 | * Make your changes in a new git branch 31 | ```bash 32 | $ git checkout -b my-fix-branch master 33 | ``` 34 | * Create your patch, **including appropriate test cases** 35 | * In lieu of a formal styleguide, take care to maintain the existing coding style. Lint your code. 36 | * Run the full test suite, and ensure that all tests pass 37 | * Commit your changes using a descriptive commit message that follows the [Commit Message Guidelines](#commit-message-guidelines) and passes the commit message presubmit hook `validate-commit-msg.js`. Adherence to the [Commit Message Guidelines](#commit-message-guidelines) is required, because release notes are automatically generated from these messages. 38 | ```bash 39 | $ git commit -a 40 | ``` 41 | Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files 42 | * Build your changes locally to ensure all the tests pass 43 | ```bash 44 | $ gulp test 45 | ``` 46 | * Push your branch 47 | ```bash 48 | $ git push origin my-fix-branch 49 | ``` 50 | * Send a pull request to `ng-classify:master` 51 | * If changes are suggested then: 52 | - Make the required updates 53 | - Re-run the test suite to ensure tests are still passing 54 | - Rebase your branch and force push to your repository (this will update your Pull Request): 55 | ```bash 56 | $ git rebase master -i 57 | $ git push -f 58 | ``` 59 | 60 | **Thank you for your contribution!** 61 | 62 | After your pull request is merged, you can safely delete your branch, and pull the changes from the main (upstream) repository: 63 | 64 | * Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: 65 | ```bash 66 | $ git push origin --delete my-fix-branch 67 | ``` 68 | * Check out the master branch: 69 | ```bash 70 | $ git checkout master -f 71 | ``` 72 | * Delete the local branch: 73 | ```bash 74 | $ git branch -D my-fix-branch 75 | ``` 76 | * Update your master with the latest upstream version: 77 | ```bash 78 | $ git pull --ff upstream master 79 | ``` 80 | 81 | 82 | ## Commit Message Guidelines 83 | There are very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. But also, the git commit messages are used to generate the [Changelog](CHANGELOG.md). 84 | 85 | 86 | ### Commit Message Format 87 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **[Type](#type)**, a **[Scope](#scope)**, and a **[Subject](#subject)**: 88 | 89 | ``` 90 | (): 91 | 92 | 93 | 94 |