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