Skip to content

Commit

Permalink
QUALITY: Alter build system to enable angular 2 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Nov 1, 2018
1 parent 5079635 commit 78065c1
Show file tree
Hide file tree
Showing 24 changed files with 437 additions and 177 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ tmp.scss
.vscode
.tscache
a.env
dist/
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ module.exports = function ( grunt ) {
* before watching for changes.
*/
grunt.renameTask( 'watch', 'delta' );
grunt.registerTask( 'watch', [ gruntEnv, 'build', 'browserSync', 'delta' ] );
grunt.registerTask( 'watch', [ 'build', 'browserSync', 'delta' ] );

/**
* Grunt watchsvr no longer exists
Expand Down Expand Up @@ -666,6 +666,7 @@ module.exports = function ( grunt ) {
* The `build` task gets your app ready to run for development and testing.
*/
grunt.registerTask( 'build', [
gruntEnv,
'clean',
'html2js',
'jshint',
Expand Down
258 changes: 255 additions & 3 deletions angular.json

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,23 @@
"@angular/router": "~6.0.1",
"@angular/upgrade": "~6.0.1",
"core-js": "^2.5.4",
"ngx-bootstrap": "^3.0.1",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^6.0.0",
"@angular-devkit/build-angular": "~0.6.1",
"typescript": "~2.7.2",
"@angular/cli": "~6.0.1",
"@angular/compiler-cli": "^6.0.0",
"@angular/language-service": "^6.0.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/lodash": "^4.14.115",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.4.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"autoprefixer": "^6.3.3",
"canonical-path": "0.0.2",
"codelyzer": "~4.2.1",
"concurrently": "^3.2.0",
"autoprefixer": "^6.3.3",
"grunt": "^1.0.2",
"grunt-browser-sync": "^2.2.0",
"grunt-bump": "0.8.0",
Expand All @@ -71,7 +62,18 @@
"grunt-preprocess": "5.1.0",
"grunt-sass-globbing": "^1.4.0",
"ip": "^1.1.2",
"jasmine-core": "~2.4.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"postcss-scss": "^0.1.7",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2",
"underscore": "^1.8.3"
}
}
20 changes: 0 additions & 20 deletions src/app/app.coffee

This file was deleted.

7 changes: 0 additions & 7 deletions src/app/app.component.ts

This file was deleted.

10 changes: 7 additions & 3 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static';
import { ModalModule } from 'ngx-bootstrap/modal';

import { AboutDoubtfireModal } from 'src/app/common/modals/about-doubtfire-modal/about-doubtfire-modal'

@NgModule({
imports: [
BrowserModule,
UpgradeModule
]
UpgradeModule,
ModalModule.forRoot()
],
providers: [ AboutDoubtfireModal ]
})
export class AppModule {
constructor(private upgrade: UpgradeModule) { }
constructor(private upgrade: UpgradeModule ) { }

ngDoBootstrap() {
this.upgrade.bootstrap(document.body, ['doubtfire'], { strictDi: false });
Expand Down
33 changes: 33 additions & 0 deletions src/app/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// #
// # Doubtfire - A lightweight, modern learning management system
// #
// # Doubtfire is modularised into many modules, as indicated by the directory
// # tree inside app/
// #
import { downgradeInjectable } from '@angular/upgrade/static';

import { AboutDoubtfireModal } from 'src/app/common/modals/about-doubtfire-modal/about-doubtfire-modal'

var angular = window['angular'];

var m = angular.module('doubtfire', [
'doubtfire.config',
'doubtfire.api',
'doubtfire.sessions',
'doubtfire.common',
'doubtfire.errors',
'doubtfire.home',
'doubtfire.admin',
'doubtfire.units',
'doubtfire.tasks',
'doubtfire.projects',
'doubtfire.groups',
'doubtfire.visualisations']);

m.factory('AboutDoubtfireModal',
downgradeInjectable(AboutDoubtfireModal)
);

export class DoubtfireAppModule {
public static angularJS = angular;
}
2 changes: 1 addition & 1 deletion src/app/common/header/header.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
angular.module('doubtfire.common.header', [
'doubtfire.common.header.unit-dropdown'
])
.controller("BasicHeaderCtrl", ($scope, $state, $rootScope, $modal, AboutDoubtfireModal, UserNotificationSettingsModal, UserSettingsModal, currentUser, $stateParams) ->
.controller("BasicHeaderCtrl", ($scope, $state, $rootScope, $modal, UserNotificationSettingsModal, UserSettingsModal, currentUser, $stateParams, AboutDoubtfireModal) ->
$scope.currentUser = currentUser.profile

$scope.tutor = $state.params?.tutor?
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 78065c1

Please sign in to comment.