##// END OF EJS Templates
Working sandbox
cin -
r99:908c1ce6ce6d v1.3
parent child
Show More
@@ -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
@@ -1,91 +1,104
1 1 plugins {
2 2 id "org.implab.gradle-typescript" version "1.3.4"
3 3 id "ivy-publish"
4 4 }
5 5
6 6 configurations {
7 7 "default" {
8 8 canBeConsumed = true
9 9 canBeResolved = false
10 10 }
11 11 }
12 12
13 13 typescript {
14 14 compilerOptions {
15 15 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
16 16 // listFiles = true
17 17 declaration = true
18 18 strict = true
19 19 types = []
20 20 module = "amd"
21 21 it.target = "es5"
22 22 experimentalDecorators = true
23 23 noUnusedLocals = false
24 24 jsx = "react"
25 25 jsxFactory = "createElement"
26 26 moduleResolution = "node"
27 27 // dojo-typings are sick
28 28 skipLibCheck = true
29 29 // traceResolution = true
30 30 // baseUrl = "./"
31 31 // paths = [ "*": [ "$projectDir/src/typings/*" ] ]
32 32 // baseUrl = "$projectDir/src/typings"
33 33 // typeRoots = ["$projectDir/src/typings"]
34 34 }
35 35
36 36 tscCmd = "$projectDir/node_modules/.bin/tsc"
37 37 tsLintCmd = "$projectDir/node_modules/.bin/tslint"
38 38 esLintCmd = "$projectDir/node_modules/.bin/eslint"
39 39 }
40 40
41 41 configureTsMain {
42 42 sourceFiles {
43 43 from sources.main.typings
44 44 }
45 45 compilerOptions {
46 46 // baseUrl = "$projectDir/src"
47 47 /*paths = [
48 48 "dojo/*" : [ "typings/dojo/*" ],
49 49 "dijit/*" : [ "typings/dijit/*" ]
50 50 ]*/
51 51 types = ["requirejs", "@implab/dojo-typings"]
52 52 }
53 53 }
54 54
55 55 configureTsTest {
56 56 compilerOptions {
57 57 typeRoots = []
58 58 types = ["requirejs", sources.main.output.typingsDir.get().toString() ]
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 75 npmPackMeta {
63 76 meta {
64 77 name = "@$npmScope/$project.name"
65 78 }
66 79 }
67 80
68 81 task npmPackTypings(type: Copy) {
69 82 dependsOn typings
70 83
71 84 npmPackContents.dependsOn it
72 85
73 86 from typescript.typingsDir
74 87 into npm.packageDir
75 88 }
76 89
77 90 task printVersion {
78 91 doLast {
79 92 println "packageName: ${npmPackMeta.metadata.get().name}";
80 93 println "version: $version";
81 94 println "target: $typescript.compilerOptions.target";
82 95 println "module: $typescript.compilerOptions.module";
83 96 println "symbols: $symbols";
84 97 }
85 98 }
86 99
87 100 artifacts {
88 101 "default" (npm.packageDir) {
89 102 builtBy npmAssemblePackage
90 103 }
91 104 } No newline at end of file
@@ -1,217 +1,215
1 1 import { IDestroyable } from "@implab/core-amd/interfaces";
2 2 import { isDestroyable } from "@implab/core-amd/safe";
3 3 import _WidgetBase = require("dijit/_WidgetBase");
4 4 import registry = require("dijit/registry");
5 5 import { IScope } from "./Scope";
6 6
7 7 interface _WidgetBaseConstructor {
8 8 new <A = {}, E extends { [k in keyof E]: Event } = {}>(params?: Partial<_WidgetBase<E> & A>, srcNodeRef?: dojo.NodeOrString): _WidgetBase<E> & dojo._base.DeclareCreatedObject;
9 9 prototype: _WidgetBase<any>;
10 10 }
11 11
12 12 export type DojoNodePosition = "first" | "after" | "before" | "last" | "replace" | "only" | number;
13 13
14 14 export type DojoNodeLocation = [Node, DojoNodePosition];
15 15
16 16 export interface Rendition<TNode extends Node = Node> {
17 17 getDomNode(scope?: IScope): TNode;
18 18
19 19 placeAt(refNode: string | Node, position?: DojoNodePosition): void;
20 20 }
21 21
22 22 /**
23 23 * @deprecated use Rendition
24 24 */
25 25 export type BuildContext<TNode extends Node = Node> = Rendition<TNode>;
26 26
27 27 export interface IRecursivelyDestroyable {
28 28 destroyRecursive(): void;
29 29 }
30 30
31 31 export const isNode = (el: unknown): el is Node => !!(el && (el as Node).nodeName && (el as Node).nodeType);
32 32
33 33 export const isElementNode = (el: unknown): el is Element => isNode(el) && el.nodeType === 1;
34 34
35 35 export const isTextNode = (el: unknown): el is Text => isNode(el) && el.nodeType === 3;
36 36
37 37 export const isProcessingInstructionNode = (el: unknown): el is ProcessingInstruction => isNode(el) && el.nodeType === 7;
38 38
39 39 export const isCommentNode = (el: unknown): el is Comment => isNode(el) && el.nodeType === 8;
40 40
41 41 export const isDocumentNode = (el: unknown): el is Document => isNode(el) && el.nodeType === 9;
42 42
43 43 export const isDocumentTypeNode = (el: unknown): el is DocumentType => isNode(el) && el.nodeType === 10;
44 44
45 45 export const isDocumentFragmentNode = (el: any): el is DocumentFragment => isNode(el) && el.nodeType === 11;
46 46
47 47 export const isWidget = (v: unknown): v is _WidgetBase => !!(v && "domNode" in (v as _WidgetBase));
48 48
49 49 export const isRendition = (v: unknown): v is Rendition => !!(v && typeof (v as Rendition).getDomNode === "function");
50 50
51 51 /**
52 52 * @deprecated use isRendition
53 53 */
54 54 export const isBuildContext = isRendition;
55 55
56 56 export const isPlainObject = (v: object) => {
57 57 if (typeof v !== "object")
58 58 return false;
59 59
60 60 const vp = Object.getPrototypeOf(v);
61 61 return !vp || vp === Object.prototype;
62 62 }
63 63
64 64 export const isWidgetConstructor = (v: unknown): v is _WidgetBaseConstructor =>
65 65 typeof v === "function" && v.prototype && (
66 66 "domNode" in v.prototype ||
67 67 "buildRendering" in v.prototype
68 68 );
69 69
70 70
71 71 /** Tests whether the specified node is placed in visible dom.
72 72 * @param {Node} node The node to test
73 73 */
74 74 export const isInPage = (node: Node) => node === document.body ? false : document.body.contains(node);
75 75
76 76 export const isRecursivelyDestroyable = (target: unknown): target is IRecursivelyDestroyable =>
77 77 !!(target && typeof (target as IRecursivelyDestroyable).destroyRecursive === "function");
78 78
79 79
80 80
81 81 /** Destroys DOM Node with all contained widgets.
82 82 * If the specified node is the root node of a widget, then the
83 83 * widget will be destroyed.
84 84 *
85 85 * @param target DOM Node or widget to destroy
86 86 */
87 87 export const destroy = (target: Node | IDestroyable | IRecursivelyDestroyable) => {
88 88 if (isRecursivelyDestroyable(target)) {
89 89 target.destroyRecursive();
90 90 } else if (isDestroyable(target)) {
91 91 target.destroy();
92 92 } else if (isNode(target)) {
93 93 if (isElementNode(target)) {
94 94 const w = registry.byNode(target);
95 95 if (w) {
96 96 w.destroyRecursive();
97 97 } else {
98 98 emptyNode(target);
99 99 const parent = target.parentNode;
100 100 if (parent)
101 101 parent.removeChild(target);
102 102 }
103 103 }
104 104 }
105 105 }
106 106
107 107 /** Empties a content of the specified node and destroys all contained widgets.
108 108 *
109 109 * @param target DOM node to empty.
110 110 */
111 111 export const emptyNode = (target: Node) => {
112 112 registry.findWidgets(target).forEach(destroy);
113 113
114 114 for(let c; c = target.lastChild;){ // intentional assignment
115 115 target.removeChild(c);
116 116 }
117 117 }
118 118
119 119 /** This function starts all widgets inside the DOM node if the target is a node
120 120 * or starts widget itself if the target is the widget. If the specified node
121 121 * associated with the widget that widget will be started.
122 122 *
123 123 * @param target DOM node to find and start widgets or the widget itself.
124 124 */
125 125 export const startupWidgets = (target: Node | _WidgetBase, skipNode?: Node) => {
126 126 if (isNode(target)) {
127 127 if (isElementNode(target)) {
128 128 const w = registry.byNode(target);
129 129 if (w) {
130 130 if (w.startup)
131 131 w.startup();
132 132 } else {
133 133 registry.findWidgets(target, skipNode).forEach(x => x.startup());
134 134 }
135 135 }
136 136 } else {
137 137 if (target.startup)
138 138 target.startup();
139 139 }
140 140 }
141 141
142 142 /** Places the specified DOM node at the specified location.
143 143 *
144 144 * @param node The node which should be placed
145 145 * @param refNodeOrId The reference node where the created
146 146 * DOM should be placed.
147 147 * @param position Optional parameter, specifies the
148 148 * position relative to refNode. Default is "last" (i.e. last child).
149 149 */
150 150 export const placeAt = (node: Node, refNodeOrId: string | Node, position: DojoNodePosition = "last") => {
151 151 const ref = typeof refNodeOrId == "string" ? document.getElementById(refNodeOrId) : refNodeOrId;
152 152 if (!ref)
153 153 return;
154 154
155 155 const parent = ref.parentNode;
156 156
157 const insertBefore = (node: Node, refNode: Node | null) => parent && parent.insertBefore(node, refNode);
158
159 157 if (typeof position == "number") {
160 158 if (ref.childNodes.length <= position) {
161 159 ref.appendChild(node);
162 160 } else {
163 161 ref.insertBefore(node, ref.childNodes[position]);
164 162 }
165 163 } else {
166 164 switch (position) {
167 165 case "before":
168 insertBefore(node, ref);
166 parent && parent.insertBefore(node, ref);
169 167 break;
170 168 case "after":
171 insertBefore(node, ref.nextSibling);
169 parent && parent.insertBefore(node, ref.nextSibling);
172 170 break;
173 171 case "first":
174 insertBefore(node, parent && parent.firstChild);
172 ref.insertBefore(node,ref.firstChild);
175 173 break;
176 174 case "last":
177 insertBefore(node, null);
175 ref.appendChild(node);
178 176 break;
179 177 case "only":
180 178 emptyNode(ref);
181 179 ref.appendChild(node);
182 180 break;
183 181 case "replace":
184 182 if (parent)
185 183 parent.replaceChild(node, ref);
186 184 destroy(ref);
187 185 break;
188 186 }
189 187 }
190 188 }
191 189
192 190 /** Collects nodes from collection to an array.
193 191 *
194 192 * @param collection The collection of nodes.
195 193 * @returns The array of nodes.
196 194 */
197 195 export const collectNodes = (collection: HTMLCollection) => {
198 196 const items = [];
199 197 for (let i = 0, n = collection.length; i < n; i++) {
200 198 items.push(collection[i]);
201 199 }
202 200 return items;
203 201 };
204 202
205 203 /** Starts widgets if the node contained in the document or in the started widget.
206 204 *
207 205 * @param node The node to start.
208 206 */
209 207 export const autostartWidgets = (node: Node) => {
210 208 if (node.parentNode) {
211 209 const parentWidget = registry.getEnclosingWidget(node.parentNode);
212 210 if (parentWidget && parentWidget._started)
213 211 return startupWidgets(node);
214 212 }
215 213 if (isInPage(node))
216 214 startupWidgets(node);
217 215 }; No newline at end of file
@@ -1,59 +1,108
1 1 plugins {
2 2 id "org.implab.gradle-typescript" version "1.3.4"
3 3 id "ivy-publish"
4 4 }
5 5
6 6 configurations {
7 7 npmLocal
8 8 }
9 9
10 10 dependencies {
11 11 npmLocal project(":djx")
12 12 }
13 13
14 14 def bundleDir = fileTree(layout.buildDirectory.dir("bundle")) {
15 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 57 npmInstall {
19 58 //npmInstall.dependsOn it
59 dependsOn configurations.npmLocal
20 60
21 61 doFirst {
22 62 configurations.npmLocal.each { f ->
23 63 exec {
24 64 commandLine "npm", "install", f, "--save-dev"
25 65 }
26 66 }
27 67 }
28 68 }
29 69
70 clean {
71 doFirst {
72 delete "$buildDir/bundle"
73 }
74 }
75
30 76
31 77 task processResourcesBundle(type: Copy) {
32 78 from "src/bundle"
33 79 into layout.buildDirectory.dir("bundle")
34 80 }
35 81
36 82 task copyModules(type: Copy) {
37 83 dependsOn npmInstall
38 84 into layout.buildDirectory.dir("bundle/js");
39 85
40 86 def pack = { String jsmod ->
41 87 into(jsmod) {
42 88 from npm.module(jsmod)
43 89 }
44 90 }
45 91
46 92
47 93 pack("@implab/djx")
94 pack("@implab/core-amd")
48 95 pack("dojo")
96 pack("dijit")
97 from npm.module("requirejs/require.js")
49 98 }
50 99
51 100 task copyApp(type: Copy) {
52 101 dependsOn assemble
53 102 from typescript.assemblyDir
54 103 into layout.buildDirectory.dir("bundle/js/app")
55 104 }
56 105
57 106 task bundle {
58 107 dependsOn copyModules, processResourcesBundle, copyApp
59 108 } No newline at end of file
@@ -1,63 +1,143
1 1 {
2 2 "name": "@implab/djx-playground",
3 3 "lockfileVersion": 2,
4 4 "requires": true,
5 5 "packages": {
6 6 "": {
7 7 "name": "@implab/djx-playground",
8 8 "dependencies": {
9 "dijit": "1.17.3",
9 10 "dojo": "1.17.3",
10 11 "requirejs": "2.3.6"
11 12 },
12 13 "devDependencies": {
13 "@implab/djx": "file:../djx/build/npm/package"
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 21 "../djx/build/npm/package": {
17 22 "name": "@implab/djx",
18 23 "dev": true,
19 24 "license": "BSD-2-Clause",
20 25 "peerDependencies": {
21 26 "@implab/core-amd": "^1.4.0",
22 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 39 "node_modules/@implab/djx": {
26 40 "resolved": "../djx/build/npm/package",
27 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 63 "node_modules/dojo": {
30 64 "version": "1.17.3",
31 65 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz",
32 66 "integrity": "sha512-iWDx1oSfCEDnIrs8cMW7Zh9Fbjgxu8iRagFz+Qi2eya3MXIAxFXKhv2A7dpi+bfpMpFozLwcsLV8URLw6BsHsA=="
33 67 },
34 68 "node_modules/requirejs": {
35 69 "version": "2.3.6",
36 70 "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
37 71 "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==",
38 72 "bin": {
39 73 "r_js": "bin/r.js",
40 74 "r.js": "bin/r.js"
41 75 },
42 76 "engines": {
43 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 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 102 "@implab/djx": {
49 103 "version": "file:../djx/build/npm/package",
50 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 126 "dojo": {
53 127 "version": "1.17.3",
54 128 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.17.3.tgz",
55 129 "integrity": "sha512-iWDx1oSfCEDnIrs8cMW7Zh9Fbjgxu8iRagFz+Qi2eya3MXIAxFXKhv2A7dpi+bfpMpFozLwcsLV8URLw6BsHsA=="
56 130 },
57 131 "requirejs": {
58 132 "version": "2.3.6",
59 133 "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
60 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 }
@@ -1,11 +1,16
1 1 {
2 2 "name": "@implab/djx-playground",
3 3 "private": true,
4 4 "dependencies": {
5 "dijit": "1.17.3",
5 6 "dojo": "1.17.3",
6 7 "requirejs": "2.3.6"
7 8 },
8 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 }
@@ -1,14 +1,13
1 1 <!DOCTYPE html>
2 2 <html>
3 3 <head>
4 4 <meta charset='utf-8'>
5 5 <meta http-equiv='X-UA-Compatible' content='IE=edge'>
6 6 <title>Djx playground</title>
7 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>
8 <script data-main="config.js" src='js/require.js'></script>
10 9 </head>
11 10 <body>
12 11
13 12 </body>
14 13 </html> No newline at end of file
@@ -1,1 +1,4
1 console.log("hi!"); No newline at end of file
1 import MainWidget from "./MainWidget";
2
3 const w = new MainWidget();
4 w.placeAt(document.body); No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now