##// END OF EJS Templates
Added playground project
cin -
r97:8b413dc7fc42 v1.3
parent child
Show More
@@ -0,0 +1,59
1 plugins {
2 id "org.implab.gradle-typescript" version "1.3.4"
3 id "ivy-publish"
4 }
5
6 configurations {
7 npmLocal
8 }
9
10 dependencies {
11 npmLocal project(":djx")
12 }
13
14 def bundleDir = fileTree(layout.buildDirectory.dir("bundle")) {
15 builtBy "bundle"
16 }
17
18 npmInstall {
19 //npmInstall.dependsOn it
20
21 doFirst {
22 configurations.npmLocal.each { f ->
23 exec {
24 commandLine "npm", "install", f, "--save-dev"
25 }
26 }
27 }
28 }
29
30
31 task processResourcesBundle(type: Copy) {
32 from "src/bundle"
33 into layout.buildDirectory.dir("bundle")
34 }
35
36 task copyModules(type: Copy) {
37 dependsOn npmInstall
38 into layout.buildDirectory.dir("bundle/js");
39
40 def pack = { String jsmod ->
41 into(jsmod) {
42 from npm.module(jsmod)
43 }
44 }
45
46
47 pack("@implab/djx")
48 pack("dojo")
49 }
50
51 task copyApp(type: Copy) {
52 dependsOn assemble
53 from typescript.assemblyDir
54 into layout.buildDirectory.dir("bundle/js/app")
55 }
56
57 task bundle {
58 dependsOn copyModules, processResourcesBundle, copyApp
59 } No newline at end of file
@@ -0,0 +1,63
1 {
2 "name": "@implab/djx-playground",
3 "lockfileVersion": 2,
4 "requires": true,
5 "packages": {
6 "": {
7 "name": "@implab/djx-playground",
8 "dependencies": {
9 "dojo": "1.17.3",
10 "requirejs": "2.3.6"
11 },
12 "devDependencies": {
13 "@implab/djx": "file:../djx/build/npm/package"
14 }
15 },
16 "../djx/build/npm/package": {
17 "name": "@implab/djx",
18 "dev": true,
19 "license": "BSD-2-Clause",
20 "peerDependencies": {
21 "@implab/core-amd": "^1.4.0",
22 "dojo": "^1.10.0"
23 }
24 },
25 "node_modules/@implab/djx": {
26 "resolved": "../djx/build/npm/package",
27 "link": true
28 },
29 "node_modules/dojo": {
30 "version": "1.17.3",
31 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz",
32 "integrity": "sha512-iWDx1oSfCEDnIrs8cMW7Zh9Fbjgxu8iRagFz+Qi2eya3MXIAxFXKhv2A7dpi+bfpMpFozLwcsLV8URLw6BsHsA=="
33 },
34 "node_modules/requirejs": {
35 "version": "2.3.6",
36 "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
37 "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==",
38 "bin": {
39 "r_js": "bin/r.js",
40 "r.js": "bin/r.js"
41 },
42 "engines": {
43 "node": ">=0.4.0"
44 }
45 }
46 },
47 "dependencies": {
48 "@implab/djx": {
49 "version": "file:../djx/build/npm/package",
50 "requires": {}
51 },
52 "dojo": {
53 "version": "1.17.3",
54 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz",
55 "integrity": "sha512-iWDx1oSfCEDnIrs8cMW7Zh9Fbjgxu8iRagFz+Qi2eya3MXIAxFXKhv2A7dpi+bfpMpFozLwcsLV8URLw6BsHsA=="
56 },
57 "requirejs": {
58 "version": "2.3.6",
59 "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
60 "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg=="
61 }
62 }
63 }
@@ -0,0 +1,11
1 {
2 "name": "@implab/djx-playground",
3 "private": true,
4 "dependencies": {
5 "dojo": "1.17.3",
6 "requirejs": "2.3.6"
7 },
8 "devDependencies": {
9 "@implab/djx": "file:../djx/build/npm/package"
10 }
11 }
@@ -0,0 +1,14
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset='utf-8'>
5 <meta http-equiv='X-UA-Compatible' content='IE=edge'>
6 <title>Djx playground</title>
7 <meta name='viewport' content='width=device-width, initial-scale=1'>
8 <link rel='stylesheet' type='text/css' media='screen' href='main.css'>
9 <script src='main.js'></script>
10 </head>
11 <body>
12
13 </body>
14 </html> No newline at end of file
@@ -0,0 +1,1
1 console.log("hi!"); No newline at end of file
@@ -1,8 +1,15
1 1 plugins {
2 id "org.implab.gradle-typescript" version "1.3.3"
2 id "org.implab.gradle-typescript" version "1.3.4"
3 3 id "ivy-publish"
4 4 }
5 5
6 configurations {
7 "default" {
8 canBeConsumed = true
9 canBeResolved = false
10 }
11 }
12
6 13 typescript {
7 14 compilerOptions {
8 15 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
@@ -75,4 +82,10 task printVersion {
75 82 println "module: $typescript.compilerOptions.module";
76 83 println "symbols: $symbols";
77 84 }
85 }
86
87 artifacts {
88 "default" (npm.packageDir) {
89 builtBy npmAssemblePackage
90 }
78 91 } No newline at end of file
@@ -18,7 +18,7
18 18 "eslint": "6.8.0",
19 19 "requirejs": "2.3.6",
20 20 "tslint": "^6.1.3",
21 "typescript": "4.2.4",
21 "typescript": "4.7.4",
22 22 "yaml": "~1.7.2"
23 23 },
24 24 "peerDependencies": {
@@ -1368,9 +1368,9
1368 1368 }
1369 1369 },
1370 1370 "node_modules/typescript": {
1371 "version": "4.2.4",
1372 "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
1373 "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
1371 "version": "4.7.4",
1372 "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
1373 "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
1374 1374 "dev": true,
1375 1375 "bin": {
1376 1376 "tsc": "bin/tsc",
@@ -2547,9 +2547,9
2547 2547 "dev": true
2548 2548 },
2549 2549 "typescript": {
2550 "version": "4.2.4",
2551 "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz",
2552 "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==",
2550 "version": "4.7.4",
2551 "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
2552 "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
2553 2553 "dev": true
2554 2554 },
2555 2555 "uri-js": {
@@ -28,7 +28,7
28 28 "eslint": "6.8.0",
29 29 "requirejs": "2.3.6",
30 30 "tslint": "^6.1.3",
31 "typescript": "4.2.4",
31 "typescript": "4.7.4",
32 32 "yaml": "~1.7.2"
33 33 }
34 34 }
@@ -11,7 +11,7 export type Consumer<T> = Partial<Sink<T
11 11 export type Producer<T> = (sink: Sink<T>) => (void | (() => void));
12 12
13 13 export interface Observable<T> {
14 on(sink: Partial<Sink<T>>): IDestroyable;
14 on(consumer: Partial<Sink<T>>): IDestroyable;
15 15 }
16 16
17 17 const noop = () => {};
@@ -27,7 +27,7 const sink = <T>(consumer: Consumer<T>)
27 27 };
28 28 }
29 29
30 export const observe = <T>(producer: Producer<T>) => ({
30 export const observe = <T>(producer: Producer<T>) : Observable<T> => ({
31 31 on: (consumer: Consumer<T>) => ({
32 32 destroy: producer(sink(consumer)) ?? noop
33 33 })
@@ -8,6 +8,8 import { Observable } from "../observabl
8 8
9 9 const trace = TraceSource.get(mid);
10 10
11 const noop = () => {};
12
11 13 export class WatchRendition<T> extends RenditionBase<Node> {
12 14 private readonly _factory: (arg: T) => any;
13 15
@@ -30,7 +32,7 export class WatchRendition<T> extends R
30 32
31 33 protected _create(attrs: object, children: any[], scope: IScope) {
32 34 scope.own(this._scope);
33 scope.own(this._subject.on({ next: this._onValue }))
35 scope.own(this._subject.on({ next: this._onValue }));
34 36 }
35 37
36 38 private _onValue = (value: T) => void this._render(value).catch( e => trace.error(e));
@@ -1,10 +1,10
1 1 import { argumentNotNull } from "@implab/core-amd/safe";
2 import { getItemDom, RenditionBase } from "./RenditionBase";
2 import { RenditionBase } from "./RenditionBase";
3 3 import { DojoNodePosition, isElementNode, isInPage, isWidget, placeAt } from "./traits";
4 4 import registry = require("dijit/registry");
5 5 import ContentPane = require("dijit/layout/ContentPane");
6 6 import { IScope } from "./Scope";
7 import { getScope } from "./Renderer";
7 import { getItemDom, getScope } from "./Renderer";
8 8
9 9 // tslint:disable-next-line: class-name
10 10 export interface _Widget {
@@ -4,7 +4,10 import _WidgetBase = require("dijit/_Wid
4 4 import registry = require("dijit/registry");
5 5 import { IScope } from "./Scope";
6 6
7 type _WidgetBaseConstructor = typeof _WidgetBase;
7 interface _WidgetBaseConstructor {
8 new <A = {}, E extends { [k in keyof E]: Event } = {}>(params?: Partial<_WidgetBase<E> & A>, srcNodeRef?: dojo.NodeOrString): _WidgetBase<E> & dojo._base.DeclareCreatedObject;
9 prototype: _WidgetBase<any>;
10 }
8 11
9 12 export type DojoNodePosition = "first" | "after" | "before" | "last" | "replace" | "only" | number;
10 13
1 NO CONTENT: file renamed from djx/src/main/typings/css.d.ts to djx/src/main/typings/css-plugin.d.ts
@@ -1,4 +1,4
1 /// <reference path="./css.d.ts"/>
1 /// <reference path="./css-plugin.d.ts"/>
2 2
3 3 declare namespace JSX {
4 4
1 NO CONTENT: modified file, binary diff hidden
@@ -1,5 +1,5
1 1 distributionBase=GRADLE_USER_HOME
2 2 distributionPath=wrapper/dists
3 distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
3 distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4 4 zipStoreBase=GRADLE_USER_HOME
5 5 zipStorePath=wrapper/dists
@@ -154,19 +154,19 if [ "$cygwin" = "true" -o "$msys" = "tr
154 154 else
155 155 eval `echo args$i`="\"$arg\""
156 156 fi
157 i=$((i+1))
157 i=`expr $i + 1`
158 158 done
159 159 case $i in
160 (0) set -- ;;
161 (1) set -- "$args0" ;;
162 (2) set -- "$args0" "$args1" ;;
163 (3) set -- "$args0" "$args1" "$args2" ;;
164 (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
160 0) set -- ;;
161 1) set -- "$args0" ;;
162 2) set -- "$args0" "$args1" ;;
163 3) set -- "$args0" "$args1" "$args2" ;;
164 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 170 esac
171 171 fi
172 172
@@ -175,14 +175,9 save () {
175 175 for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 176 echo " "
177 177 }
178 APP_ARGS=$(save "$@")
178 APP_ARGS=`save "$@"`
179 179
180 180 # Collect all arguments for the java command, following the shell quoting and substitution rules
181 181 eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 182
183 # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 cd "$(dirname "$0")"
186 fi
187
188 183 exec "$JAVACMD" "$@"
@@ -14,4 +14,5
14 14
15 15 rootProject.name = 'implabjs-djx'
16 16
17 include 'djx' No newline at end of file
17 include 'djx'
18 include 'playground' No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now