diff --git a/dist/index.d.ts b/dist/index.d.ts
new file mode 100644
index 0000000..91610b5
--- /dev/null
+++ b/dist/index.d.ts
@@ -0,0 +1,18 @@
+///
+import * as q from 'q';
+/**
+ * defines a LazyModule
+ */
+export declare class LazyModule {
+ name: string;
+ cwd: string;
+ constructor(nameArg: string, cwdArg?: string);
+ /**
+ * loads the module
+ */
+ load(): q.Promise;
+ /**
+ * loads additional lazy modules specified as arguments and returns them in the promise for easy use
+ */
+ loadAlso(...args: LazyModule[]): void;
+}
diff --git a/dist/index.js b/dist/index.js
new file mode 100644
index 0000000..a768812
--- /dev/null
+++ b/dist/index.js
@@ -0,0 +1,46 @@
+"use strict";
+const q = require("q");
+const lik_1 = require("lik");
+let systemjs = require('systemjs');
+class Smartsystem {
+ constructor() {
+ this.lazyModules = new lik_1.Objectmap();
+ }
+ /**
+ * add lazyModule to Smartsystem
+ */
+ addLazyModule(lazyModuleArg) {
+ this.lazyModules.add(lazyModuleArg);
+ }
+}
+// create the internal smartsystem
+let smartsystem = new Smartsystem();
+/**
+ * defines a LazyModule
+ */
+class LazyModule {
+ constructor(nameArg, cwdArg = process.cwd()) {
+ this.name = nameArg;
+ this.cwd = cwdArg;
+ smartsystem.addLazyModule(this);
+ }
+ /**
+ * loads the module
+ */
+ load() {
+ let done = q.defer();
+ let loadedModule;
+ systemjs.import(this.name).then((m) => {
+ loadedModule = m;
+ done.resolve(loadedModule);
+ });
+ return done.promise;
+ }
+ /**
+ * loads additional lazy modules specified as arguments and returns them in the promise for easy use
+ */
+ loadAlso(...args) {
+ }
+}
+exports.LazyModule = LazyModule;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsdUJBQXNCO0FBQ3RCLDZCQUErQjtBQUMvQixJQUFJLFFBQVEsR0FBR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0QkMifQ==
\ No newline at end of file
diff --git a/package.json b/package.json
index fd187b4..04bd07a 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "wraps systemjs for smarter workflows",
"main": "dist/index.js",
+ "typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
},
@@ -19,6 +20,11 @@
"dependencies": {
"@types/q": "0.0.32",
"lik": "^1.0.24",
- "q": "^1.4.1"
+ "q": "^1.4.1",
+ "systemjs": "^0.19.39"
+ },
+ "devDependencies": {
+ "@types/should": "^8.1.30",
+ "should": "^11.1.1"
}
}
diff --git a/test/test.d.ts b/test/test.d.ts
new file mode 100644
index 0000000..e69de29
diff --git a/test/test.js b/test/test.js
new file mode 100644
index 0000000..249b44a
--- /dev/null
+++ b/test/test.js
@@ -0,0 +1,2 @@
+"use strict";
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
\ No newline at end of file
diff --git a/test/test.ts b/test/test.ts
new file mode 100644
index 0000000..7e8e165
--- /dev/null
+++ b/test/test.ts
@@ -0,0 +1,2 @@
+import * as should from 'should'
+import * as smartsystem from '../dist/index'
diff --git a/ts/index.ts b/ts/index.ts
index cdb98db..084d130 100644
--- a/ts/index.ts
+++ b/ts/index.ts
@@ -1,5 +1,54 @@
import * as plugins from './smartsystem.plugins'
-export class Smartsystem {
-
+import * as q from 'q'
+import { Objectmap } from 'lik'
+let systemjs = require('systemjs')
+
+class Smartsystem {
+ lazyModules = new Objectmap()
+
+ /**
+ * add lazyModule to Smartsystem
+ */
+ addLazyModule(lazyModuleArg: LazyModule) {
+ this.lazyModules.add(lazyModuleArg)
+ }
+
+ loadLazyModule(lazyModuleArg: LazyModule)
+}
+
+// create the internal smartsystem
+let smartsystem = new Smartsystem()
+
+/**
+ * defines a LazyModule
+ */
+export class LazyModule {
+ name: string
+ cwd: string
+ constructor(nameArg: string, cwdArg: string = process.cwd()){
+ this.name = nameArg
+ this.cwd = cwdArg
+ smartsystem.addLazyModule(this)
+ }
+
+ /**
+ * loads the module
+ */
+ load(): q.Promise {
+ let done = q.defer()
+ let loadedModule: T
+ systemjs.import(this.name).then((m) => {
+ loadedModule = m
+ done.resolve(loadedModule)
+ })
+ return done.promise
+ }
+
+ /**
+ * loads additional lazy modules specified as arguments and returns them in the promise for easy use
+ */
+ loadAlso(...args: LazyModule[]) {
+
+ }
}
\ No newline at end of file
diff --git a/ts/smartsystem.plugins.ts b/ts/smartsystem.plugins.ts
deleted file mode 100644
index 0d94356..0000000
--- a/ts/smartsystem.plugins.ts
+++ /dev/null
@@ -1 +0,0 @@
-import * as lik from 'lik'
diff --git a/tslint.json b/tslint.json
new file mode 100644
index 0000000..45052ad
--- /dev/null
+++ b/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": "tslint-config-standard"
+}