Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Typings Refactor #27

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/dist/
/node_modules/
/node_modules/
/typings/
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"main": "index.js",
"scripts": {
"test": "karma start",
"start_universal": "node dist/app/main-server.js"
"start_universal": "node dist/app/main-server.js",
"clean-ng2": "rimraf node_modules/angular2/manual_typings node_modules/angular2/typings node_modules/angular2/bundles/typings",
"postinstall": "npm run clean-ng2"
},
"author": "",
"license": "MIT",
"dependencies": {
"angular2": "^2.0.0-beta.1",
"angular2-universal-preview": "^0.32.0",
"angular2-universal-preview": "^0.32.1",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.13",
"express": "^4.13.3",
Expand All @@ -34,11 +36,12 @@
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.6",
"karma-systemjs": "^0.10.0",
"rimraf": "^2.5.1",
"systemjs": "^0.19.6",
"systemjs-builder": "^0.14.11",
"ts-node": "^0.5.4",
"tsd": "^0.6.5",
"typescript": "^1.7.3",
"typescript-node": "^0.1.3"
"typescript-node": "^0.1.3",
"typings": "^0.6.2"
}
}
2 changes: 0 additions & 2 deletions src/main-server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference path="../typings/tsd.d.ts" />

import * as path from 'path';
import * as express from 'express';
import {SERVER_LOCATION_PROVIDERS, ng2engine} from 'angular2-universal-preview/dist/server';
Expand Down
4 changes: 1 addition & 3 deletions src/services/Backend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference path="../../typings/tsd.d.ts" />

import * as Firebase from 'firebase';
import {Injectable} from 'angular2/core';
import {Observable} from 'rxjs/Observable';
Expand Down Expand Up @@ -37,4 +35,4 @@ export class Backend {
authRequest.subscribe(this.authState);

}
}
}
13 changes: 4 additions & 9 deletions tasks/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ var Builder = require('systemjs-builder');
var util = require('gulp-util');
var ts = require('gulp-typescript');

var tsProject = ts.createProject('tsconfig.json');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also create different projects per environment for example tsconfig.test.json


export const compile = (gulp, config) => {
gulp.task('compile:main-server', () => {
return gulp.src('src/**/*.ts')
.pipe(ts({
noImplicitAny: false,
typescript: require('typescript'),
module: 'commonjs',
emitDecoratorMetadata: true,
experimentalDecorators: true,
moduleResolution: 'node'
}))
return tsProject.src()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's important to use tsProject.src() here since we need to also include the type definitions. By using tsProject.src() we're reverting control over the files to our tsconfig.json to specify our entry/type definition files rather than managing it in our gulpfile

.pipe(ts(tsProject))
.pipe(gulp.dest('dist/app'));
});

Expand Down
11 changes: 5 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"noResolve": false
},
"files": [
"src/main.ts",
"src/main-server.ts"
],
"exclude": [
"node_modules/"
"typings/main.d.ts",
"src/main.ts",
"src/main-server.ts",
"src/ng2-service-worker.ts"
]
}
}
21 changes: 0 additions & 21 deletions tsd.json

This file was deleted.

22 changes: 22 additions & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"dependencies": {
"xhr2": "github:gdi2290/typed-xhr2#69f2b8d40d0cd407c1b2a2f2f41fecc6852cabbb",
"es6-promise": "github:typings/typed-es6-promise#9243c53f70fb4909ed7cce3094bec221b9fb6d5f"
},
"devDependencies": {},
"ambientDependencies": {
"angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#64b25f63f0ec821040a5d3e049a976865062ed9d",
"express": "github:DefinitelyTyped/DefinitelyTyped/express/express.d.ts#2cad4a3cff770c37b40496188c246b1a60e87e2d",
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2",
"hammerjs": "github:DefinitelyTyped/DefinitelyTyped/hammerjs/hammerjs.d.ts#74a4dfc1bc2dfadec47b8aae953b28546cb9c6b7",
"firebase": "github:DefinitelyTyped/DefinitelyTyped/firebase/firebase.d.ts#2cad4a3cff770c37b40496188c246b1a60e87e2d",
"mime": "github:DefinitelyTyped/DefinitelyTyped/mime/mime.d.ts#2cad4a3cff770c37b40496188c246b1a60e87e2d",
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#8cf8164641be73e8f1e652c2a5b967c7210b6729",
"serve-static": "github:DefinitelyTyped/DefinitelyTyped/serve-static/serve-static.d.ts#2cad4a3cff770c37b40496188c246b1a60e87e2d",
"selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea",
"webpack": "github:DefinitelyTyped/DefinitelyTyped/webpack/webpack.d.ts#95c02169ba8fa58ac1092422efbd2e3174a206f4",
"jasmine": "github:angular/DefinitelyTyped/jasmine/jasmine.d.ts#4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c",
"zone": "github:angular/DefinitelyTyped/zone/zone.d.ts#31e7317c9a0793857109236ef7c7f223305a8aa9",
"ng2": "github:gdi2290/typings-ng2/ng2.d.ts#32998ff5584c0eab0cd9dc7704abb1c5c450701c"
}
}
9 changes: 0 additions & 9 deletions typings/README.md

This file was deleted.

Loading