]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Update to Angular RC 1
authorChocobozzz <florian.bigard@gmail.com>
Fri, 13 May 2016 12:18:37 +0000 (14:18 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Fri, 13 May 2016 12:23:11 +0000 (14:23 +0200)
20 files changed:
client/.gitignore
client/angular/app/app.component.ts
client/angular/friends/services/friends.service.ts
client/angular/main.ts [moved from client/angular/bootstrap.ts with 54% similarity]
client/angular/users/components/login/login.component.ts
client/angular/users/services/auth.service.ts
client/angular/videos/components/add/videos-add.component.ts
client/angular/videos/components/list/videos-list.component.ts
client/angular/videos/components/watch/videos-watch.component.ts
client/angular/videos/services/videos.service.ts
client/index.html
client/package.json
client/systemjs.bundle.js [new file with mode: 0644]
client/systemjs.config.js [new file with mode: 0644]
client/tsconfig.json
client/typings.json
client/typings/typings.d.ts [new file with mode: 0644]
scripts/build/client/tsc.sh
scripts/clean/client/tsc.sh
scripts/danger/clean/modules.sh

index 4bb21ebabb0812c260ee8817aefd7b52f9d217be..24129f7c5812f05e51afde3c175f6a24b011102d 100644 (file)
@@ -1,5 +1,7 @@
 typings
+!typings/typings.d.ts
 angular/**/*.js
 angular/**/*.map
 angular/**/*.css
 stylesheets/index.css
+bundles
index 83a4f33107a36e5b048078ff5f688100c1b8de47..359d7128ee47ca935be17122b5602e8a349ee4e1 100644 (file)
@@ -1,6 +1,6 @@
-import { Component } from 'angular2/core';
-import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from 'angular2/router';
-import { HTTP_PROVIDERS } from 'angular2/http';
+import { Component } from '@angular/core';
+import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from '@angular/router-deprecated';
+import { HTTP_PROVIDERS } from '@angular/http';
 
 import { VideosAddComponent } from '../videos/components/add/videos-add.component';
 import { VideosListComponent } from '../videos/components/list/videos-list.component';
index 4eb1fc67b153f2ca71cd710bb2e8b4e6df43fd33..cb34323e447eb6ae0074296cc11fab7f7b356c89 100644 (file)
@@ -1,5 +1,5 @@
-import { Injectable } from 'angular2/core';
-import { Http, Response } from 'angular2/http';
+import { Injectable } from '@angular/core';
+import { Http, Response } from '@angular/http';
 import { Observable } from 'rxjs/Rx';
 
 @Injectable()
similarity index 54%
rename from client/angular/bootstrap.ts
rename to client/angular/main.ts
index d0f524f4a0bc2004b04d504e41a3cb5905004ee6..e35f7dbdf219a418b0a34aa3122a2889342dc4f3 100644 (file)
@@ -1,4 +1,4 @@
-import { bootstrap }    from 'angular2/platform/browser';
+import { bootstrap }    from '@angular/platform-browser-dynamic';
 import { AppComponent } from './app/app.component';
 
 bootstrap(AppComponent);
index cecf5d2fd741c50b1d03e3c19e589e219f217855..d339353ef654c9346e250fd7800a9fdbcc0457d1 100644 (file)
@@ -1,5 +1,5 @@
-import { Component } from 'angular2/core';
-import { Router } from 'angular2/router';
+import { Component } from '@angular/core';
+import { Router } from '@angular/router-deprecated';
 
 import { AuthService } from '../../services/auth.service';
 import { AuthStatus } from '../../models/authStatus';
index fc5048d8af27c24612e715e186c872b02818ff4e..099563d43bdb6273cd1391e77fef6f1ff21125bc 100644 (file)
@@ -1,5 +1,5 @@
-import { Injectable } from 'angular2/core';
-import { Http, Response, Headers, URLSearchParams, RequestOptions } from 'angular2/http';
+import { Injectable } from '@angular/core';
+import { Http, Response, Headers, URLSearchParams, RequestOptions } from '@angular/http';
 import { Observable, Subject } from 'rxjs/Rx';
 
 import { AuthStatus } from '../models/authStatus';
index bc7b4057c469f7b15c8b4860ed2b38f8b806f167..f801cecbb1075ced77aaa5ba1de6e731d4d977f2 100644 (file)
@@ -1,5 +1,5 @@
-import { Component, ElementRef, OnInit } from 'angular2/core';
-import { Router } from 'angular2/router';
+import { Component, ElementRef, OnInit } from '@angular/core';
+import { Router } from '@angular/router-deprecated';
 
 import { AuthService } from '../../../users/services/auth.service';
 import { User } from '../../../users/models/user';
index b081522c7e8596455f320242712ede00299e605a..6ff0b2afb42fc16455344c185443cebc9560e016 100644 (file)
@@ -1,5 +1,5 @@
-import { Component, OnInit } from 'angular2/core';
-import { ROUTER_DIRECTIVES, RouteParams } from 'angular2/router';
+import { Component, OnInit } from '@angular/core';
+import { ROUTER_DIRECTIVES, RouteParams } from '@angular/router-deprecated';
 
 import { AuthService } from '../../../users/services/auth.service';
 import { User } from '../../../users/models/user';
index b996ad882aed2622d1e2e397428b5060c9ce96f4..6ac2787ed8257fd57696e0c98d858047ec123e1e 100644 (file)
@@ -1,6 +1,6 @@
-import { Component, OnInit, ElementRef } from 'angular2/core';
-import { RouteParams, CanDeactivate, ComponentInstruction } from 'angular2/router';
-import { BytesPipe } from 'angular-pipes/math';
+import { Component, OnInit, ElementRef } from '@angular/core';
+import { RouteParams, CanDeactivate, ComponentInstruction } from '@angular/router-deprecated';
+import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
 
 // TODO import it with systemjs
 declare var WebTorrent: any;
index 74b6a1ddc46f5573d24e344671e4d87bc33c2de3..d08548339678dc47edadff389f853196ff31056f 100644 (file)
@@ -1,5 +1,5 @@
-import { Injectable } from 'angular2/core';
-import { Http, Response } from 'angular2/http';
+import { Injectable } from '@angular/core';
+import { Http, Response } from '@angular/http';
 import { Observable } from 'rxjs/Rx';
 
 import { Video } from '../models/video';
index 49a448c2c352c97ae455a271b6222b59e9169724..c9bc7adb2fa9c488daf2f6617addb558c7d96d36 100644 (file)
@@ -1,47 +1,34 @@
 <html>
   <head>
+    <base href="/">
+
     <title>PeerTube</title>
+
+    <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
+
     <link rel="stylesheet" href="/app/stylesheets/index.css">
 
     <!-- 1. Load libraries -->
     <!-- IE required polyfills, in this exact order -->
     <script src="/app/node_modules/es6-shim/es6-shim.min.js"></script>
-    <script src="/app/node_modules/systemjs/dist/system-polyfills.js"></script>
-    <script src="/app/node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
-
-    <script src="/app/node_modules/angular2/bundles/angular2-polyfills.js"></script>
+    <script src="/app/node_modules/zone.js/dist/zone.js"></script>
+    <script src="/app/node_modules/reflect-metadata/Reflect.js"></script>
     <script src="/app/node_modules/systemjs/dist/system.src.js"></script>
-    <script src="/app/node_modules/rxjs/bundles/Rx.js"></script>
-    <script src="/app/node_modules/angular2/bundles/angular2.dev.js"></script>
-    <script src="/app/node_modules/angular2/bundles/router.dev.js"></script>
-    <script src="/app/node_modules/angular2/bundles/http.dev.js"></script>
+
     <script src="/app/node_modules/jquery/dist/jquery.js"></script>
     <script src="/app/node_modules/jquery.ui.widget/jquery.ui.widget.js"></script>
     <script src="/app/node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script>
+
     <script src="/app/node_modules/webtorrent/webtorrent.min.js"></script>
 
+    <!-- <script src="/app/angular/angular-rxjs.bundle.js"></script> -->
 
     <!-- 2. Configure SystemJS -->
+    <script src="/app/systemjs.config.js"></script>
     <script>
-      System.config({
-        packages: {
-          '/app': {
-            components: {
-              format: 'register',
-              defaultExtension: 'js'
-            }
-          }
-        },
-        map: {
-          'angular-pipes/math': '/app/node_modules/angular-pipes/math.js'
-        }
-      });
-      System.import('/app/angular/bootstrap')
-            .then(null, console.error.bind(console));
+      System.import('app').catch(function(err){ console.error(err); });
     </script>
-
-    <base href="/">
   </head>
 
   <!-- 3. Display the application -->
index db93ac68119d6959e06755e2a5e718d3094ba83e..5a103ceb77733dac988cf33cf8b198ac81ade12b 100644 (file)
     "tsc:w": "tsc -w",
     "typings": "typings",
     "postinstall": "typings install",
-    "test": "tslint -c ./tslint.json angular/**/*.ts angular/**/**/*.ts angular/**/**/**/*.ts"
+    "test": "standard && tslint -c ./tslint.json angular/**/*.ts angular/**/**/*.ts angular/**/**/**/*.ts"
   },
-  "license": "ISC",
+  "license": "GPLv3",
   "dependencies": {
-    "angular-pipes": "^1.5.0",
-    "angular2": "2.0.0-beta.17",
+    "angular-pipes": "^2.0.0",
+    "@angular/common": "2.0.0-rc.1",
+    "@angular/compiler": "2.0.0-rc.1",
+    "@angular/core": "2.0.0-rc.1",
+    "@angular/http": "2.0.0-rc.1",
+    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
+    "@angular/platform-browser": "2.0.0-rc.1",
+    "@angular/router-deprecated": "2.0.0-rc.1",
     "blueimp-file-upload": "^9.12.1",
     "bootstrap-sass": "^3.3.6",
     "es6-promise": "^3.0.2",
     "es6-shim": "^0.35.0",
     "jquery": "^2.2.3",
     "jquery.ui.widget": "^1.10.3",
-    "reflect-metadata": "0.1.2",
+    "reflect-metadata": "0.1.3",
     "rxjs": "5.0.0-beta.6",
-    "systemjs": "0.19.26",
+    "systemjs": "0.19.27",
     "webtorrent": "^0.89.0",
     "zone.js": "0.6.12"
   },
   "devDependencies": {
     "codelyzer": "0.0.18",
+    "standard": "^7.0.1",
+    "systemjs-builder": "^0.15.16",
     "tslint": "^3.7.4",
     "typescript": "^1.8.10",
     "typings": "^0.8.1"
+  },
+  "standard": {
+    "ignore": [
+      "angular/",
+      "bundles/"
+    ]
   }
 }
diff --git a/client/systemjs.bundle.js b/client/systemjs.bundle.js
new file mode 100644 (file)
index 0000000..2fd4515
--- /dev/null
@@ -0,0 +1,15 @@
+var SystemBuilder = require('systemjs-builder')
+var builder = new SystemBuilder('node_modules', 'systemjs.config.js')
+
+var toBundle = [
+  'rxjs/Rx',
+  '@angular/common',
+  '@angular/compiler',
+  '@angular/core',
+  '@angular/http',
+  '@angular/platform-browser',
+  '@angular/platform-browser-dynamic',
+  '@angular/router-deprecated'
+]
+
+builder.bundle(toBundle.join(' + '), 'bundles/angular-rxjs.bundle.js')
diff --git a/client/systemjs.config.js b/client/systemjs.config.js
new file mode 100644 (file)
index 0000000..6b284ec
--- /dev/null
@@ -0,0 +1,47 @@
+;(function (global) {
+  var map = {
+    'app': 'app/angular',
+    'angular-pipes': 'app/node_modules/angular-pipes',
+    'angular-rxjs.bundle': 'app/bundles/angular-rxjs.bundle.js'
+  }
+
+  var packages = {
+    'app': { main: 'main.js', defaultExtension: 'js' },
+    'rxjs': { defaultExtension: 'js' }
+  }
+  var packageNames = [
+    '@angular/common',
+    '@angular/compiler',
+    '@angular/core',
+    '@angular/http',
+    '@angular/platform-browser',
+    '@angular/platform-browser-dynamic',
+    '@angular/router-deprecated',
+    'angular-pipes'
+  ]
+
+  packageNames.forEach(function (pkgName) {
+    packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }
+  })
+
+  var config = {
+    map: map,
+    packages: packages,
+    bundles: {
+      'angular-rxjs.bundle': [
+        'rxjs',
+        '@angular/common/index.js',
+        '@angular/compiler/index.js',
+        '@angular/core/index.js',
+        '@angular/http/index.js',
+        '@angular/platform-browser/index.js',
+        '@angular/platform-browser-dynamic/index.js',
+        '@angular/router-deprecated/index.js'
+      ]
+    }
+  }
+
+  // filterSystemConfig - index.html's chance to modify config before we register it.
+  if (global.filterSystemConfig) global.filterSystemConfig(config)
+  System.config(config)
+})(this)
index ca58ddb899554265d570abf670136914b2a79421..3e4648cf7914e37b6362164f1cf347adc15a52a6 100644 (file)
@@ -1,7 +1,7 @@
 {
   "compilerOptions": {
     "target": "es5",
-    "module": "system",
+    "module": "commonjs",
     "moduleResolution": "node",
     "sourceMap": true,
     "emitDecoratorMetadata": true,
index c06bb4d720174bb70d0349600a3198477dbaa17d..b5324f4199ec713731b9fe72c79a20e6cd0e4532 100644 (file)
@@ -1,6 +1,7 @@
 {
   "ambientDependencies": {
-    "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
-    "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd"
+    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
+    "jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
+    "node": "registry:dt/node#4.0.0+20160509154515"
   }
 }
diff --git a/client/typings/typings.d.ts b/client/typings/typings.d.ts
new file mode 100644 (file)
index 0000000..579c9a5
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * Declares the 'commonjs' format module object that identifies the "module id" for the current module.
+ * Set a component's `moduleId` metadata property to `module.id` for module-relative urls
+ * when the generated module format is 'commonjs'.
+ */
+declare var module: {id: string};
+
+/**
+ * Declares the 'system' format string that identifies the "module id" for the current module.
+ * Set a component's `moduleId` metadata property to `__moduleName` for module-relative urls
+ * when the generated module format is 'system'.
+ */
+declare var __moduleName: string;
index ec06b643a99a57e2dea13eefbf1fea09ee178bf4..cca1643d4b0080da6563acbd11637e185b7abee9 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env sh
 
 cd client || exit -1
-
+node systemjs.bundle.js
 npm run tsc
index 775157a546b5c2ec1a329b7221ffcdb4e26cd90e..3ea6e78d5b8cc5353094877d3de2b241ea6629b9 100755 (executable)
@@ -2,3 +2,4 @@
 
 cd client || exit -1
 find angular -regextype posix-egrep -regex ".*\.(js|map)$" -exec rm -f {} \;
+rm -rf ./bundles
index 1aa6c732b9cbc7eb05ec58dd73bdb17657447fa4..d357e1b77f53ccdab295591216afe83748d1869f 100755 (executable)
@@ -3,5 +3,5 @@
 read -p "This will remove all node and typescript modules. Are you sure? " -n 1 -r
 
 if [[ "$REPLY" =~ ^[Yy]$ ]]; then
-  rm -rf node_modules client/node_modules client/typings
+  rm -rf node_modules client/node_modules client/typings/{browser,main}*
 fi