Skip to content

Commit 6fc30f3

Browse files
committed
调整包入口文件位置以保障调试时源代码映射的目录结构正确。
1 parent 16aec98 commit 6fc30f3

39 files changed

+243
-164
lines changed

gulpfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $gulp.task('lint', function () {
1414
});
1515

1616
$gulp.task('dist', function () {
17-
var ts = $gulp.src('lib/' + ns + '/@module.ts')
17+
var ts = $gulp.src('lib/@' + ns.toLowerCase() + '.ts')
1818
.pipe($smap.init())
1919
.pipe($tsc($tsc.createProject('tsconfig.json', {
2020
outFile: pkg.name + '.js'
@@ -28,7 +28,7 @@ $gulp.task('dist', function () {
2828
});
2929

3030
$gulp.task('tsd', ['lint'], function () {
31-
var ts = $gulp.src('lib/' + ns + '/@module.ts')
31+
var ts = $gulp.src('lib/@' + ns.toLowerCase() + '.ts')
3232
.pipe($tsc($tsc.createProject('tsconfig.json', {
3333
declaration: true,
3434
removeComments: true

include/es6-promise/es6-promise.d.ts

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Type definitions for es6-promise
2+
// Project: https://github.com/jakearchibald/ES6-Promise
3+
// Definitions by: François de Campredon <https://github.com/fdecampredon/>, vvakame <https://github.com/vvakame>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
interface Thenable<R> {
7+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
8+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
9+
}
10+
11+
declare class Promise<R> implements Thenable<R> {
12+
/**
13+
* If you call resolve in the body of the callback passed to the constructor,
14+
* your promise is fulfilled with result object passed to resolve.
15+
* If you call reject your promise is rejected with the object passed to reject.
16+
* For consistency and debugging (eg stack traces), obj should be an instanceof Error.
17+
* Any errors thrown in the constructor callback will be implicitly passed to reject().
18+
*/
19+
constructor(callback: (resolve : (value?: R | Thenable<R>) => void, reject: (error?: any) => void) => void);
20+
21+
/**
22+
* onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
23+
* Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
24+
* Both callbacks have a single parameter , the fulfillment value or rejection reason.
25+
* "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
26+
* If an error is thrown in the callback, the returned promise rejects with that error.
27+
*
28+
* @param onFulfilled called when/if "promise" resolves
29+
* @param onRejected called when/if "promise" rejects
30+
*/
31+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
32+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
33+
34+
/**
35+
* Sugar for promise.then(undefined, onRejected)
36+
*
37+
* @param onRejected called when/if "promise" rejects
38+
*/
39+
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
40+
}
41+
42+
declare module Promise {
43+
/**
44+
* Make a new promise from the thenable.
45+
* A thenable is promise-like in as far as it has a "then" method.
46+
*/
47+
function resolve<R>(value?: R | Thenable<R>): Promise<R>;
48+
49+
/**
50+
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
51+
*/
52+
function reject(error: any): Promise<any>;
53+
54+
/**
55+
* Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects.
56+
* the array passed to all can be a mixture of promise-like objects and other objects.
57+
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
58+
*/
59+
function all<R>(promises: (R | Thenable<R>)[]): Promise<R[]>;
60+
61+
/**
62+
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
63+
*/
64+
function race<R>(promises: (R | Thenable<R>)[]): Promise<R>;
65+
}
66+
67+
declare module 'es6-promise' {
68+
var foo: typeof Promise; // Temp variable to reference Promise in local context
69+
module rsvp {
70+
export var Promise: typeof foo;
71+
}
72+
export = rsvp;
73+
}

include/tsd.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/// <reference path="../node_modules/bigine.util/var/build/bigine.util.d.ts" />
2+
/// <reference path="es6-promise/es6-promise.d.ts" />

lib/@c2d.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* 定义包主程序文件。
3+
*
4+
* @author 郑煜宇 <[email protected]>
5+
* @copyright © 2016 Dahao.de
6+
* @license GPL-3.0
7+
* @file @c2d.ts
8+
*/
9+
10+
/// <reference path="C2D/_Element/Stage.ts" />
11+
/// <reference path="C2D/_Element/Color.ts" />
12+
/// <reference path="C2D/_Element/Image.ts" />
13+
/// <reference path="C2D/_Element/Text.ts" />
14+
/// <reference path="C2D/_Element/Button.ts" />
15+
/// <reference path="C2D/_Animation/Combo.ts" />
16+
/// <reference path="C2D/_Animation/AudioFadeOut.ts" />
17+
/// <reference path="C2D/_Animation/FadeIn.ts" />
18+
/// <reference path="C2D/_Animation/FadeOut.ts" />
19+
/// <reference path="C2D/_Animation/Move.ts" />
20+
/// <reference path="C2D/_Animation/Type.ts" />
21+
/// <reference path="C2D/_Animation/TypeDelay.ts" />
22+
/// <reference path="C2D/_Animation/WaitForClick.ts" />
23+
24+
namespace C2D {
25+
export var version: string = '${BIGINE_MODULE_VERSION}';
26+
}

lib/C2D/@module.ts

-26
This file was deleted.

lib/C2D/_Animation/ACenter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author 郑煜宇 <[email protected]>
55
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/ACenter.ts
7+
* @file C2D/_Animation/ACenter.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/Animation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author 郑煜宇 <[email protected]>
55
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/Animation.ts
7+
* @file C2D/_Animation/Animation.ts
88
*/
99

1010
/// <reference path="../../../include/mozRequestAnimationFrame.d.ts" />

lib/C2D/_Animation/AudioFadeOut.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义透明度渐变动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/AudioFadeOut.ts
7+
* @file C2D/_Animation/AudioFadeOut.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/Combo.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义画面组合动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/Combo.ts
7+
* @file C2D/_Animation/Combo.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/Delay.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义冻结(延时)动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/Delay.ts
7+
* @file C2D/_Animation/Delay.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/Fade.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义透明度渐变动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/Fade.ts
7+
* @file C2D/_Animation/Fade.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/FadeIn.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义透明度渐显动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/FadeIn.ts
7+
* @file C2D/_Animation/FadeIn.ts
88
*/
99

1010
/// <reference path="Fade.ts" />

lib/C2D/_Animation/FadeOut.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义透明度渐隐动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/FadeOut.ts
7+
* @file C2D/_Animation/FadeOut.ts
88
*/
99

1010
/// <reference path="Fade.ts" />

lib/C2D/_Animation/IAudioFadeMetas.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 声明音频音量渐变动画元信息接口规范。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/IAudioFadeMetas.ts
7+
* @file C2D/_Animation/IAudioFadeMetas.ts
88
*/
99

1010
/// <reference path="../../../include/tsd.d.ts" />

lib/C2D/_Animation/IFadeMetas.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 声明透明度渐变动画元信息接口规范。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/IFadeMetas.ts
7+
* @file C2D/_Animation/IFadeMetas.ts
88
*/
99

1010
/// <reference path="../../../include/tsd.d.ts" />

lib/C2D/_Animation/IMoveMetas.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 声明位移动画元信息接口规范。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/IMoveMetas.ts
7+
* @file C2D/_Animation/IMoveMetas.ts
88
*/
99

1010
/// <reference path="../../../include/tsd.d.ts" />

lib/C2D/_Animation/Move.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义位移动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/Move.ts
7+
* @file C2D/_Animation/Move.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/Type.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义打字效果动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/Type.ts
7+
* @file C2D/_Animation/Type.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Animation/TypeDelay.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义打字延时动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/TypeDelay.ts
7+
* @file C2D/_Animation/TypeDelay.ts
88
*/
99

1010
/// <reference path="Delay.ts" />

lib/C2D/_Animation/WaitForClick.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义等待点击动画组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Animation/WaitForClick.ts
7+
* @file C2D/_Animation/WaitForClick.ts
88
*/
99

1010
/// <reference path="Animation.ts" />

lib/C2D/_Element/Button.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义画面按钮元素组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Element/Stage.ts
7+
* @file C2D/_Element/Stage.ts
88
*/
99

1010
/// <reference path="Sprite.ts" />

lib/C2D/_Element/Color.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义色块画面元素组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Element/Color.ts
7+
* @file C2D/_Element/Color.ts
88
*/
99

1010
/// <reference path="Element.ts" />

lib/C2D/_Element/Element.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义抽象画面元素组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Element/Element.ts
7+
* @file C2D/_Element/Element.ts
88
*/
99

1010
/// <reference path="../E.ts" />

lib/C2D/_Element/IBounds.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 声明画面元素区域接口规范。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Element/IBounds.ts
7+
* @file C2D/_Element/IBounds.ts
88
*/
99

1010
namespace C2D {

lib/C2D/_Element/Image.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义图像画面元素组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Element/Image.ts
7+
* @file C2D/_Element/Image.ts
88
*/
99

1010
/// <reference path="Element.ts" />

lib/C2D/_Element/Sprite.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* 定义画面组合元素组件。
33
*
44
* @author 郑煜宇 <[email protected]>
5-
* @copyright © 2015 Dahao.de
5+
* @copyright © 2016 Dahao.de
66
* @license GPL-3.0
7-
* @file _Element/Sprite.ts
7+
* @file C2D/_Element/Sprite.ts
88
*/
99

1010
/// <reference path="Element.ts" />

0 commit comments

Comments
 (0)