Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on upgrading to ng2 #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/typings/
/tasks/vendor/tmp-gamejolt.iss
/build/
debug.log
10 changes: 10 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"attr-value-double-quotes": true,
"id-unique": true,
"src-not-empty": true,
"attr-no-duplication": true,
"tagname-lowercase": true,
"alt-require": true,
"id-class-value": "dash",
"space-tab-mixed-disabled": "true"
}
8 changes: 0 additions & 8 deletions debug.log

This file was deleted.

28 changes: 16 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ var gulp = require( 'gulp' );

var config = {
staticCdn: 'http://sites.development.gamejolt.io',
extraBower: {
'angular-bootstrap': [
'src/transition/transition.js',
'src/position/position.js',
'src/bindHtml/bindHtml.js',
'src/tooltip/tooltip.js',
'src/collapse/collapse.js',
'src/modal/modal.js'
],
},
// extraBower: {
// 'angular-bootstrap': [
// 'src/transition/transition.js',
// 'src/position/position.js',
// 'src/bindHtml/bindHtml.js',
// 'src/tooltip/tooltip.js',
// 'src/collapse/collapse.js',
// 'src/modal/modal.js'
// ],
// },
rollup: {
vendor: {
'ng-metadata/core': 'vendor.ngMetadata_core',
'ng-metadata/platform': 'vendor.ngMetadata_platform',
'@angular/core': 'vendor.ng_core',
'@angular/common': 'vendor.ng_common',
'@angular/forms': 'vendor.ng_forms',
'@angular/platform-browser': 'vendor.ng_platformBrowser',
'@angular/platform-browser-dynamic': 'vendor.ng_platformBrowserDynamic',
'@angular/http': 'vendor.ng_http',
},
},
extraStyles: [
Expand Down
140 changes: 8 additions & 132 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,142 +1,18 @@
/// <reference path="./typings/index.d.ts" />

// Since we don't import these through ES6.
// declare var oc = require( 'oc' );

declare module "html!*" {
const content: string;
export default content;
}

interface Window {
_: _.LoDashStatic;
moment: moment.MomentStatic;
_gjStartTime: number;
Stripe: StripeStatic;
gapi: any;
}
// interface Window {
// _: _.LoDashStatic;
// moment: moment.MomentStatic;
// _gjStartTime: number;
// Stripe: StripeStatic;
// gapi: any;
// }

declare var global: any;
declare var process: any;

declare var GJ_ENVIRONMENT: 'development' | 'production';
declare var GJ_BUILD_TYPE: 'development' | 'production';

// getString: function (string, scope, context) {
declare namespace angular.gettext {
interface gettextCatalog {
getString( string: string, scope: any, context: string ): string;
}
}

// Have to add this in for the moment.
declare module angular {
interface IModule {
controller(...args: ProvideSpreadType[]): IModule;
}

interface IDocumentService {
[k: number]: HTMLDocument;
}

interface IAugmentedJQuery {
[k: number]: HTMLElement;
}
}

// FROM NG-METADATA
declare type StringMap = {[key:string]:string};
declare type Type = Function;
declare type ProvideSpreadType = string|Type;

// @TODO add angular1 module overrides for proper ...provide handling
declare module angular {
interface IParseService{
( exp: string, interceptorFn?: Function, expensiveChecks?: boolean ): ng.ICompiledExpression
}
interface IModule {
value(...args: ProvideSpreadType[]): IModule;
constant(...args: ProvideSpreadType[]): IModule;
directive(...args: ProvideSpreadType[]): IModule;
filter(...args: ProvideSpreadType[]): IModule;
service(...args: ProvideSpreadType[]): IModule;
provider(...args: ProvideSpreadType[]): IModule;
}
///////////////////////////////////////////////////////////////////////////
// AUTO module (angular.js)
///////////////////////////////////////////////////////////////////////////
export module auto {

///////////////////////////////////////////////////////////////////////
// ProvideService
// see http://docs.angularjs.org/api/AUTO.$provide
///////////////////////////////////////////////////////////////////////
interface IProvideService {
// Documentation says it returns the registered instance, but actual
// implementation does not return anything.
// constant(name: string, value: any): any;
/**
* Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
*/
constant(...args: ProvideSpreadType[]): void;

/**
* Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
*
* @param name The name of the service to decorate.
* @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
*
* $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
*/
//decorator(name: string, decorator: Function): void;
/**
* Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
*
* @param name The name of the service to decorate.
* @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
*
* $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
*/
//decorator(name: string, inlineAnnotatedFunction: any[]): void;
factory(...args: ProvideSpreadType[]): IServiceProvider;
provider(...args: ProvideSpreadType[]): IServiceProvider;
service(...args: ProvideSpreadType[]): IServiceProvider;
value(...args: ProvideSpreadType[]): IServiceProvider;
}

}

/**
* $rootScope - $rootScopeProvider - service in module ng
* see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope
*/
interface IRootScopeService {

// private members
$$postDigest( callback: Function ): void,
$$postDigestQueue: Function[],
$$applyAsyncQueue: Function[],
$$asyncQueue: Function[],
$$watchers: Watchers[],
$$watchersCount: number,
$$listenerCount: Object,
$$listeners: Object,
$$destroyed: boolean,
$$childHead: IScope,
$$childTail: IScope,
$$prevSibling: IScope,
$$nextSibling: IScope,

// ngMetadata private members
$$disconnected?: boolean,

}

/* @private */
interface Watchers {
eq: boolean,
exp: ( s: any, l: any, a: any, i: any ) => any,
fn: ( newValue: any, oldValue: any ) => any,
get: ( s: any, l: any, a: any, i: any ) => any,
last: any
}
}
47 changes: 31 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
"version": "0.0.1",
"scripts": {},
"devDependencies": {
"@types/angular": "^1.5.7",
"@types/angular-hotkeys": "0.0.30",
"@types/angular-ui-router": "^1.1.30",
"@angular/common": "4.0.0-beta.1",
"@angular/compiler": "4.0.0-beta.1",
"@angular/core": "4.0.0-beta.1",
"@angular/forms": "4.0.0-beta.1",
"@angular/http": "4.0.0-beta.1",
"@angular/platform-browser": "4.0.0-beta.1",
"@angular/platform-browser-dynamic": "4.0.0-beta.1",
"@angular/platform-server": "4.0.0-beta.1",
"@angular/compiler-cli": "4.0.0-beta.1",
"@types/core-js": "^0.9.35",
"@types/hammerjs": "^2.0.28",
"@types/lodash": "0.0.27",
"@types/lodash-es": "^4.14.0",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^3.0.0-beta.17",
"bootstrap": "^4.0.0-alpha.5",
"codelyzer": "2.0.0-beta.4",
"concat-with-sourcemaps": "~1.0.2",
"connect-history-api-fallback": "0.0.4",
"core-js": "2.4.1",
"glob-expand": "~0.0.2",
"gulp": "gulpjs/gulp#4.0",
"gulp-angular-embed-templates": "^2.1.0",
"gulp-angular-gettext": "^2.1.0",
"gulp-autoprefixer": "~0.0.7",
"gulp-clean": "~0.3.0",
"gulp-concat": "~2.6.0",
Expand All @@ -26,8 +36,6 @@
"gulp-load-plugins": "~0.5.1",
"gulp-minify-css": "~0.3.4",
"gulp-newer": "^0.5.0",
"gulp-ng-annotate": "~1.1.0",
"gulp-ng-html2js": "~0.1.7",
"gulp-plumber": "~1.0.0",
"gulp-rename": "~1.2.0",
"gulp-replace": "^0.5.1",
Expand All @@ -41,23 +49,30 @@
"gulp-uglify": "~1.2.0",
"gulp-util": "~3.0.0",
"gulp-wrapper": "^0.1.5",
"html-webpack-plugin": "^2.24.1",
"lodash-es": "4.17.3",
"merge-stream": "^1.0.0",
"minimist": "~0.2.0",
"mv": "^2.1.1",
"ng-metadata": "gamejolt/ng-metadata#6cbaa679d2aa0bcfaa7c7b03cfe1991d279ac7b1",
"pofile": "^1.0.2",
"reflect-metadata": "^0.1.3",
"rollup": "0.33.0",
"rollup-plugin-commonjs": "^2.2.1",
"rollup-plugin-node-resolve": "^1.5.0",
"rollup-plugin-replace": "^1.1.0",
"rollup-plugin-string": "^2.0.0",
"rollup-plugin-typescript": "^0.7.5",
"rollup": "0.38.2",
"rollup-plugin-commonjs": "6.0.1",
"rollup-plugin-node-resolve": "2.0.0",
"rollup-plugin-replace": "1.1.1",
"rollup-plugin-string": "2.0.2",
"rollup-plugin-typescript": "0.8.1",
"rxjs": "5.0.2",
"sanitize-html": "^1.11.3",
"script-ext-html-webpack-plugin": "^1.3.5",
"streamqueue": "~0.1.1",
"stylus": "0.53.0",
"through2": "~0.5.1",
"typescript": "^2.1.0",
"undertaker-forward-reference": "^1.0.1"
"tslib": "^1.4.0",
"tslint": "4.2.0",
"typescript": "2.1.4",
"undertaker-forward-reference": "^1.0.1",
"webpack": "2.1.0-beta.25",
"zone.js": "0.7.4"
}
}
7 changes: 0 additions & 7 deletions src/app/app-service.ts

This file was deleted.

23 changes: 14 additions & 9 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<!--<link rel="stylesheet" ng-href="{{ $ctrl.themes[ $ctrl.site.theme.definition.key ].style }}">-->
<link rel="stylesheet" ng-href="{{ $ctrl.themes[ 'redux' ].style }}">
<div *ngIf="!isLoading">
<link rel="stylesheet" [href]="themes[ site.theme.definition.key ].style">

<div ng-if="!$ctrl.isLoading">
<!--<gj-theme-injector
definition="$ctrl.site.theme.definition.definition"
theme="$ctrl.site.theme.theme"
<gj-theme-injector
[definition]="site.theme.definition.definition"
[theme]="site.theme.theme"
>
</gj-theme-injector>-->
</gj-theme-injector>

<!--<div ng-include="$ctrl.themes[ $ctrl.site.theme.definition.key ].template"></div>-->
<div ng-include="$ctrl.themes[ 'redux' ].template"></div>
<div *ngIf="site.theme.definition.key == 'vash'">
<gj-theme-vash
[game]="game"
[packages]="packages"
[mediaItems]="mediaItems"
>
</gj-theme-vash>
</div>

</div>
Loading