Added basic support for TypeScript

pull/3947/head
Roman Roelofsen 9 years ago committed by Oliver Günther
parent a54fcdd472
commit 821a132a46
  1. 1
      frontend/.gitignore
  2. 2
      frontend/app/openproject-app.js
  3. 11
      frontend/app/typescript_demo/demo.controller.ts
  4. 13
      frontend/app/typescript_demo/demo.service.ts
  5. 45
      frontend/npm-shrinkwrap.json
  6. 2
      frontend/package.json
  7. 12
      frontend/tsconfig.json
  8. 15
      frontend/tsd.json
  9. 3
      frontend/webpack.config.js

@ -1,3 +1,4 @@
/typings
/.sass-cache
/bower_components
/coverage

@ -308,3 +308,5 @@ require('!ngtemplate?module=openproject.templates!html!angular-busy/angular-busy
var requireComponent = require.context('./components/', true, /^((?!\.(test|spec)).)*\.(js|html)$/);
requireComponent.keys().forEach(requireComponent);
require('./typescript_demo/demo.controller');

@ -0,0 +1,11 @@
import {DemoService} from "./demo.service";
class DemoController {
constructor(demoService: DemoService) {
demoService.method();
}
}
angular.module('openproject').controller("DemoController", DemoController);

@ -0,0 +1,13 @@
export class DemoService {
constructor() {
console.log("start");
}
method() {
}
}
angular.module('openproject').service("demoService", DemoService);

@ -1479,6 +1479,51 @@
}
}
},
"ts-loader": {
"version": "0.7.2",
"dependencies": {
"arrify": {
"version": "1.0.0"
},
"colors": {
"version": "1.1.2"
},
"enhanced-resolve": {
"version": "0.9.1",
"dependencies": {
"tapable": {
"version": "0.1.10"
},
"memory-fs": {
"version": "0.2.0"
},
"graceful-fs": {
"version": "4.1.2"
}
}
},
"loader-utils": {
"version": "0.2.12",
"dependencies": {
"big.js": {
"version": "3.1.3"
},
"json5": {
"version": "0.4.0"
}
}
},
"object-assign": {
"version": "2.1.1"
},
"semver": {
"version": "5.1.0"
}
}
},
"typescript": {
"version": "1.7.3"
},
"url-loader": {
"version": "0.5.5",
"dependencies": {

@ -61,6 +61,8 @@
"polyfill-function-prototype-bind": "0.0.1",
"shelljs": "^0.3.0",
"style-loader": "^0.8.2",
"ts-loader": "^0.7.2",
"typescript": "^1.7.3",
"url-loader": "^0.5.5",
"webpack": "^1.7.3",
"yaml-loader": "^0.1.0"

@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"noEmitOnError": false,
"noImplicitAny": false,
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true
},
"files": ["typings/tsd.d.ts"]
}

@ -0,0 +1,15 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"jquery/jquery.d.ts": {
"commit": "43b6bf88758852b9ab713a9b011487f047f94f4e"
},
"angularjs/angular.d.ts": {
"commit": "43b6bf88758852b9ab713a9b011487f047f94f4e"
}
}
}

@ -50,6 +50,7 @@ var browsersList = JSON.stringify(_.filter(browsersListConfig.split('\n'), funct
}));
var loaders = [
{ test: /\.ts$/, loader: 'ts-loader' },
{ test: /[\/]angular\.js$/, loader: 'exports?angular' },
{ test: /[\/]jquery\.js$/, loader: 'expose?jQuery' },
{ test: /[\/]dragula\.js$/, loader: 'expose?dragula' },
@ -109,6 +110,8 @@ module.exports = {
resolve: {
root: __dirname,
extensions: ['', '.webpack.js', '.ts', '.js'],
modulesDirectories: [
'node_modules',
'bower_components',

Loading…
Cancel
Save