fix some things

This commit is contained in:
Philipp Kunz 2016-07-01 06:07:58 +02:00
parent db2a0c2992
commit d20742f881
17 changed files with 68 additions and 68 deletions

3
dist/index.js vendored
View File

@ -11,5 +11,4 @@ exports.interpreter = SmartfileInterpreter;
exports.memory = SmartfileMemory;
exports.remote = SmartfileRemote;
exports.requireReload = SmartfileFs.requireReload;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFHeEIsSUFBWSxXQUFXLFdBQU0sZ0JBQWdCLENBQUMsQ0FBQTtBQUM5QyxJQUFZLG9CQUFvQixXQUFNLHlCQUN0QyxDQUFDLENBRDhEO0FBQy9ELElBQVksZUFBZSxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDdEQsSUFBWSxlQUFlLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUV0RCw0Q0FBd0IsK0JBQStCLENBQUM7QUFBaEQsNERBQWdEO0FBRTdDLFVBQUUsR0FBRyxXQUFXLENBQUM7QUFDakIsbUJBQVcsR0FBRyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFNLEdBQUcsZUFBZSxDQUFDO0FBQ3pCLGNBQU0sR0FBRyxlQUFlLENBQUM7QUFDekIscUJBQWEsR0FBRyxXQUFXLENBQUMsYUFBYSxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcblxuaW1wb3J0ICogYXMgcGx1Z2lucyBmcm9tIFwiLi9zbWFydGZpbGUucGx1Z2luc1wiO1xuaW1wb3J0ICogYXMgU21hcnRmaWxlRnMgZnJvbSBcIi4vc21hcnRmaWxlLmZzXCI7XG5pbXBvcnQgKiBhcyBTbWFydGZpbGVJbnRlcnByZXRlciBmcm9tIFwiLi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EdBQUcsb0JBQW9CLENBQUM7QUFDbkMsY0FBTSxHQUFHLGVBQWUsQ0FBQztBQUN6QixjQUFNLEdBQUcsZUFBZSxDQUFDO0FBQ3pCLHFCQUFhLEdBQUcsV0FBVyxDQUFDLGFBQWEsQ0FBQyJ9

View File

@ -6,5 +6,4 @@ var Smartfile = (function () {
return Smartfile;
}());
exports.Smartfile = Smartfile;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5jbGFzc2VzLnNtYXJ0ZmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7SUFDSTtJQUVBLENBQUM7O0lBQ0wsZ0JBQUM7QUFBRCxDQUpBLEFBSUMsSUFBQTtBQUpZLGlCQUFTLFlBSXJCLENBQUEiLCJmaWxlIjoic21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIFNtYXJ0ZmlsZSB7XG4gICAgY29uc3RydWN0b3IoKXtcbiAgICAgICAgXG4gICAgfTtcbn0iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtJQUNJO0lBRUEsQ0FBQzs7SUFDTCxnQkFBQztBQUFELENBQUMsQUFKRCxJQUlDO0FBSlksaUJBQVMsWUFJckIsQ0FBQSJ9

View File

@ -1,4 +1,6 @@
/// <reference types="q" />
import "typings-global";
import plugins = require("./smartfile.plugins");
/**
*
* @param filePath
@ -10,7 +12,7 @@ export declare let fileExistsSync: (filePath: any) => boolean;
* @param filePath
* @returns {any}
*/
export declare let fileExists: (filePath: any) => any;
export declare let fileExists: (filePath: any) => plugins.Q.Promise<{}>;
/**
* Checks if given path points to an existing directory
*/
@ -22,7 +24,7 @@ export declare let isFile: (pathArg: any) => boolean;
/**
* ensures that a directory is in place
*/
export declare let ensureDir: (dirPathArg: string) => any;
export declare let ensureDir: (dirPathArg: string) => plugins.Q.Promise<{}>;
/**
* ensures that a directory is in place
*/
@ -30,7 +32,7 @@ export declare let ensureDirSync: (dirPathArg: string) => void;
/**
* copies a file from A to B on the local disk
*/
export declare let copy: (fromArg: string, toArg: string) => any;
export declare let copy: (fromArg: string, toArg: string) => plugins.Q.Promise<{}>;
/**
* copies a file SYNCHRONOUSLY from A to B on the local disk
*/
@ -38,7 +40,7 @@ export declare let copySync: (fromArg: string, toArg: string) => boolean;
/**
* removes a file or folder from local disk
*/
export declare let remove: (pathArg: string) => any;
export declare let remove: (pathArg: string) => plugins.Q.Promise<{}>;
/**
* removes a file SYNCHRONOUSLY from local disk
*/
@ -80,7 +82,7 @@ export declare let requireReload: (path: string) => any;
* lists Folders in a directory on local disk
* @returns Promise
*/
export declare let listFolders: (pathArg: string, regexFilter?: RegExp) => any;
export declare let listFolders: (pathArg: string, regexFilter?: RegExp) => plugins.Q.Promise<{}>;
/**
* lists Folders SYNCHRONOUSLY in a directory on local disk
* @returns an array with the folder names as strings
@ -90,7 +92,7 @@ export declare let listFoldersSync: (pathArg: string, regexFilter?: RegExp) => s
* lists Files in a directory on local disk
* @returns Promise
*/
export declare let listFiles: (pathArg: string, regexFilter?: RegExp) => any;
export declare let listFiles: (pathArg: string, regexFilter?: RegExp) => plugins.Q.Promise<{}>;
/**
* lists Files SYNCHRONOUSLY in a directory on local disk
* @returns an array with the folder names as strings
@ -100,10 +102,10 @@ export declare let listFilesSync: (pathArg: string, regexFilter?: RegExp) => str
* lists all items (folders AND files) in a directory on local disk
* @returns Promise
*/
export declare let listAllItems: (pathArg: string, regexFilter?: RegExp) => any;
export declare let listAllItems: (pathArg: string, regexFilter?: RegExp) => plugins.Q.Promise<{}>;
/**
* lists all items (folders AND files) SYNCHRONOUSLY in a directory on local disk
* @returns an array with the folder names as strings
*/
export declare let listAllItemsSync: (pathArg: string, regexFilter?: RegExp) => string[];
export declare let listFileTree: (dirPath: string, miniMatchFilter: string) => any;
export declare let listFileTree: (dirPath: string, miniMatchFilter: string) => plugins.Q.Promise<{}>;

23
dist/smartfile.fs.js vendored

File diff suppressed because one or more lines are too long

View File

@ -18,5 +18,4 @@ exports.objectFile = function (fileStringArg, fileTypeArg) {
break;
}
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5pbnRlcnByZXRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRXhCLElBQU8sT0FBTyxXQUFXLHFCQUFxQixDQUFDLENBQUM7QUFFckMsZ0JBQVEsR0FBRyxVQUFDLE9BQWM7SUFDakMsSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDNUMsSUFBSSxRQUFRLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxZQUFZLEVBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyx3QkFBd0I7SUFDM0UsTUFBTSxDQUFDLFFBQVEsQ0FBQztBQUNwQixDQUFDLENBQUM7QUFFUyxrQkFBVSxHQUFHLFVBQUMsYUFBb0IsRUFBRSxXQUFXO0lBQ3RELE1BQU0sQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7UUFDbEIsS0FBSyxLQUFLLENBQUU7UUFDWixLQUFLLE1BQU07WUFDUCxNQUFNLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDaEQsS0FBSyxNQU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UNyQztZQUNJLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLFlBQVksR0FBRyxXQUFXLENBQUMsSUFBSSxHQUFHLGdCQUFnQixDQUFDLENBQUM7WUFDNUUsS0FBSyxDQUFDO0lBQ2QsQ0FBQztBQUNMLENBQUMsQ0FBQSJ9

View File

@ -1,4 +1,7 @@
/// <reference types="vinyl" />
/// <reference types="q" />
import "typings-global";
import plugins = require("./smartfile.plugins");
/**
* allows you to create a gulp stream
* from String, from an Array of Strings, from Vinyl File, from an Array of VinylFiles
@ -6,7 +9,7 @@ import "typings-global";
* @returns stream.Readable
* @TODO: make it async;
*/
export declare let toGulpStream: (fileArg: any, baseArg?: string) => any;
export declare let toGulpStream: (fileArg: string | string[] | plugins.vinyl | plugins.vinyl[], baseArg?: string) => any;
/**
* converts file to Object
* @param fileStringArg
@ -23,7 +26,7 @@ export declare let toVinylFileSync: (fileArg: string, optionsArg?: {
filename?: string;
base?: string;
relPath?: string;
}) => any;
}) => plugins.vinyl;
/**
* takes a string array and some options and returns a vinylfile array
* @param arrayArg
@ -37,12 +40,12 @@ export declare let toVinylArraySync: (arrayArg: string[], optionsArg?: {
/**
* takes a vinylFile object and converts it to String
*/
export declare let toStringSync: (fileArg: any) => any;
export declare let toStringSync: (fileArg: plugins.vinyl) => string;
/**
* writes string or vinyl file to disk.
* @param fileArg
* @param fileNameArg
* @param fileBaseArg
*/
export declare let toFs: (fileContentArg: any, filePathArg: any) => any;
export declare let toFs: (fileContentArg: string | plugins.vinyl, filePathArg: any) => plugins.Q.Promise<{}>;
export declare let toFsSync: (fileArg: any, filePathArg: string) => void;

File diff suppressed because one or more lines are too long

View File

@ -2,13 +2,13 @@ import "typings-global";
export import beautylog = require("beautylog");
export declare let fs: any;
export declare let gulp: any;
export declare let glob: any;
export import glob = require("glob");
export declare let g: {
remoteSrc: any;
};
export declare let path: any;
export declare let q: any;
export declare let vinyl: any;
export import path = require("path");
export import Q = require("q");
export import vinyl = require("vinyl");
export declare let vinylFile: any;
export declare let yaml: any;
export declare let request: any;

View File

@ -8,11 +8,10 @@ exports.g = {
remoteSrc: require("gulp-remote-src")
};
exports.path = require("path");
exports.q = require("q");
exports.Q = require("q");
exports.vinyl = require("vinyl");
exports.vinylFile = require("vinyl-file");
exports.yaml = require("js-yaml");
exports.request = require("request");
exports.requireReload = require("require-reload");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0ZmlsZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFDVixpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ3BDLFVBQUUsR0FBRyxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUM7QUFDekIsWUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUN2QixZQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ3ZCLFNBQUMsR0FBRztJQUNYLFNBQVMsRUFBRSxPQUFPLENBQUMsaUJBQWlCLENBQUM7Q0FDeEMsQ0FBQztBQUNTLFlBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDdkIsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNqQixhQUFLLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ3pCLGlCQUFTLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ2xDLFlBQUksR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDMUIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUM3QixxQkFBYSxHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDIiwiZm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UMsQ0FBQztBQUNwQyxVQUFFLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0FBQ3pCLFlBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7QUFDcEIsWUFBSSxXQUFXLE1BQU0sQ0FBQyxDQUFDO0FBQzFCLFNBQUMsR0FBRztJQUNYLFNBQVMsRUFBRSxPQUFPLENBQUMsaUJBQWlCLENBQUM7Q0FDeEMsQ0FBQztBQUNZLFlBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUN2QixTQUFDLFdBQVcsR0FBRyxDQUFDLENBQUM7QUFDakIsYUFBSyxXQUFXLE9BQU8sQ0FBQyxDQUFDO0FBQzVCLGlCQUFTLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ2xDLFlBQUksR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDMUIsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUM3QixxQkFBYSxHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDIn0=

View File

@ -1,5 +1,7 @@
/// <reference types="q" />
import "typings-global";
export declare let toFs: (from: string, toPath: string) => any;
import plugins = require("./smartfile.plugins");
export declare let toFs: (from: string, toPath: string) => plugins.Q.Promise<{}>;
/**
*
* @param filePathArg
@ -11,10 +13,10 @@ export declare let toGulpStreamSync: (filePathArg: string, baseArg: string) => a
* @param fromArg
* @returns {any}
*/
export declare let toObject: (fromArg: string) => any;
export declare let toObject: (fromArg: string) => plugins.Q.Promise<{}>;
/**
*
* @param fromArg
* @returns {any}
*/
export declare let toString: (fromArg: string) => any;
export declare let toString: (fromArg: string) => plugins.Q.Promise<{}>;

File diff suppressed because one or more lines are too long

View File

@ -27,6 +27,7 @@
"homepage": "https://gitlab.com/pushrocks/smartfile",
"dependencies": {
"@types/glob": "^5.0.22-alpha",
"@types/q": "0.0.21-alpha",
"beautylog": "^5.0.12",
"fs-extra": "^0.30.0",
"glob": "^7.0.5",

File diff suppressed because one or more lines are too long

View File

@ -30,9 +30,9 @@ export let fileExistsSync = function(filePath):boolean {
* @returns {any}
*/
export let fileExists = function(filePath){
let done = plugins.q.defer();
let done = plugins.Q.defer();
plugins.fs.access(filePath, plugins.fs.R_OK, function (err) {
err ? done.reject() : done.resolve();
err ? done.reject(err) : done.resolve();
});
return done.promise;
};
@ -59,7 +59,7 @@ export let isFile = function(pathArg):boolean{
* ensures that a directory is in place
*/
export let ensureDir = (dirPathArg:string) => {
let done = plugins.q.defer();
let done = plugins.Q.defer();
plugins.fs.ensureDir(dirPathArg,done.resolve);
return done.promise;
}
@ -75,7 +75,7 @@ export let ensureDirSync = (dirPathArg:string) => {
* copies a file from A to B on the local disk
*/
export let copy = function(fromArg:string, toArg:string){
var done = plugins.q.defer();
var done = plugins.Q.defer();
plugins.fs.copy(fromArg,toArg,{},function(){
done.resolve();
});
@ -94,7 +94,7 @@ export let copySync = function(fromArg:string,toArg:string):boolean{
* removes a file or folder from local disk
*/
export let remove = function(pathArg:string){
var done = plugins.q.defer();
var done = plugins.Q.defer();
plugins.fs.remove(pathArg,function(){
done.resolve();
});
@ -176,7 +176,7 @@ export let requireReload = function(path:string){
* @returns Promise
*/
export let listFolders = function(pathArg:string,regexFilter?:RegExp){
let done = plugins.q.defer();
let done = plugins.Q.defer();
let folderArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isDirectory();
});
@ -211,7 +211,7 @@ export let listFoldersSync = function(pathArg:string,regexFilter?:RegExp):string
* @returns Promise
*/
export let listFiles = function(pathArg:string, regexFilter?:RegExp){
let done = plugins.q.defer();
let done = plugins.Q.defer();
let fileArray = plugins.fs.readdirSync(pathArg).filter(function(file) {
return plugins.fs.statSync(plugins.path.join(pathArg, file)).isFile();
});
@ -245,7 +245,7 @@ export let listFilesSync = function(pathArg:string, regexFilter?:RegExp):string[
* @returns Promise
*/
export let listAllItems = function(pathArg:string, regexFilter?:RegExp){
let done = plugins.q.defer();
let done = plugins.Q.defer();
let allItmesArray = plugins.fs.readdirSync(pathArg);
if(regexFilter){
allItmesArray = allItmesArray.filter((fileItem) => {
@ -273,14 +273,14 @@ export let listAllItemsSync = function(pathArg:string, regexFilter?:RegExp):stri
};
export let listFileTree = (dirPath:string, miniMatchFilter:string) => {
let done = plugins.q.defer();
let done = plugins.Q.defer();
let options = {
cwd:dirPath
}
plugins.glob(miniMatchFilter,options,(err,files:string[]) => {
if(err){
console.log(err);
done.reject();
done.reject(err);
};
done.resolve(files);
});

View File

@ -98,7 +98,7 @@ export let toStringSync = function(fileArg:plugins.vinyl){
* @param fileBaseArg
*/
export let toFs = function(fileContentArg:string|vinyl,filePathArg){
let done = plugins.q.defer();
let done = plugins.Q.defer();
//function checks to abort if needed
if (!fileContentArg || !filePathArg) throw new Error("expected valid arguments");

View File

@ -2,13 +2,13 @@ import "typings-global";
export import beautylog = require("beautylog");
export let fs = require("fs-extra");
export let gulp = require("gulp");
export let glob = require("glob");
export import glob = require("glob");
export let g = {
remoteSrc: require("gulp-remote-src")
};
export let path = require("path");
export let q = require("q");
export let vinyl = require("vinyl");
export import path = require("path");
export import Q = require("q");
export import vinyl = require("vinyl");
export let vinylFile = require("vinyl-file");
export let yaml = require("js-yaml");
export let request = require("request");

View File

@ -3,7 +3,7 @@ import plugins = require("./smartfile.plugins");
import SmartfileInterpreter = require("./smartfile.interpreter");
export let toFs = function(from:string,toPath:string) {
var done = plugins.q.defer();
var done = plugins.Q.defer();
var stream = plugins.request(from).pipe(plugins.fs.createWriteStream(toPath));
stream.on('finish',function(){
done.resolve(toPath);
@ -29,7 +29,7 @@ export let toGulpStreamSync = function(filePathArg:string,baseArg:string){
* @returns {any}
*/
export let toObject = function(fromArg:string){
let done = plugins.q.defer();
let done = plugins.Q.defer();
plugins.request.get(fromArg, function (error, response, bodyString) {
let returnObject;
if (!error && response.statusCode == 200) {
@ -50,7 +50,7 @@ export let toObject = function(fromArg:string){
* @returns {any}
*/
export let toString = (fromArg:string) => {
let done = plugins.q.defer();
let done = plugins.Q.defer();
plugins.request.get(fromArg, function (error, response, bodyString) {
if (!error && response.statusCode == 200) {
done.resolve(bodyString);