-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 55e7c55
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.DS_Store | ||
jspm_packages/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
System.config({ | ||
baseURL: "/", | ||
defaultJSExtensions: true, | ||
transpiler: "babel", | ||
babelOptions: { | ||
"optional": [ | ||
"runtime", | ||
"optimisation.modules.system" | ||
] | ||
}, | ||
paths: { | ||
"github:*": "jspm_packages/github/*", | ||
"npm:*": "jspm_packages/npm/*" | ||
}, | ||
|
||
map: { | ||
"babel": "npm:[email protected]", | ||
"babel-runtime": "npm:[email protected]", | ||
"core-js": "npm:[email protected]", | ||
"github:jspm/[email protected]": { | ||
"process": "npm:[email protected]" | ||
}, | ||
"npm:[email protected]": { | ||
"process": "github:jspm/[email protected]" | ||
}, | ||
"npm:[email protected]": { | ||
"fs": "github:jspm/[email protected]", | ||
"process": "github:jspm/[email protected]" | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
var imports = {}; | ||
var systemNormalize = System.normalize; | ||
System.normalize = function (path, importFrom) { | ||
var promise = systemNormalize.apply(this, arguments); | ||
promise.then(function (normalizedPath) { | ||
imports[normalizedPath] = { | ||
importPath: path, | ||
path: normalizedPath, | ||
from: importFrom, | ||
deps: [] | ||
}; | ||
}); | ||
return promise; | ||
}; | ||
var systemInstantiate = System.instantiate; | ||
System.instantiate = function (load) { | ||
return systemInstantiate.apply(this, arguments) | ||
.then(function (result) { | ||
var importData = imports[load.name]; | ||
importData.metadata = load.metadata; | ||
var fromData = imports[importData.from]; | ||
if (fromData) { | ||
fromData.deps.push(importData); | ||
} | ||
return result; | ||
}); | ||
}; | ||
|
||
export function logImport (importData) { | ||
console.groupCollapsed(importData.importPath); | ||
console.log('path: ', importData.path); | ||
var metadata = importData.metadata; | ||
for (let metaKey in metadata) { | ||
if (metaKey === 'deps') continue; | ||
var metaValue = metadata[metaKey]; | ||
if (metaValue !== undefined) { | ||
console.log(`${metaKey}: ${metaValue}`); | ||
} | ||
} | ||
console.group(' deps: ', importData.deps.length); | ||
for (let depData of importData.deps) { | ||
logImport(depData); | ||
} | ||
console.groupEnd(); | ||
console.groupEnd(); | ||
} | ||
export function logImports () { | ||
console.group('Imports'); | ||
for (let index in imports) { | ||
var importData = imports[index]; | ||
// root imports? | ||
if (importData.from === undefined) { | ||
logImport(importData); | ||
} | ||
} | ||
console.groupEnd(); | ||
} | ||
export function getImports () { | ||
return imports; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "systemjs-debugger", | ||
"version": "0.0.1", | ||
"description": "SystemJS debugger", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/peteruithoven/systemjs-debugger.git" | ||
}, | ||
"keywords": [ | ||
"systemjs", | ||
"jspm" | ||
], | ||
"author": "Peter Uithoven", | ||
"license": "MIT", | ||
"jspm": { | ||
"directories": {}, | ||
"devDependencies": { | ||
"babel": "npm:babel-core@^5.8.21", | ||
"babel-runtime": "npm:babel-runtime@^5.8.20", | ||
"core-js": "npm:core-js@^1.0.0" | ||
} | ||
} | ||
} |