1 | NO CONTENT: new file 100644 |
|
NO CONTENT: new file 100644 |
@@ -1,62 +1,73 | |||||
1 | plugins { |
|
1 | plugins { | |
2 |
id "org.implab.gradle-typescript" version "1.3. |
|
2 | id "org.implab.gradle-typescript" version "1.3.3" | |
3 | id "ivy-publish" |
|
3 | id "ivy-publish" | |
4 | } |
|
4 | } | |
5 |
|
5 | |||
6 | typescript { |
|
6 | typescript { | |
7 | compilerOptions { |
|
7 | compilerOptions { | |
8 | lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"] |
|
8 | lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"] | |
9 | //listFiles = true |
|
9 | //listFiles = true | |
10 | declaration = true |
|
10 | declaration = true | |
11 | strict = true |
|
11 | strict = true | |
12 | types = [] |
|
12 | types = [] | |
13 | module = "amd" |
|
13 | module = "amd" | |
14 | it.target = "es5" |
|
14 | it.target = "es5" | |
15 | experimentalDecorators = true |
|
15 | experimentalDecorators = true | |
16 | jsx = "react" |
|
16 | jsx = "react" | |
17 | jsxFactory = "createElement" |
|
17 | jsxFactory = "createElement" | |
18 | moduleResolution = "node" |
|
18 | moduleResolution = "node" | |
19 | // dojo-typings are sick |
|
19 | // dojo-typings are sick | |
20 | skipLibCheck = true |
|
20 | skipLibCheck = true | |
21 | // traceResolution = true |
|
21 | // traceResolution = true | |
22 | // baseUrl = "./" |
|
22 | // baseUrl = "./" | |
23 | // paths = [ "*": [ "$projectDir/src/typings/*" ] ] |
|
23 | // paths = [ "*": [ "$projectDir/src/typings/*" ] ] | |
24 | // baseUrl = "$projectDir/src/typings" |
|
24 | // baseUrl = "$projectDir/src/typings" | |
25 | // typeRoots = ["$projectDir/src/typings"] |
|
25 | // typeRoots = ["$projectDir/src/typings"] | |
26 | } |
|
26 | } | |
27 |
|
27 | |||
28 | tscCmd = "$projectDir/node_modules/.bin/tsc" |
|
28 | tscCmd = "$projectDir/node_modules/.bin/tsc" | |
29 | tsLintCmd = "$projectDir/node_modules/.bin/tslint" |
|
29 | tsLintCmd = "$projectDir/node_modules/.bin/tslint" | |
30 | esLintCmd = "$projectDir/node_modules/.bin/eslint" |
|
30 | esLintCmd = "$projectDir/node_modules/.bin/eslint" | |
31 | } |
|
31 | } | |
32 |
|
32 | |||
33 | configureTsMain { |
|
33 | configureTsMain { | |
34 | compilerOptions { |
|
34 | compilerOptions { | |
35 | types = ["requirejs", "dojo-typings"] |
|
35 | types = ["requirejs", "dojo-typings"] | |
36 | } |
|
36 | } | |
37 | } |
|
37 | } | |
38 |
|
38 | |||
|
39 | configureTsTest { | |||
|
40 | compilerOptions { | |||
|
41 | baseUrl = "." | |||
|
42 | paths = [ | |||
|
43 | "@implab/djx" : [ sources.main.output.typingsDir.get().toString() ], | |||
|
44 | "@implab/djx/*" : [ "${sources.main.output.typingsDir.get().toString()}/*" ] | |||
|
45 | ] | |||
|
46 | types = ["requirejs", sources.main.output.typingsDir.get().toString()] | |||
|
47 | } | |||
|
48 | } | |||
|
49 | ||||
39 | npmPackMeta { |
|
50 | npmPackMeta { | |
40 | meta { |
|
51 | meta { | |
41 | name = "@$npmScope/$project.name" |
|
52 | name = "@$npmScope/$project.name" | |
42 | } |
|
53 | } | |
43 | } |
|
54 | } | |
44 |
|
55 | |||
45 | task npmPackTypings(type: Copy) { |
|
56 | task npmPackTypings(type: Copy) { | |
46 | dependsOn typings |
|
57 | dependsOn typings | |
47 |
|
58 | |||
48 | npmPackContents.dependsOn it |
|
59 | npmPackContents.dependsOn it | |
49 |
|
60 | |||
50 | from typescript.typingsDir |
|
61 | from typescript.typingsDir | |
51 | into npm.packageDir |
|
62 | into npm.packageDir | |
52 | } |
|
63 | } | |
53 |
|
64 | |||
54 | task printVersion { |
|
65 | task printVersion { | |
55 | doLast { |
|
66 | doLast { | |
56 | println "packageName: ${npmPackMeta.metadata.get().name}"; |
|
67 | println "packageName: ${npmPackMeta.metadata.get().name}"; | |
57 | println "version: $version"; |
|
68 | println "version: $version"; | |
58 | println "target: $typescript.compilerOptions.target"; |
|
69 | println "target: $typescript.compilerOptions.target"; | |
59 | println "module: $typescript.compilerOptions.module"; |
|
70 | println "module: $typescript.compilerOptions.module"; | |
60 | println "symbols: $symbols"; |
|
71 | println "symbols: $symbols"; | |
61 | } |
|
72 | } | |
62 | } No newline at end of file |
|
73 | } |
@@ -1,62 +1,60 | |||||
1 | import { IObservable, ICancellation, IDestroyable } from "@implab/core-amd/interfaces"; |
|
1 | import { IObservable, ICancellation, IDestroyable } from "@implab/core-amd/interfaces"; | |
2 | import { Cancellation } from "@implab/core-amd/Cancellation"; |
|
2 | import { Cancellation } from "@implab/core-amd/Cancellation"; | |
3 | import { TraceEvent, LogLevel, WarnLevel, DebugLevel, TraceSource } from "@implab/core-amd/log/TraceSource"; |
|
3 | import { TraceEvent, LogLevel, WarnLevel, DebugLevel, TraceSource } from "@implab/core-amd/log/TraceSource"; | |
4 | import { argumentNotNull, destroy } from "@implab/core-amd/safe"; |
|
4 | import { argumentNotNull, destroy } from "@implab/core-amd/safe"; | |
5 | import { TapWriter } from "./Tap"; |
|
5 | import { TapWriter } from "./Tap"; | |
6 |
|
6 | |||
7 |
|
7 | |||
8 |
|
8 | |||
9 | export class TapeWriter implements IDestroyable { |
|
9 | export class TapeWriter implements IDestroyable { | |
10 |
|
10 | |||
11 | private readonly _t: TapWriter; |
|
11 | private readonly _t: TapWriter; | |
12 |
|
12 | |||
13 | private readonly _subscriptions = new Array<IDestroyable>(); |
|
13 | private readonly _subscriptions = new Array<IDestroyable>(); | |
14 | private _destroyed = false; |
|
14 | private _destroyed = false; | |
15 |
|
15 | |||
16 | constructor(t: TapWriter) { |
|
16 | constructor(t: TapWriter) { | |
17 | argumentNotNull(t, "test"); |
|
17 | argumentNotNull(t, "test"); | |
18 | this._t = t; |
|
18 | this._t = t; | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | writeEvents(source: IObservable<TraceEvent>, ct: ICancellation = Cancellation.none) { |
|
21 | writeEvents(source: IObservable<TraceEvent>, ct: ICancellation = Cancellation.none) { | |
22 | if (!this._destroyed) { |
|
22 | if (!this._destroyed) { | |
23 | const subscription = source.on(this.writeEvent.bind(this)); |
|
23 | const subscription = source.on(this.writeEvent.bind(this)); | |
24 | if (ct.isSupported()) { |
|
24 | if (ct.isSupported()) { | |
25 | ct.register(subscription.destroy.bind(subscription)); |
|
25 | ct.register(subscription.destroy.bind(subscription)); | |
26 | } |
|
26 | } | |
27 | this._subscriptions.push(subscription); |
|
27 | this._subscriptions.push(subscription); | |
28 | } |
|
28 | } | |
29 | } |
|
29 | } | |
30 |
|
30 | |||
31 | writeEvent(next: TraceEvent) { |
|
31 | writeEvent(next: TraceEvent) { | |
32 | if (next.level >= DebugLevel) { |
|
32 | if (next.level >= DebugLevel) { | |
33 | this._t.comment(`DEBUG ${next.source.id} ${next}`); |
|
33 | this._t.comment(`DEBUG ${next.source.id} ${next}`); | |
34 | } else if (next.level >= LogLevel) { |
|
34 | } else if (next.level >= LogLevel) { | |
35 | this._t.comment(`LOG ${next.source.id} ${next}`); |
|
35 | this._t.comment(`LOG ${next.source.id} ${next}`); | |
36 | } else if (next.level >= WarnLevel) { |
|
36 | } else if (next.level >= WarnLevel) { | |
37 | this._t.comment(`WARN ${next.source.id} ${next}`); |
|
37 | this._t.comment(`WARN ${next.source.id} ${next}`); | |
38 | } else { |
|
38 | } else { | |
39 | this._t.comment(`ERROR ${next.source.id} ${next}`); |
|
39 | this._t.comment(`ERROR ${next.source.id} ${next}`); | |
40 | } |
|
40 | } | |
41 | } |
|
41 | } | |
42 |
|
42 | |||
43 | destroy() { |
|
43 | destroy() { | |
44 | if (this._destroyed) |
|
44 | if (this._destroyed) | |
45 | return; |
|
45 | return; | |
46 | this._destroyed = true; |
|
46 | this._destroyed = true; | |
47 | this._subscriptions.forEach(destroy); |
|
47 | this._subscriptions.forEach(destroy); | |
48 | } |
|
48 | } | |
49 | } |
|
49 | } | |
50 |
|
50 | |||
51 | type TestCallback = (ok: (msg: string) => void, fail: (msg: string) => void, trace: TraceSource) => void; |
|
51 | type TestCallback = (ok: (msg: string) => void, fail: (msg: string) => void, trace: TraceSource) => void; | |
52 | type AsyncTestCallback = (trace: TraceSource) => PromiseLike<void>; |
|
52 | type AsyncTestCallback = (trace: TraceSource) => PromiseLike<void>; | |
53 |
|
53 | |||
54 | export function test(name: string, cb: TestCallback ): void; |
|
|||
55 | export function test(name: string, cb: AsyncTestCallback): void; |
|
|||
56 | export function test(name: string, cb: TestCallback | AsyncTestCallback) { |
|
54 | export function test(name: string, cb: TestCallback | AsyncTestCallback) { | |
57 |
|
55 | |||
58 | } |
|
56 | } | |
59 |
|
57 | |||
60 | export function run() { |
|
58 | export function run() { | |
61 |
|
59 | |||
62 | } |
|
60 | } |
@@ -1,18 +1,18 | |||||
1 | import { test } from "./TestTraits"; |
|
1 | import { test } from "./TestTraits"; | |
2 | import { delay } from "@implab/core-amd/safe"; |
|
2 | import { delay } from "@implab/core-amd/safe"; | |
3 | import { assert } from "chai"; |
|
3 | import { assert } from "chai"; | |
4 | import "@implab/djx"; |
|
|||
5 | import css = require("@implab/djx/css!my,css"); |
|
4 | import css = require("@implab/djx/css!my,css"); | |
|
5 | import {} from "@implab/djx/i18n"; | |||
6 |
|
6 | |||
7 | test("simple", (ok, fail, log) => { |
|
7 | test("simple", (ok, fail, log) => { | |
8 | setTimeout(() => { |
|
8 | setTimeout(() => { | |
9 | // end should be called after the last assertion |
|
9 | // end should be called after the last assertion | |
10 | ok("async assert"); |
|
10 | ok("async assert"); | |
11 | }, 100); |
|
11 | }, 100); | |
12 | }); |
|
12 | }); | |
13 |
|
13 | |||
14 | test("simple", async log => { |
|
14 | test("simple", async log => { | |
15 | await delay(0); |
|
15 | await delay(0); | |
16 |
|
16 | |||
17 | assert.ok(true); // everything is fine |
|
17 | assert.ok(true); // everything is fine | |
18 | }); |
|
18 | }); |
@@ -1,18 +1,18 | |||||
1 | { |
|
1 | { | |
2 | "extends": "../tsconfig", |
|
2 | "extends": "../tsconfig", | |
3 | "compilerOptions": { |
|
3 | "compilerOptions": { | |
4 | "baseUrl": ".", |
|
4 | "baseUrl": ".", | |
5 | "rootDir": "ts", |
|
5 | "rootDir": "ts", | |
6 | "rootDirs": [ |
|
6 | "rootDirs": [ | |
7 | "ts", |
|
7 | "ts", | |
8 | "typings", |
|
8 | "typings", | |
9 | "../main/ts", |
|
9 | "../main/ts", | |
10 | "../main/typings" |
|
10 | "../main/typings" | |
11 | ], |
|
11 | ], | |
12 | "paths": { |
|
12 | "paths": { | |
13 | "@implab/djx" : ["../main/ts", "../main/typings"] |
|
13 | "@implab/djx" : ["../main/ts", "../main/typings"], | |
14 |
|
|
14 | "@implab/djx/*" : ["../main/ts/*", "../main/typings/*" ] | |
15 | }, |
|
15 | }, | |
16 | "types": ["requirejs"] |
|
16 | "types": ["requirejs", "../main/typings"] | |
17 | } |
|
17 | } | |
18 | } No newline at end of file |
|
18 | } |
General Comments 0
You need to be logged in to leave comments.
Login now