add git module and kvStore
This commit is contained in:
parent
10cc7cf581
commit
5eb07f1ad7
6
dist/mod_git/index.d.ts
vendored
Normal file
6
dist/mod_git/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* handle cli input
|
||||
* @param argvArg
|
||||
*/
|
||||
export declare let handleCli: (argvArg: any) => Promise<void>;
|
||||
export declare let mirror: () => Promise<void>;
|
33
dist/mod_git/index.js
vendored
Normal file
33
dist/mod_git/index.js
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./mod.plugins");
|
||||
/**
|
||||
* handle cli input
|
||||
* @param argvArg
|
||||
*/
|
||||
exports.handleCli = (argvArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
if (argvArg._.length >= 2) {
|
||||
let action = argvArg._[1];
|
||||
switch (action) {
|
||||
case 'mirror':
|
||||
yield exports.mirror();
|
||||
break;
|
||||
default:
|
||||
plugins.beautylog.error(`>>npmci git ...<< action >>${action}<< not supported`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
plugins.beautylog.log(`>>npmci git ...<< cli arguments invalid... Please read the documentation.`);
|
||||
}
|
||||
});
|
||||
exports.mirror = () => __awaiter(this, void 0, void 0, function* () {
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfZ2l0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSx5Q0FBd0M7QUFFeEM7OztHQUdHO0FBQ1EsUUFBQSxTQUFTLEdBQUcsQ0FBTyxPQUFPO0lBQ25DLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDMUIsSUFBSSxNQUFNLEdBQVcsT0FBTyxDQUFDLENBQUMsQ0FBRSxDQUFDLENBQUUsQ0FBQTtRQUNuQyxNQUFNLENBQUMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO1lBQ2YsS0FBSyxRQUFRO2dCQUNYLE1BQU0sY0FBTSxFQUFFLENBQUE7Z0JBQ2QsS0FBSyxDQUFBO1lBQ1A7Z0JBQ0UsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsOEJBQThCLE1BQU0sa0JBQWtCLENBQUMsQ0FBQTtRQUNuRixDQUFDO0lBQ0gsQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ04sT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsMkVBQTJFLENBQUMsQ0FBQTtJQUNwRyxDQUFDO0FBQ0gsQ0FBQyxDQUFBLENBQUE7QUFFVSxRQUFBLE1BQU0sR0FBRztBQUVwQixDQUFDLENBQUEsQ0FBQSJ9
|
1
dist/mod_git/mod.plugins.d.ts
vendored
Normal file
1
dist/mod_git/mod.plugins.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export * from '../npmci.plugins';
|
7
dist/mod_git/mod.plugins.js
vendored
Normal file
7
dist/mod_git/mod.plugins.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("../npmci.plugins"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9tb2RfZ2l0L21vZC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsc0NBQWdDIn0=
|
2
dist/npmci.config.d.ts
vendored
2
dist/npmci.config.d.ts
vendored
@ -1,4 +1,6 @@
|
||||
import { KeyValueStore } from 'npmextra';
|
||||
export interface INpmciOptions {
|
||||
globalNpmTools: string[];
|
||||
}
|
||||
export declare let kvStorage: KeyValueStore;
|
||||
export declare let getConfig: () => Promise<INpmciOptions>;
|
||||
|
6
dist/npmci.config.js
vendored
6
dist/npmci.config.js
vendored
@ -10,6 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./npmci.plugins");
|
||||
const paths = require("./npmci.paths");
|
||||
const npmci_env_1 = require("./npmci.env");
|
||||
const npmextra_1 = require("npmextra");
|
||||
// instantiate a kvStorage for the current directory
|
||||
exports.kvStorage = new npmextra_1.KeyValueStore('custom', npmci_env_1.repo.repo);
|
||||
exports.getConfig = () => __awaiter(this, void 0, void 0, function* () {
|
||||
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
||||
let defaultConfig = {
|
||||
@ -18,4 +22,4 @@ exports.getConfig = () => __awaiter(this, void 0, void 0, function* () {
|
||||
let npmciConfig = npmciNpmextra.dataFor('npmci', defaultConfig);
|
||||
return npmciConfig;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4v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QUU7S0FDbkIsQ0FBQTtJQUNELElBQUksV0FBVyxHQUFHLGFBQWEsQ0FBQyxPQUFPLENBQWdCLE9BQU8sRUFBRSxhQUFhLENBQUMsQ0FBQTtJQUM5RSxNQUFNLENBQUMsV0FBVyxDQUFBO0FBQ3BCLENBQUMsQ0FBQSxDQUFBIn0=
|
2
dist/npmci.mods.d.ts
vendored
2
dist/npmci.mods.d.ts
vendored
@ -2,6 +2,7 @@ import * as _modClean from './mod_clean/index';
|
||||
import * as _modCloudflare from './mod_cloudflare/index';
|
||||
import * as _modCommand from './mod_command/index';
|
||||
import * as _modDocker from './mod_docker/index';
|
||||
import * as _modGit from './mod_git/index';
|
||||
import * as _modNpm from './mod_npm/index';
|
||||
import * as _modNode from './mod_node/index';
|
||||
import * as _modSsh from './mod_ssh/index';
|
||||
@ -10,6 +11,7 @@ import { LazyModule } from 'smartsystem';
|
||||
export declare let modClean: LazyModule<typeof _modClean>;
|
||||
export declare let modCloudflare: LazyModule<typeof _modCloudflare>;
|
||||
export declare let modCommand: LazyModule<typeof _modCommand>;
|
||||
export declare let modGit: LazyModule<typeof _modGit>;
|
||||
export declare let modDocker: LazyModule<typeof _modDocker>;
|
||||
export declare let modNode: LazyModule<typeof _modNode>;
|
||||
export declare let modNpm: LazyModule<typeof _modNpm>;
|
||||
|
3
dist/npmci.mods.js
vendored
3
dist/npmci.mods.js
vendored
@ -4,9 +4,10 @@ const smartsystem_1 = require("smartsystem");
|
||||
exports.modClean = new smartsystem_1.LazyModule('./mod_clean/index', __dirname);
|
||||
exports.modCloudflare = new smartsystem_1.LazyModule('./mod_cloudflare/index', __dirname);
|
||||
exports.modCommand = new smartsystem_1.LazyModule('./mod_command/index', __dirname);
|
||||
exports.modGit = new smartsystem_1.LazyModule('./mod_git/index', __dirname);
|
||||
exports.modDocker = new smartsystem_1.LazyModule('./mod_docker/index', __dirname);
|
||||
exports.modNode = new smartsystem_1.LazyModule('./mod_node/index', __dirname);
|
||||
exports.modNpm = new smartsystem_1.LazyModule('./mod_npm/index', __dirname);
|
||||
exports.modSsh = new smartsystem_1.LazyModule('./mod_ssh/index', __dirname);
|
||||
exports.modTrigger = new smartsystem_1.LazyModule('./mod_trigger/index', __dirname);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kubW9kcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLm1vZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFTQSw2Q0FBd0M7QUFFN0IsUUFBQSxRQUFRLEdBQUcsSUFBSSx3QkFBVSxDQUFtQixtQkFBbUIsRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUMzRSxRQUFBLGFBQWEsR0FBRyxJQUFJLHdCQUFVLENBQXdCLHdCQUF3QixFQUFFLFNBQVMsQ0FBQyxDQUFBO0FBQzFGLFFBQUEsVUFBVSxHQUFHLElBQUksd0JBQVUsQ0FBcUIscUJBQXFCLEVBQUUsU0FBUyxDQUFDLENBQUE7QUFDakYsUUFBQSxTQUFTLEdBQUcsSUFBSSx3QkFBVSxDQUFvQixvQkFBb0IsRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUM5RSxRQUFBLE9BQU8sR0FBRyxJQUFJLHdCQUFVLENBQWtCLGtCQUFrQixFQUFFLFNBQVMsQ0FBQyxDQUFBO0FBQ3hFLFFBQUEsTUFBTSxHQUFHLElBQUksd0JBQVUsQ0FBaUIsaUJBQWlCLEVBQUUsU0FBUyxDQUFDLENBQUE7QUFDckUsUUFBQSxNQUFNLEdBQUcsSUFBSSx3QkFBVSxDQUFpQixpQkFBaUIsRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUNyRSxRQUFBLFVBQVUsR0FBRyxJQUFJLHdCQUFVLENBQXFCLHFCQUFxQixFQUFFLFNBQVMsQ0FBQyxDQUFBIn0=
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kubW9kcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLm1vZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFVQSw2Q0FBd0M7QUFFN0IsUUFBQSxRQUFRLEdBQUcsSUFBSSx3QkFBVSxDQUFtQixtQkFBbUIsRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUMzRSxRQUFBLGFBQWEsR0FBRyxJQUFJLHdCQUFVLENBQXdCLHdCQUF3QixFQUFFLFNBQVMsQ0FBQyxDQUFBO0FBQzFGLFFBQUEsVUFBVSxHQUFHLElBQUksd0JBQVUsQ0FBcUIscUJBQXFCLEVBQUUsU0FBUyxDQUFDLENBQUE7QUFDakYsUUFBQSxNQUFNLEdBQUcsSUFBSSx3QkFBVSxDQUFpQixpQkFBaUIsRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUNyRSxRQUFBLFNBQVMsR0FBRyxJQUFJLHdCQUFVLENBQW9CLG9CQUFvQixFQUFFLFNBQVMsQ0FBQyxDQUFBO0FBQzlFLFFBQUEsT0FBTyxHQUFHLElBQUksd0JBQVUsQ0FBa0Isa0JBQWtCLEVBQUUsU0FBUyxDQUFDLENBQUE7QUFDeEUsUUFBQSxNQUFNLEdBQUcsSUFBSSx3QkFBVSxDQUFpQixpQkFBaUIsRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUNyRSxRQUFBLE1BQU0sR0FBRyxJQUFJLHdCQUFVLENBQWlCLGlCQUFpQixFQUFFLFNBQVMsQ0FBQyxDQUFBO0FBQ3JFLFFBQUEsVUFBVSxHQUFHLElBQUksd0JBQVUsQ0FBcUIscUJBQXFCLEVBQUUsU0FBUyxDQUFDLENBQUEifQ==
|
24
ts/mod_git/index.ts
Normal file
24
ts/mod_git/index.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import * as plugins from './mod.plugins'
|
||||
|
||||
/**
|
||||
* handle cli input
|
||||
* @param argvArg
|
||||
*/
|
||||
export let handleCli = async (argvArg) => {
|
||||
if (argvArg._.length >= 2) {
|
||||
let action: string = argvArg._[ 1 ]
|
||||
switch (action) {
|
||||
case 'mirror':
|
||||
await mirror()
|
||||
break
|
||||
default:
|
||||
plugins.beautylog.error(`>>npmci git ...<< action >>${action}<< not supported`)
|
||||
}
|
||||
} else {
|
||||
plugins.beautylog.log(`>>npmci git ...<< cli arguments invalid... Please read the documentation.`)
|
||||
}
|
||||
}
|
||||
|
||||
export let mirror = async () => {
|
||||
|
||||
}
|
1
ts/mod_git/mod.plugins.ts
Normal file
1
ts/mod_git/mod.plugins.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from '../npmci.plugins'
|
@ -3,10 +3,17 @@ import * as q from 'q'
|
||||
import * as plugins from './npmci.plugins'
|
||||
import * as paths from './npmci.paths'
|
||||
|
||||
import { repo } from './npmci.env'
|
||||
|
||||
import { KeyValueStore } from 'npmextra'
|
||||
|
||||
export interface INpmciOptions {
|
||||
globalNpmTools: string[]
|
||||
}
|
||||
|
||||
// instantiate a kvStorage for the current directory
|
||||
export let kvStorage = new KeyValueStore('custom', repo.user + repo.repo)
|
||||
|
||||
export let getConfig = async (): Promise<INpmciOptions> => {
|
||||
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
|
||||
let defaultConfig: INpmciOptions = {
|
||||
|
@ -2,6 +2,7 @@ import * as _modClean from './mod_clean/index'
|
||||
import * as _modCloudflare from './mod_cloudflare/index'
|
||||
import * as _modCommand from './mod_command/index'
|
||||
import * as _modDocker from './mod_docker/index'
|
||||
import * as _modGit from './mod_git/index'
|
||||
import * as _modNpm from './mod_npm/index'
|
||||
import * as _modNode from './mod_node/index'
|
||||
import * as _modSsh from './mod_ssh/index'
|
||||
@ -12,6 +13,7 @@ import { LazyModule } from 'smartsystem'
|
||||
export let modClean = new LazyModule<typeof _modClean>('./mod_clean/index', __dirname)
|
||||
export let modCloudflare = new LazyModule<typeof _modCloudflare>('./mod_cloudflare/index', __dirname)
|
||||
export let modCommand = new LazyModule<typeof _modCommand>('./mod_command/index', __dirname)
|
||||
export let modGit = new LazyModule<typeof _modGit>('./mod_git/index', __dirname)
|
||||
export let modDocker = new LazyModule<typeof _modDocker>('./mod_docker/index', __dirname)
|
||||
export let modNode = new LazyModule<typeof _modNode>('./mod_node/index', __dirname)
|
||||
export let modNpm = new LazyModule<typeof _modNpm>('./mod_npm/index', __dirname)
|
||||
|
Loading…
Reference in New Issue
Block a user