Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jspm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body>
<div id="content"></div>
<script>
System.import('app').then(function(m) {
SystemJS.import("app").then(function(m) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - does System still exist? Is using SystemJS best practice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it System still exists but it will be deprecated in the next major version. Most documentation has been updated to use SystemJS. You can read about the change in systemjs/systemjs/issues/936

var element = document.getElementById("content");
m.main(element);
});
Expand Down
243 changes: 232 additions & 11 deletions jspm/jspm.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,254 @@
SystemJS.config({
transpiler: "plugin-typescript",
typescriptOptions: {
"tsconfig": true,
"typeCheck": true
},
packages: {
"app": {
"main": "app.ts",
"defaultExtension": "ts"
}
},
browserConfig: {
baseURL: "/",
paths: {
"baseURL": "/",
"paths": {
"app/": "src/",
"github:": "jspm_packages/github/",
"npm:": "jspm_packages/npm/"
}
},
devConfig: {
"map": {
"plugin-typescript": "github:frankwallis/plugin-typescript@4.0.6",
"os": "github:jspm/nodelibs-os@0.2.0-alpha"
"plugin-typescript": "github:frankwallis/plugin-typescript@5.3.3",
"os": "npm:jspm-nodelibs-os@0.2.0",
"child_process": "npm:jspm-nodelibs-child_process@0.2.0",
"assert": "npm:jspm-nodelibs-assert@0.2.0",
"module": "npm:jspm-nodelibs-module@0.2.0",
"buffer": "npm:jspm-nodelibs-buffer@0.2.1",
"util": "npm:jspm-nodelibs-util@0.2.1",
"crypto": "npm:jspm-nodelibs-crypto@0.2.0",
"stream": "npm:jspm-nodelibs-stream@0.2.0",
"constants": "npm:jspm-nodelibs-constants@0.2.0",
"string_decoder": "npm:jspm-nodelibs-string_decoder@0.2.0",
"vm": "npm:jspm-nodelibs-vm@0.2.0",
"events": "npm:jspm-nodelibs-events@0.2.0",
"net": "npm:jspm-nodelibs-net@0.2.0"
},
"packages": {
"github:frankwallis/plugin-typescript@4.0.6": {
"npm:jspm-nodelibs-os@0.2.0": {
"map": {
"typescript": "npm:typescript@1.8.10"
"os-browserify": "npm:os-browserify@0.2.1"
}
},
"github:jspm/nodelibs-os@0.2.0-alpha": {
"github:frankwallis/plugin-typescript@5.3.3": {
"map": {
"os-browserify": "npm:os-browserify@0.2.1"
"typescript": "npm:typescript@2.1.4"
}
},
"npm:typescript@2.1.4": {
"map": {
"source-map-support": "npm:source-map-support@0.4.8"
}
},
"npm:source-map-support@0.4.8": {
"map": {
"source-map": "npm:source-map@0.5.6"
}
},
"npm:jspm-nodelibs-buffer@0.2.1": {
"map": {
"buffer": "npm:buffer@4.9.1"
}
},
"npm:buffer@4.9.1": {
"map": {
"base64-js": "npm:base64-js@1.2.0",
"ieee754": "npm:ieee754@1.1.8",
"isarray": "npm:isarray@1.0.0"
}
},
"npm:jspm-nodelibs-crypto@0.2.0": {
"map": {
"crypto-browserify": "npm:crypto-browserify@3.11.0"
}
},
"npm:crypto-browserify@3.11.0": {
"map": {
"diffie-hellman": "npm:diffie-hellman@5.0.2",
"pbkdf2": "npm:pbkdf2@3.0.9",
"create-ecdh": "npm:create-ecdh@4.0.0",
"browserify-sign": "npm:browserify-sign@4.0.0",
"create-hmac": "npm:create-hmac@1.1.4",
"browserify-cipher": "npm:browserify-cipher@1.0.0",
"create-hash": "npm:create-hash@1.1.2",
"inherits": "npm:inherits@2.0.3",
"public-encrypt": "npm:public-encrypt@4.0.0",
"randombytes": "npm:randombytes@2.0.3"
}
},
"npm:pbkdf2@3.0.9": {
"map": {
"create-hmac": "npm:create-hmac@1.1.4"
}
},
"npm:browserify-sign@4.0.0": {
"map": {
"create-hmac": "npm:create-hmac@1.1.4",
"create-hash": "npm:create-hash@1.1.2",
"inherits": "npm:inherits@2.0.3",
"bn.js": "npm:bn.js@4.11.6",
"parse-asn1": "npm:parse-asn1@5.0.0",
"elliptic": "npm:elliptic@6.3.2",
"browserify-rsa": "npm:browserify-rsa@4.0.1"
}
},
"npm:diffie-hellman@5.0.2": {
"map": {
"randombytes": "npm:randombytes@2.0.3",
"bn.js": "npm:bn.js@4.11.6",
"miller-rabin": "npm:miller-rabin@4.0.0"
}
},
"npm:create-hmac@1.1.4": {
"map": {
"create-hash": "npm:create-hash@1.1.2",
"inherits": "npm:inherits@2.0.3"
}
},
"npm:create-hash@1.1.2": {
"map": {
"inherits": "npm:inherits@2.0.3",
"cipher-base": "npm:cipher-base@1.0.3",
"ripemd160": "npm:ripemd160@1.0.1",
"sha.js": "npm:sha.js@2.4.8"
}
},
"npm:public-encrypt@4.0.0": {
"map": {
"create-hash": "npm:create-hash@1.1.2",
"randombytes": "npm:randombytes@2.0.3",
"bn.js": "npm:bn.js@4.11.6",
"parse-asn1": "npm:parse-asn1@5.0.0",
"browserify-rsa": "npm:browserify-rsa@4.0.1"
}
},
"npm:create-ecdh@4.0.0": {
"map": {
"bn.js": "npm:bn.js@4.11.6",
"elliptic": "npm:elliptic@6.3.2"
}
},
"npm:miller-rabin@4.0.0": {
"map": {
"bn.js": "npm:bn.js@4.11.6",
"brorand": "npm:brorand@1.0.6"
}
},
"npm:parse-asn1@5.0.0": {
"map": {
"create-hash": "npm:create-hash@1.1.2",
"pbkdf2": "npm:pbkdf2@3.0.9",
"asn1.js": "npm:asn1.js@4.9.0",
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
"browserify-aes": "npm:browserify-aes@1.0.6"
}
},
"npm:asn1.js@4.9.0": {
"map": {
"bn.js": "npm:bn.js@4.11.6",
"inherits": "npm:inherits@2.0.3",
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
}
},
"npm:browserify-cipher@1.0.0": {
"map": {
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
"browserify-des": "npm:browserify-des@1.0.0",
"browserify-aes": "npm:browserify-aes@1.0.6"
}
},
"npm:cipher-base@1.0.3": {
"map": {
"inherits": "npm:inherits@2.0.3"
}
},
"npm:sha.js@2.4.8": {
"map": {
"inherits": "npm:inherits@2.0.3"
}
},
"npm:evp_bytestokey@1.0.0": {
"map": {
"create-hash": "npm:create-hash@1.1.2"
}
},
"npm:browserify-aes@1.0.6": {
"map": {
"cipher-base": "npm:cipher-base@1.0.3",
"create-hash": "npm:create-hash@1.1.2",
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
"inherits": "npm:inherits@2.0.3",
"buffer-xor": "npm:buffer-xor@1.0.3"
}
},
"npm:browserify-des@1.0.0": {
"map": {
"cipher-base": "npm:cipher-base@1.0.3",
"inherits": "npm:inherits@2.0.3",
"des.js": "npm:des.js@1.0.0"
}
},
"npm:elliptic@6.3.2": {
"map": {
"bn.js": "npm:bn.js@4.11.6",
"brorand": "npm:brorand@1.0.6",
"inherits": "npm:inherits@2.0.3",
"hash.js": "npm:hash.js@1.0.3"
}
},
"npm:browserify-rsa@4.0.1": {
"map": {
"bn.js": "npm:bn.js@4.11.6",
"randombytes": "npm:randombytes@2.0.3"
}
},
"npm:jspm-nodelibs-stream@0.2.0": {
"map": {
"stream-browserify": "npm:stream-browserify@2.0.1"
}
},
"npm:des.js@1.0.0": {
"map": {
"inherits": "npm:inherits@2.0.3",
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
}
},
"npm:stream-browserify@2.0.1": {
"map": {
"inherits": "npm:inherits@2.0.3",
"readable-stream": "npm:readable-stream@2.2.2"
}
},
"npm:hash.js@1.0.3": {
"map": {
"inherits": "npm:inherits@2.0.3"
}
},
"npm:readable-stream@2.2.2": {
"map": {
"isarray": "npm:isarray@1.0.0",
"inherits": "npm:inherits@2.0.3",
"string_decoder": "npm:string_decoder@0.10.31",
"process-nextick-args": "npm:process-nextick-args@1.0.7",
"buffer-shims": "npm:buffer-shims@1.0.0",
"core-util-is": "npm:core-util-is@1.0.2",
"util-deprecate": "npm:util-deprecate@1.0.2"
}
},
"npm:jspm-nodelibs-string_decoder@0.2.0": {
"map": {
"string_decoder-browserify": "npm:string_decoder@0.10.31"
}
}
}
Expand All @@ -42,9 +263,9 @@ SystemJS.config({
],
map: {
"core-js": "npm:core-js@2.4.0",
"fs": "github:jspm/nodelibs-fs@0.2.0-alpha",
"path": "github:jspm/nodelibs-path@0.2.0-alpha",
"process": "github:jspm/nodelibs-process@0.2.0-alpha"
"fs": "npm:jspm-nodelibs-fs@0.2.0",
"path": "npm:jspm-nodelibs-path@0.2.0",
"process": "npm:jspm-nodelibs-process@0.2.0"
},
packages: {}
});
32 changes: 26 additions & 6 deletions jspm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,33 @@
"core-js": "npm:core-js@^2.4.0"
},
"devDependencies": {
"os": "github:jspm/nodelibs-os@^0.2.0-alpha",
"plugin-typescript": "github:frankwallis/plugin-typescript@^4.0.6"
"assert": "npm:jspm-nodelibs-assert@^0.2.0",
"buffer": "npm:jspm-nodelibs-buffer@^0.2.0",
"child_process": "npm:jspm-nodelibs-child_process@^0.2.0",
"constants": "npm:jspm-nodelibs-constants@^0.2.0",
"crypto": "npm:jspm-nodelibs-crypto@^0.2.0",
"events": "npm:jspm-nodelibs-events@^0.2.0",
"module": "npm:jspm-nodelibs-module@^0.2.0",
"net": "npm:jspm-nodelibs-net@^0.2.0",
"os": "npm:jspm-nodelibs-os@^0.2.0",
"plugin-typescript": "github:frankwallis/plugin-typescript@^5.3.3",
"stream": "npm:jspm-nodelibs-stream@^0.2.0",
"string_decoder": "npm:jspm-nodelibs-string_decoder@^0.2.0",
"util": "npm:jspm-nodelibs-util@^0.2.0",
"vm": "npm:jspm-nodelibs-vm@^0.2.0"
},
"peerDependencies": {
"fs": "github:jspm/nodelibs-fs@^0.2.0-alpha",
"path": "github:jspm/nodelibs-path@^0.2.0-alpha",
"process": "github:jspm/nodelibs-process@^0.2.0-alpha"
"fs": "npm:jspm-nodelibs-fs@^0.2.0",
"path": "npm:jspm-nodelibs-path@^0.2.0",
"process": "npm:jspm-nodelibs-process@^0.2.0"
},
"overrides": {
"npm:typescript@1.8.10": {
"npm:inherits@2.0.3": {
"ignore": [
"test.js"
]
},
"npm:typescript@2.1.4": {
"browser": {},
"map": {
"buffer": "@empty",
Expand All @@ -22,6 +39,9 @@
"path": "@empty",
"process": "@empty",
"readline": "@empty"
},
"dependencies": {
"source-map-support": "*"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion jspm/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Greeter } from './greeter'
import { Greeter } from "./greeter";

export function main(el: HTMLElement): void {
let greeter = new Greeter(el);
Expand Down
16 changes: 6 additions & 10 deletions jspm/src/greeter.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import repeat from "core-js/fn/string/repeat"
import repeat from "core-js/fn/string/repeat";

export class Greeter
{
export class Greeter {
element: HTMLElement;
span: HTMLElement;
timerToken: number;

constructor (element: HTMLElement)
{
constructor(element: HTMLElement) {
this.element = element;
this.element.innerText += "The time is: ";
this.span = document.createElement('span');
this.element.appendChild(this.span);
this.span.innerText = new Date().toUTCString();
}

start()
{
this.timerToken = setInterval(() => this.span.innerText = `"${repeat(new Date().toUTCString() + " ", 2)}"`, 500);
start() {
this.timerToken = setInterval(() => this.span.innerText = `"${repeat(new Date().toUTCString() + " ", 2)}"`, 500);
}

stop()
{
stop() {
clearTimeout(this.timerToken);
}
}