Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 2350e25

Browse files
Merge pull request #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/plugin-typescript@4.0.6",
20-
"os": "github:jspm/nodelibs-os@0.2.0-alpha"
23+
"plugin-typescript": "github:frankwallis/plugin-typescript@5.3.3",
24+
"os": "npm:jspm-nodelibs-os@0.2.0",
25+
"child_process": "npm:jspm-nodelibs-child_process@0.2.0",
26+
"assert": "npm:jspm-nodelibs-assert@0.2.0",
27+
"module": "npm:jspm-nodelibs-module@0.2.0",
28+
"buffer": "npm:jspm-nodelibs-buffer@0.2.1",
29+
"util": "npm:jspm-nodelibs-util@0.2.1",
30+
"crypto": "npm:jspm-nodelibs-crypto@0.2.0",
31+
"stream": "npm:jspm-nodelibs-stream@0.2.0",
32+
"constants": "npm:jspm-nodelibs-constants@0.2.0",
33+
"string_decoder": "npm:jspm-nodelibs-string_decoder@0.2.0",
34+
"vm": "npm:jspm-nodelibs-vm@0.2.0",
35+
"events": "npm:jspm-nodelibs-events@0.2.0",
36+
"net": "npm:jspm-nodelibs-net@0.2.0"
2137
},
2238
"packages": {
23-
"github:frankwallis/plugin-typescript@4.0.6": {
39+
"npm:jspm-nodelibs-os@0.2.0": {
2440
"map": {
25-
"typescript": "npm:typescript@1.8.10"
41+
"os-browserify": "npm:os-browserify@0.2.1"
2642
}
2743
},
28-
"github:jspm/nodelibs-os@0.2.0-alpha": {
44+
"github:frankwallis/plugin-typescript@5.3.3": {
2945
"map": {
30-
"os-browserify": "npm:os-browserify@0.2.1"
46+
"typescript": "npm:typescript@2.1.4"
47+
}
48+
},
49+
"npm:typescript@2.1.4": {
50+
"map": {
51+
"source-map-support": "npm:source-map-support@0.4.8"
52+
}
53+
},
54+
"npm:source-map-support@0.4.8": {
55+
"map": {
56+
"source-map": "npm:source-map@0.5.6"
57+
}
58+
},
59+
"npm:jspm-nodelibs-buffer@0.2.1": {
60+
"map": {
61+
"buffer": "npm:buffer@4.9.1"
62+
}
63+
},
64+
"npm:buffer@4.9.1": {
65+
"map": {
66+
"base64-js": "npm:base64-js@1.2.0",
67+
"ieee754": "npm:ieee754@1.1.8",
68+
"isarray": "npm:isarray@1.0.0"
69+
}
70+
},
71+
"npm:jspm-nodelibs-crypto@0.2.0": {
72+
"map": {
73+
"crypto-browserify": "npm:crypto-browserify@3.11.0"
74+
}
75+
},
76+
"npm:crypto-browserify@3.11.0": {
77+
"map": {
78+
"diffie-hellman": "npm:diffie-hellman@5.0.2",
79+
"pbkdf2": "npm:pbkdf2@3.0.9",
80+
"create-ecdh": "npm:create-ecdh@4.0.0",
81+
"browserify-sign": "npm:browserify-sign@4.0.0",
82+
"create-hmac": "npm:create-hmac@1.1.4",
83+
"browserify-cipher": "npm:browserify-cipher@1.0.0",
84+
"create-hash": "npm:create-hash@1.1.2",
85+
"inherits": "npm:inherits@2.0.3",
86+
"public-encrypt": "npm:public-encrypt@4.0.0",
87+
"randombytes": "npm:randombytes@2.0.3"
88+
}
89+
},
90+
"npm:pbkdf2@3.0.9": {
91+
"map": {
92+
"create-hmac": "npm:create-hmac@1.1.4"
93+
}
94+
},
95+
"npm:browserify-sign@4.0.0": {
96+
"map": {
97+
"create-hmac": "npm:create-hmac@1.1.4",
98+
"create-hash": "npm:create-hash@1.1.2",
99+
"inherits": "npm:inherits@2.0.3",
100+
"bn.js": "npm:bn.js@4.11.6",
101+
"parse-asn1": "npm:parse-asn1@5.0.0",
102+
"elliptic": "npm:elliptic@6.3.2",
103+
"browserify-rsa": "npm:browserify-rsa@4.0.1"
104+
}
105+
},
106+
"npm:diffie-hellman@5.0.2": {
107+
"map": {
108+
"randombytes": "npm:randombytes@2.0.3",
109+
"bn.js": "npm:bn.js@4.11.6",
110+
"miller-rabin": "npm:miller-rabin@4.0.0"
111+
}
112+
},
113+
"npm:create-hmac@1.1.4": {
114+
"map": {
115+
"create-hash": "npm:create-hash@1.1.2",
116+
"inherits": "npm:inherits@2.0.3"
117+
}
118+
},
119+
"npm:create-hash@1.1.2": {
120+
"map": {
121+
"inherits": "npm:inherits@2.0.3",
122+
"cipher-base": "npm:cipher-base@1.0.3",
123+
"ripemd160": "npm:ripemd160@1.0.1",
124+
"sha.js": "npm:sha.js@2.4.8"
125+
}
126+
},
127+
"npm:public-encrypt@4.0.0": {
128+
"map": {
129+
"create-hash": "npm:create-hash@1.1.2",
130+
"randombytes": "npm:randombytes@2.0.3",
131+
"bn.js": "npm:bn.js@4.11.6",
132+
"parse-asn1": "npm:parse-asn1@5.0.0",
133+
"browserify-rsa": "npm:browserify-rsa@4.0.1"
134+
}
135+
},
136+
"npm:create-ecdh@4.0.0": {
137+
"map": {
138+
"bn.js": "npm:bn.js@4.11.6",
139+
"elliptic": "npm:elliptic@6.3.2"
140+
}
141+
},
142+
"npm:miller-rabin@4.0.0": {
143+
"map": {
144+
"bn.js": "npm:bn.js@4.11.6",
145+
"brorand": "npm:brorand@1.0.6"
146+
}
147+
},
148+
"npm:parse-asn1@5.0.0": {
149+
"map": {
150+
"create-hash": "npm:create-hash@1.1.2",
151+
"pbkdf2": "npm:pbkdf2@3.0.9",
152+
"asn1.js": "npm:asn1.js@4.9.0",
153+
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
154+
"browserify-aes": "npm:browserify-aes@1.0.6"
155+
}
156+
},
157+
"npm:asn1.js@4.9.0": {
158+
"map": {
159+
"bn.js": "npm:bn.js@4.11.6",
160+
"inherits": "npm:inherits@2.0.3",
161+
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
162+
}
163+
},
164+
"npm:browserify-cipher@1.0.0": {
165+
"map": {
166+
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
167+
"browserify-des": "npm:browserify-des@1.0.0",
168+
"browserify-aes": "npm:browserify-aes@1.0.6"
169+
}
170+
},
171+
"npm:cipher-base@1.0.3": {
172+
"map": {
173+
"inherits": "npm:inherits@2.0.3"
174+
}
175+
},
176+
"npm:sha.js@2.4.8": {
177+
"map": {
178+
"inherits": "npm:inherits@2.0.3"
179+
}
180+
},
181+
"npm:evp_bytestokey@1.0.0": {
182+
"map": {
183+
"create-hash": "npm:create-hash@1.1.2"
184+
}
185+
},
186+
"npm:browserify-aes@1.0.6": {
187+
"map": {
188+
"cipher-base": "npm:cipher-base@1.0.3",
189+
"create-hash": "npm:create-hash@1.1.2",
190+
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
191+
"inherits": "npm:inherits@2.0.3",
192+
"buffer-xor": "npm:buffer-xor@1.0.3"
193+
}
194+
},
195+
"npm:browserify-des@1.0.0": {
196+
"map": {
197+
"cipher-base": "npm:cipher-base@1.0.3",
198+
"inherits": "npm:inherits@2.0.3",
199+
"des.js": "npm:des.js@1.0.0"
200+
}
201+
},
202+
"npm:elliptic@6.3.2": {
203+
"map": {
204+
"bn.js": "npm:bn.js@4.11.6",
205+
"brorand": "npm:brorand@1.0.6",
206+
"inherits": "npm:inherits@2.0.3",
207+
"hash.js": "npm:hash.js@1.0.3"
208+
}
209+
},
210+
"npm:browserify-rsa@4.0.1": {
211+
"map": {
212+
"bn.js": "npm:bn.js@4.11.6",
213+
"randombytes": "npm:randombytes@2.0.3"
214+
}
215+
},
216+
"npm:jspm-nodelibs-stream@0.2.0": {
217+
"map": {
218+
"stream-browserify": "npm:stream-browserify@2.0.1"
219+
}
220+
},
221+
"npm:des.js@1.0.0": {
222+
"map": {
223+
"inherits": "npm:inherits@2.0.3",
224+
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
225+
}
226+
},
227+
"npm:stream-browserify@2.0.1": {
228+
"map": {
229+
"inherits": "npm:inherits@2.0.3",
230+
"readable-stream": "npm:readable-stream@2.2.2"
231+
}
232+
},
233+
"npm:hash.js@1.0.3": {
234+
"map": {
235+
"inherits": "npm:inherits@2.0.3"
236+
}
237+
},
238+
"npm:readable-stream@2.2.2": {
239+
"map": {
240+
"isarray": "npm:isarray@1.0.0",
241+
"inherits": "npm:inherits@2.0.3",
242+
"string_decoder": "npm:string_decoder@0.10.31",
243+
"process-nextick-args": "npm:process-nextick-args@1.0.7",
244+
"buffer-shims": "npm:buffer-shims@1.0.0",
245+
"core-util-is": "npm:core-util-is@1.0.2",
246+
"util-deprecate": "npm:util-deprecate@1.0.2"
247+
}
248+
},
249+
"npm:jspm-nodelibs-string_decoder@0.2.0": {
250+
"map": {
251+
"string_decoder-browserify": "npm:string_decoder@0.10.31"
31252
}
32253
}
33254
}
@@ -42,9 +263,9 @@ SystemJS.config({
42263
],
43264
map: {
44265
"core-js": "npm:core-js@2.4.0",
45-
"fs": "github:jspm/nodelibs-fs@0.2.0-alpha",
46-
"path": "github:jspm/nodelibs-path@0.2.0-alpha",
47-
"process": "github:jspm/nodelibs-process@0.2.0-alpha"
266+
"fs": "npm:jspm-nodelibs-fs@0.2.0",
267+
"path": "npm:jspm-nodelibs-path@0.2.0",
268+
"process": "npm:jspm-nodelibs-process@0.2.0"
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-
"npm:typescript@1.8.10": {
28+
"npm:inherits@2.0.3": {
29+
"ignore": [
30+
"test.js"
31+
]
32+
},
33+
"npm:typescript@2.1.4": {
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)