├── .editorconfig ├── .eslintrc ├── .gitignore ├── .npmrc ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── examples ├── class-decorators │ ├── mark-constructor.js │ └── wrap-constructor.js └── method-decorators │ ├── class-method-rename.js │ ├── class-props.js │ ├── coalesce.js │ ├── combine-getter-setter.js │ ├── double-decorate-get-set.js │ ├── extras.js │ ├── finishers.js │ ├── obj-prop.js │ ├── obj-spread.js │ ├── preserve-ctor.js │ ├── reflect-metadata.js │ └── symbol-key.js ├── lib └── babel-plugin-transform-decorators-stage-2-initial.js ├── package.json └── test ├── .eslintrc ├── decorators.test.js └── mocha.opts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "groupon-es5" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | /tmp 4 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '4' 4 | - '6' 5 | before_deploy: 6 | - git config --global user.email "jan.krems@gmail.com" 7 | - git config --global user.name "Jan Krems" 8 | deploy: 9 | provider: script 10 | script: ./node_modules/.bin/nlm release 11 | skip_cleanup: true 12 | 'on': 13 | branch: master 14 | node: '6' 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Contributing 4 | 5 | 🎉🏅 Thanks for helping us improve this project! 🙏 6 | 7 | This document outlines some of the practices we care about. 8 | If you have any questions or suggestions about the process, 9 | feel free to [open an issue](#reporting-issues) 10 | . 11 | 12 | ## How Can I Contribute? 13 | 14 | ### Reporting Issues 15 | 16 | If you find any mistakes in the docs or a bug in the code, 17 | please [open an issue in Github](https://github.com/jkrems/babel-plugin-transform-decorators-stage-2-initial/issues/new) so we can look into it. 18 | You can also [create a PR](#contributing-code) fixing it yourself, or course. 19 | 20 | If you report a bug, please follow these guidelines: 21 | 22 | * Make sure the bug exists in the latest version. 23 | * Include instructions on how to reproduce the issue. 24 | The instructions should be as minimal as possible 25 | and answer the three big questions: 26 | 1. What are the exact steps you took? This includes the exact versions of node, npm, and any packages involved. 27 | 1. What result are you expecting? 28 | 1. What is the actual result? 29 | 30 | ### Improving Documentation 31 | 32 | For small documentation changes, you can use [Github's editing feature](https://help.github.com/articles/editing-files-in-another-user-s-repository/). 33 | The only thing to keep in mind is to prefix the commit message with "docs: ". 34 | The detault commit message generated by Github will lead to a failing CI build. 35 | 36 | For larger updates to the documentation 37 | it might be better to follow the [instructions for contributing code below](#contributing-code). 38 | 39 | ### Contributing Code 40 | 41 | **Note:** If you're planning on making substantial changes, 42 | please [open an issue first to discuss your idea](#reporting-issues). 43 | Otherwise you might end up investing a lot of work 44 | only to discover that it conflicts with plans the maintainers might have. 45 | 46 | The general steps for creating a pull request are: 47 | 48 | 1. Create a branch for your change. 49 | Always start your branch from the latest `master`. 50 | We often prefix the branch name with our initials, e.g. `jk-a-change`. 51 | 1. Run `npm install` to install the dependencies. 52 | 1. If you're fixing a bug, be sure to write a test *first*. 53 | That way you can validate that the test actually catches the bug and doesn't pass. 54 | 1. Make your changes to the code. 55 | Remember to update the tests if you add new features or change behavior. 56 | 1. Run the tests via `npm test`. This will also run style checks and other validations. 57 | You might see errors about uncommitted files. 58 | This is expected until you commit your changes. 59 | 1. Once you're done, `git add .` and `git commit`. 60 | Please follow the [commit message conventions](#commits--commit-messages) described below. 61 | 1. Push your branch to Github & create a PR. 62 | 63 | #### Code Style 64 | 65 | In addition to any linting rules the project might include, 66 | a few general rules of thumb: 67 | 68 | * Try to match the style of the rest of the code. 69 | * We prefer simple code that is easy to understand over terse, expressive code. 70 | * We try to structure projects by semantics instead of role. 71 | E.g. we'd rather have a `tree.js` module that contains tree traversal-related helpers 72 | than a `helpers.js` module. 73 | * Actually, if you create helpers you might want to put those into a separate package. 74 | That way it's easier to reuse them. 75 | 76 | #### Commits & Commit Messages 77 | 78 | Please follow the [angular commit message conventions](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). 79 | We use an automated tool for generating releases 80 | that depends on the conventions to determine the next version and the content of the changelog. 81 | Commit messages that don't follow the conventions will cause `npm test` (and thus CI) to fail. 82 | 83 | The short summary - a commit message should look like this: 84 | 85 | ``` 86 | : 87 | 88 | 89 | 90 | 91 | 92 |