Permalink
Browse files

remove direct dependency for reflect-metadat

  • Loading branch information...
1 parent 301388b commit 5514ac0806072e1d2e43f20f39ea48fa23f43814 @mseemann committed Sep 29, 2016
Showing with 31 additions and 42 deletions.
  1. +1 −0 README.md
  2. +1 −0 config/spec-bundle.js
  3. +11 −12 package.json
  4. +0 −1 src/core/decorator-parser.ts
  5. +0 −1 src/core/decorators.ts
  6. +8 −2 src/js-restful.ts
  7. +0 −1 src/vendor.ts
  8. +10 −16 tsconfig.json
  9. +0 −9 typings.json
View
@@ -14,6 +14,7 @@ Create a RESTful service with ES7 decorators for your node.js application.
```bash
npm install js-restful --save
```
+Make sure you have a shim for es7 reflect. For example core-js or reflect-metadat.
**Usage**
Extend your node js service class with decorators (this is TypeScript with decorators!):
@@ -2,6 +2,7 @@
Error.stackTraceLimit = Infinity;
require('ts-helpers');
+require('core-js');
var testContext = require.context('../src', true, /\.spec\.ts/);
View
@@ -5,9 +5,8 @@
"main": "src/js-restful.js",
"typings": "./src/js-restful.d.ts",
"scripts": {
- "install_typings": "typings install",
- "test": "typings install && tsc && node --max-old-space-size=4096 node_modules/karma/bin/karma start",
- "prepublish": "typings install && tsc",
+ "test": "tsc -version && tsc && node --max-old-space-size=4096 node_modules/karma/bin/karma start",
+ "prepublish": "tsc",
"docs": "jsdoc -c config/jsdoc-conf.json -r src"
},
"repository": {
@@ -28,14 +27,14 @@
],
"author": "Michael Seemann",
"license": "MIT",
- "dependencies": {
- "reflect-metadata": "0.1.2"
- },
- "peerDependencies": {
- "reflect-metadata": "0.1.2"
- },
+ "dependencies": {},
+ "peerDependencies": {},
"devDependencies": {
+ "@types/core-js": "^0.9.34",
+ "@types/jasmine": "^2.2.34",
+ "@types/reflect-metadata": "0.0.4",
"codeclimate-test-reporter": "^0.3.1",
+ "core-js": "^2.4.1",
"coveralls": "^2.11.9",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "2.4.1",
@@ -52,10 +51,10 @@
"source-map-loader": "^0.1.5",
"ts-helpers": "^1.1.1",
"ts-loader": "^0.8.2",
- "tslint": "3.8.1",
+ "tslint": "3.15.1",
"tslint-loader": "^2.1.4",
- "typescript": "1.8.10",
- "typings": "0.8.1",
+ "typescript": "2.0.3",
+ "typings": "1.4.0",
"webpack": "1.13.0"
},
"bugs": {
@@ -1,4 +1,3 @@
-import 'reflect-metadata';
import { ServiceDescription, MethodDescription, HttpMethod, ParamDescription } from "./descriptions";
import * as namings from './namings';
import {contextParam} from "./namings";
@@ -1,4 +1,3 @@
-import 'reflect-metadata';
import * as namings from './namings';
import {ParamDescription, HttpMethod, ContextTypes} from './descriptions';
import { DecoratorUtil } from './decoratorUtil';
View
@@ -12,7 +12,13 @@ export {
SecurityContext,
RolesAllowed } from './core/decorators';
export { ServiceParser } from './core/decorator-parser';
-export { ServiceDescription, MethodDescription, HttpMethod, ParamDescription, ContextTypes, ISecurityContext, IUser } from './core/descriptions';
+export {
+ ServiceDescription,
+ MethodDescription,
+ HttpMethod,
+ ParamDescription,
+ ContextTypes,
+ ISecurityContext,
+ IUser } from './core/descriptions';
export { DecoratorUtil } from './core/decoratorUtil';
-
View
@@ -1 +0,0 @@
-import 'reflect-metadata';
View
@@ -3,25 +3,19 @@
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
+ "lib": ["es5"],
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
- "declaration": true
- },
- "files":[
- "typings/main.d.ts",
- "src/vendor.ts",
- "src/js-restful.ts",
- "src/core/namings.ts",
- "src/core/decorators.ts",
- "src/core/decorators.spec.ts",
- "src/core/decoratorUtil.ts",
- "src/core/descriptions.spec.ts",
- "src/core/descriptions.ts",
- "src/core/decorator-parser.ts",
- "src/core/decorator-parser.spec.ts",
- "src/core/test-classes.spec.ts"
- ]
+ "declaration": true,
+ "typeRoots": [
+ "../node_modules/@types"
+ ],
+ "types": [
+ "jasmine",
+ "reflect-metadata" // the typings for core-js are limited - es7.reflect is missing :( use reflect-metadata typings insted
+ ]
+ }
}
View
@@ -1,9 +0,0 @@
-{
- "version": false,
- "ambientDependencies": {
- "reflect-metadata": "github:rbuckton/ReflectDecorators/reflect-metadata.d.ts#1affc8fcd1301caac47602e3738b057ecfd88830"
- },
- "ambientDevDependencies": {
- "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#dd638012d63e069f2c99d06ef4dcc9616a943ee4"
- }
-}

0 comments on commit 5514ac0

Please sign in to comment.