nsgm-cli
Version:
A CLI tool to run Next/Style-components and Graphql/Mysql fullstack project
173 lines (172 loc) • 9.88 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.destServerApisPath = exports.destServerModulesPath = exports.destServerPath = exports.destClientLayoutPath = exports.destClientUtilsPath = exports.destClientStyledLayoutPath = exports.destClientStyledPath = exports.destClientServicePath = exports.destClientReduxPath = exports.destClientPath = exports.sourceTypesPath = exports.sourceScriptsPath = exports.sourcePublicPath = exports.sourcePagesPath = exports.sourceServerPathGeneration = exports.sourceServerPath = exports.sourceClientPathGeneration = exports.sourceClientPath = exports.sourceGenerationPath = exports.restPath = exports.packagePath = exports.slbHealthCheckPath = exports.reduxReducersPath = exports.utilsMenuPath = exports.sqlPath = exports.apisPath = exports.modulesPath = exports.componentsPath = exports.layoutPath = exports.utilsPath = exports.styledLayoutPath = exports.styledPath = exports.servicePath = exports.reduxPath = exports.typesPath = exports.typesPathSource = exports.scriptsPath = exports.scriptsPathSource = exports.publicPath = exports.publicPathSource = exports.pagesPath = exports.pagesPathSource = exports.serverPath = exports.serverPathSource = exports.clientPath = exports.clientPathSource = exports.generationPath = exports.isLocal = exports.destFolder = exports.sourceFolder = void 0;
exports.mysqlDatabase = exports.mysqlPort = exports.mysqlHost = exports.mysqlPassword = exports.mysqlUser = exports.destServerRestPath = exports.destPackagePath = exports.destPublicHealthCheckPath = exports.destClientReduxReducersAllPath = exports.destClientUtilsMenuPath = exports.destTypesPath = exports.destScriptsPath = exports.destPublicPath = exports.destPagesPath = exports.destServerUtilsPath = exports.destServerSqlPath = void 0;
const path_1 = __importStar(require("path"));
const db_1 = __importDefault(require("./server/db"));
const sourceFolder = __dirname;
exports.sourceFolder = sourceFolder;
const destFolder = process.cwd();
exports.destFolder = destFolder;
const isLocal = sourceFolder === (0, path_1.resolve)(`${destFolder}/lib`);
exports.isLocal = isLocal;
const { getMysqlConfig } = db_1.default;
const { mysqlOptions } = getMysqlConfig();
const { user: mysqlUser, password: mysqlPassword, host: mysqlHost, port: mysqlPort, database: mysqlDatabase, } = mysqlOptions;
exports.mysqlUser = mysqlUser;
exports.mysqlPassword = mysqlPassword;
exports.mysqlHost = mysqlHost;
exports.mysqlPort = mysqlPort;
exports.mysqlDatabase = mysqlDatabase;
const generationPath = '../generation';
exports.generationPath = generationPath;
const clientPathSource = '../client';
exports.clientPathSource = clientPathSource;
const clientPath = './client';
exports.clientPath = clientPath;
const serverPathSource = '../server';
exports.serverPathSource = serverPathSource;
const serverPath = './server';
exports.serverPath = serverPath;
const pagesPathSource = '../pages';
exports.pagesPathSource = pagesPathSource;
const pagesPath = './pages';
exports.pagesPath = pagesPath;
const publicPathSource = '../public';
exports.publicPathSource = publicPathSource;
const publicPath = './public';
exports.publicPath = publicPath;
const scriptsPathSource = '../scripts';
exports.scriptsPathSource = scriptsPathSource;
const scriptsPath = './scripts';
exports.scriptsPath = scriptsPath;
const typesPathSource = '../types';
exports.typesPathSource = typesPathSource;
const typesPath = './types';
exports.typesPath = typesPath;
const reduxPath = '/redux';
exports.reduxPath = reduxPath;
const servicePath = '/service';
exports.servicePath = servicePath;
const styledPath = '/styled';
exports.styledPath = styledPath;
const styledLayoutPath = '/layout';
exports.styledLayoutPath = styledLayoutPath;
const utilsPath = '/utils';
exports.utilsPath = utilsPath;
const layoutPath = '/layout';
exports.layoutPath = layoutPath;
const componentsPath = '/components';
exports.componentsPath = componentsPath;
const modulesPath = '/modules';
exports.modulesPath = modulesPath;
const apisPath = '/apis';
exports.apisPath = apisPath;
const sqlPath = '/sql';
exports.sqlPath = sqlPath;
const utilsMenuPath = '/menu.tsx';
exports.utilsMenuPath = utilsMenuPath;
const reduxReducersPath = '/reducers.ts';
exports.reduxReducersPath = reduxReducersPath;
const slbHealthCheckPath = '/slbhealthcheck.html';
exports.slbHealthCheckPath = slbHealthCheckPath;
const packagePath = '/package.json';
exports.packagePath = packagePath;
const restPath = '/rest.js';
exports.restPath = restPath;
const sourceGenerationPath = path_1.default.join(sourceFolder, generationPath);
exports.sourceGenerationPath = sourceGenerationPath;
const sourceClientPath = path_1.default.join(sourceFolder, clientPathSource);
exports.sourceClientPath = sourceClientPath;
const sourceClientPathGeneration = path_1.default.join(sourceGenerationPath, clientPath);
exports.sourceClientPathGeneration = sourceClientPathGeneration;
const sourceServerPath = path_1.default.join(sourceFolder, serverPathSource);
exports.sourceServerPath = sourceServerPath;
const sourceServerPathGeneration = path_1.default.join(sourceGenerationPath, serverPath);
exports.sourceServerPathGeneration = sourceServerPathGeneration;
const sourcePagesPath = path_1.default.join(sourceFolder, pagesPathSource);
exports.sourcePagesPath = sourcePagesPath;
const sourcePublicPath = path_1.default.join(sourceFolder, publicPathSource);
exports.sourcePublicPath = sourcePublicPath;
const sourceScriptsPath = path_1.default.join(sourceFolder, scriptsPathSource);
exports.sourceScriptsPath = sourceScriptsPath;
const sourceTypesPath = path_1.default.join(sourceFolder, typesPathSource);
exports.sourceTypesPath = sourceTypesPath;
const destClientPath = path_1.default.join(destFolder, clientPath);
exports.destClientPath = destClientPath;
const destClientReduxPath = (0, path_1.resolve)(destClientPath + reduxPath);
exports.destClientReduxPath = destClientReduxPath;
const destClientServicePath = (0, path_1.resolve)(destClientPath + servicePath);
exports.destClientServicePath = destClientServicePath;
const destClientStyledPath = (0, path_1.resolve)(destClientPath + styledPath);
exports.destClientStyledPath = destClientStyledPath;
const destClientStyledLayoutPath = (0, path_1.resolve)(destClientStyledPath + styledLayoutPath);
exports.destClientStyledLayoutPath = destClientStyledLayoutPath;
const destClientUtilsPath = (0, path_1.resolve)(destClientPath + utilsPath);
exports.destClientUtilsPath = destClientUtilsPath;
const destClientLayoutPath = (0, path_1.resolve)(destClientPath + layoutPath);
exports.destClientLayoutPath = destClientLayoutPath;
const destServerPath = path_1.default.join(destFolder, serverPath);
exports.destServerPath = destServerPath;
const destServerModulesPath = (0, path_1.resolve)(destServerPath + modulesPath);
exports.destServerModulesPath = destServerModulesPath;
const destServerApisPath = (0, path_1.resolve)(destServerPath + apisPath);
exports.destServerApisPath = destServerApisPath;
const destServerSqlPath = (0, path_1.resolve)(destServerPath + sqlPath);
exports.destServerSqlPath = destServerSqlPath;
const destServerUtilsPath = (0, path_1.resolve)(destServerPath + utilsPath);
exports.destServerUtilsPath = destServerUtilsPath;
const destPagesPath = path_1.default.join(destFolder, pagesPath);
exports.destPagesPath = destPagesPath;
const destPublicPath = path_1.default.join(destFolder, publicPath);
exports.destPublicPath = destPublicPath;
const destScriptsPath = path_1.default.join(destFolder, scriptsPath);
exports.destScriptsPath = destScriptsPath;
const destTypesPath = path_1.default.join(destFolder, typesPath);
exports.destTypesPath = destTypesPath;
const destClientUtilsMenuPath = (0, path_1.resolve)(destClientUtilsPath + utilsMenuPath);
exports.destClientUtilsMenuPath = destClientUtilsMenuPath;
const destClientReduxReducersAllPath = (0, path_1.resolve)(destClientReduxPath + reduxReducersPath);
exports.destClientReduxReducersAllPath = destClientReduxReducersAllPath;
const destPublicHealthCheckPath = (0, path_1.resolve)(destPublicPath + slbHealthCheckPath);
exports.destPublicHealthCheckPath = destPublicHealthCheckPath;
const destPackagePath = (0, path_1.resolve)(destFolder + packagePath);
exports.destPackagePath = destPackagePath;
const destServerRestPath = (0, path_1.resolve)(destServerPath + restPath);
exports.destServerRestPath = destServerRestPath;