Skip to content

Commit 29c9b17

Browse files
refactor(*): Move ng1 source files from /src/ng1/* to /src/*
chore(typescript): Update to typescript 2.1.1
1 parent 8f3074e commit 29c9b17

30 files changed

+48
-47
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"typedoc-plugin-external-module-name": "^1.0.2",
9595
"typedoc-plugin-internal-external": "^1.0.0",
9696
"typedoc-plugin-ui-router": "^1.0.0",
97-
"typescript": "~2.0.2",
97+
"typescript": "^2.1.1",
9898
"ui-router-typedoc-themes": "^1.0.0",
9999
"watch": "^0.18.0",
100100
"webpack": "1.x",

src/ng1/directives/stateDirectives.ts renamed to src/directives/stateDirectives.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @preferred @module ng1_directives
77
*/ /** for typedoc */
8-
import { ng as angular } from "../../angular";
8+
import { ng as angular } from "../angular";
99
import { IAugmentedJQuery, ITimeoutService, IScope, IInterpolateService } from "angular";
1010

1111
import {

src/ng1/directives/viewDirective.ts renamed to src/directives/viewDirective.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @module ng1_directives */ /** for typedoc */
2-
import { ng as angular } from "../../angular";
2+
import { ng as angular } from "../angular";
33
import {
44
IInterpolateService, IScope, ITranscludeFunction, IAugmentedJQuery,
55
ICompileService, IControllerService, ITimeoutService

src/index.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Main entry point for angular 1.x build
3+
* @module ng1
4+
*/
5+
/** for typedoc */
6+
7+
export * from "ui-router-core";
8+
9+
export * from "./interface";
10+
export * from "./services";
11+
export * from "./statebuilders/views";
12+
export * from "./stateProvider";
13+
14+
import "./directives/stateDirectives";
15+
import "./stateFilters";
16+
import "./directives/viewDirective";
17+
import "./viewScroll";
18+
19+
export default "ui.router";
File renamed without changes.
File renamed without changes.

src/ng1/legacy/stateEvents.ts renamed to src/legacy/stateEvents.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @module ng1_state_events
1818
*/ /** */
19-
import { ng as angular } from "../../angular";
19+
import { ng as angular } from "../angular";
2020
import { IScope, IAngularEvent, IServiceProviderFactory } from "angular";
2121
import {
2222
Obj, TargetState, StateService, Transition, TransitionService, UrlRouter, HookResult, UIInjector

src/ng1.ts

-19
This file was deleted.

src/ng1/services.ts renamed to src/services.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
/** for typedoc */
13-
import { ng as angular } from "../angular";
13+
import { ng as angular } from "./angular";
1414
import {
1515
IRootScopeService, IQService, ILocationService, ILocationProvider, IHttpService, ITemplateCacheService
1616
} from "angular";

src/ng1/stateFilters.ts renamed to src/stateFilters.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @module state */ /** for typedoc */
22

3-
import { ng as angular } from "../angular";
3+
import { ng as angular } from "./angular";
44
import { Obj, StateService, StateOrName } from "ui-router-core";
55

66
/**
File renamed without changes.

src/ng1/statebuilders/views.ts renamed to src/statebuilders/views.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @module ng1 */ /** */
2-
import { ng as angular } from "../../angular";
2+
import { ng as angular } from "../angular";
33
import {
44
State, pick, forEach, anyTrueR, tail, extend,
55
isArray, isInjectable, isDefined, isString, services, trace,

src/ng1/templateFactory.ts renamed to src/templateFactory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ng as angular } from "../angular";
1+
import { ng as angular } from "./angular";
22
/** @module view */ /** for typedoc */
33
import {
44
isArray, isDefined, isFunction, isObject, services, Obj, IInjectable, tail, kebobString, unnestR, ResolveContext, Resolvable, RawParams

src/ng1/viewScroll.ts renamed to src/viewScroll.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @module ng1 */ /** */
2-
import { ng as angular } from "../angular";
2+
import { ng as angular } from "./angular";
33
import { IServiceProviderFactory } from "angular";
44
import IAnchorScrollService = angular.IAnchorScrollService;
55
import ITimeoutService = angular.ITimeoutService;

test/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
require('./util');
55

6-
require('../src/ng1');
6+
require('../src/index');
77

88
var testsContext = require.context(".", true, /Spec$/);
99
testsContext.keys().forEach(testsContext);

test/ng1StateBuilderSpec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// <reference path='../node_modules/@types/angular-mocks/index.d.ts' />
33
/// <reference path='../node_modules/@types/jasmine/index.d.ts' />
44

5-
import {StateBuilder, StateMatcher, ng1ViewsBuilder, extend} from "../src/ng1";
5+
import {StateBuilder, StateMatcher, ng1ViewsBuilder, extend} from "../src/index.ts";
66
import {Resolvable} from "ui-router-core";
77
declare var inject;
88

test/resolveSpec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ declare var inject;
1111
import Spy = jasmine.Spy;
1212
import "./util/matchers.ts";
1313
import { resolvedValue, resolvedError, caught } from './util/testUtilsNg1';
14-
import { ResolveContext, State, PathNode, omit, pick, extend, forEach } from "../src/ng1";
15-
import {Resolvable, services, StateDeclaration} from "ui-router-core";
14+
import { ResolveContext, State, PathNode, omit, pick, extend, forEach } from "../src/index.ts";
15+
import { Resolvable, services, StateDeclaration } from "ui-router-core";
1616

1717
let module = angular['mock'].module;
1818
///////////////////////////////////////////////

test/stateDirectivesSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33
var obj = require('./util/testUtilsNg1').obj;
44

55
describe('uiStateRef', function() {

test/stateEventsSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
3-
var stateEvents = require("../src/ng1/legacy/stateEvents.ts");
2+
var uiRouter = require("../src/index");
3+
var stateEvents = require("../src/legacy/stateEvents.ts");
44
var decorateExceptionHandler = require("./util/testUtilsNg1").decorateExceptionHandler;
55
var obj = require('./util/testUtilsNg1').obj;
66

test/stateFiltersSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33

44
describe('isState filter', function() {
55
beforeEach(module('ui.router'));

test/stateSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33
var extend = uiRouter.extend;
44
var forEach = uiRouter.forEach;
55
var services = uiRouter.services;

test/templateFactorySpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33

44
describe('templateFactory', function () {
55

test/urlMatcherFactorySpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33
var Param = uiRouter.Param;
44
var ParamTypes = uiRouter.ParamTypes;
55
var UrlMatcher = uiRouter.UrlMatcher;

test/urlRouterSpec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import "./util/matchers";
88
import { html5Compat } from './util/testUtilsNg1';
99
declare var inject;
1010

11-
import {UrlMatcher, UrlMatcherFactory, services, UrlRouterProvider, UrlRouter, StateService} from "../src/ng1";
11+
import {UrlMatcher, UrlMatcherFactory, services, UrlRouterProvider, UrlRouter, StateService} from "../src/index.ts";
1212

1313
var module = angular['mock'].module;
1414

test/viewDirectiveSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33

44
function animateFlush($animate) {
55
$animate && $animate.triggerCallbacks && $animate.triggerCallbacks(); // 1.2-1.3

test/viewScrollSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var module = angular.mock.module;
2-
var uiRouter = require("../src/ng1");
2+
var uiRouter = require("../src/index");
33

44
describe('uiView', function () {
55
'use strict';

test/viewSpec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {curry} from "ui-router-core";
1111
import {PathNode} from "ui-router-core";
1212
import {ResolveContext} from "ui-router-core";
1313
import {PathFactory} from "ui-router-core";
14-
import {ng1ViewsBuilder, ng1ViewConfigFactory} from "../src/ng1/statebuilders/views";
14+
import {ng1ViewsBuilder, ng1ViewConfigFactory} from "../src/statebuilders/views";
1515
import {ViewService} from "ui-router-core";
1616
import {StateMatcher, StateBuilder} from "ui-router-core";
1717
import {State} from "ui-router-core";
18-
import {Ng1StateDeclaration} from "../src/ng1/interface";
18+
import {Ng1StateDeclaration} from "../src/interface";
1919

2020
describe('view', function() {
2121
var scope, $compile, $injector, elem, $controllerProvider, $urlMatcherFactoryProvider;

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"sourceMap": true
1313
},
1414
"files": [
15-
"src/ng1.ts", "src/ng1/legacy/stateEvents.ts"
15+
"src/index.ts",
16+
"src/legacy/stateEvents.ts"
1617
]
1718
}

webpack.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ var banner = pkg.description + '\n' +
1010
var webpack = require('webpack');
1111
module.exports = {
1212
entry: {
13-
"angular-ui-router": "./src/ng1.ts",
14-
"angular-ui-router.min": "./src/ng1.ts",
13+
"angular-ui-router": "./src/index.ts",
14+
"angular-ui-router.min": "./src/index.ts",
1515
"stateEvents": "./src/ng1/legacy/stateEvents.ts",
1616
"stateEvents.min": "./src/ng1/legacy/stateEvents.ts",
1717
},

0 commit comments

Comments
 (0)