//#region imports
import { TaonTempDatabasesFolder, TaonTempRoutesFolder } from 'taon/lib-prod';
import { config, dotTaonFolder, fileName, folderName, } from 'tnp-core/lib-prod';
import { fse } from 'tnp-core/lib-prod';
import { ___NS__times } from 'tnp-core/lib-prod';
import { crossPlatformPath, path, Utils__NS__uniqArray } from 'tnp-core/lib-prod';
import { CURRENT_PACKAGE_VERSION } from './build-info._auto-generated_';
// import type { Project } from './project/abstract/project';
//#endregion
export const whatToLinkFromCore = 'src/lib';
// export const whatToLinkFromCore: 'src' | 'src/lib' = 'src/lib';
/**
 *  '' - when whatToLinkFromCore is src
 *  'lib' - when whatToLinkFromCore is src/lib
 *  'deep/folder' - when whatToLinkFromCore is src/deep/folder
 */
export const whatToLinkFromCoreDeepPart = whatToLinkFromCore === 'src'
    ? ''
    : whatToLinkFromCore.replace('src/', '');
export const keysMap = {
    destinationDomain: 'dn',
    projectName: 'pn',
    releaseType: 'rt',
    version: 'ver',
    envName: 'enm',
    envNumber: 'enu',
    targetArtifact: 'ta',
};
export const dirnameFromSourceToProject = (linkToSource) => {
    const orgParamLinkAbs = linkToSource;
    linkToSource = fse.realpathSync(linkToSource);
    linkToSource = crossPlatformPath(linkToSource);
    const orgRealLinkToSource = linkToSource;
    const howManyDirname = whatToLinkFromCore.split('/').length;
    ___NS__times(howManyDirname, n => {
        // console.log(`dirname action ${n}/${howManyDirname}`);
        linkToSource = crossPlatformPath(path.dirname(linkToSource));
    });
    linkToSource = crossPlatformPath(linkToSource);
    // console.log({ linkToSource, orgRealLinkToSource, howManyDirname });
    if (path.basename(linkToSource) === 'src') {
        // console.log(`FIXING NOT PROPER LINK TO SOURCE ${orgParamLinkAbs}`);
        linkToSource = crossPlatformPath(path.dirname(linkToSource));
        // if (whatToLinkFromCore === 'src') {
        //   try {
        //     fse.unlinkSync(orgParamLinkAbs);
        //   } catch (error) {}
        //   Helpers__NS__createSymLink(
        //     crossPlatformPath([linkToSource, whatToLinkFromCore]),
        //     orgParamLinkAbs,
        //   );
        // }
        // linkToSource = crossPlatformPath(path.dirname(linkToSource));
    }
    return linkToSource;
};
export const DUMMY_LIB = '@lib';
export const DOCKER_COMPOSE_FILE_NAME = 'docker-compose.yml';
export const DOCKER_FOLDER = 'docker';
export const BASE_TEMP_DOCKER_FOLDER = 'tmp-docker';
export const DOCKER_TEMPLATES = 'docker-templates';
export const ACTIVE_CONTEXT = 'ACTIVE_CONTEXT';
export const friendlyNameForReleaseAutoConfigIsRequired = false;
export const iconVscode128Basename = 'icon-vscode.png';
export const startJsFromBin = 'start.js';
export const startTsFromLib = 'start-cli.ts';
export const taonIgnore = '@taon' + '-' + 'ignore';
export const DEBUG_WORD = 'Run'; //'Debug/Start';
export const GENERATE_CMD_COPY_TO_AI = 'generate-cmd-copy-to-ai';
export const scriptsCommands = [
    'taon init',
    'taon start',
    'taon build:lib',
    'taon build:watch:lib',
    'taon build:watch:app',
    'taon build:watch:electron',
    'taon docs',
    'taon docs:watch',
    'taon clear',
    'taon release',
    'taon release:auto',
    'taon release:install:locally',
    'taon migration:create',
    'taon migration:run',
    'taon migration:revert',
    'taon vscode:temp:show',
    'taon vscode:temp:hide',
];
export const THIS_IS_GENERATED_STRING = `THIS FILE IS GENERATED - DO NOT MODIFY`;
export const THIS_IS_GENERATED_INFO_COMMENT = `// ${THIS_IS_GENERATED_STRING}`;
export const defaultLicenseVscodePlugin = 'MIT';
export const OVERRIDE_FROM_TNP = [
    'activationEvents',
    'author',
    'bugs',
    'categories',
    'description',
    'engines',
    'homepage',
    'keywords',
    'license',
    'private',
    'repository',
    'scripts',
];
export const startSpinner = 'start-spinner';
export const stopSpinner = 'stop-spinner';
export const failSpinner = 'fail-spinner';
export const succeedSpinner = 'succeed-spinner';
export const USE_IN_HOST_CONFIG_FULL_CONTEXT_PATH = false;
export const MIGRATION_CONST_PREFIX = 'MIGRATIONS_CLASSES_FOR_';
let taonUsingBundledCliMode = false;
//#region @backend
taonUsingBundledCliMode = !!global.taonUsingBundledCliMode;
//#endregion
export { taonUsingBundledCliMode };
export const UNIT_TEST_TIMEOUT = 30000;
export const INTEGRATION_TEST_TIMEOUT = 30000;
export const USE_MIGRATIONS_DATA_IN_HOST_CONFIG = false;
export const COMPILATION_COMPLETE_LIB_NG_BUILD = 'Compilation complete. Watching for file changes';
export const COMPILATION_WATCHING_STARTED = 'Watching for file changes';
export const COMPILATION_COMPLETE_APP_NG_SERVE = 'Compiled successfully';
export const COMPILATION_COMPLETE_TSC = 'Found 0 errors. Watching for file changes';
// TODO get this from cli, global
export const DEFAULT_FRAMEWORK_VERSION = `v${CURRENT_PACKAGE_VERSION.split('.')[0]}`;
export { taonRepoPathUserInUserDir, taonBasePathToGlobalDockerTemplates, globalSpinner, } from 'tnp-core/lib-prod';
/**
 * Prevents taon from checking core container when
 * calling itself from child process
 */
export const skipCoreCheck = '--skipCoreCheck';
export const argsToClear = [
    'websql',
    'serveApp',
    'skipNodeModules',
    'skipSmartContainerDistInit',
    'copyto',
    'port',
    'branding',
    'struct',
    'verbose',
];
export const watcherPrefix = '-watcher';
export const verbosePrefix = '-verbose';
export const spinnerPrefix = '-spinner';
export const oldBuildModePrefix = '-oldBuildMode';
export const oldBuildModePrefixShort = '-obm';
export const websqlPrefix = '-websql';
export const folder_shared_folder_info = 'shared_folder_info.txt';
export const taonConfigSchemaJsonStandalone = 'taon-config-standalone.schema.json';
export const taonConfigSchemaJsonContainer = 'taon-config-container.schema.json';
export const TEMP_DOCS = 'tmp-documentation';
const libsAppPortsFolder = 'libs-apps-ports';
export const HOST_BACKEND_PORT = 'HOST_BACKEND_PORT';
export const tmp_HOST_BACKEND_PORT = `${dotTaonFolder}/${libsAppPortsFolder}/${HOST_BACKEND_PORT}`;
export const FRONTEND_WEBSQL_APP_PORT = 'FRONTEND_WEBSQL_APP_PORT';
export const tmp_FRONTEND_WEBSQL_APP_PORT = `${dotTaonFolder}/${libsAppPortsFolder}/${FRONTEND_WEBSQL_APP_PORT}`;
export const FRONTEND_NORMAL_APP_PORT = 'FRONTEND_NORMAL_APP_PORT';
export const tmp_FRONTEND_NORMAL_APP_PORT = `${dotTaonFolder}/${libsAppPortsFolder}/${FRONTEND_NORMAL_APP_PORT}`;
export const FRONTEND_NORMAL_ELECTRON_PORT = 'FRONTEND_NORMAL_ELECTRON_PORT';
export const tmp_FRONTEND_NORMAL_ELECTRON_PORT = `${dotTaonFolder}/${libsAppPortsFolder}/${FRONTEND_NORMAL_ELECTRON_PORT}`;
export const DEFAULT_PORT = {
    DIST_SERVER_DOCS: 4000,
    APP_BUILD_LOCALHOST: 4200,
    SERVER_LOCALHOST: 4100,
    DEBUGGING_CLI_TOOL: 9222,
    DEBUGGING_ELECTRON: 9888,
};
export const docsConfigJsonFileName = 'docs-config.jsonc';
export const docsConfigSchema = 'docs-config.schema.json';
export const customDefaultCss = 'custom-default.css';
export const customDefaultJs = 'custom-default.js';
export const frameworkBuildFolders = Utils__NS__uniqArray([
    'firedev',
    'taon',
    'tnp',
    `${config.frameworkName}`,
])
    .filter(f => !!f)
    .map(f => `.${f}`);
export const envTs = 'env.ts';
export const environmentsFolder = 'environments';
export const coreRequiredEnvironments = [
    '__',
    'prod',
];
/**
 * @deprecated not needed probably
 */
export const result_packages_json = 'result-packages.json';
export const readmeMdMainProject = 'README.md';
export const tmpIsomorphicPackagesJson = 'tmp-isomorphic-packages.json';
/**
 * If exist - copy manager will clean copy bundled package to destinations
 */
export const tmpAlreadyStartedCopyManager = 'tmp-already-started-copy-manager'; // not for prod
export const tmpAllAssetsLinked = 'tmp-all-assets-linked'; // not for prod
/**
 * Destination place for all taon processes (tsc, ng build, etc)
 * From this folder code is copied to final destinations node_modules
 */
export const tmpLocalCopytoProjDist = 'tmp-local-copyto-proj-dist'; // not for prod
/**
 * Folder where tmpSrdDist code is cutted file by file before publishing
 */
export const tmpCutReleaseSrcDist = 'tmp-cut-release-src-dist'; // not for prod
/**
 * Folder where tmpSrdDist code is cutted file by file before publishing (websql version)
 */
export const tmpCutReleaseSrcDistWebsql = 'tmp-cut-release-src-dist-websql'; // not for prod
/**
 * Temporary folder for base href overwrite during build
 * (taon library build sets it)
 */
export const tmpBaseHrefOverwrite = 'tmp-base-href-overwrite';
/**
 * Temporary folder for vscode project files
 */
export const tmpVscodeProj = `tmp-vscode-proj`;
/**
 * Taon code transformed for backend
 */
export const tmpSourceDist = 'tmp-source-dist'; // ok for prod
/**
 * Taon code transformed for backend in websql mode
 * (this code is probably never used)
 */
export const tmpSourceDistWebsql = 'tmp-source-dist-websql'; // ok for prod
/**
 * Taon code transformed for browser
 */
export const tmpSrcDist = 'tmp-src-dist'; // ok for prod
/**
 * Taon code transformed for browser in websql mode
 */
export const tmpSrcDistWebsql = 'tmp-src-dist-websql'; // ok for prod
/**
 * Taon code transformed for browser (angular app uses this)
 */
export const tmpSrcAppDist = 'tmp-src-app-dist'; // ok for prod
/**
 * Taon code transformed for browser (angular app in websql uses this)
 */
export const tmpSrcAppDistWebsql = 'tmp-src-app-dist-websql'; // ok for prod
export const defaultConfiguration = 'defaultConfiguration';
export const mainProjectSubProjects = 'sub-projects';
export var TempalteSubprojectType;
(function (TempalteSubprojectType) {
    TempalteSubprojectType["TAON_STRIPE_CLOUDFLARE_WORKER"] = "taon-stripe-cloudflare-worker";
    TempalteSubprojectType["TAON_YT_CLOUDFLARE_WORKER"] = "taon-yt-cloudflare-worker";
})(TempalteSubprojectType || (TempalteSubprojectType = {}));
export const TempalteSubprojectTypeArr = [
    TempalteSubprojectType.TAON_STRIPE_CLOUDFLARE_WORKER,
    TempalteSubprojectType.TAON_YT_CLOUDFLARE_WORKER,
];
export const TemplateSubprojectDbPrefix = {
    [TempalteSubprojectType.TAON_STRIPE_CLOUDFLARE_WORKER]: 'SALES_KV',
    [TempalteSubprojectType.TAON_YT_CLOUDFLARE_WORKER]: 'YT_DATA_KV',
};
export var TempalteSubprojectGroup;
(function (TempalteSubprojectGroup) {
    TempalteSubprojectGroup["KEY_VALUE_FAST_WORKER_DATABASE"] = "key-value-fast-worker-database";
})(TempalteSubprojectGroup || (TempalteSubprojectGroup = {}));
export const TempalteSubprojectTypeGroup = {
    [TempalteSubprojectType.TAON_STRIPE_CLOUDFLARE_WORKER]: TempalteSubprojectGroup.KEY_VALUE_FAST_WORKER_DATABASE,
    [TempalteSubprojectType.TAON_YT_CLOUDFLARE_WORKER]: TempalteSubprojectGroup.KEY_VALUE_FAST_WORKER_DATABASE,
};
/**
 * template folders from isomorphic lib
 */
export var TemplateFolder;
(function (TemplateFolder) {
    /**
     * Core project for angular app webapp, library and electron app
     */
    TemplateFolder["templateApp"] = "template-app";
    TemplateFolder["templatesSubprojects"] = "templates-subprojects";
    /**
     * @deprecated
     * Core project angular library
     */
    // templateLib = 'template-lib',
    /**
     * @deprecated
     * Core project template for electron app
     */
    // templateElectron = 'template-electron',
})(TemplateFolder || (TemplateFolder = {}));
export var AngularJsonTaskName;
(function (AngularJsonTaskName) {
    AngularJsonTaskName["ANGULAR_APP"] = "app";
    AngularJsonTaskName["ELECTRON_APP"] = "angular-electron";
})(AngularJsonTaskName || (AngularJsonTaskName = {}));
export var CoreAssets;
(function (CoreAssets) {
    CoreAssets["sqlWasmFile"] = "sql-wasm.wasm";
    CoreAssets["mainFont"] = "flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2";
})(CoreAssets || (CoreAssets = {}));
export const dockerTemplatesFolder = 'docker-templates';
export var DockerTemplatesFolders;
(function (DockerTemplatesFolders) {
    DockerTemplatesFolders["ANGULAR_APP_NODE"] = "angular-app-node";
    DockerTemplatesFolders["ANGULAR_APP_SSR_NODE"] = "angular-app-ssr-node";
    DockerTemplatesFolders["BACKEND_APP_NODE"] = "backend-app-node";
    DockerTemplatesFolders["DATABASE_MYSQL"] = "database-mysql";
})(DockerTemplatesFolders || (DockerTemplatesFolders = {}));
export var CoreNgTemplateFiles;
(function (CoreNgTemplateFiles) {
    CoreNgTemplateFiles["sqlJSLoaderTs"] = "sqljs-loader.ts";
    CoreNgTemplateFiles["SERVER_TS"] = "server.ts";
    CoreNgTemplateFiles["JEST_CONFIG_JS"] = "jest.config.js";
    CoreNgTemplateFiles["SETUP_JEST_TS"] = "setupJest.ts";
    CoreNgTemplateFiles["JEST_GLOBAL_MOCKS_TS"] = "jestGlobalMocks.ts";
    CoreNgTemplateFiles["NG_PACKAGE_JSON"] = "ng-package.json";
    CoreNgTemplateFiles["PACKAGE_JSON"] = "package.json";
    CoreNgTemplateFiles["ANGULAR_JSON"] = "angular.json";
    CoreNgTemplateFiles["INDEX_HTML_NG_APP"] = "index.html";
    CoreNgTemplateFiles["FAVICON_ICO"] = "favicon.ico";
    CoreNgTemplateFiles["WEBMANIFEST_JSON"] = "manifest.webmanifest";
})(CoreNgTemplateFiles || (CoreNgTemplateFiles = {}));
export var TaonGeneratedFiles;
(function (TaonGeneratedFiles) {
    TaonGeneratedFiles["BUILD_INFO_MD"] = "BUILD-INFO.md";
    TaonGeneratedFiles["BUILD_STATUS_MD"] = "BUILD-STATUS.md";
    TaonGeneratedFiles["build_info_generated_ts"] = "build-info._auto-generated_.ts";
    TaonGeneratedFiles["index_generated_ts"] = "index._auto-generated_.ts";
    TaonGeneratedFiles["BUILD_INFO_AUTO_GENERATED_JS"] = "build-info._auto-generated_.js";
    TaonGeneratedFiles["MIGRATIONS_INFO_MD"] = "migrations-info.md";
    TaonGeneratedFiles["MOCHA_TESTS_INFO_MD"] = "mocha-tests-info.md";
    TaonGeneratedFiles["SHARED_FOLDER_INFO_TXT"] = "shared_folder_info.txt";
    TaonGeneratedFiles["APP_HOSTS_TS"] = "app.hosts.ts";
    TaonGeneratedFiles["LAUNCH_JSON"] = "launch.json";
    TaonGeneratedFiles["LAUNCH_BACKUP_JSON"] = "launch-backup.json";
    TaonGeneratedFiles["VARS_SCSS"] = "vars.scss";
    TaonGeneratedFiles["LIB_INFO_MD"] = "lib-info.md";
    TaonGeneratedFiles["APP_FOLDER_INFO_MD"] = "app-folder-info.md";
})(TaonGeneratedFiles || (TaonGeneratedFiles = {}));
export const DS_Store = '.DS_Store';
export var TaonGeneratedFolders;
(function (TaonGeneratedFolders) {
    TaonGeneratedFolders["ENV_FOLDER"] = "env";
    TaonGeneratedFolders["COMPILED"] = "compiled";
})(TaonGeneratedFolders || (TaonGeneratedFolders = {}));
export const splitNamespacesJson = 'split-namespaces.json';
export const reExportJson = 're-export.json';
/**
 * Main project /dist folder
 */
export const nodeModulesMainProject = folderName.node_modules;
export const nodeModulesSubPorject = folderName.node_modules;
/**
 * Main project /dist-nocutsrc folder (d.ts files without code cutting)
 */
export const distNoCutSrcMainProject = `dist-nocutsrc`;
/**
 * Main project /dist folder
 */
export const distMainProject = folderName.dist;
/**
 * Vscode project dist folder
 */
export const distVscodeProj = folderName.dist;
/**
 * Electron project dist folder
 */
export const distElectronProj = folderName.dist;
/**
 * Normal angular app build
 */
export const distFromNgBuild = folderName.dist;
export const distEsm = 'dist-esm';
export const libEsm = 'lib-esm';
/**
 * Dist from sass loader
 */
export const distFromSassLoader = folderName.dist;
export const electronNgProj = 'electron';
export const combinedDocsAllMdFilesFolder = `allmdfiles`;
/**
 * Vscode project dist folder
 */
export const outVscodeProj = folderName.out;
/**
 * Main project /docs folder
 */
export const docsMainProject = folderName.docs;
/**
 * Main project /bin folder
 */
export const binMainProject = folderName.bin;
/**
 * Main project /src folder
 */
export const srcMainProject = folderName.src;
/**
 * src from template proxy project
 */
export const srcNgProxyProject = folderName.src;
/**
 * each taon import ends with /src
 */
export const srcFromTaonImport = folderName.src;
/**
 * each taon import ends with /src
 */
export const srcDtsFromNpmPackage = 'src.d.ts';
export const srcJSFromNpmPackage = 'src.js';
export const myLibFromNgProject = 'my-lib';
export const USE_LIB_ESM_INSTEAD_LIB = true;
export const externalLibsFromNgProject = 'external-libs';
/**
 * projects/my-lib form angular lib template
 */
export const projectsFromNgTemplate = folderName.projects;
/**
 * @deprecated special place in standalone project for projects
 */
export const projectsFromMainProject = folderName.projects;
/**
 * Main project app folder from /src/app folder
 */
export const appFromSrc = folderName.app;
/**
 * Generated app inside angular app (comes from /src/app folder)
 */
export const appFromSrcInsideNgApp = folderName.app;
export const libTypeString = folderName.lib;
export const browserTypeString = folderName.browser;
export const websqlTypeString = folderName.websql;
/**
 * Main project lib folder from /src/lib folder
 */
export const libFromSrc = folderName.lib;
/**
 * Lib from taon import
 */
export const libFromImport = folderName.lib;
/**
 * Lib from dist/lib
 */
export const libFromCompiledDist = folderName.lib;
/**
 * Lib from npm packages
 */
export const libFromNpmPackage = folderName.lib;
/**
 * lib from ng projects
 */
export const libFromNgProject = folderName.lib;
/**
 * Main project tests folder from /src/tests folder
 */
export const testsFromSrc = folderName.tests;
/**
 * Main project assets from /src/assets folder
 */
export const assetsFromSrc = folderName.assets;
/**
 * Assets stored in taon isomorphic npm package with
 */
export const assetsFromNpmLib = folderName.assets;
/**
 * Main project assets from /tmp-*\/src/assets folder
 */
export const assetsFromTempSrc = folderName.assets;
/**
 * Assets from ng template project
 */
export const assetsFromNgProj = folderName.assets;
/**
 * Assets from npm package
 */
export const assetsFromNpmPackage = folderName.assets;
/**
 * Shared from assets from /src/assets/shared folder
 */
export const sharedFromAssets = folderName.shared;
/**
 * Generated folder in assets from /src/assets/generated folder
 */
export const generatedFromAssets = folderName.generated;
/**
 * Generated pwa assets from /src/assets/generated/pwa folder
 */
export const pwaGeneratedFolder = 'pwa';
/**
 * Generated assets-for folder
 */
export const assetsFor = 'assets-for';
/**
 * @deprecated it was probably needed for old container build
 * Folder for all browser libs
 */
export const libs = folderName.libs;
export var BundledFiles;
(function (BundledFiles) {
    BundledFiles["CNAME"] = "CNAME";
    BundledFiles["README_MD"] = "README.md";
    BundledFiles["CLI_README_MD"] = "CLI-README.md";
    BundledFiles["INDEX_HTML"] = "index.html";
})(BundledFiles || (BundledFiles = {}));
export var AngularJsonAppOrElectronTaskName;
(function (AngularJsonAppOrElectronTaskName) {
    AngularJsonAppOrElectronTaskName["developmentSsr"] = "development";
    AngularJsonAppOrElectronTaskName["productionSsr"] = "production";
    AngularJsonAppOrElectronTaskName["developmentStatic"] = "development-static";
    AngularJsonAppOrElectronTaskName["productionStatic"] = "production-static";
})(AngularJsonAppOrElectronTaskName || (AngularJsonAppOrElectronTaskName = {}));
export const AngularJsonAppOrElectronTaskNameResolveFor = (envOptions) => {
    if (envOptions.build.websql || !envOptions.build.ssr) {
        if (!envOptions.build.watch && !!envOptions.release.releaseType) {
            return AngularJsonAppOrElectronTaskName.productionStatic;
        }
        else {
            return AngularJsonAppOrElectronTaskName.developmentStatic;
        }
    }
    else {
        if (!envOptions.build.watch && !!envOptions.release.releaseType) {
            return AngularJsonAppOrElectronTaskName.productionSsr;
        }
        else {
            return AngularJsonAppOrElectronTaskName.developmentSsr;
        }
    }
};
export var AngularJsonLibTaskName;
(function (AngularJsonLibTaskName) {
    AngularJsonLibTaskName["development"] = "development";
    AngularJsonLibTaskName["production"] = "production";
})(AngularJsonLibTaskName || (AngularJsonLibTaskName = {}));
export const AngularJsonLibTaskNameResolveFor = (envOptions) => {
    if (!envOptions.build.watch && !!envOptions.release.releaseType) {
        return AngularJsonLibTaskName.production;
    }
    else {
        return AngularJsonLibTaskName.development;
    }
};
export var BundledDocsFolders;
(function (BundledDocsFolders) {
    BundledDocsFolders["VERSION"] = "version";
})(BundledDocsFolders || (BundledDocsFolders = {}));
export var TaonCommands;
(function (TaonCommands) {
    TaonCommands["NPM_RUN_TSC"] = "npm-run tsc";
    TaonCommands["NPM_RUN_TSCGO"] = "npm-run tsgo";
    TaonCommands["NPM_RUN_NG"] = "npm-run ng";
    TaonCommands["NG"] = "ng";
})(TaonCommands || (TaonCommands = {}));
export const appTsFromSrc = 'app.ts';
export const appAutoGenDocsMd = 'app.auto-gen-docs.md';
export const appAutoGenJs = 'app.auto-gen-ver.js';
export const appJsBackend = 'app.js';
export const appScssFromSrc = 'app.scss';
export const globalScssFromSrc = 'global.scss';
export const ngProjectStylesScss = 'styles.scss';
export const appElectronTsFromSrc = 'app.electron.ts';
export const appVscodeTsFromSrc = 'app.vscode.ts';
export const appVscodeJSFromBuild = 'app.vscode.js';
export var TaonFileExtension;
(function (TaonFileExtension) {
    TaonFileExtension["DOT_WORKER_TS"] = ".worker.ts";
    TaonFileExtension["DOT_CONTEXT_TS"] = ".context.ts";
})(TaonFileExtension || (TaonFileExtension = {}));
/**
 * ng build for library from /src/lib
 */
export const tmpLibsForDist = 'tmp-libs-for-dist';
/**
 * ng build for library from /src/lib (websql code)
 */
export const tmpLibsForDistWebsql = 'tmp-libs-for-dist-websql';
/**
 * normal angular app build
 */
export const tmpAppsForDist = 'tmp-apps-for-dist';
/**
 * websql angular app build
 */
export const tmpAppsForDistWebsql = 'tmp-apps-for-dist-websql';
/**
 * electron angular app build
 */
export const tmpAppsForDistElectron = `tmp-apps-for-dist-electron`;
export const tmpAppsForDistElectronWebsql = `tmp-apps-for-dist-websql-electron`;
/**
 * Dummy auto generated /src/index.ts
 */
export const indexTsFromSrc = fileName.index_ts;
/**
 * Entry point for angular lib from /src/lib/index.ts
 */
export const indexTsFromLibFromSrc = fileName.index_ts;
/**
 * Entry point for scss from /src/index.scss
 */
export const indexScssFromSrc = fileName.index_ts;
/**
 * Index for autogenerated migrations /src/migrations/index.ts
 */
export const indexTsFromMigrationsFromSrc = fileName.index_ts;
/**
 * Entry point for scss from /src/lib/index.scss
 */
export const indexScssFromSrcLib = 'index.scss';
/**
 *
 * @param appForLib if true code is for angular (ng server/build) app build, false for lib ng build
 * @param websql if true websql version
 * @returns relative path to temp browser source folder
 */
export function tempSourceFolder(appForLib, websql, prod = false) {
    if (appForLib && websql) {
        return tmpSrcAppDistWebsql + (prod ? prodSuffix : '');
    }
    if (appForLib && !websql) {
        return tmpSrcAppDist + (prod ? prodSuffix : '');
    }
    if (!appForLib && websql) {
        return tmpSrcDistWebsql + (prod ? prodSuffix : '');
    }
    if (!appForLib && !websql) {
        return tmpSrcDist + (prod ? prodSuffix : '');
    }
} // ok for prod
export const ENV_INJECT_COMMENT = '<!--ENV_INJECT-->';
export const isomorphicPackagesJsonKey = 'isomorphicPackages';
export const browserMainProject = folderName.browser;
export const browserFromCompiledDist = folderName.browser;
export const browserNgBuild = folderName.browser;
export const browserFromImport = folderName.browser;
export const browserNpmPackage = folderName.browser;
export const websqlMainProject = folderName.websql;
export const websqlFromCompiledDist = folderName.websql;
export const websqlFromImport = folderName.websql;
export const websqlNpmPackage = folderName.websql;
export const clientCodeVersionFolder = [browserMainProject, websqlMainProject];
export const notAllowedAsPacakge = [...clientCodeVersionFolder, assetsFromSrc];
export const MESSAGES = {
    SHUT_DOWN_FOLDERS_AND_DEBUGGERS: 'Please shut down your code debugger and any open windows from node_modules and press any key...',
};
export const localReleaseMainProject = 'local_release';
export const dotInstallDate = '.install-date';
export const KV_DATABASE_ONLINE_NAME = 'KV_DATABASE_ONLINE_NAME';
export const dotVscodeMainProject = '.vscode';
export const indexTsInSrcForWorker = `src/index.ts`;
export const wranglerJsonC = `wrangler.jsonc`;
export const packageJsonLockMainProject = fileName.package_lock_json;
export const packageJsonLockSubProject = fileName.package_lock_json;
export const yarnLockMainProject = fileName.yarn_lock;
export const packageJsonMainProject = fileName.package_json;
export const packageJsonSubProject = fileName.package_json;
export const packageJsonNpmLib = fileName.package_json;
export const packageJsonVscodePlugin = fileName.package_json;
export const packageJsonNpmLibAngular = fileName.package_json;
export const packageJsonNgProject = fileName.package_json;
export const packageJsonLibDist = fileName.package_json;
export const tsconfigJsonMainProject = 'tsconfig.json';
export const tsconfigNgProject = 'tsconfig.json';
export const tsconfigSubProject = 'tsconfig.json';
export const tsconfigSpecNgProject = 'tsconfig.spec.json';
// export const tsconfigForUnitTestsNgProject = 'tsconfig.spec-for-unit.json';
export const tsconfigSpecJsonMain = 'tsconfig.spec.json';
/**
 * TODO not used?
 */
export const tsconfigJsonBrowserMainProject = 'tsconfig.browser.json';
export const tsconfigBackendDistJson = 'tsconfig.backend.dist.json';
export const tsconfigBackendEsmDistJson = 'tsconfig.backend-esm.dist.json';
export const tsconfigBackendDistJson_PROD = 'tsconfig.backend.dist.prod.json';
export const tsconfigBackendEsmDistJson_PROD = 'tsconfig.backend-esm.dist.prod.json';
export const tsconfigForSchemaJson = 'tsconfig-for-schema.json';
export const tsconfigJsonIsomorphicMainProject = 'tsconfig.isomorphic.json';
export const dotNpmrcMainProject = fileName._npmrc;
export const dotGitIgnoreMainProject = fileName._gitignore;
export const dotNpmIgnoreMainProject = fileName._npmignore;
export const webpackConfigJsMainProject = 'webpack.config.js';
export const esLintCustomRulesMainProject = 'eslint-rules';
export const esLintConfigJsonMainProject = 'eslint.config.ts';
export const vitestConfigJsonMainProject = 'vitest.config.ts';
export const esLintRuleNoNamespaceReExport = 'eslint-rules/no-namespace-reexport.ts';
export const runJsMainProject = 'run.js';
export const indexDtsMainProject = fileName.index_d_ts;
export const indexDtsNpmPackage = fileName.index_d_ts;
export const indexJSNpmPackage = fileName.index_js;
export const indexJSElectronDist = fileName.index_js;
export const indexProdJs = 'index-prod.js';
export const cliTsFromSrc = 'cli.ts';
export const cliJSNpmPackage = 'cli.js';
export const cliJSMapNpmPackage = 'cli.js.map';
export const cliDtsNpmPackage = 'cli.d.js';
export const indexJsMainProject = fileName.index_js;
export const indexJsMapMainProject = fileName.index_js_map;
export const sourceLinkInNodeModules = folderName.source;
export const taonJsonMainProject = fileName.taon_jsonc;
export const updateVscodePackageJsonJsMainProject = 'update-vscode-package-json.js';
export const VERIFIED_BUILD_DATA = 'VERIFIED-BUILD-DATA.jsonc';
export const routes = TaonTempRoutesFolder;
export const databases = TaonTempDatabasesFolder;
export const dotFileTemplateExt = '.filetemplate';
export const dotEnvFile = '.env';
export const suffixLatest = '-latest';
export const prodSuffix = '-prod';
export const releaseSuffix = '-release';
export const debugSuffix = '--debug';
export const debugBrkSuffix = '--debug-brk';
export const inspectSuffix = '--inspect';
export const inspectBrkSuffix = '--inspect-brk';
export const containerPrefix = 'container-';
export const testEnvironmentsMainProject = folderName.testsEnvironments;
export const ONLY_COPY_ALLOWED = [
    // 'background-worker-process',
    'better-sqlite3',
    '.bin',
    '.install-date',
];
/**
 * to prevent lib error when building with asserts
 */
export const TO_REMOVE_TAG = `/${'TO_REMOVE'
    .split('')
    .map(c => ___NS__times(8, () => c).join(''))
    .join('')}`;
export const ERR_MESSAGE_DEPLOYMENT_NOT_FOUND = 'DEPLOYMENT_NOT_FOUND';
export const migrationsFromLib = folderName.migrations;
export const migration_index_autogenerated_ts = 'migrations_index._auto-generated_.ts';
export const migrationIndexAutogeneratedTsFileRelativeToSrcPath = crossPlatformPath([
    libFromSrc,
    migrationsFromLib,
    migration_index_autogenerated_ts,
]);
export const debugModeTaonLightWeightWatchMode = false;
export const DEBOUCE_takeLeadOfBuildingDebounce = 500;
export const DEBOUNCE_trigerLeadBuilding = 200;
export const DEBOUNCE_notifyLeaderAboutBuildDone = 200;
export const DEBOUNCE_debouceUpdate = 500;
export const OBSERVER_PARALLELS = true;
//# sourceMappingURL=constants.js.map