Package detail

aurelia-metadata

aurelia54.7kMIT1.0.8

Utilities for reading and writing the metadata of JavaScript functions.

aurelia, metadata, annotations

readme

Aurelia

License: MIT npm Version Discourse status TypeScript Twitter

Backers on Open Collective Sponsors on Open Collective Discord Chat

aurelia-metadata

This library is part of the Aurelia platform and contains utilities for reading and writing the metadata of JavaScript functions. It provides a consistent way of accessing type, annotation and origin metadata across a number of languages and formats. This library supports TypeScript metadata and contains helper functions that understand several simple, alternate locations and formats for metadata which are more easily leveraged by developers authoring code in plain ES6 or ES5.

To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions, please join our community on Gitter or use stack overflow. Documentation can be found in our developer hub.

Platform Support

This library can be used in the browser as well as on the server.

Building The Code

To build the code, follow these steps.

  1. Ensure that NodeJS version 12+ is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:

     npm ci
  3. To build the code, you can now run:

     npm run build
  4. You will find the compiled code in the dist folder, available in three module formats: AMD, CommonJS and ES6.

  5. See gulpfile.js, or package.json (scripts section) for other tasks related to generating the docs and linting.

Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

  1. You can now run the tests with this command:

     npm run test

If you want to run the test in watch mode, you can run this command:

npm run test:watch

changelog

1.0.8 (2020-11-05)

1.0.7 (2019-03-26)

Bug Fixes

  • all: change es2015 back to native-modules (1d4bfe2)

1.0.6 (2019-02-04)

Bug Fixes

  • all: change es2015 back to native-modules (1d4bfe2)

1.0.5 (2019-01-18)

  • Add module field to package.json.

1.0.4 (2018-06-13)

Bug Fixes

  • metadata: IE cross origin frame Access Denied on Window['frameElement'] in Origin.get (5e678d7)
  • metadata: IE cross origin frame Access Denied on Window['frameElement'] in Origin.get - add test (553c5a2)

1.0.3 (2016-12-23)

Bug Fixes

1.0.1 (2016-10-05)

Bug Fixes

1.0.0 (2016-07-27)

1.0.0-rc.1.0.1 (2016-07-12)

1.0.0-rc.1.0.0 (2016-06-22)

1.0.0-beta.1.2.1 (2016-05-10)

Bug Fixes

  • metadata: targetKey in Reflect.defineMetadata is optional (fa861f7c)

1.0.0-beta.1.2.0 (2016-03-22)

  • Update to Babel 6

1.0.0-beta.1.1.6 (2016-03-02)

Bug Fixes

1.0.0-beta.1.1.5 (2016-03-01)

Bug Fixes

  • all: remove core-js dependency (3a300a87)

Features

  • all: remove duplicate code and use new polyfills (ec2b65ee)

1.0.0-beta.1.1.4 (2016-02-08)

1.0.0-beta.1.1.2 (2016-01-28)

  • fix package metadata for jspm

1.0.0-beta.1.1.0 (2016-01-28)

Features

  • all: update for jspm; update core-js; update aurelia deps (01aa7e40)

1.0.0-beta.1 (2015-11-15)

0.10.1 (2015-11-11)

Bug Fixes

  • all: improve TS happiness for decorators (dd35c4fd)

0.10.0 (2015-11-09)

Bug Fixes

  • decorators: remove generics causing the build to fail (88067ab4)
  • eslintrc: linting configuration (86ee6498)
  • protocol: make decorates work with any object type (dd64b951)

Features

  • all: new decorators, mixin, protocol and deprecated; new way for ES5/6 to apply decor (b0c2cd4c)

0.9.0 (2015-10-13)

Bug Fixes

  • ResourceType: fix load to return Promise (a43e8d28)
  • all:
    • Metadata to metadata Decorators to decorators (86abaa7b)
    • remove System faking and move eachModule helper (b8c1ce2e)
    • address issue with globals and remove unnecessary Reflect.metadata poly (93cda3b4)
    • update compiler, fix core-js ref (b3dd9ea8)
  • annotations:
  • annotations spec: remove bad import (d949c42d)
  • build:
    • update linting, testing and tools (15c83ea6)
    • add missing bower bump (017aad74)
  • metadata:
    • Use correct import for core-js We were previously using `import core from core-j (d7895cf5)
    • incorrect types and global references (88dbfb5e, closes #16, #17)
    • mark fake System as such (c40cfcb8)
    • store in private map (52aed24e)
    • fix initializer for _first property (740eb07c)
    • add the locator config back on a configure property (555612d1)
    • fix safari complaint about variable "locator" (6e887eac)
    • rename configuration helper (81c73ec1)
    • accidental double wrapping of custom location function (ac11ead8)
  • origin:
    • short-circuit module registry search on origin location success (889e0ce7)
    • never return null for a origin check (cc25a5e6)
  • origin.spec: incorrect test for empty origin data (14304d56)
  • package:
    • update aurelia tools and dts generator (4cba6176)
    • change jspm directories (2d61d2da)
  • readme: Now mentions Chrome required to run tests. (86d9f4c2)
  • test: correct import sources (fd5b6f06)

Features

  • all:
    • update to pal (6544cec1)
    • improve d.ts generation and api doc comments (901f6747)
    • improve type info (1818b0a8)
    • metadata is now based on the ES7 proposal (32ebe967)
    • new decorator infrastructure (72a6226e)
  • annotations: enable deep traversal of inheritance hierarchy (db07e892)
  • build:
    • d.ts generation and build concat (e7e24b5b)
    • update to latest 6to5 and switch to system.register module format (8d5e644b)
  • docs: generate api.json from .d.ts file (8edc2390)
  • metadata:
    • add a noop property for noop functions (bcd4fc66)
    • add firstOrAdd helper (8ba74b71)
    • enable adding custom metadata as first metadata method (705fd865, closes #7)
    • enhance dsl for configuring added metadata (8ba28995)
    • add a "has" helper to MetadataStorage (362fcc7b)
    • new metadata fluent api (b4c8162f)
    • re-implement metadata (ce0304e2)
  • origin:
    • search module registry for module id if not found (4abfc246)
    • do not alter target object or function with origin data (cbb8ac3a)

0.8.0 (2015-09-04)

Bug Fixes

  • build: update linting, testing and tools (15c83ea6)

Features

  • all: improve d.ts generation and api doc comments (901f6747)
  • metadata: add a noop property for noop functions (bcd4fc66)

0.7.3 (2015-08-14)

Bug Fixes

  • metadata: Use correct import for core-js We were previously using `import core from core-j (d7895cf5)

Features

  • all: improve type info (1818b0a8)
  • docs: generate api.json from .d.ts file (8edc2390)

0.7.2 (2015-08-04)

0.7.1 (2015-07-29)

Bug Fixes

  • metadata: incorrect types and global references (88dbfb5e, closes #16, #17)

0.7.0 (2015-07-01)

Bug Fixes

  • all: address issue with globals and remove unnecessary Reflect.metadata poly (93cda3b4)
  • metadata: mark fake System as such (c40cfcb8)
  • origin: short-circuit module registry search on origin location success (889e0ce7)
  • package: update aurelia tools and dts generator (4cba6176)
  • test: correct import sources (fd5b6f06)

Features

  • build: d.ts generation and build concat (e7e24b5b)

0.6.0 (2015-06-08)

Bug Fixes

  • readme: Now mentions Chrome required to run tests. (86d9f4c2)

Features

  • origin: search module registry for module id if not found (4abfc246)

0.5.0 (2015-04-30)

Bug Fixes

  • origin: never return null for a origin check (cc25a5e6)
  • origin.spec: incorrect test for empty origin data (14304d56)

Features

  • all: metadata is now based on the ES7 proposal (32ebe967)

0.4.0 (2015-04-09)

Bug Fixes

  • ResourceType: fix load to return Promise (a43e8d28)
  • all: update compiler, fix core-js ref (b3dd9ea8)
  • metadata:
    • store in private map (52aed24e)
    • fix initializer for _first property (740eb07c)
    • add the locator config back on a configure property (555612d1)

Features

  • all: new decorator infrastructure (72a6226e)
  • metadata: add firstOrAdd helper (8ba74b71)

0.3.4 (2015-03-24)

Features

  • metadata: enable adding custom metadata as first metadata method (705fd865, closes #7)

0.3.3 (2015-02-28)

Bug Fixes

  • package: change jspm directories (2d61d2da)

0.3.2 (2015-02-27)

Bug Fixes

  • build: add missing bower bump (017aad74)

0.3.1 (2015-01-25)

Bug Fixes

  • metadata: fix safari complaint about variable "locator" (6e887eac)

0.3.0 (2015-01-22)

Bug Fixes

  • metadata:
    • rename configuration helper (81c73ec1)
    • accidental double wrapping of custom location function (ac11ead8)

Features

  • metadata:
    • enhance dsl for configuring added metadata (8ba28995)
    • add a "has" helper to MetadataStorage (362fcc7b)
    • new metadata fluent api (b4c8162f)
    • re-implement metadata (ce0304e2)
  • origin: do not alter target object or function with origin data (cbb8ac3a)

0.2.4 (2015-01-12)

Bug Fixes

  • annotations: remove bad export (e307aaa8)
  • annotations spec: remove bad import (d949c42d)

0.2.3 (2015-01-06)

  • Updated package data to ensure proper system.register module format detetion by jspm.

0.2.0 (2015-01-06)

Features

  • annotations: enable deep traversal of inheritance hierarchy (db07e892)
  • build: update to latest 6to5 and switch to system.register module format (8d5e644b)

0.1.0 (2014-12-11)

Bug Fixes

  • annotations: normalize annotations on the fly (0c2b6a55)