Skip to content

Commit 2350e25

Browse files
Merge pull request microsoft#133 from aluanhaddad/master
Updated jspm sample
2 parents 8c4c001 + 466ea63 commit 2350e25

File tree

5 files changed

+266
-29
lines changed

5 files changed

+266
-29
lines changed

jspm/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<body>
88
<div id="content"></div>
99
<script>
10-
System.import('app').then(function(m) {
10+
SystemJS.import("app").then(function(m) {
1111
var element = document.getElementById("content");
1212
m.main(element);
1313
});

jspm/jspm.config.js

Lines changed: 232 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,254 @@
11
SystemJS.config({
22
transpiler: "plugin-typescript",
3+
typescriptOptions: {
4+
"tsconfig": true,
5+
"typeCheck": true
6+
},
37
packages: {
48
"app": {
59
"main": "app.ts",
610
"defaultExtension": "ts"
711
}
812
},
913
browserConfig: {
10-
baseURL: "/",
11-
paths: {
14+
"baseURL": "/",
15+
"paths": {
1216
"app/": "src/",
1317
"github:": "jspm_packages/github/",
1418
"npm:": "jspm_packages/npm/"
1519
}
1620
},
1721
devConfig: {
1822
"map": {
19-
"plugin-typescript": "github:frankwallis/[email protected]",
20-
"os": "github:jspm/[email protected]"
23+
"plugin-typescript": "github:frankwallis/[email protected]",
24+
"os": "npm:[email protected]",
25+
"child_process": "npm:[email protected]",
26+
"assert": "npm:[email protected]",
27+
"module": "npm:[email protected]",
28+
"buffer": "npm:[email protected]",
29+
"util": "npm:[email protected]",
30+
"crypto": "npm:[email protected]",
31+
"stream": "npm:[email protected]",
32+
"constants": "npm:[email protected]",
33+
"string_decoder": "npm:[email protected]",
34+
"vm": "npm:[email protected]",
35+
"events": "npm:[email protected]",
36+
"net": "npm:[email protected]"
2137
},
2238
"packages": {
23-
"github:frankwallis/[email protected]": {
39+
2440
"map": {
25-
"typescript": "npm:[email protected]"
41+
"os-browserify": "npm:[email protected]"
2642
}
2743
},
28-
"github:jspm/[email protected]": {
44+
"github:frankwallis/[email protected]": {
2945
"map": {
30-
"os-browserify": "npm:[email protected]"
46+
"typescript": "npm:[email protected]"
47+
}
48+
},
49+
50+
"map": {
51+
"source-map-support": "npm:[email protected]"
52+
}
53+
},
54+
55+
"map": {
56+
"source-map": "npm:[email protected]"
57+
}
58+
},
59+
60+
"map": {
61+
"buffer": "npm:[email protected]"
62+
}
63+
},
64+
65+
"map": {
66+
"base64-js": "npm:[email protected]",
67+
"ieee754": "npm:[email protected]",
68+
"isarray": "npm:[email protected]"
69+
}
70+
},
71+
72+
"map": {
73+
"crypto-browserify": "npm:[email protected]"
74+
}
75+
},
76+
77+
"map": {
78+
"diffie-hellman": "npm:[email protected]",
79+
"pbkdf2": "npm:[email protected]",
80+
"create-ecdh": "npm:[email protected]",
81+
"browserify-sign": "npm:[email protected]",
82+
"create-hmac": "npm:[email protected]",
83+
"browserify-cipher": "npm:[email protected]",
84+
"create-hash": "npm:[email protected]",
85+
"inherits": "npm:[email protected]",
86+
"public-encrypt": "npm:[email protected]",
87+
"randombytes": "npm:[email protected]"
88+
}
89+
},
90+
91+
"map": {
92+
"create-hmac": "npm:[email protected]"
93+
}
94+
},
95+
96+
"map": {
97+
"create-hmac": "npm:[email protected]",
98+
"create-hash": "npm:[email protected]",
99+
"inherits": "npm:[email protected]",
100+
"bn.js": "npm:[email protected]",
101+
"parse-asn1": "npm:[email protected]",
102+
"elliptic": "npm:[email protected]",
103+
"browserify-rsa": "npm:[email protected]"
104+
}
105+
},
106+
107+
"map": {
108+
"randombytes": "npm:[email protected]",
109+
"bn.js": "npm:[email protected]",
110+
"miller-rabin": "npm:[email protected]"
111+
}
112+
},
113+
114+
"map": {
115+
"create-hash": "npm:[email protected]",
116+
"inherits": "npm:[email protected]"
117+
}
118+
},
119+
120+
"map": {
121+
"inherits": "npm:[email protected]",
122+
"cipher-base": "npm:[email protected]",
123+
"ripemd160": "npm:[email protected]",
124+
"sha.js": "npm:[email protected]"
125+
}
126+
},
127+
128+
"map": {
129+
"create-hash": "npm:[email protected]",
130+
"randombytes": "npm:[email protected]",
131+
"bn.js": "npm:[email protected]",
132+
"parse-asn1": "npm:[email protected]",
133+
"browserify-rsa": "npm:[email protected]"
134+
}
135+
},
136+
137+
"map": {
138+
"bn.js": "npm:[email protected]",
139+
"elliptic": "npm:[email protected]"
140+
}
141+
},
142+
143+
"map": {
144+
"bn.js": "npm:[email protected]",
145+
"brorand": "npm:[email protected]"
146+
}
147+
},
148+
149+
"map": {
150+
"create-hash": "npm:[email protected]",
151+
"pbkdf2": "npm:[email protected]",
152+
"asn1.js": "npm:[email protected]",
153+
"evp_bytestokey": "npm:[email protected]",
154+
"browserify-aes": "npm:[email protected]"
155+
}
156+
},
157+
158+
"map": {
159+
"bn.js": "npm:[email protected]",
160+
"inherits": "npm:[email protected]",
161+
"minimalistic-assert": "npm:[email protected]"
162+
}
163+
},
164+
165+
"map": {
166+
"evp_bytestokey": "npm:[email protected]",
167+
"browserify-des": "npm:[email protected]",
168+
"browserify-aes": "npm:[email protected]"
169+
}
170+
},
171+
172+
"map": {
173+
"inherits": "npm:[email protected]"
174+
}
175+
},
176+
177+
"map": {
178+
"inherits": "npm:[email protected]"
179+
}
180+
},
181+
182+
"map": {
183+
"create-hash": "npm:[email protected]"
184+
}
185+
},
186+
187+
"map": {
188+
"cipher-base": "npm:[email protected]",
189+
"create-hash": "npm:[email protected]",
190+
"evp_bytestokey": "npm:[email protected]",
191+
"inherits": "npm:[email protected]",
192+
"buffer-xor": "npm:[email protected]"
193+
}
194+
},
195+
196+
"map": {
197+
"cipher-base": "npm:[email protected]",
198+
"inherits": "npm:[email protected]",
199+
"des.js": "npm:[email protected]"
200+
}
201+
},
202+
203+
"map": {
204+
"bn.js": "npm:[email protected]",
205+
"brorand": "npm:[email protected]",
206+
"inherits": "npm:[email protected]",
207+
"hash.js": "npm:[email protected]"
208+
}
209+
},
210+
211+
"map": {
212+
"bn.js": "npm:[email protected]",
213+
"randombytes": "npm:[email protected]"
214+
}
215+
},
216+
217+
"map": {
218+
"stream-browserify": "npm:[email protected]"
219+
}
220+
},
221+
222+
"map": {
223+
"inherits": "npm:[email protected]",
224+
"minimalistic-assert": "npm:[email protected]"
225+
}
226+
},
227+
228+
"map": {
229+
"inherits": "npm:[email protected]",
230+
"readable-stream": "npm:[email protected]"
231+
}
232+
},
233+
234+
"map": {
235+
"inherits": "npm:[email protected]"
236+
}
237+
},
238+
239+
"map": {
240+
"isarray": "npm:[email protected]",
241+
"inherits": "npm:[email protected]",
242+
"string_decoder": "npm:[email protected]",
243+
"process-nextick-args": "npm:[email protected]",
244+
"buffer-shims": "npm:[email protected]",
245+
"core-util-is": "npm:[email protected]",
246+
"util-deprecate": "npm:[email protected]"
247+
}
248+
},
249+
250+
"map": {
251+
"string_decoder-browserify": "npm:[email protected]"
31252
}
32253
}
33254
}
@@ -42,9 +263,9 @@ SystemJS.config({
42263
],
43264
map: {
44265
"core-js": "npm:[email protected]",
45-
"fs": "github:jspm/[email protected]-alpha",
46-
"path": "github:jspm/[email protected]-alpha",
47-
"process": "github:jspm/[email protected]-alpha"
266+
"fs": "npm:jspm-[email protected]",
267+
"path": "npm:jspm-[email protected]",
268+
"process": "npm:jspm-[email protected]"
48269
},
49270
packages: {}
50271
});

jspm/package.json

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,33 @@
44
"core-js": "npm:core-js@^2.4.0"
55
},
66
"devDependencies": {
7-
"os": "github:jspm/nodelibs-os@^0.2.0-alpha",
8-
"plugin-typescript": "github:frankwallis/plugin-typescript@^4.0.6"
7+
"assert": "npm:jspm-nodelibs-assert@^0.2.0",
8+
"buffer": "npm:jspm-nodelibs-buffer@^0.2.0",
9+
"child_process": "npm:jspm-nodelibs-child_process@^0.2.0",
10+
"constants": "npm:jspm-nodelibs-constants@^0.2.0",
11+
"crypto": "npm:jspm-nodelibs-crypto@^0.2.0",
12+
"events": "npm:jspm-nodelibs-events@^0.2.0",
13+
"module": "npm:jspm-nodelibs-module@^0.2.0",
14+
"net": "npm:jspm-nodelibs-net@^0.2.0",
15+
"os": "npm:jspm-nodelibs-os@^0.2.0",
16+
"plugin-typescript": "github:frankwallis/plugin-typescript@^5.3.3",
17+
"stream": "npm:jspm-nodelibs-stream@^0.2.0",
18+
"string_decoder": "npm:jspm-nodelibs-string_decoder@^0.2.0",
19+
"util": "npm:jspm-nodelibs-util@^0.2.0",
20+
"vm": "npm:jspm-nodelibs-vm@^0.2.0"
921
},
1022
"peerDependencies": {
11-
"fs": "github:jspm/nodelibs-fs@^0.2.0-alpha",
12-
"path": "github:jspm/nodelibs-path@^0.2.0-alpha",
13-
"process": "github:jspm/nodelibs-process@^0.2.0-alpha"
23+
"fs": "npm:jspm-nodelibs-fs@^0.2.0",
24+
"path": "npm:jspm-nodelibs-path@^0.2.0",
25+
"process": "npm:jspm-nodelibs-process@^0.2.0"
1426
},
1527
"overrides": {
16-
28+
29+
"ignore": [
30+
"test.js"
31+
]
32+
},
33+
1734
"browser": {},
1835
"map": {
1936
"buffer": "@empty",
@@ -22,6 +39,9 @@
2239
"path": "@empty",
2340
"process": "@empty",
2441
"readline": "@empty"
42+
},
43+
"dependencies": {
44+
"source-map-support": "*"
2545
}
2646
}
2747
}

jspm/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Greeter } from './greeter'
1+
import { Greeter } from "./greeter";
22

33
export function main(el: HTMLElement): void {
44
let greeter = new Greeter(el);

jspm/src/greeter.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
import repeat from "core-js/fn/string/repeat"
1+
import repeat from "core-js/fn/string/repeat";
22

3-
export class Greeter
4-
{
3+
export class Greeter {
54
element: HTMLElement;
65
span: HTMLElement;
76
timerToken: number;
87

9-
constructor (element: HTMLElement)
10-
{
8+
constructor(element: HTMLElement) {
119
this.element = element;
1210
this.element.innerText += "The time is: ";
1311
this.span = document.createElement('span');
1412
this.element.appendChild(this.span);
1513
this.span.innerText = new Date().toUTCString();
1614
}
1715

18-
start()
19-
{
20-
this.timerToken = setInterval(() => this.span.innerText = `"${repeat(new Date().toUTCString() + " ", 2)}"`, 500);
16+
start() {
17+
this.timerToken = setInterval(() => this.span.innerText = `"${repeat(new Date().toUTCString() + " ", 2)}"`, 500);
2118
}
2219

23-
stop()
24-
{
20+
stop() {
2521
clearTimeout(this.timerToken);
2622
}
2723
}

0 commit comments

Comments
 (0)