add option for npm access level

This commit is contained in:
2018-04-04 22:25:13 +02:00
parent c8c17e6cba
commit 0ab1e1ab7c
70 changed files with 1977 additions and 1846 deletions

View File

@@ -1,30 +1,34 @@
import * as q from 'q'
import * as q from 'q';
import * as plugins from './npmci.plugins'
import * as paths from './npmci.paths'
import * as plugins from './npmci.plugins';
import * as paths from './npmci.paths';
import { repo } from './npmci.env'
import { repo } from './npmci.env';
import { KeyValueStore } from 'npmextra'
import { KeyValueStore } from 'npmextra';
export interface INpmciOptions {
npmGlobalTools: string[]
dockerRegistryRepoMap: any
dockerBuildargEnvMap: any
npmGlobalTools: string[];
npmAccessLevel?: 'private' | 'public';
dockerRegistryRepoMap: any;
dockerBuildargEnvMap: any;
}
// instantiate a kvStorage for the current directory
export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`)
export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`);
// handle config retrival
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd)
let npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
let defaultConfig: INpmciOptions = {
npmGlobalTools: [],
dockerRegistryRepoMap: {},
dockerBuildargEnvMap: {}
}
export let configObject = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig)
};
export let configObject = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig);
/**
* gets the npmci portion of the npmextra.json file
*/
export let getConfig = async (): Promise<INpmciOptions> => {
return configObject
}
return configObject;
};