* update literally everything

* slow down there, champ!

* fix build and rm deps

* simplify config loading

* fix weird formatting

* downgrade ts again

* Fix merge derp
This commit is contained in:
Simon Schick 2017-02-08 22:53:51 +01:00 коммит произвёл GitHub
Родитель 502d669fe4
Коммит b169b9fd56
12 изменённых файлов: 60 добавлений и 104 удалений

Просмотреть файл

@ -38,7 +38,6 @@ module.exports = {
{
loader: 'awesome-typescript-loader',
query: {
useForkChecker: true,
tsconfig: paths.tsconfig
}
},
@ -53,8 +52,6 @@ module.exports = {
chunksSortMode: (a, b) => chunkOrder.indexOf(a.names[0]) > chunkOrder.indexOf(b.names[0]),
}),
new atl.ForkCheckerPlugin(),
// Fix for critical dependency warning due to System.import in angular.
// See https://github.com/angular/angular/issues/11580
new webpack.ContextReplacementPlugin(

Просмотреть файл

@ -158,6 +158,6 @@ gulp.task(':test:deps', (cb) => {
*/
gulp.task('test', [':test:deps'], (done) => {
new karma.Server({
configFile: path.join(process.cwd(), 'test/karma.confloader.js')
configFile: path.join(process.cwd(), 'test/karma.conf.js')
}, done).start();
});

Просмотреть файл

@ -21,34 +21,32 @@
"url": "git://github.com/WatchBeam/arcade-machine.git"
},
"dependencies": {
"@angular/core": "2.2.3",
"rxjs": "5.0.0-beta.12"
"@angular/core": "~2.4.6",
"rxjs": "~5.0.3"
},
"devDependencies": {
"@angular/common": "2.2.3",
"@angular/compiler": "2.2.3",
"@angular/compiler-cli": "2.2.3",
"@angular/platform-browser": "2.2.3",
"@angular/platform-browser-dynamic": "2.2.3",
"@angular/common": "~2.4.6",
"@angular/compiler": "~2.4.6",
"@angular/compiler-cli": "~2.4.6",
"@angular/platform-browser": "~2.4.6",
"@angular/platform-browser-dynamic": "~2.4.6",
"@types/core-js": "^0.9.34",
"@types/jasmine": "^2.5.35",
"@types/node": "^6.0.45",
"@types/winrt-uwp": "0.0.16",
"awesome-typescript-loader": "^2.2.4",
"awesome-typescript-loader": "^3.0.3",
"clean-webpack-plugin": "^0.1.10",
"codelyzer": "0.0.28",
"codelyzer": "^2.0.0-beta.4",
"core-js": "^2.4.1",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-concat": "^2.6.0",
"gulp-typescript": "^3.0.1",
"html-webpack-plugin": "^2.22.0",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "^2.5.2",
"jasmine-spec-reporter": "^2.7.0",
"karma": "^1.1.1",
"karma-browserstack-launcher": "^1.0.1",
"karma-chrome-launcher": "^1.0.1",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
@ -56,17 +54,16 @@
"karma-sauce-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"merge2": "^1.0.2",
"npm-run-all": "^3.1.1",
"npm-run-all": "^4.0.0",
"rimraf": "^2.5.1",
"run-sequence": "^1.2.2",
"systemjs": "0.19.38",
"systemjs": "~0.19.42",
"ts-helpers": "^1.1.1",
"tslint": "^3.15.1",
"tslint-loader": "^2.1.0",
"tslint-microsoft-contrib": "^2.0.12",
"typescript": "2.0.3",
"webpack": "^2.1.0-beta.25",
"webpack-dev-server": "^2.1.0-beta.7",
"zone.js": "^0.6.23"
"tslint": "^4.3.1",
"tslint-microsoft-contrib": "^4.0.0",
"typescript": "~2.1.5",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.3.0",
"zone.js": "^0.7.6"
}
}

Просмотреть файл

@ -1,5 +1,3 @@
import { Direction, IArcEvent, IArcHandler } from './model';
import { RegistryService } from './registry.service';
import {
Directive,
ElementRef,
@ -14,11 +12,14 @@ import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/never';
import 'rxjs/add/operator/startWith';
import { Direction, IArcEvent, IArcHandler } from './model';
import { RegistryService } from './registry.service';
function createDirectionCapture(direction: Direction, target: HTMLElement) {
if (!target) {
throw new Error(
`Cannot set [arc-${Direction[direction]}] to an undefined element!` +
'Make sure the element you\'re passing is defined correctly.'
'Make sure the element you\'re passing is defined correctly.',
);
}
@ -89,7 +90,7 @@ export class ArcDirective implements OnInit, OnDestroy, IArcHandler {
constructor(
private el: ElementRef,
private registry: RegistryService
private registry: RegistryService,
) { }
public ngOnInit() {

Просмотреть файл

@ -15,7 +15,7 @@ export class ArcEvent implements IArcEvent {
directive: IArcHandler,
next: HTMLElement,
event: Direction,
target: HTMLElement
target: HTMLElement,
}) { Object.assign(this, opts); }
public stopPropagation() {

Просмотреть файл

@ -1,12 +1,13 @@
import { ArcEvent } from './event';
import { Direction } from './model';
import { RegistryService } from './registry.service';
import { Injectable } from '@angular/core';
import { Location } from '@angular/common';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/filter';
import { ArcEvent } from './event';
import { Direction } from './model';
import { RegistryService } from './registry.service';
// These factors can be tweaked to adjust which elements are favored by the focus algorithm
const scoringConstants = Object.freeze({
primaryAxisDistanceWeight: 30,
@ -103,7 +104,7 @@ function calculateScore(
maxDistance: number,
historyRect: ClientRect,
referenceRect: ClientRect,
potentialRect: ClientRect
potentialRect: ClientRect,
): number {
let percentInShadow: number;
let primaryAxisDistance: number;
@ -515,7 +516,7 @@ export class FocusService {
console.warn(
`arcade-machine focusable element <${el.tagName}> was moved outside of` +
'the focus root. We may not be able to handle focus correctly.',
el
el,
);
break;
}
@ -670,12 +671,12 @@ export class FocusService {
newHistoryRect.top = Math.max(
result.rect.top,
result.referenceRect.top,
this.historyRect ? this.historyRect.top : Number.MIN_VALUE
this.historyRect ? this.historyRect.top : Number.MIN_VALUE,
);
newHistoryRect.bottom = Math.min(
result.rect.bottom,
result.referenceRect.bottom,
this.historyRect ? this.historyRect.bottom : Number.MAX_VALUE
this.historyRect ? this.historyRect.bottom : Number.MAX_VALUE,
);
if (newHistoryRect.bottom <= newHistoryRect.top) {
@ -690,12 +691,12 @@ export class FocusService {
newHistoryRect.left = Math.max(
result.rect.left,
result.referenceRect.left,
this.historyRect ? this.historyRect.left : Number.MIN_VALUE
this.historyRect ? this.historyRect.left : Number.MIN_VALUE,
);
newHistoryRect.right = Math.min(
result.rect.right,
result.referenceRect.right,
this.historyRect ? this.historyRect.right : Number.MAX_VALUE
this.historyRect ? this.historyRect.right : Number.MAX_VALUE,
);
if (newHistoryRect.right <= newHistoryRect.left) {

Просмотреть файл

@ -106,7 +106,7 @@ describe('input service', () => {
expect(fire.calls.count()).toEqual(4);
done();
},
850
850,
);
});

Просмотреть файл

@ -1,6 +1,3 @@
import { ArcEvent } from './event';
import { FocusService } from './focus.service';
import { Direction } from './model';
import { EventEmitter, Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
@ -9,6 +6,10 @@ import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/observable/merge';
import { ArcEvent } from './event';
import { FocusService } from './focus.service';
import { Direction } from './model';
interface IGamepadWrapper {
// Directional returns from the gamepad. They debounce themselves and
// trigger again after debounce times.
@ -410,7 +411,7 @@ export class InputService {
this.subscriptions.push(
Observable.fromEvent<FocusEvent>(document, 'focusin', { passive: true })
.subscribe(ev => this.focus.onFocusChange(<HTMLElement>ev.target, this.scrollSpeed))
.subscribe(ev => this.focus.onFocusChange(<HTMLElement>ev.target, this.scrollSpeed)),
);
}
@ -464,12 +465,12 @@ export class InputService {
this.subscriptions.push(
Observable.merge(
this.gamepadSrc,
Observable.fromEvent(window, 'gamepadconnected')
Observable.fromEvent(window, 'gamepadconnected'),
).subscribe(ev => {
addGamepad((<any>ev).gamepad);
cancelAnimationFrame(this.pollRaf);
this.scheduleGamepadPoll();
})
}),
);
}
@ -601,12 +602,12 @@ export class InputService {
this.subscriptions.push(
Observable.merge(
this.keyboardSrc,
Observable.fromEvent<KeyboardEvent>(window, 'keydown')
Observable.fromEvent<KeyboardEvent>(window, 'keydown'),
).subscribe(ev => {
if (!ev.defaultPrevented && this.handleKeyDown(ev.keyCode)) {
ev.preventDefault();
}
})
}),
);
}
}

Просмотреть файл

@ -1,7 +1,8 @@
import { IArcHandler } from './model';
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { IArcHandler } from './model';
/**
* The Registry keeps track of services of `arc` directives present in the DOM.
*/

Просмотреть файл

@ -1,6 +1,6 @@
import path = require('path');
const path = require('path');
export function config(config: any) {
module.exports = function config(config) {
config.set({

Просмотреть файл

@ -1,28 +0,0 @@
const fs = require('fs');
const ts = require('typescript');
const old = require.extensions['.ts'];
require.extensions['.ts'] = function(m, filename) {
// If we're in node module, either call the old hook or simply compile the
// file without transpilation. We do not touch node_modules/**.
if (filename.match(/node_modules/)) {
if (old) {
return old(m, filename);
}
return m._compile(fs.readFileSync(filename), filename);
}
// Node requires all require hooks to be sync.
const source = fs.readFileSync(filename).toString();
const result = ts.transpile(source, {
target: ts.ScriptTarget.ES5,
module: ts.ModuleKind.CommonJs,
});
// Send it to node to execute.
return m._compile(result, filename);
};
// Import the TS once we know it's safe to require.
module.exports = require('./karma.conf.ts').config;

Просмотреть файл

@ -10,7 +10,7 @@
"mocha-no-side-effect-code": false,
"no-any": false,
"no-conditional-assignment": false,
"no-constructor-vars": false,
"no-parameter-properties": false,
"no-multiline-string": false,
"no-relative-imports": false,
"no-stateless-class": false,
@ -25,31 +25,17 @@
}],
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore"],
"import-blacklist": [
true,
"lodash",
"rxjs/Rx",
"rxjs"
],
// Angular
"directive-selector-name": [
true,
"camelCase"
],
"component-selector-name": [
true,
"kebab-case"
],
"directive-selector-type": [
true,
"attribute"
],
"component-selector-type": [
true,
"element"
],
"directive-selector-prefix": [
true,
"arc"
],
"component-selector-prefix": [
true,
"arc"
],
"directive-selector": [true, "attribute", "arc", "camelCase"],
"component-selector": [true, "element", "arc", "kebab-case"],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,