JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 47306
  • Score
    100M100P100Q169053F
  • License MIT

Babel plugin to add angularjs dependency injection annotations

Package Exports

  • babel-plugin-angularjs-annotate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-angularjs-annotate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-plugin-angularjs-annotate

Circle CI

Experimental fork of ng-annotate.

Work in progress. Do not use this for anything serious. Stick with ng-annotate or babel-ng-annotate for now.

Goals & Tasks

This project/experiment does not seek to replace ng-annotate. However, it does seek to provide similar functionality for Angular 1.x developers who are already using Babel and/or coding in ES6.

Because of some of the limitations presented by Babel's transformation process, this project does not aim to achieve feature parity, or provide identical output to ng-annotate. Notably, Babel does not preserve formatting and indentations like ng-annotate does.

Initially, I had hoped to make very few modifications to the upstream sources, in the hopes of eventually merging babel support directly into ng-annotate. Unfortunately, Babylon appears to have diverged too far from Acorn to make that goal realistic. (I would love to be wrong here, and would welcome contributions that close the gap between the two projects!)

That being said, this is my short-term todo list:

  • ✓ Support the majority of invocations/annotations currently performed by ng-annotate
  • ✓ Split up ng-annotate's test suite to be more granular and tolerant of some of babel's other transforms.
  • ✓ Actually pass those tests.
  • Pass tests in conjunction with the ES2015 preset.
  • Cleanup. Remove vestigial functionality from the upstream project.
  • Support a (very) limited set of ES6-friendly annotation patterns.
  • Publish to npm, make a release, etc.

Don't Say I Didn't Warn You

To test this mess of an experiment, create a .babelrc file for your sources

{
  "presets": ["es2015"],
  "plugins": ["path/to/babel-ng-annotate"]
}

And try it out:

babel myCode.js

To run tests:

npm test

License

MIT, see LICENSE file.

This project is a fork of ng-annotate, which was written by Olov Lassus with the kind help by contributors. Follow @olov on Twitter for updates about ng-annotate.