wv-gotcha
Version:
 wv-local-service-bus # Purpose To accumulate your walkthroughs to accomplish your common tasks with less effort.
203 lines • 9.75 kB
JavaScript
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UPathMan = exports.TEMPLATE_PLACEHOLDER = exports.CommonDirName = exports.CommonFileName = void 0;
const decova_filesystem_1 = require("decova-filesystem");
const temp_circuits_1 = require("temp-circuits");
const path_1 = __importDefault(require("path"));
var CommonFileName;
(function (CommonFileName) {
CommonFileName["decovaSettings"] = "decova-settings.json";
CommonFileName["wvSnippets"] = "wv.code-snippets";
CommonFileName["gitIgnore"] = "$$$gitignore";
CommonFileName["tsConfigJson"] = "tsconfig.json";
CommonFileName["launch"] = "launch.json";
CommonFileName["tasksJson"] = "tasks.json";
CommonFileName["settings"] = "settings.json";
CommonFileName["packgeJson"] = "package.json";
CommonFileName["WalkthroughsSheet"] = "walkthroughs_sheet.json";
CommonFileName["WalkthroughsSchema"] = "walkthroughs_schema.json";
CommonFileName["translationMap"] = "translationMap.json";
})(CommonFileName || (exports.CommonFileName = CommonFileName = {}));
var CommonDirName;
(function (CommonDirName) {
CommonDirName["vscode"] = ".vscode";
// gotcha_main_dir = "decova-gotcha-data",
// decova_gotcha_repo = "decova-gotcha-data",
// text_snippets = "text-snippets"
CommonDirName["Template_RootDir_AnyNodeProject"] = "AnyNodeJSProject";
CommonDirName["Template_RootDir_AnyDotNetProject"] = "AnyDotNetProject";
CommonDirName["Template_RootDir_NewNodeProject"] = "NewNodeJSProject";
CommonDirName["Template_RootDir_NewCleanArchitectureSolution"] = "CleanArchitectureService";
CommonDirName["GenericGenTemplates"] = "GenericGenTemplates";
})(CommonDirName || (exports.CommonDirName = CommonDirName = {}));
exports.TEMPLATE_PLACEHOLDER = '___TEMPLATE_PLACEHOLDER___';
let UPathMan = class UPathMan extends temp_circuits_1.RootCircuit {
get UserProfileDir() {
if (this._UserProfileDir)
return this._UserProfileDir;
if (!process.env.USERPROFILE) {
throw new temp_circuits_1.Exception_InvalidProgramState("process.env.USERPROFILE", "process.env.USERPROFILE is empty or undefined");
}
this._UserProfileDir = new decova_filesystem_1.DirectoryInfo(process.env.USERPROFILE);
return this._UserProfileDir;
}
get mindMapsDir() {
return new decova_filesystem_1.DirectoryInfo("G:/MyMindMaps");
}
;
get genericGenTemplates() {
return new decova_filesystem_1.DirectoryInfo(decova_filesystem_1.Path.join(this.contentDir.FullName, CommonDirName.GenericGenTemplates));
}
get xmmapTemplateFile() {
return new decova_filesystem_1.FileInfo(decova_filesystem_1.Path.join(this.mindMapsDir.FullName, `${exports.TEMPLATE_PLACEHOLDER}.xmmap`));
}
getMindMapFile(documentName) {
return new decova_filesystem_1.FileInfo(decova_filesystem_1.Path.join(this.mindMapsDir.FullName, `ggg ${documentName}.xmmap`));
}
// private _GotchaMainDir!: DirectoryInfo;
// get GotchaMainDir(): DirectoryInfo
// {
// if(this._GotchaMainDir) return this._GotchaMainDir;
// this._GotchaMainDir = new DirectoryInfo(`${this.UserProfileDir.FullName}\\${CommonDirName.gotcha_main_dir}`);
// this._GotchaMainDir.Ensure();
// return this._GotchaMainDir;
// }
get distDir() {
return new decova_filesystem_1.FileInfo(process.argv.xSkip(1).xFirst()).directory;
}
get dstVscodeDir() {
return new decova_filesystem_1.DirectoryInfo(decova_filesystem_1.Path.join(this.currentDir.FullName, CommonDirName.vscode));
}
get dstnWvSnippetsFilePath() {
return decova_filesystem_1.Path.join(this.dstVscodeDir.FullName, CommonFileName.wvSnippets);
}
get dstnGitIgnoreFilePath() {
return decova_filesystem_1.Path.join(this.currentDir.FullName, CommonFileName.gitIgnore);
}
get dstnTsConfigFilePath() {
return decova_filesystem_1.Path.join(this.currentDir.FullName, CommonFileName.tsConfigJson);
}
get mode() {
return (this.distDir.Name === 'wv-gotcha') ? 'prod' : 'dev';
}
get mainDeploymentDir() {
if (this.mode === 'prod')
return this.distDir;
else
return this.distDir.Parent;
}
get contentDir() {
return new decova_filesystem_1.DirectoryInfo(path_1.default.join(this.mainDeploymentDir.FullName, 'content'));
}
get codeTemplatesDir() {
return new decova_filesystem_1.DirectoryInfo(path_1.default.join(this.contentDir.FullName, `CodeTemplates`));
}
get genericGenDirTemplates() {
return new decova_filesystem_1.DirectoryInfo(path_1.default.join(this.contentDir.FullName, CommonDirName.GenericGenTemplates));
}
get templateRootDir_AnyNodeJSProject() {
CommonDirName;
return new decova_filesystem_1.DirectoryInfo(path_1.default.join(this.contentDir.FullName, `AnyNodeJSProject`));
}
// static get GotchaLocalDataDir(): DirectoryInfo
// {
// const path = Path.Join(this.GotchaMainDir.FullName);
// const rootDataDir = new DirectoryInfo(path);
// rootDataDir.Ensure();
// return rootDataDir;
// }
// static get GotchaLocalRepoGitDir(): DirectoryInfo
// {
// const path = Path.Join(this.GotchaLocalDataDir.FullName, ".git");
// return new DirectoryInfo(path);
// }
// get GotchaLocalRepo_Vscode_Dir(): DirectoryInfo
// {
// const path = Path.join(this.GotchaMainDir.FullName, CommonDirName.vscode)
// return new DirectoryInfo(path)
// }
// get GotchaLocalRepo_WalkthroughsSheet(): FileInfo
// {
// const path = Path.join(this.GotchaMainDir.FullName, CommonFileName.WalkthroughsSheet);
// return new FileInfo(path);
// }
// static get GotchaLocalRepo_WalkthroughsSchema(): FileInfo
// {
// const path = Path.Join(this.GotchaLocalRepo.FullName, CommonFileName.WalkthroughsSchema);
// return new FileInfo(path);
// }
// get GotchaLocalRepo_DecovaSettingsFile(): FileInfo
// {
// const path = Path.join(this.GotchaLocalRepo_Vscode_Dir.FullName, CommonFileName.decovaSettings);
// return new FileInfo(path);
// }
// get GotchaLocalRepo_DecovaSnippets(): FileInfo
// {
// const path = Path.join(this.GotchaLocalRepo_Vscode_Dir.FullName, CommonFileName.decovaSnippets);
// return new FileInfo(path);
// }
// get GotchaLocalRepo_LaunchFile(): FileInfo
// {
// const path = Path.join(this.GotchaLocalRepo_Vscode_Dir.FullName, CommonFileName.launch);
// return new FileInfo(path);
// }
// get GotchaLocalRepo_SettingsFile(): FileInfo
// {
// const path = Path.join(this.GotchaLocalRepo_Vscode_Dir.FullName, CommonFileName.settings);
// return new FileInfo(path);
// }
get currentDir() {
if (this.distDir.Name === 'dist')
return new decova_filesystem_1.DirectoryInfo(`J:/Test_wV_Gotcha_output`);
else
return decova_filesystem_1.DirectoryInfo.Current;
}
get CurrentWorkspace_VsCodeDir() {
const path = decova_filesystem_1.Path.join(this.currentDir.FullName, CommonDirName.vscode);
return new decova_filesystem_1.DirectoryInfo(path);
}
get CurrentWorkspace_DecovaSettings() {
const path = decova_filesystem_1.Path.join(this.CurrentWorkspace_VsCodeDir.FullName, CommonFileName.decovaSettings);
return new decova_filesystem_1.FileInfo(path);
}
get CurrentWorkspace_Settings() {
const path = decova_filesystem_1.Path.join(this.CurrentWorkspace_VsCodeDir.FullName, CommonFileName.settings);
return new decova_filesystem_1.FileInfo(path);
}
get CurrentWorkspace_Tasks() {
const path = decova_filesystem_1.Path.join(this.CurrentWorkspace_VsCodeDir.FullName, CommonFileName.tasksJson);
return new decova_filesystem_1.FileInfo(path);
}
// get CurrentWorkspace_DecovaSnippets(): FileInfo
// {
// const path = Path.join(this.CurrentWorkspace_VsCodeDir.FullName, CommonFileName.decovaSnippets)
// return new FileInfo(path);
// }
get CurrentWorkspace_Lanuch() {
const path = decova_filesystem_1.Path.join(this.CurrentWorkspace_VsCodeDir.FullName, CommonFileName.launch);
return new decova_filesystem_1.FileInfo(path);
}
// get GotchaLocalRepo_TextSnippets_Dir(): DirectoryInfo
// {
// const path = Path.join(this.GotchaLocalRepo_Vscode_Dir.FullName, CommonDirName.text_snippets)
// return new DirectoryInfo(path);
// }
get CurrentWorkspace_PackageJson() {
const path = decova_filesystem_1.Path.join(this.currentDir.FullName, CommonFileName.packgeJson);
return new decova_filesystem_1.FileInfo(path);
}
};
exports.UPathMan = UPathMan;
exports.UPathMan = UPathMan = __decorate([
(0, temp_circuits_1.Register)()
], UPathMan);
//# sourceMappingURL=UPathMan.js.map