UNPKG

@git.zone/cli

Version:

A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.

50 lines (43 loc) 1.21 kB
import * as plugins from './plugins.js'; import * as paths from './paths.js'; export type TGitzoneProjectType = 'npm' | 'service' | 'wcc' | 'website'; /** * type of the actual gitzone data */ export interface IGitzoneConfigData { projectType: TGitzoneProjectType; module: { githost: string; gitscope: string; gitrepo: string; description: string; npmPackageName: string; license: string; projectDomain: string; assetbrokerUrl: string; legalUrl: string; }; copy: { [key: string]: string }; npmciOptions: { npmAccessLevel: 'public' | 'private'; }; } /** * gitzone config */ export class GitzoneConfig { public static async fromCwd() { const gitzoneConfig = new GitzoneConfig(); await gitzoneConfig.readConfigFromCwd(); return gitzoneConfig; } public data: IGitzoneConfigData; public async readConfigFromCwd() { const npmextraInstance = new plugins.npmextra.Npmextra(paths.cwd); this.data = npmextraInstance.dataFor<IGitzoneConfigData>('gitzone', {}); this.data.npmciOptions = npmextraInstance.dataFor<IGitzoneConfigData['npmciOptions']>('npmci', { npmAccessLevel: 'public', }); } constructor() {} }