initial
This commit is contained in:
parent
13ae19fd24
commit
5a45aa5fbe
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
.settings/
|
||||
.idea/
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
16
.travis.yml
Normal file
16
.travis.yml
Normal file
@ -0,0 +1,16 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 4.2.2
|
||||
before_install:
|
||||
- npm install -g tsd
|
||||
deploy:
|
||||
provider: npm
|
||||
email: npm@smart-coordination.com
|
||||
api_key:
|
||||
secure: uNjLbNelm8nj9R/tRlwRvcXWLS1QtA0QEbDKPDTWHNo68wAHgdwXIdzkVkNcihZYVasR/LqGuSLfzoD4H8mKmCXD+v85h048VmmtWniZQRp/OVWl0uzRwDDryhiYlhY5U9oOFEQsMO96C8qPqcGchq+DA7Gi3ZnAl7pmeb54xp9H+7jmLyZTyO8Hq00anV5PopBOW23mZEnWHznzYeg83BlWmLdbyfyZKT4W5Urg1BAMgxt9PdtrQoiPy4LP6AHXG88kvY3Iz8OBG+h/06bura8MPfeupGoktodN9krb+sRE/COybATWImMh9Z5gI5TWqUR7tp7XivpgolYY41gaN93oUQ9EOTdJ5kFku1dnPrNFqXO/97slVTMR6fMMgRXwzTz6BiKI1NsAZeW7oLUONw06APZ6VBhVY6Po3Rioun8OE9Q0wXm/BvnRqVHt3sew4MIgmEBwQSQE14gLJGGgNojzmcPstc0czQp+kzV5DpGiW3IWIWZ7MsBJOOJ13RHeb6koFdBR7JZj0QzzBcWD7juJVOS45MlP7hU/sKRDO/fN3nu8TNwHvJab6XYP5/gqlbh/3h2vb7bxyDXiKGi2Ds8hZOHoyWoCrU3sbH3eKKkKo+LFI3J7PbY11T6TkSAdszLsQzcvC2QlsGQRWVywYMm32R6BVfxF3AlLX5a8JsI=
|
||||
on:
|
||||
tags: true
|
||||
repo: pushrocks/smartenv
|
||||
notifications:
|
||||
slack:
|
||||
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=
|
28
index.js
Normal file
28
index.js
Normal file
@ -0,0 +1,28 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var beautylog = require("beautylog")("os");
|
||||
var addToGlobal = function (objectArg, paramName) {
|
||||
global[paramName] = objectArg;
|
||||
};
|
||||
var smartenv = {}; //create smartenv object
|
||||
smartenv.items = {}; // create the items object to store items to.
|
||||
smartenv.makeGlobal = function () {
|
||||
addToGlobal(smartenv, "smartenv"); //add object smartenv as global["smartenv"]
|
||||
};
|
||||
smartenv.info = function () {
|
||||
var pck = require("./package.json");
|
||||
beautylog.log("node version is " + process.version + " and smartenv version is " + pck.version);
|
||||
beautylog.log("the smartenv module currently holds the following properties:");
|
||||
console.log(Object.getOwnPropertyNames(smartenv.items).sort());
|
||||
};
|
||||
smartenv.register = function (objectArg, paramName) {
|
||||
if (paramName === void 0) { paramName = "undefined"; }
|
||||
if (paramName == "undefined") {
|
||||
beautylog.error("paramName is undefined");
|
||||
return;
|
||||
}
|
||||
smartenv.items[paramName] = objectArg;
|
||||
};
|
||||
smartenv.get = function (keyName) {
|
||||
return smartenv.items[keyName];
|
||||
};
|
||||
module.exports = smartenv;
|
32
package.json
Normal file
32
package.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "smartenv",
|
||||
"version": "0.0.0",
|
||||
"description": "store things about your environment and let them travel across modules",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "(cd ts/compile && node compile.js) && (node test.js)",
|
||||
"reinstall": "(rm -r node_modules && npm install)",
|
||||
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
||||
"startdev": "(git checkout master && git pull origin master && npm install)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pushrocks/smartenv.git"
|
||||
},
|
||||
"keywords": [
|
||||
"environment"
|
||||
],
|
||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pushrocks/smartenv/issues"
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/smartenv",
|
||||
"dependencies": {
|
||||
"beautylog": "^1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-typescript": "^2.9.2"
|
||||
}
|
||||
}
|
11
test.js
Normal file
11
test.js
Normal file
@ -0,0 +1,11 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var smartenv = require("./index.js");
|
||||
var beautylog = require("beautylog")("os");
|
||||
beautylog.info("Now testing the smartenv module");
|
||||
smartenv.info();
|
||||
smartenv.register({ key1: "Peter" }, "docit");
|
||||
smartenv.info();
|
||||
beautylog.log(smartenv.get("docit").key1);
|
||||
smartenv.makeGlobal();
|
||||
beautylog.log(global.smartenv.get("docit").key1);
|
||||
beautylog.success("Success!");
|
28
ts/compile/compile.js
Normal file
28
ts/compile/compile.js
Normal file
@ -0,0 +1,28 @@
|
||||
// import gulp
|
||||
var gulp = require("gulp");
|
||||
var gulpTypescript = require("gulp-typescript");
|
||||
var bl = require("beautylog")("os");
|
||||
|
||||
gulp.task('compileTS', function() {
|
||||
var stream = gulp.src('../index.ts')
|
||||
.pipe(gulpTypescript({
|
||||
out: "index.js"
|
||||
}))
|
||||
.pipe(gulp.dest("../../"));
|
||||
return stream;
|
||||
});
|
||||
|
||||
gulp.task('compileTestTS', function() {
|
||||
var stream = gulp.src('../test.ts')
|
||||
.pipe(gulpTypescript({
|
||||
out: "test.js"
|
||||
}))
|
||||
.pipe(gulp.dest("../../"));
|
||||
return stream;
|
||||
});
|
||||
|
||||
gulp.task('default',['compileTS','compileTestTS'], function() {
|
||||
bl.success('Typescript compiled');
|
||||
});
|
||||
|
||||
gulp.start.apply(gulp, ['default']);
|
2
ts/compile/readme.md
Normal file
2
ts/compile/readme.md
Normal file
@ -0,0 +1,2 @@
|
||||
# How to compile.
|
||||
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.
|
29
ts/index.js
Normal file
29
ts/index.js
Normal file
@ -0,0 +1,29 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var beautylog = require("beautylog")("os");
|
||||
var addToGlobal = function (objectArg, paramName) {
|
||||
global[paramName] = objectArg;
|
||||
};
|
||||
var smartenv = {}; //create smartenv object
|
||||
smartenv.items = {}; // create the items object to store items to.
|
||||
smartenv.makeGlobal = function () {
|
||||
addToGlobal(smartenv, "smartenv"); //add object smartenv as global["smartenv"]
|
||||
};
|
||||
smartenv.info = function () {
|
||||
var pck = require("./package.json");
|
||||
beautylog.log("node version is " + process.version + " and smartenv version is " + pck.version);
|
||||
beautylog.log("the smartenv module currently holds the following properties:");
|
||||
console.log(Object.getOwnPropertyNames(smartenv.items).sort());
|
||||
};
|
||||
smartenv.register = function (objectArg, paramName) {
|
||||
if (paramName === void 0) { paramName = "undefined"; }
|
||||
if (paramName == "undefined") {
|
||||
beautylog.error("paramName is undefined");
|
||||
return;
|
||||
}
|
||||
smartenv.items[paramName] = objectArg;
|
||||
};
|
||||
smartenv.get = function (keyName) {
|
||||
return smartenv.items[keyName];
|
||||
};
|
||||
module.exports = smartenv;
|
||||
//# sourceMappingURL=index.js.map
|
1
ts/index.js.map
Normal file
1
ts/index.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3C,IAAI,WAAW,GAAG,UAAS,SAAS,EAAC,SAAS;IAC1C,MAAM,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAClC,CAAC,CAAC;AACF,IAAI,QAAQ,GAAO,EAAE,CAAC,CAAC,wBAAwB;AAC/C,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,6CAA6C;AAClE,QAAQ,CAAC,UAAU,GAAG;IAClB,WAAW,CAAC,QAAQ,EAAC,UAAU,CAAC,CAAC,CAAA,2CAA2C;AAChF,CAAC,CAAC;AAGF,QAAQ,CAAC,IAAI,GAAG;IACZ,IAAI,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,SAAS,CAAC,GAAG,CAAC,kBAAkB,GAAG,OAAO,CAAC,OAAO,GAAG,2BAA2B,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;IAChG,SAAS,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,QAAQ,CAAC,QAAQ,GAAG,UAAS,SAAS,EAAC,SAAuB;IAAvB,yBAAuB,GAAvB,uBAAuB;IAC1D,EAAE,CAAC,CAAC,SAAS,IAAI,WAAW,CAAC,CAAA,CAAC;QAC1B,SAAS,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC1C,MAAM,CAAC;IACX,CAAC;IACD,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAC1C,CAAC,CAAC;AACF,QAAQ,CAAC,GAAG,GAAG,UAAS,OAAO;IAC3B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAC"}
|
31
ts/index.ts
Normal file
31
ts/index.ts
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var beautylog = require("beautylog")("os");
|
||||
var addToGlobal = function(objectArg,paramName) {
|
||||
global[paramName] = objectArg;
|
||||
};
|
||||
var smartenv:any = {}; //create smartenv object
|
||||
smartenv.items = {}; // create the items object to store items to.
|
||||
smartenv.makeGlobal = function() {
|
||||
addToGlobal(smartenv,"smartenv");//add object smartenv as global["smartenv"]
|
||||
};
|
||||
|
||||
|
||||
smartenv.info = function() {
|
||||
var pck = require("./package.json");
|
||||
beautylog.log("node version is " + process.version + " and smartenv version is " + pck.version);
|
||||
beautylog.log("the smartenv module currently holds the following properties:");
|
||||
console.log(Object.getOwnPropertyNames(smartenv.items).sort());
|
||||
};
|
||||
|
||||
smartenv.register = function(objectArg,paramName = "undefined") {
|
||||
if (paramName == "undefined"){
|
||||
beautylog.error("paramName is undefined");
|
||||
return;
|
||||
}
|
||||
smartenv.items[paramName] = objectArg;
|
||||
};
|
||||
smartenv.get = function(keyName) {
|
||||
return smartenv.items[keyName];
|
||||
}
|
||||
|
||||
module.exports = smartenv;
|
12
ts/test.js
Normal file
12
ts/test.js
Normal file
@ -0,0 +1,12 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var smartenv = require("./index.js");
|
||||
var beautylog = require("beautylog")("os");
|
||||
beautylog.info("Now testing the smartenv module");
|
||||
smartenv.info();
|
||||
smartenv.register({ key1: "Peter" }, "docit");
|
||||
smartenv.info();
|
||||
beautylog.log(smartenv.get("docit").key1);
|
||||
smartenv.makeGlobal();
|
||||
beautylog.log(global.smartenv.get("docit").key1);
|
||||
beautylog.success("Success!");
|
||||
//# sourceMappingURL=test.js.map
|
1
ts/test.js.map
Normal file
1
ts/test.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,IAAI,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACrC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAClD,QAAQ,CAAC,IAAI,EAAE,CAAC;AAChB,QAAQ,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAC,OAAO,EAAC,EAAC,OAAO,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,EAAE,CAAC;AAChB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1C,QAAQ,CAAC,UAAU,EAAE,CAAC;AACtB,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjD,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}
|
11
ts/test.ts
Normal file
11
ts/test.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/// <reference path="typings/tsd.d.ts" />
|
||||
var smartenv = require("./index.js");
|
||||
var beautylog = require("beautylog")("os");
|
||||
beautylog.info("Now testing the smartenv module");
|
||||
smartenv.info();
|
||||
smartenv.register({key1:"Peter"},"docit");
|
||||
smartenv.info();
|
||||
beautylog.log(smartenv.get("docit").key1);
|
||||
smartenv.makeGlobal();
|
||||
beautylog.log(global.smartenv.get("docit").key1);
|
||||
beautylog.success("Success!");
|
12
ts/tsd.json
Normal file
12
ts/tsd.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"node/node.d.ts": {
|
||||
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
|
||||
}
|
||||
}
|
||||
}
|
2079
ts/typings/node/node.d.ts
vendored
Normal file
2079
ts/typings/node/node.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
ts/typings/tsd.d.ts
vendored
Normal file
1
ts/typings/tsd.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
/// <reference path="node/node.d.ts" />
|
Loading…
x
Reference in New Issue
Block a user