added ProjectInfo main class
This commit is contained in:
		
							
								
								
									
										15
									
								
								dist/projectinfo.classes.git.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								dist/projectinfo.classes.git.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,5 +1,16 @@
 | 
				
			|||||||
import 'typings-global';
 | 
					 | 
				
			||||||
export declare class ProjectinfoGit {
 | 
					export declare class ProjectinfoGit {
 | 
				
			||||||
    isGit: boolean;
 | 
					    isGit: boolean;
 | 
				
			||||||
    constructor();
 | 
					    githost: string;
 | 
				
			||||||
 | 
					    gituser: string;
 | 
				
			||||||
 | 
					    gitrepo: string;
 | 
				
			||||||
 | 
					    cwd: string;
 | 
				
			||||||
 | 
					    constructor(cwdArg: string);
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get git info from path
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getGitInfoFromPath(): void;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get git info from remote url
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getGitInfoFromRemote(remoteUrlArg: string): void;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										22
									
								
								dist/projectinfo.classes.git.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								dist/projectinfo.classes.git.js
									
									
									
									
										vendored
									
									
								
							@@ -1,8 +1,24 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
require("typings-global");
 | 
					const plugins = require("./projectinfo.plugins");
 | 
				
			||||||
class ProjectinfoGit {
 | 
					class ProjectinfoGit {
 | 
				
			||||||
    constructor() {
 | 
					    constructor(cwdArg) {
 | 
				
			||||||
 | 
					        this.cwd = cwdArg;
 | 
				
			||||||
 | 
					        this.getGitInfoFromPath();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get git info from path
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getGitInfoFromPath() {
 | 
				
			||||||
 | 
					        let localSmartpath = new plugins.smartpath.Smartpath(this.cwd);
 | 
				
			||||||
 | 
					        this.gitrepo = localSmartpath.pathLevelsBackwards[0];
 | 
				
			||||||
 | 
					        this.gituser = localSmartpath.pathLevelsBackwards[1];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get git info from remote url
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getGitInfoFromRemote(remoteUrlArg) {
 | 
				
			||||||
 | 
					        let gitRepoParsed = new plugins.smartstring.GitRepo(remoteUrlArg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.ProjectinfoGit = ProjectinfoGit;
 | 
					exports.ProjectinfoGit = ProjectinfoGit;
 | 
				
			||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8uY2xhc3Nlcy5naXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wcm9qZWN0aW5mby5jbGFzc2VzLmdpdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCO0FBRXZCO0lBRUk7SUFFQSxDQUFDO0NBQ0o7QUFMRCx3Q0FLQyJ9
 | 
					//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8uY2xhc3Nlcy5naXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9wcm9qZWN0aW5mby5jbGFzc2VzLmdpdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsaURBQWdEO0FBRWhEO0lBTUksWUFBWSxNQUFjO1FBQ3RCLElBQUksQ0FBQyxHQUFHLEdBQUcsTUFBTSxDQUFBO1FBQ2pCLElBQUksQ0FBQyxrQkFBa0IsRUFBRSxDQUFBO0lBQzdCLENBQUM7SUFFRDs7T0FFRztJQUNILGtCQUFrQjtRQUNkLElBQUksY0FBYyxHQUFHLElBQUksT0FBTyxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFBO1FBQzlELElBQUksQ0FBQyxPQUFPLEdBQUcsY0FBYyxDQUFDLG1CQUFtQixDQUFDLENBQUMsQ0FBQyxDQUFBO1FBQ3BELElBQUksQ0FBQyxPQUFPLEdBQUcsY0FBYyxDQUFDLG1CQUFtQixDQUFDLENBQUMsQ0FBQyxDQUFBO0lBQ3hELENBQUM7SUFFRDs7T0FFRztJQUNILG9CQUFvQixDQUFDLFlBQW9CO1FBQ3JDLElBQUksYUFBYSxHQUFHLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUE7SUFDckUsQ0FBQztDQUNKO0FBMUJELHdDQTBCQyJ9
 | 
				
			||||||
							
								
								
									
										3
									
								
								dist/projectinfo.classes.npm.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								dist/projectinfo.classes.npm.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,4 +1,5 @@
 | 
				
			|||||||
import 'typings-global';
 | 
					import 'typings-global';
 | 
				
			||||||
 | 
					import plugins = require('./projectinfo.plugins');
 | 
				
			||||||
export declare class ProjectinfoNpm {
 | 
					export declare class ProjectinfoNpm {
 | 
				
			||||||
    isNpm: boolean;
 | 
					    isNpm: boolean;
 | 
				
			||||||
    packageJson: any;
 | 
					    packageJson: any;
 | 
				
			||||||
@@ -6,7 +7,7 @@ export declare class ProjectinfoNpm {
 | 
				
			|||||||
    version: string;
 | 
					    version: string;
 | 
				
			||||||
    status: string;
 | 
					    status: string;
 | 
				
			||||||
    license: string;
 | 
					    license: string;
 | 
				
			||||||
    git: any;
 | 
					    git: plugins.smartstring.GitRepo;
 | 
				
			||||||
    constructor(cwdArg: string, optionsArg?: {
 | 
					    constructor(cwdArg: string, optionsArg?: {
 | 
				
			||||||
        gitAccessToken?: string;
 | 
					        gitAccessToken?: string;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								dist/projectinfo.classes.projectinfo.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/projectinfo.classes.projectinfo.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,4 +1,5 @@
 | 
				
			|||||||
import { ProjectinfoNpm } from './projectinfo.classes.npm';
 | 
					import { ProjectinfoNpm } from './projectinfo.classes.npm';
 | 
				
			||||||
 | 
					import { ProjectinfoGit } from './projectinfo.classes.git';
 | 
				
			||||||
export declare type TProjectType = 'git' | 'npm';
 | 
					export declare type TProjectType = 'git' | 'npm';
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * class projectinfo automatically examines a given directory and exposes relevant info about it
 | 
					 * class projectinfo automatically examines a given directory and exposes relevant info about it
 | 
				
			||||||
@@ -6,8 +7,9 @@ export declare type TProjectType = 'git' | 'npm';
 | 
				
			|||||||
export declare class ProjectInfo {
 | 
					export declare class ProjectInfo {
 | 
				
			||||||
    type: TProjectType;
 | 
					    type: TProjectType;
 | 
				
			||||||
    npm: ProjectinfoNpm;
 | 
					    npm: ProjectinfoNpm;
 | 
				
			||||||
 | 
					    git: ProjectinfoGit;
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * this constructor
 | 
					     * constructor of class ProjectInfo
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    constructor(cwdArg: string);
 | 
					    constructor(cwdArg: string);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								dist/projectinfo.classes.projectinfo.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								dist/projectinfo.classes.projectinfo.js
									
									
									
									
										vendored
									
									
								
							@@ -1,15 +1,17 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
const projectinfo_classes_npm_1 = require("./projectinfo.classes.npm");
 | 
					const projectinfo_classes_npm_1 = require("./projectinfo.classes.npm");
 | 
				
			||||||
 | 
					const projectinfo_classes_git_1 = require("./projectinfo.classes.git");
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * class projectinfo automatically examines a given directory and exposes relevant info about it
 | 
					 * class projectinfo automatically examines a given directory and exposes relevant info about it
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
class ProjectInfo {
 | 
					class ProjectInfo {
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * this constructor
 | 
					     * constructor of class ProjectInfo
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    constructor(cwdArg) {
 | 
					    constructor(cwdArg) {
 | 
				
			||||||
        this.npm = new projectinfo_classes_npm_1.ProjectinfoNpm(cwdArg);
 | 
					        this.npm = new projectinfo_classes_npm_1.ProjectinfoNpm(cwdArg);
 | 
				
			||||||
 | 
					        this.git = new projectinfo_classes_git_1.ProjectinfoGit(cwdArg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
exports.ProjectInfo = ProjectInfo;
 | 
					exports.ProjectInfo = ProjectInfo;
 | 
				
			||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8uY2xhc3Nlcy5wcm9qZWN0aW5mby5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Byb2plY3RpbmZvLmNsYXNzZXMucHJvamVjdGluZm8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLHVFQUEwRDtBQUkxRDs7R0FFRztBQUNIO0lBR0k7O09BRUc7SUFDSCxZQUFZLE1BQWM7UUFDdEIsSUFBSSxDQUFDLEdBQUcsR0FBRyxJQUFJLHdDQUFjLENBQUMsTUFBTSxDQUFDLENBQUE7SUFDekMsQ0FBQztDQUlKO0FBWkQsa0NBWUMifQ==
 | 
					//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8uY2xhc3Nlcy5wcm9qZWN0aW5mby5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Byb2plY3RpbmZvLmNsYXNzZXMucHJvamVjdGluZm8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLHVFQUEwRDtBQUMxRCx1RUFBMEQ7QUFHMUQ7O0dBRUc7QUFDSDtJQUlJOztPQUVHO0lBQ0gsWUFBWSxNQUFjO1FBQ3RCLElBQUksQ0FBQyxHQUFHLEdBQUcsSUFBSSx3Q0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFBO1FBQ3JDLElBQUksQ0FBQyxHQUFHLEdBQUcsSUFBSSx3Q0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFBO0lBQ3pDLENBQUM7Q0FDSjtBQVhELGtDQVdDIn0=
 | 
				
			||||||
							
								
								
									
										5
									
								
								dist/projectinfo.plugins.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								dist/projectinfo.plugins.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,5 +1,6 @@
 | 
				
			|||||||
import 'typings-global';
 | 
					import 'typings-global';
 | 
				
			||||||
export declare let path: any;
 | 
					export import path = require('path');
 | 
				
			||||||
export declare let Q: any;
 | 
					export import q = require('q');
 | 
				
			||||||
export import smartfile = require('smartfile');
 | 
					export import smartfile = require('smartfile');
 | 
				
			||||||
export import smartstring = require('smartstring');
 | 
					export import smartstring = require('smartstring');
 | 
				
			||||||
 | 
					export import smartpath = require('smartpath');
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								dist/projectinfo.plugins.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								dist/projectinfo.plugins.js
									
									
									
									
										vendored
									
									
								
							@@ -1,7 +1,8 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
require("typings-global");
 | 
					require("typings-global");
 | 
				
			||||||
exports.path = require('path');
 | 
					exports.path = require("path");
 | 
				
			||||||
exports.Q = require('q');
 | 
					exports.q = require("q");
 | 
				
			||||||
exports.smartfile = require("smartfile");
 | 
					exports.smartfile = require("smartfile");
 | 
				
			||||||
exports.smartstring = require("smartstring");
 | 
					exports.smartstring = require("smartstring");
 | 
				
			||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8ucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Byb2plY3RpbmZvLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF1QjtBQUNaLFFBQUEsSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQTtBQUN0QixRQUFBLENBQUMsR0FBSSxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUE7QUFDNUIseUNBQThDO0FBQzlDLDZDQUFrRCJ9
 | 
					exports.smartpath = require("smartpath");
 | 
				
			||||||
 | 
					//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvamVjdGluZm8ucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Byb2plY3RpbmZvLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF1QjtBQUN2QiwrQkFBb0M7QUFDcEMseUJBQThCO0FBQzlCLHlDQUE4QztBQUM5Qyw2Q0FBa0Q7QUFDbEQseUNBQThDIn0=
 | 
				
			||||||
@@ -30,8 +30,10 @@
 | 
				
			|||||||
    "typings-test": "^1.0.3"
 | 
					    "typings-test": "^1.0.3"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
 | 
					    "@types/q": "0.0.32",
 | 
				
			||||||
    "q": "^1.4.1",
 | 
					    "q": "^1.4.1",
 | 
				
			||||||
    "smartfile": "4.1.0",
 | 
					    "smartfile": "4.1.0",
 | 
				
			||||||
 | 
					    "smartpath": "^3.2.6",
 | 
				
			||||||
    "smartstring": "2.0.22",
 | 
					    "smartstring": "2.0.22",
 | 
				
			||||||
    "typings-global": "^1.0.14"
 | 
					    "typings-global": "^1.0.14"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,29 @@
 | 
				
			|||||||
import 'typings-global'
 | 
					import * as plugins from './projectinfo.plugins'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class ProjectinfoGit {
 | 
					export class ProjectinfoGit {
 | 
				
			||||||
    isGit: boolean
 | 
					    isGit: boolean
 | 
				
			||||||
    constructor() {
 | 
					    githost: string
 | 
				
			||||||
        
 | 
					    gituser: string
 | 
				
			||||||
 | 
					    gitrepo: string
 | 
				
			||||||
 | 
					    cwd: string
 | 
				
			||||||
 | 
					    constructor(cwdArg: string) {
 | 
				
			||||||
 | 
					        this.cwd = cwdArg
 | 
				
			||||||
 | 
					        this.getGitInfoFromPath()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get git info from path
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getGitInfoFromPath() {
 | 
				
			||||||
 | 
					        let localSmartpath = new plugins.smartpath.Smartpath(this.cwd)
 | 
				
			||||||
 | 
					        this.gitrepo = localSmartpath.pathLevelsBackwards[0]
 | 
				
			||||||
 | 
					        this.gituser = localSmartpath.pathLevelsBackwards[1]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * get git info from remote url
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    getGitInfoFromRemote(remoteUrlArg: string) {
 | 
				
			||||||
 | 
					        let gitRepoParsed = new plugins.smartstring.GitRepo(remoteUrlArg)
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@ export class ProjectinfoNpm {
 | 
				
			|||||||
    version: string
 | 
					    version: string
 | 
				
			||||||
    status: string
 | 
					    status: string
 | 
				
			||||||
    license: string
 | 
					    license: string
 | 
				
			||||||
    git
 | 
					    git: plugins.smartstring.GitRepo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    constructor(cwdArg: string, optionsArg: { gitAccessToken?: string } = {}) {
 | 
					    constructor(cwdArg: string, optionsArg: { gitAccessToken?: string } = {}) {
 | 
				
			||||||
        let resolvedCwd = plugins.path.resolve(cwdArg)
 | 
					        let resolvedCwd = plugins.path.resolve(cwdArg)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
import * as plugins from './projectinfo.plugins'
 | 
					import * as plugins from './projectinfo.plugins'
 | 
				
			||||||
import { ProjectinfoNpm } from './projectinfo.classes.npm'
 | 
					import { ProjectinfoNpm } from './projectinfo.classes.npm'
 | 
				
			||||||
 | 
					import { ProjectinfoGit } from './projectinfo.classes.git'
 | 
				
			||||||
export type TProjectType = 'git' | 'npm'
 | 
					export type TProjectType = 'git' | 'npm'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -9,13 +9,12 @@ export type TProjectType = 'git' | 'npm'
 | 
				
			|||||||
export class ProjectInfo {
 | 
					export class ProjectInfo {
 | 
				
			||||||
    type: TProjectType
 | 
					    type: TProjectType
 | 
				
			||||||
    npm: ProjectinfoNpm
 | 
					    npm: ProjectinfoNpm
 | 
				
			||||||
 | 
					    git: ProjectinfoGit
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * this constructor 
 | 
					     * constructor of class ProjectInfo
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    constructor(cwdArg: string) {
 | 
					    constructor(cwdArg: string) {
 | 
				
			||||||
        this.npm = new ProjectinfoNpm(cwdArg)
 | 
					        this.npm = new ProjectinfoNpm(cwdArg)
 | 
				
			||||||
 | 
					        this.git = new ProjectinfoGit(cwdArg)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
import 'typings-global'
 | 
					import 'typings-global'
 | 
				
			||||||
export let path = require('path')
 | 
					export import path = require('path')
 | 
				
			||||||
export let Q =  require('q')
 | 
					export import q = require('q')
 | 
				
			||||||
export import smartfile = require('smartfile')
 | 
					export import smartfile = require('smartfile')
 | 
				
			||||||
export import smartstring = require('smartstring')
 | 
					export import smartstring = require('smartstring')
 | 
				
			||||||
 | 
					export import smartpath = require('smartpath')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user