@@ -0,0 +1,11 | |||||
|
1 | requirejs.config({ | |||
|
2 | baseUrl: "js", | |||
|
3 | packages: [ | |||
|
4 | "app", | |||
|
5 | "@implab/djx", | |||
|
6 | "@implab/core-amd", | |||
|
7 | "dojo", | |||
|
8 | "dijit" | |||
|
9 | ], | |||
|
10 | deps: ["app"] | |||
|
11 | }); |
@@ -0,0 +1,12 | |||||
|
1 | import { djbase, djclass } from "@implab/djx/declare"; | |||
|
2 | import { DjxWidgetBase } from "@implab/djx/tsx/DjxWidgetBase"; | |||
|
3 | import { createElement } from "@implab/djx/tsx"; | |||
|
4 | ||||
|
5 | @djclass | |||
|
6 | export default class MainWidget extends djbase(DjxWidgetBase) { | |||
|
7 | render() { | |||
|
8 | return <div> | |||
|
9 | <h2>Hi!</h2> | |||
|
10 | </div>; | |||
|
11 | } | |||
|
12 | } |
@@ -0,0 +1,16 | |||||
|
1 | { | |||
|
2 | "compilerOptions": { | |||
|
3 | "moduleResolution": "node", | |||
|
4 | "experimentalDecorators": true, | |||
|
5 | "module": "AMD", | |||
|
6 | "jsx": "react", | |||
|
7 | "jsxFactory": "createElement", | |||
|
8 | "strict": true, | |||
|
9 | "types": [ | |||
|
10 | "requirejs", | |||
|
11 | "@implab/djx", | |||
|
12 | "@implab/dojo-typings" | |||
|
13 | ], | |||
|
14 | "skipLibCheck": true | |||
|
15 | } | |||
|
16 | } No newline at end of file |
@@ -59,6 +59,19 configureTsTest { | |||||
59 | } |
|
59 | } | |
60 | } |
|
60 | } | |
61 |
|
61 | |||
|
62 | tasks.matching{ it.name =~ /^configureTs/ }.configureEach { | |||
|
63 | compilerOptions { | |||
|
64 | if (symbols != 'none') { | |||
|
65 | sourceMap = true | |||
|
66 | switch(symbols) { | |||
|
67 | case "local": | |||
|
68 | sourceRoot = ( isWindows ? "file:///" : "file://" ) + it.rootDir | |||
|
69 | break; | |||
|
70 | } | |||
|
71 | } | |||
|
72 | } | |||
|
73 | } | |||
|
74 | ||||
62 | npmPackMeta { |
|
75 | npmPackMeta { | |
63 | meta { |
|
76 | meta { | |
64 | name = "@$npmScope/$project.name" |
|
77 | name = "@$npmScope/$project.name" |
@@ -154,8 +154,6 export const placeAt = (node: Node, refN | |||||
154 |
|
154 | |||
155 | const parent = ref.parentNode; |
|
155 | const parent = ref.parentNode; | |
156 |
|
156 | |||
157 | const insertBefore = (node: Node, refNode: Node | null) => parent && parent.insertBefore(node, refNode); |
|
|||
158 |
|
||||
159 | if (typeof position == "number") { |
|
157 | if (typeof position == "number") { | |
160 | if (ref.childNodes.length <= position) { |
|
158 | if (ref.childNodes.length <= position) { | |
161 | ref.appendChild(node); |
|
159 | ref.appendChild(node); | |
@@ -165,16 +163,16 export const placeAt = (node: Node, refN | |||||
165 | } else { |
|
163 | } else { | |
166 | switch (position) { |
|
164 | switch (position) { | |
167 | case "before": |
|
165 | case "before": | |
168 | insertBefore(node, ref); |
|
166 | parent && parent.insertBefore(node, ref); | |
169 | break; |
|
167 | break; | |
170 | case "after": |
|
168 | case "after": | |
171 | insertBefore(node, ref.nextSibling); |
|
169 | parent && parent.insertBefore(node, ref.nextSibling); | |
172 | break; |
|
170 | break; | |
173 | case "first": |
|
171 | case "first": | |
174 |
insertBefore(node, |
|
172 | ref.insertBefore(node,ref.firstChild); | |
175 | break; |
|
173 | break; | |
176 | case "last": |
|
174 | case "last": | |
177 |
|
|
175 | ref.appendChild(node); | |
178 | break; |
|
176 | break; | |
179 | case "only": |
|
177 | case "only": | |
180 | emptyNode(ref); |
|
178 | emptyNode(ref); |
@@ -15,8 +15,48 def bundleDir = fileTree(layout.buildDir | |||||
15 | builtBy "bundle" |
|
15 | builtBy "bundle" | |
16 | } |
|
16 | } | |
17 |
|
17 | |||
|
18 | typescript { | |||
|
19 | compilerOptions { | |||
|
20 | lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"] | |||
|
21 | // listFiles = true | |||
|
22 | strict = true | |||
|
23 | types = ["requirejs", "@implab/dojo-typings", "@implab/djx"] | |||
|
24 | module = "amd" | |||
|
25 | it.target = "es5" | |||
|
26 | experimentalDecorators = true | |||
|
27 | noUnusedLocals = false | |||
|
28 | jsx = "react" | |||
|
29 | jsxFactory = "createElement" | |||
|
30 | moduleResolution = "node" | |||
|
31 | // dojo-typings are sick | |||
|
32 | skipLibCheck = true | |||
|
33 | // traceResolution = true | |||
|
34 | // baseUrl = "./" | |||
|
35 | // paths = [ "*": [ "$projectDir/src/typings/*" ] ] | |||
|
36 | // baseUrl = "$projectDir/src/typings" | |||
|
37 | // typeRoots = ["$projectDir/src/typings"] | |||
|
38 | } | |||
|
39 | tscCmd = "$projectDir/node_modules/.bin/tsc" | |||
|
40 | tsLintCmd = "$projectDir/node_modules/.bin/tslint" | |||
|
41 | esLintCmd = "$projectDir/node_modules/.bin/eslint" | |||
|
42 | } | |||
|
43 | ||||
|
44 | tasks.matching{ it.name =~ /^configureTs/ }.configureEach { | |||
|
45 | compilerOptions { | |||
|
46 | if (symbols != 'none') { | |||
|
47 | sourceMap = true | |||
|
48 | switch(symbols) { | |||
|
49 | case "local": | |||
|
50 | sourceRoot = ( isWindows ? "file:///" : "file://" ) + it.rootDir | |||
|
51 | break; | |||
|
52 | } | |||
|
53 | } | |||
|
54 | } | |||
|
55 | } | |||
|
56 | ||||
18 | npmInstall { |
|
57 | npmInstall { | |
19 | //npmInstall.dependsOn it |
|
58 | //npmInstall.dependsOn it | |
|
59 | dependsOn configurations.npmLocal | |||
20 |
|
60 | |||
21 | doFirst { |
|
61 | doFirst { | |
22 | configurations.npmLocal.each { f -> |
|
62 | configurations.npmLocal.each { f -> | |
@@ -27,6 +67,12 npmInstall { | |||||
27 | } |
|
67 | } | |
28 | } |
|
68 | } | |
29 |
|
69 | |||
|
70 | clean { | |||
|
71 | doFirst { | |||
|
72 | delete "$buildDir/bundle" | |||
|
73 | } | |||
|
74 | } | |||
|
75 | ||||
30 |
|
76 | |||
31 | task processResourcesBundle(type: Copy) { |
|
77 | task processResourcesBundle(type: Copy) { | |
32 | from "src/bundle" |
|
78 | from "src/bundle" | |
@@ -45,7 +91,10 task copyModules(type: Copy) { | |||||
45 |
|
91 | |||
46 |
|
92 | |||
47 | pack("@implab/djx") |
|
93 | pack("@implab/djx") | |
|
94 | pack("@implab/core-amd") | |||
48 | pack("dojo") |
|
95 | pack("dojo") | |
|
96 | pack("dijit") | |||
|
97 | from npm.module("requirejs/require.js") | |||
49 | } |
|
98 | } | |
50 |
|
99 | |||
51 | task copyApp(type: Copy) { |
|
100 | task copyApp(type: Copy) { |
@@ -6,11 +6,16 | |||||
6 | "": { |
|
6 | "": { | |
7 | "name": "@implab/djx-playground", |
|
7 | "name": "@implab/djx-playground", | |
8 | "dependencies": { |
|
8 | "dependencies": { | |
|
9 | "dijit": "1.17.3", | |||
9 | "dojo": "1.17.3", |
|
10 | "dojo": "1.17.3", | |
10 | "requirejs": "2.3.6" |
|
11 | "requirejs": "2.3.6" | |
11 | }, |
|
12 | }, | |
12 | "devDependencies": { |
|
13 | "devDependencies": { | |
13 |
"@implab/d |
|
14 | "@implab/core-amd": "1.4.6", | |
|
15 | "@implab/djx": "file:../djx/build/npm/package", | |||
|
16 | "@implab/dojo-typings": "1.0.2", | |||
|
17 | "@types/requirejs": "2.1.34", | |||
|
18 | "typescript": "4.8.2" | |||
14 | } |
|
19 | } | |
15 | }, |
|
20 | }, | |
16 | "../djx/build/npm/package": { |
|
21 | "../djx/build/npm/package": { | |
@@ -22,10 +27,39 | |||||
22 | "dojo": "^1.10.0" |
|
27 | "dojo": "^1.10.0" | |
23 | } |
|
28 | } | |
24 | }, |
|
29 | }, | |
|
30 | "node_modules/@implab/core-amd": { | |||
|
31 | "version": "1.4.6", | |||
|
32 | "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.4.6.tgz", | |||
|
33 | "integrity": "sha512-I1RwUAxeiodePpiBzveoHaehMSAyk7NFPPPEvDqfphHBC8yXoXWAaUrp7EcOKEzjXAs7lJQVhNpmjCjIqoj6BQ==", | |||
|
34 | "dev": true, | |||
|
35 | "peerDependencies": { | |||
|
36 | "dojo": "^1.10.0" | |||
|
37 | } | |||
|
38 | }, | |||
25 | "node_modules/@implab/djx": { |
|
39 | "node_modules/@implab/djx": { | |
26 | "resolved": "../djx/build/npm/package", |
|
40 | "resolved": "../djx/build/npm/package", | |
27 | "link": true |
|
41 | "link": true | |
28 | }, |
|
42 | }, | |
|
43 | "node_modules/@implab/dojo-typings": { | |||
|
44 | "version": "1.0.2", | |||
|
45 | "resolved": "https://registry.npmjs.org/@implab/dojo-typings/-/dojo-typings-1.0.2.tgz", | |||
|
46 | "integrity": "sha512-/lbcMCHdRoHJLKFcT8xdk1KbGazSlb1pGSDJ406io7iMenPm/XbJYcUti+VzXnn71zOJ8aYpGT12T5L0rfOZNA==", | |||
|
47 | "dev": true | |||
|
48 | }, | |||
|
49 | "node_modules/@types/requirejs": { | |||
|
50 | "version": "2.1.34", | |||
|
51 | "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.34.tgz", | |||
|
52 | "integrity": "sha512-iQLGNE1DyIRYih60B47l/hI5X7J0wAnnRBL6Yn85GUYQg8Fm3wl8kvT6NRwncKroUOSx7/lbAagIFNV7y02DiQ==", | |||
|
53 | "dev": true | |||
|
54 | }, | |||
|
55 | "node_modules/dijit": { | |||
|
56 | "version": "1.17.3", | |||
|
57 | "resolved": "https://registry.npmjs.org/dijit/-/dijit-1.17.3.tgz", | |||
|
58 | "integrity": "sha512-QS+1bNhPT+BF9E+iomQSi5qI+o3oUNSx1r5TF8WlGH4LybGZP+IIGJBOO5/41YduBPljVXhY7vaPsgrycxC6UQ==", | |||
|
59 | "dependencies": { | |||
|
60 | "dojo": "1.17.3" | |||
|
61 | } | |||
|
62 | }, | |||
29 | "node_modules/dojo": { |
|
63 | "node_modules/dojo": { | |
30 | "version": "1.17.3", |
|
64 | "version": "1.17.3", | |
31 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz", |
|
65 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz", | |
@@ -42,13 +76,53 | |||||
42 | "engines": { |
|
76 | "engines": { | |
43 | "node": ">=0.4.0" |
|
77 | "node": ">=0.4.0" | |
44 | } |
|
78 | } | |
|
79 | }, | |||
|
80 | "node_modules/typescript": { | |||
|
81 | "version": "4.8.2", | |||
|
82 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", | |||
|
83 | "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", | |||
|
84 | "dev": true, | |||
|
85 | "bin": { | |||
|
86 | "tsc": "bin/tsc", | |||
|
87 | "tsserver": "bin/tsserver" | |||
|
88 | }, | |||
|
89 | "engines": { | |||
|
90 | "node": ">=4.2.0" | |||
|
91 | } | |||
45 | } |
|
92 | } | |
46 | }, |
|
93 | }, | |
47 | "dependencies": { |
|
94 | "dependencies": { | |
|
95 | "@implab/core-amd": { | |||
|
96 | "version": "1.4.6", | |||
|
97 | "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.4.6.tgz", | |||
|
98 | "integrity": "sha512-I1RwUAxeiodePpiBzveoHaehMSAyk7NFPPPEvDqfphHBC8yXoXWAaUrp7EcOKEzjXAs7lJQVhNpmjCjIqoj6BQ==", | |||
|
99 | "dev": true, | |||
|
100 | "requires": {} | |||
|
101 | }, | |||
48 | "@implab/djx": { |
|
102 | "@implab/djx": { | |
49 | "version": "file:../djx/build/npm/package", |
|
103 | "version": "file:../djx/build/npm/package", | |
50 | "requires": {} |
|
104 | "requires": {} | |
51 | }, |
|
105 | }, | |
|
106 | "@implab/dojo-typings": { | |||
|
107 | "version": "1.0.2", | |||
|
108 | "resolved": "https://registry.npmjs.org/@implab/dojo-typings/-/dojo-typings-1.0.2.tgz", | |||
|
109 | "integrity": "sha512-/lbcMCHdRoHJLKFcT8xdk1KbGazSlb1pGSDJ406io7iMenPm/XbJYcUti+VzXnn71zOJ8aYpGT12T5L0rfOZNA==", | |||
|
110 | "dev": true | |||
|
111 | }, | |||
|
112 | "@types/requirejs": { | |||
|
113 | "version": "2.1.34", | |||
|
114 | "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.34.tgz", | |||
|
115 | "integrity": "sha512-iQLGNE1DyIRYih60B47l/hI5X7J0wAnnRBL6Yn85GUYQg8Fm3wl8kvT6NRwncKroUOSx7/lbAagIFNV7y02DiQ==", | |||
|
116 | "dev": true | |||
|
117 | }, | |||
|
118 | "dijit": { | |||
|
119 | "version": "1.17.3", | |||
|
120 | "resolved": "https://registry.npmjs.org/dijit/-/dijit-1.17.3.tgz", | |||
|
121 | "integrity": "sha512-QS+1bNhPT+BF9E+iomQSi5qI+o3oUNSx1r5TF8WlGH4LybGZP+IIGJBOO5/41YduBPljVXhY7vaPsgrycxC6UQ==", | |||
|
122 | "requires": { | |||
|
123 | "dojo": "1.17.3" | |||
|
124 | } | |||
|
125 | }, | |||
52 | "dojo": { |
|
126 | "dojo": { | |
53 | "version": "1.17.3", |
|
127 | "version": "1.17.3", | |
54 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz", |
|
128 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz", | |
@@ -58,6 +132,12 | |||||
58 | "version": "2.3.6", |
|
132 | "version": "2.3.6", | |
59 | "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", |
|
133 | "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", | |
60 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==" |
|
134 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==" | |
|
135 | }, | |||
|
136 | "typescript": { | |||
|
137 | "version": "4.8.2", | |||
|
138 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", | |||
|
139 | "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", | |||
|
140 | "dev": true | |||
61 | } |
|
141 | } | |
62 | } |
|
142 | } | |
63 | } |
|
143 | } |
@@ -2,10 +2,15 | |||||
2 | "name": "@implab/djx-playground", |
|
2 | "name": "@implab/djx-playground", | |
3 | "private": true, |
|
3 | "private": true, | |
4 | "dependencies": { |
|
4 | "dependencies": { | |
|
5 | "dijit": "1.17.3", | |||
5 | "dojo": "1.17.3", |
|
6 | "dojo": "1.17.3", | |
6 | "requirejs": "2.3.6" |
|
7 | "requirejs": "2.3.6" | |
7 | }, |
|
8 | }, | |
8 | "devDependencies": { |
|
9 | "devDependencies": { | |
9 | "@implab/djx": "file:../djx/build/npm/package" |
|
10 | "@implab/core-amd": "1.4.6", | |
|
11 | "@implab/djx": "file:../djx/build/npm/package", | |||
|
12 | "@implab/dojo-typings": "1.0.2", | |||
|
13 | "@types/requirejs": "2.1.34", | |||
|
14 | "typescript": "4.8.2" | |||
10 | } |
|
15 | } | |
11 | } |
|
16 | } |
@@ -5,8 +5,7 | |||||
5 | <meta http-equiv='X-UA-Compatible' content='IE=edge'> |
|
5 | <meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
6 | <title>Djx playground</title> |
|
6 | <title>Djx playground</title> | |
7 | <meta name='viewport' content='width=device-width, initial-scale=1'> |
|
7 | <meta name='viewport' content='width=device-width, initial-scale=1'> | |
8 | <link rel='stylesheet' type='text/css' media='screen' href='main.css'> |
|
8 | <script data-main="config.js" src='js/require.js'></script> | |
9 | <script src='main.js'></script> |
|
|||
10 | </head> |
|
9 | </head> | |
11 | <body> |
|
10 | <body> | |
12 |
|
11 |
General Comments 0
You need to be logged in to leave comments.
Login now