Skip to content

Commit 3be710d

Browse files
refactor(*): use modules.ts files to package and build ui-router
1 parent 83defe7 commit 3be710d

File tree

16 files changed

+137
-147
lines changed

16 files changed

+137
-147
lines changed

src/common/module.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as angular1 from "./angular1";
2+
export {angular1};
3+
4+
import * as common from "./common";
5+
export {common};
6+
7+
import * as queue from "./queue";
8+
export {queue};
9+
10+
import * as trace from "./trace";
11+
export {trace};

src/params/module.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as param from "./param";
2+
export {param};
3+
4+
import * as paramSet from "./paramSet";
5+
export {paramSet};
6+
7+
import * as paramTypes from "./paramTypes";
8+
export {paramTypes};
9+
10+
import * as paramValues from "./paramValues";
11+
export {paramValues};
12+
13+
import * as type from "./type";
14+
export {type};

src/path/module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as path from "./path";
2+
export {path};
3+
4+
import * as pathFactory from "./pathFactory";
5+
export {pathFactory};

src/resolve/module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as resolvable from "./resolvable";
2+
export {resolvable};
3+
4+
import * as resolveContext from "./resolveContext";
5+
export {resolveContext};
6+
7+
import * as resolveInjector from "./resolveInjector";
8+
export {resolveInjector};

src/resolve/resolvable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference path='../../typings/angularjs/angular.d.ts' />
22
import {pick, map} from "../common/common";
3-
import trace from "../common/trace";
3+
import trace from "../common/trace";
44
import {runtime} from "../common/angular1"
55
import {IPromise} from "angular";
66

src/state/module.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import * as glob from "./glob";
2+
export {glob};
3+
4+
import * as state from "./state";
5+
export {state};
6+
7+
import * as stateBuilder from "./stateBuilder";
8+
export {stateBuilder};
9+
10+
import * as stateDirectives from "./stateDirectives";
11+
export {stateDirectives};
12+
13+
import * as stateEvents from "./stateEvents";
14+
export {stateEvents};
15+
16+
import * as stateFilters from "./stateFilters";
17+
export {stateFilters};
18+
19+
import * as stateHandler from "./stateHandler";
20+
export {stateHandler};
21+
22+
import * as stateMatcher from "./stateMatcher";
23+
export {stateMatcher};
24+
25+
import * as stateQueueManager from "./stateQueueManager";
26+
export {stateQueueManager};
27+
28+
//import * as stateService from "./stateService";
29+
30+
import * as targetState from "./targetState";
31+
export {targetState};
32+

src/transition/module.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as hookBuilder from "./hookBuilder";
2+
export {hookBuilder};
3+
4+
import * as hookRegistry from "./hookRegistry";
5+
export {hookRegistry};
6+
7+
import * as rejectFactory from "./rejectFactory";
8+
export {rejectFactory};
9+
10+
import * as transition from "./transition";
11+
export {transition};
12+
13+
import * as transitionHook from "./transitionHook";
14+
export {transitionHook};
15+
16+
import * as transitionService from "./transitionService";
17+
export {transitionService};
18+

src/ui-router.ts

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,11 @@
1-
import * as angular1 from "./common/angular1"
2-
import * as _common from "./common/common"
3-
import trace from "./common/trace"
4-
var common = { angular1, common: _common, trace };
5-
6-
import Param from "./params/param"
7-
import ParamSet from "./params/paramSet"
8-
import Type from "./params/type"
9-
import paramTypes from "./params/paramTypes"
10-
var params = { Param, ParamSet, Type, paramTypes };
11-
12-
import Path from "./path/path"
13-
import PathFactory from "./path/pathFactory"
14-
var path = { Path, PathFactory }
15-
16-
import ResolveInjector from "./resolve/resolveInjector"
17-
import Resolvable from "./resolve/resolvable"
18-
import ResolveContext from "./resolve/resolveContext"
19-
var resolve = { Path, ResolveInjector, Resolvable, ResolveContext };
20-
21-
import Glob from "./state/glob";
22-
import * as stateInterface from "./state/interface";
23-
import * as stateState from "./state/state";
24-
import StateBuilder from "./state/stateBuilder";
25-
import * as stateDirectives from "./state/stateDirectives";
26-
import * as stateEvents from "./state/stateEvents";
27-
import * as stateFilters from "./state/stateFilters";
28-
import StateMatcher from "./state/stateMatcher";
29-
import StateQueueManager from "./state/stateQueueManager";
30-
import TargetState from "./state/targetState";
31-
//import StateService from "./state/stateService";
32-
import Queue from "./common/queue";
33-
var state = { Glob, stateInterface, state: stateState, StateBuilder, stateDirectives,
34-
stateEvents, stateFilters, StateMatcher, StateQueueManager, TargetState, Queue};
35-
36-
import HookBuilder from "./transition/hookBuilder"
37-
import * as rejectFactory from "./transition/rejectFactory"
38-
import * as _transition from "./transition/transition"
39-
import TransitionHook from "./transition/transitionHook"
40-
import * as transitionService from "./transition/transitionService"
41-
var transition = { HookBuilder, rejectFactory, transition: _transition, transitionService };
42-
43-
import UrlMatcher from "./url/urlMatcher"
44-
import urlMatcherConfig from "./url/urlMatcherConfig"
45-
// TODO marked where the objects are not yet exported as ES6
46-
import * as urlMatcherFactory from "./url/urlMatcherFactory" // TODO
47-
import * as urlRouter from "./url/urlRouter" // TODO
48-
var url = { UrlMatcher, urlMatcherConfig, urlMatcherFactory, urlRouter };
49-
50-
import * as viewInterface from "./view/interface"
51-
import * as templateFactory from "./view/templateFactory" // TODO
52-
import * as _view from "./view/view" // TODO
53-
import * as viewDirective from "./view/viewDirective" // TODO
54-
import * as viewScroll from "./view/viewScroll" // TODO
55-
var view = { viewInterface, templateFactory, view: _view, viewDirective, viewScroll };
56-
57-
// Export the submodules
58-
export { common, params, path, resolve, state, transition, url, view }
1+
import * as common from "./common/module";
2+
import * as params from "./params/module";
3+
import * as path from "./path/module";
4+
import * as resolve from "./resolve/module";
5+
import * as state from "./state/module";
6+
import * as transition from "./transition/module";
7+
import * as url from "./url/module";
8+
import * as view from "./view/module";
9+
10+
export { common, params, path, resolve, state, transition, url, view };
11+
export default "ui.router";

src/url/module.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as urlMatcher from "./urlMatcher";
2+
export {urlMatcher};
3+
4+
import * as urlMatcherConfig from "./urlMatcherConfig";
5+
export {urlMatcherConfig};
6+
7+
import * as urlMatcherFactory from "./urlMatcherFactory";
8+
export {urlMatcherFactory};
9+
10+
import * as urlRouter from "./urlRouter";
11+
export {urlRouter};

src/view/module.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as templateFactory from "./templateFactory";
2+
export {templateFactory};
3+
4+
import * as view from "./view";
5+
export {view};
6+
7+
import * as viewDirective from "./viewDirective";
8+
export {viewDirective};
9+
10+
import * as viewScroll from "./viewScroll";
11+
export {viewScroll};

0 commit comments

Comments
 (0)