@intlayer/config 8.4.4 → 8.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/cjs/built.cjs +7 -1
- package/dist/cjs/built.cjs.map +1 -1
- package/dist/cjs/client.cjs +16 -1
- package/dist/cjs/colors.cjs +33 -1
- package/dist/cjs/colors.cjs.map +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs +199 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/configurationSchema.cjs +210 -1
- package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +69 -1
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/index.cjs +28 -1
- package/dist/cjs/configFile/loadConfigurationFile.cjs +30 -1
- package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs +53 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
- package/dist/cjs/defaultValues/build.cjs +35 -1
- package/dist/cjs/defaultValues/build.cjs.map +1 -1
- package/dist/cjs/defaultValues/compiler.cjs +13 -1
- package/dist/cjs/defaultValues/compiler.cjs.map +1 -1
- package/dist/cjs/defaultValues/content.cjs +40 -1
- package/dist/cjs/defaultValues/content.cjs.map +1 -1
- package/dist/cjs/defaultValues/dictionary.cjs +13 -1
- package/dist/cjs/defaultValues/dictionary.cjs.map +1 -1
- package/dist/cjs/defaultValues/editor.cjs +23 -1
- package/dist/cjs/defaultValues/editor.cjs.map +1 -1
- package/dist/cjs/defaultValues/index.cjs +66 -1
- package/dist/cjs/defaultValues/internationalization.cjs +15 -1
- package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
- package/dist/cjs/defaultValues/log.cjs +10 -1
- package/dist/cjs/defaultValues/log.cjs.map +1 -1
- package/dist/cjs/defaultValues/routing.cjs +19 -1
- package/dist/cjs/defaultValues/routing.cjs.map +1 -1
- package/dist/cjs/defaultValues/system.cjs +29 -1
- package/dist/cjs/defaultValues/system.cjs.map +1 -1
- package/dist/cjs/loadEnvFile.cjs +31 -1
- package/dist/cjs/loadEnvFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/bundleFile.cjs +71 -1
- package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/bundleJSFile.cjs +33 -1
- package/dist/cjs/loadExternalFile/bundleJSFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/index.cjs +17 -1
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs +77 -1
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/parseFileContent.cjs +77 -1
- package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +67 -1
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
- package/dist/cjs/logger.cjs +133 -1
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/node.cjs +28 -1
- package/dist/cjs/utils/ESMxCJSHelpers.cjs +27 -1
- package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
- package/dist/cjs/utils/alias.cjs +29 -1
- package/dist/cjs/utils/alias.cjs.map +1 -1
- package/dist/cjs/utils/cacheDisk.cjs +173 -1
- package/dist/cjs/utils/cacheDisk.cjs.map +1 -1
- package/dist/cjs/utils/cacheMemory.cjs +269 -1
- package/dist/cjs/utils/cacheMemory.cjs.map +1 -1
- package/dist/cjs/utils/clearModuleCache.cjs +26 -1
- package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
- package/dist/cjs/utils/compareVersions.cjs +38 -1
- package/dist/cjs/utils/compareVersions.cjs.map +1 -1
- package/dist/cjs/utils/extractErrorMessage.cjs +95 -1
- package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
- package/dist/cjs/utils/getExtension.cjs +14 -1
- package/dist/cjs/utils/getExtension.cjs.map +1 -1
- package/dist/cjs/utils/getPackageJsonPath.cjs +33 -1
- package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +45 -1
- package/dist/cjs/utils/logStack.cjs +17 -1
- package/dist/cjs/utils/logStack.cjs.map +1 -1
- package/dist/cjs/utils/normalizePath.cjs +17 -1
- package/dist/cjs/utils/normalizePath.cjs.map +1 -1
- package/dist/cjs/utils/parseFilePathPattern.cjs +24 -1
- package/dist/cjs/utils/parseFilePathPattern.cjs.map +1 -1
- package/dist/cjs/utils/retryManager.cjs +45 -1
- package/dist/cjs/utils/retryManager.cjs.map +1 -1
- package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs +13 -1
- package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs.map +1 -1
- package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs +16 -1
- package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs.map +1 -1
- package/dist/cjs/utils/stringFormatter/index.cjs +10 -1
- package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs +14 -1
- package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs.map +1 -1
- package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs +19 -1
- package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs.map +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
- package/dist/esm/built.mjs +7 -1
- package/dist/esm/built.mjs.map +1 -1
- package/dist/esm/client.mjs +9 -1
- package/dist/esm/colors.mjs +18 -1
- package/dist/esm/colors.mjs.map +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs +197 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/configurationSchema.mjs +191 -1
- package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +66 -1
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/index.mjs +6 -1
- package/dist/esm/configFile/loadConfigurationFile.mjs +29 -1
- package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs +50 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
- package/dist/esm/defaultValues/build.mjs +28 -1
- package/dist/esm/defaultValues/build.mjs.map +1 -1
- package/dist/esm/defaultValues/compiler.mjs +8 -1
- package/dist/esm/defaultValues/compiler.mjs.map +1 -1
- package/dist/esm/defaultValues/content.mjs +32 -1
- package/dist/esm/defaultValues/content.mjs.map +1 -1
- package/dist/esm/defaultValues/dictionary.mjs +8 -1
- package/dist/esm/defaultValues/dictionary.mjs.map +1 -1
- package/dist/esm/defaultValues/editor.mjs +13 -1
- package/dist/esm/defaultValues/editor.mjs.map +1 -1
- package/dist/esm/defaultValues/index.mjs +11 -1
- package/dist/esm/defaultValues/internationalization.mjs +10 -1
- package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
- package/dist/esm/defaultValues/log.mjs +8 -1
- package/dist/esm/defaultValues/log.mjs.map +1 -1
- package/dist/esm/defaultValues/routing.mjs +11 -1
- package/dist/esm/defaultValues/routing.mjs.map +1 -1
- package/dist/esm/defaultValues/system.mjs +16 -1
- package/dist/esm/defaultValues/system.mjs.map +1 -1
- package/dist/esm/loadEnvFile.mjs +27 -1
- package/dist/esm/loadEnvFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/bundleFile.mjs +67 -1
- package/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/bundleJSFile.mjs +31 -1
- package/dist/esm/loadExternalFile/bundleJSFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/index.mjs +7 -1
- package/dist/esm/loadExternalFile/loadExternalFile.mjs +73 -1
- package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/parseFileContent.mjs +73 -1
- package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -1
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +64 -1
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
- package/dist/esm/logger.mjs +118 -1
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/node.mjs +6 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs +25 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -0
- package/dist/esm/utils/alias.mjs +27 -1
- package/dist/esm/utils/alias.mjs.map +1 -1
- package/dist/esm/utils/cacheDisk.mjs +170 -1
- package/dist/esm/utils/cacheDisk.mjs.map +1 -1
- package/dist/esm/utils/cacheMemory.mjs +261 -1
- package/dist/esm/utils/cacheMemory.mjs.map +1 -1
- package/dist/esm/utils/clearModuleCache.mjs +25 -1
- package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
- package/dist/esm/utils/compareVersions.mjs +36 -1
- package/dist/esm/utils/compareVersions.mjs.map +1 -1
- package/dist/esm/utils/extractErrorMessage.mjs +93 -1
- package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
- package/dist/esm/utils/getExtension.mjs +12 -1
- package/dist/esm/utils/getExtension.mjs.map +1 -1
- package/dist/esm/utils/getPackageJsonPath.mjs +31 -1
- package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +19 -1
- package/dist/esm/utils/logStack.mjs +16 -1
- package/dist/esm/utils/logStack.mjs.map +1 -1
- package/dist/esm/utils/normalizePath.mjs +15 -1
- package/dist/esm/utils/normalizePath.mjs.map +1 -1
- package/dist/esm/utils/parseFilePathPattern.mjs +21 -1
- package/dist/esm/utils/parseFilePathPattern.mjs.map +1 -1
- package/dist/esm/utils/retryManager.mjs +44 -1
- package/dist/esm/utils/retryManager.mjs.map +1 -1
- package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs +11 -1
- package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs.map +1 -1
- package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs +14 -1
- package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs.map +1 -1
- package/dist/esm/utils/stringFormatter/index.mjs +6 -1
- package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs +12 -1
- package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs.map +1 -1
- package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs +17 -1
- package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs.map +1 -1
- package/dist/types/client.d.ts +4 -4
- package/dist/types/colors.d.ts +20 -2
- package/dist/types/colors.d.ts.map +1 -0
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/configurationSchema.d.ts +10 -10
- package/dist/types/configFile/getConfiguration.d.ts +2 -2
- package/dist/types/configFile/loadConfigurationFile.d.ts +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
- package/dist/types/loadEnvFile.d.ts +10 -2
- package/dist/types/loadEnvFile.d.ts.map +1 -0
- package/dist/types/loadExternalFile/index.d.ts +3 -3
- package/dist/types/loadExternalFile/loadExternalFile.d.ts +25 -2
- package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -0
- package/dist/types/loadExternalFile/parseFileContent.d.ts +29 -2
- package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -0
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +19 -2
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +1 -0
- package/dist/types/logger.d.ts +4 -4
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +4 -4
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts +9 -2
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts.map +1 -0
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts +9 -2
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts.map +1 -0
- package/dist/types/utils/stringFormatter/index.d.ts +4 -4
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts +5 -2
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts.map +1 -0
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts +10 -2
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
- package/dist/esm/ESMxCJSHelpers-BAuqwNXV.mjs +0 -2
- package/dist/esm/ESMxCJSHelpers-BAuqwNXV.mjs.map +0 -1
- package/dist/types/camelCaseToKebabCase-BV_lLJHR.d.ts +0 -9
- package/dist/types/camelCaseToKebabCase-BV_lLJHR.d.ts.map +0 -1
- package/dist/types/camelCaseToSentence-DAbbkwe6.d.ts +0 -9
- package/dist/types/camelCaseToSentence-DAbbkwe6.d.ts.map +0 -1
- package/dist/types/colors-BbZeGWYU.d.ts +0 -20
- package/dist/types/colors-BbZeGWYU.d.ts.map +0 -1
- package/dist/types/kebabCaseToCamelCase-h9PkNVuO.d.ts +0 -5
- package/dist/types/kebabCaseToCamelCase-h9PkNVuO.d.ts.map +0 -1
- package/dist/types/loadEnvFile-BiTBX4fe.d.ts +0 -10
- package/dist/types/loadEnvFile-BiTBX4fe.d.ts.map +0 -1
- package/dist/types/loadExternalFile-DmM_TGcA.d.ts +0 -25
- package/dist/types/loadExternalFile-DmM_TGcA.d.ts.map +0 -1
- package/dist/types/parseFileContent--o_QlW5j.d.ts +0 -29
- package/dist/types/parseFileContent--o_QlW5j.d.ts.map +0 -1
- package/dist/types/toLowerCamelCase-DUdT00I1.d.ts +0 -10
- package/dist/types/toLowerCamelCase-DUdT00I1.d.ts.map +0 -1
- package/dist/types/transpileTSToCJS-OifpV3zk.d.ts +0 -19
- package/dist/types/transpileTSToCJS-OifpV3zk.d.ts.map +0 -1
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import{cacheMemory
|
|
1
|
+
import { cacheMemory } from "./cacheMemory.mjs";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/getPackageJsonPath.ts
|
|
6
|
+
const MAX_LEVELS = 15;
|
|
7
|
+
const getPackageJsonPath = (startDir = process.cwd()) => {
|
|
8
|
+
const checkedCache = cacheMemory.get("packageJsonPath", startDir);
|
|
9
|
+
if (checkedCache) return checkedCache;
|
|
10
|
+
let currentDir = startDir;
|
|
11
|
+
for (let level = 0; level < MAX_LEVELS; level++) {
|
|
12
|
+
const packageJsonPath = join(currentDir, "package.json");
|
|
13
|
+
if (existsSync(packageJsonPath)) {
|
|
14
|
+
cacheMemory.set("packageJsonPath", startDir, {
|
|
15
|
+
packageJsonPath,
|
|
16
|
+
baseDir: currentDir
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
packageJsonPath,
|
|
20
|
+
baseDir: currentDir
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const parentDir = dirname(currentDir);
|
|
24
|
+
if (parentDir === currentDir) break;
|
|
25
|
+
currentDir = parentDir;
|
|
26
|
+
}
|
|
27
|
+
throw new Error(`Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { getPackageJsonPath };
|
|
2
32
|
//# sourceMappingURL=getPackageJsonPath.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPackageJsonPath.mjs","names":[],"sources":["../../../src/utils/getPackageJsonPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cacheMemory } from './cacheMemory';\n\nconst MAX_LEVELS = 15;\n\ntype PackageJsonPathCache = {\n packageJsonPath: string;\n baseDir: string;\n};\n\nexport const getPackageJsonPath = (\n startDir: string = process.cwd()\n): PackageJsonPathCache => {\n const checkedCache = cacheMemory.get<PackageJsonPathCache>(\n 'packageJsonPath',\n startDir\n );\n\n if (checkedCache) return checkedCache;\n\n let currentDir = startDir;\n\n for (let level = 0; level < MAX_LEVELS; level++) {\n const packageJsonPath = join(currentDir, 'package.json');\n\n if (existsSync(packageJsonPath)) {\n cacheMemory.set('packageJsonPath', startDir, {\n packageJsonPath,\n baseDir: currentDir,\n });\n\n return { packageJsonPath, baseDir: currentDir };\n }\n\n const parentDir = dirname(currentDir);\n\n // If we've reached the root directory, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n throw new Error(\n `Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getPackageJsonPath.mjs","names":[],"sources":["../../../src/utils/getPackageJsonPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cacheMemory } from './cacheMemory';\n\nconst MAX_LEVELS = 15;\n\ntype PackageJsonPathCache = {\n packageJsonPath: string;\n baseDir: string;\n};\n\nexport const getPackageJsonPath = (\n startDir: string = process.cwd()\n): PackageJsonPathCache => {\n const checkedCache = cacheMemory.get<PackageJsonPathCache>(\n 'packageJsonPath',\n startDir\n );\n\n if (checkedCache) return checkedCache;\n\n let currentDir = startDir;\n\n for (let level = 0; level < MAX_LEVELS; level++) {\n const packageJsonPath = join(currentDir, 'package.json');\n\n if (existsSync(packageJsonPath)) {\n cacheMemory.set('packageJsonPath', startDir, {\n packageJsonPath,\n baseDir: currentDir,\n });\n\n return { packageJsonPath, baseDir: currentDir };\n }\n\n const parentDir = dirname(currentDir);\n\n // If we've reached the root directory, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n throw new Error(\n `Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`\n );\n};\n"],"mappings":";;;;;AAIA,MAAM,aAAa;AAOnB,MAAa,sBACX,WAAmB,QAAQ,KAAK,KACP;CACzB,MAAM,eAAe,YAAY,IAC/B,mBACA,SACD;AAED,KAAI,aAAc,QAAO;CAEzB,IAAI,aAAa;AAEjB,MAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,SAAS;EAC/C,MAAM,kBAAkB,KAAK,YAAY,eAAe;AAExD,MAAI,WAAW,gBAAgB,EAAE;AAC/B,eAAY,IAAI,mBAAmB,UAAU;IAC3C;IACA,SAAS;IACV,CAAC;AAEF,UAAO;IAAE;IAAiB,SAAS;IAAY;;EAGjD,MAAM,YAAY,QAAQ,WAAW;AAGrC,MAAI,cAAc,WAChB;AAGF,eAAa;;AAGf,OAAM,IAAI,MACR,kEAAkE,WAAW,sCAAsC,WACpH"}
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getExtension } from "./getExtension.mjs";
|
|
2
|
+
import { normalizePath } from "./normalizePath.mjs";
|
|
3
|
+
import { getAlias } from "./alias.mjs";
|
|
4
|
+
import { cacheMemory, clearAllCache, clearCache, computeKeyId, getCache, setCache, stableStringify } from "./cacheMemory.mjs";
|
|
5
|
+
import { cacheDisk } from "./cacheDisk.mjs";
|
|
6
|
+
import { getPackageJsonPath } from "./getPackageJsonPath.mjs";
|
|
7
|
+
import { configESMxCJSRequire, getProjectRequire, isESModule } from "./ESMxCJSHelpers.mjs";
|
|
8
|
+
import { clearModuleCache } from "./clearModuleCache.mjs";
|
|
9
|
+
import { compareVersions } from "./compareVersions.mjs";
|
|
10
|
+
import { extractErrorMessage } from "./extractErrorMessage.mjs";
|
|
11
|
+
import { logStack } from "./logStack.mjs";
|
|
12
|
+
import { parseFilePathPattern, parseStringPattern } from "./parseFilePathPattern.mjs";
|
|
13
|
+
import { retryManager } from "./retryManager.mjs";
|
|
14
|
+
import { camelCaseToKebabCase } from "./stringFormatter/camelCaseToKebabCase.mjs";
|
|
15
|
+
import { camelCaseToSentence } from "./stringFormatter/camelCaseToSentence.mjs";
|
|
16
|
+
import { kebabCaseToCamelCase } from "./stringFormatter/kebabCaseToCamelCase.mjs";
|
|
17
|
+
import { toLowerCamelCase } from "./stringFormatter/toLowerCamelCase.mjs";
|
|
18
|
+
|
|
19
|
+
export { cacheDisk, cacheMemory, camelCaseToKebabCase, camelCaseToSentence, clearAllCache, clearCache, clearModuleCache, compareVersions, computeKeyId, configESMxCJSRequire, extractErrorMessage, getAlias, getCache, getExtension, getPackageJsonPath, getProjectRequire, isESModule, kebabCaseToCamelCase, logStack, normalizePath, parseFilePathPattern, parseStringPattern, retryManager, setCache, stableStringify, toLowerCamelCase };
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import{BLUE
|
|
1
|
+
import { BLUE, YELLOW } from "../colors.mjs";
|
|
2
|
+
import { colorize } from "../logger.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/logStack.ts
|
|
5
|
+
const logStack = (message, options = { limit: 50 }) => {
|
|
6
|
+
Error.stackTraceLimit = options.limit;
|
|
7
|
+
try {
|
|
8
|
+
throw new Error("test");
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.log(colorize(message, YELLOW));
|
|
11
|
+
console.log(colorize(error.stack ?? "", BLUE));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { logStack };
|
|
2
17
|
//# sourceMappingURL=logStack.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logStack.mjs","names":["ANSIColors.YELLOW","ANSIColors.BLUE"],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":["import * as ANSIColors from '../colors';\nimport { colorize } from '../logger';\n\nexport const logStack = (\n message: string,\n options: { limit: number } = { limit: 50 }\n) => {\n Error.stackTraceLimit = options.limit;\n\n try {\n throw new Error('test');\n } catch (error) {\n console.log(colorize(message, ANSIColors.YELLOW));\n console.log(colorize((error as Error).stack ?? '', ANSIColors.BLUE));\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logStack.mjs","names":["ANSIColors.YELLOW","ANSIColors.BLUE"],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":["import * as ANSIColors from '../colors';\nimport { colorize } from '../logger';\n\nexport const logStack = (\n message: string,\n options: { limit: number } = { limit: 50 }\n) => {\n Error.stackTraceLimit = options.limit;\n\n try {\n throw new Error('test');\n } catch (error) {\n console.log(colorize(message, ANSIColors.YELLOW));\n console.log(colorize((error as Error).stack ?? '', ANSIColors.BLUE));\n }\n};\n"],"mappings":";;;;AAGA,MAAa,YACX,SACA,UAA6B,EAAE,OAAO,IAAI,KACvC;AACH,OAAM,kBAAkB,QAAQ;AAEhC,KAAI;AACF,QAAM,IAAI,MAAM,OAAO;UAChB,OAAO;AACd,UAAQ,IAAI,SAAS,SAASA,OAAkB,CAAC;AACjD,UAAQ,IAAI,SAAU,MAAgB,SAAS,IAAIC,KAAgB,CAAC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/normalizePath.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a path for glob by replacing backslashes with forward slashes
|
|
4
|
+
*
|
|
5
|
+
* Utils for Windows compatibility, as Glob pattern as `**\\*.js` is not supported
|
|
6
|
+
*
|
|
7
|
+
* C:\\Users\\John\\Desktop\\test.txt -> C:/Users/John/Desktop/test.txt
|
|
8
|
+
*
|
|
9
|
+
* @param path - The path to normalize
|
|
10
|
+
* @returns The normalized path
|
|
11
|
+
*/
|
|
12
|
+
const normalizePath = (path) => path.replace(/\\/g, "/");
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { normalizePath };
|
|
2
16
|
//# sourceMappingURL=normalizePath.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePath.mjs","names":[],"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":["/**\n * Normalize a path for glob by replacing backslashes with forward slashes\n *\n * Utils for Windows compatibility, as Glob pattern as `**\\\\*.js` is not supported\n *\n * C:\\\\Users\\\\John\\\\Desktop\\\\test.txt -> C:/Users/John/Desktop/test.txt\n *\n * @param path - The path to normalize\n * @returns The normalized path\n */\nexport const normalizePath = (path: string): string => path.replace(/\\\\/g, '/');\n"],"mappings":"AAUA,MAAa,
|
|
1
|
+
{"version":3,"file":"normalizePath.mjs","names":[],"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":["/**\n * Normalize a path for glob by replacing backslashes with forward slashes\n *\n * Utils for Windows compatibility, as Glob pattern as `**\\\\*.js` is not supported\n *\n * C:\\\\Users\\\\John\\\\Desktop\\\\test.txt -> C:/Users/John/Desktop/test.txt\n *\n * @param path - The path to normalize\n * @returns The normalized path\n */\nexport const normalizePath = (path: string): string => path.replace(/\\\\/g, '/');\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,iBAAiB,SAAyB,KAAK,QAAQ,OAAO,IAAI"}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/parseFilePathPattern.ts
|
|
2
|
+
/**
|
|
3
|
+
* Parses a FilePathPattern configuration string or function to a final string path.
|
|
4
|
+
* Resolves context variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`.
|
|
5
|
+
*/
|
|
6
|
+
const parseFilePathPattern = async (pattern, context) => {
|
|
7
|
+
if (typeof pattern === "function") return await pattern(context);
|
|
8
|
+
if (typeof pattern === "object" && pattern !== null && context.locale) {
|
|
9
|
+
const localePattern = pattern[context.locale];
|
|
10
|
+
if (localePattern) {
|
|
11
|
+
if (typeof localePattern === "function") return await localePattern(context);
|
|
12
|
+
return parseStringPattern(localePattern, context);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (typeof pattern === "string") return parseStringPattern(pattern, context);
|
|
16
|
+
return "";
|
|
17
|
+
};
|
|
18
|
+
const parseStringPattern = (pattern, context) => pattern.replaceAll(/\{\{\s*locale\s*\}\}/g, context.locale ?? "").replaceAll(/\{\{\s*key\s*\}\}/g, context.key ?? "").replaceAll(/\{\{\s*fileName\s*\}\}/g, context.fileName ?? "").replaceAll(/\{\{\s*extension\s*\}\}/g, context.extension ?? "").replaceAll(/\{\{\s*componentFileName\s*\}\}/g, context.componentFileName ?? "").replaceAll(/\{\{\s*componentExtension\s*\}\}/g, context.componentExtension ?? "").replaceAll(/\{\{\s*format\s*\}\}/g, context.format ?? "").replaceAll(/\{\{\s*componentFormat\s*\}\}/g, context.componentFormat ?? "").replaceAll(/\{\{\s*componentDirPath\s*\}\}/g, context.componentDirPath ?? "");
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { parseFilePathPattern, parseStringPattern };
|
|
2
22
|
//# sourceMappingURL=parseFilePathPattern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseFilePathPattern.mjs","names":[],"sources":["../../../src/utils/parseFilePathPattern.ts"],"sourcesContent":["import type {\n FilePathPattern,\n FilePathPatternContext,\n} from '@intlayer/types/filePathPattern';\n\n/**\n * Parses a FilePathPattern configuration string or function to a final string path.\n * Resolves context variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`.\n */\nexport const parseFilePathPattern = async (\n pattern: FilePathPattern,\n context: FilePathPatternContext\n): Promise<string> => {\n if (typeof pattern === 'function') {\n return await (pattern as any)(context);\n }\n\n if (typeof pattern === 'object' && pattern !== null && context.locale) {\n const localePattern = (pattern as any)[context.locale];\n\n if (localePattern) {\n if (typeof localePattern === 'function') {\n return await localePattern(context);\n }\n return parseStringPattern(localePattern, context);\n }\n }\n\n if (typeof pattern === 'string') {\n return parseStringPattern(pattern, context);\n }\n\n return '';\n};\n\nexport const parseStringPattern = (\n pattern: string,\n context: FilePathPatternContext\n): string =>\n pattern\n .replaceAll(/\\{\\{\\s*locale\\s*\\}\\}/g, context.locale ?? '')\n .replaceAll(/\\{\\{\\s*key\\s*\\}\\}/g, context.key ?? '')\n .replaceAll(/\\{\\{\\s*fileName\\s*\\}\\}/g, context.fileName ?? '')\n .replaceAll(/\\{\\{\\s*extension\\s*\\}\\}/g, context.extension ?? '')\n .replaceAll(\n /\\{\\{\\s*componentFileName\\s*\\}\\}/g,\n context.componentFileName ?? ''\n )\n .replaceAll(\n /\\{\\{\\s*componentExtension\\s*\\}\\}/g,\n context.componentExtension ?? ''\n )\n .replaceAll(/\\{\\{\\s*format\\s*\\}\\}/g, context.format ?? '')\n .replaceAll(/\\{\\{\\s*componentFormat\\s*\\}\\}/g, context.componentFormat ?? '')\n .replaceAll(\n /\\{\\{\\s*componentDirPath\\s*\\}\\}/g,\n context.componentDirPath ?? ''\n );\n"],"mappings":"AASA,MAAa,
|
|
1
|
+
{"version":3,"file":"parseFilePathPattern.mjs","names":[],"sources":["../../../src/utils/parseFilePathPattern.ts"],"sourcesContent":["import type {\n FilePathPattern,\n FilePathPatternContext,\n} from '@intlayer/types/filePathPattern';\n\n/**\n * Parses a FilePathPattern configuration string or function to a final string path.\n * Resolves context variables like `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`.\n */\nexport const parseFilePathPattern = async (\n pattern: FilePathPattern,\n context: FilePathPatternContext\n): Promise<string> => {\n if (typeof pattern === 'function') {\n return await (pattern as any)(context);\n }\n\n if (typeof pattern === 'object' && pattern !== null && context.locale) {\n const localePattern = (pattern as any)[context.locale];\n\n if (localePattern) {\n if (typeof localePattern === 'function') {\n return await localePattern(context);\n }\n return parseStringPattern(localePattern, context);\n }\n }\n\n if (typeof pattern === 'string') {\n return parseStringPattern(pattern, context);\n }\n\n return '';\n};\n\nexport const parseStringPattern = (\n pattern: string,\n context: FilePathPatternContext\n): string =>\n pattern\n .replaceAll(/\\{\\{\\s*locale\\s*\\}\\}/g, context.locale ?? '')\n .replaceAll(/\\{\\{\\s*key\\s*\\}\\}/g, context.key ?? '')\n .replaceAll(/\\{\\{\\s*fileName\\s*\\}\\}/g, context.fileName ?? '')\n .replaceAll(/\\{\\{\\s*extension\\s*\\}\\}/g, context.extension ?? '')\n .replaceAll(\n /\\{\\{\\s*componentFileName\\s*\\}\\}/g,\n context.componentFileName ?? ''\n )\n .replaceAll(\n /\\{\\{\\s*componentExtension\\s*\\}\\}/g,\n context.componentExtension ?? ''\n )\n .replaceAll(/\\{\\{\\s*format\\s*\\}\\}/g, context.format ?? '')\n .replaceAll(/\\{\\{\\s*componentFormat\\s*\\}\\}/g, context.componentFormat ?? '')\n .replaceAll(\n /\\{\\{\\s*componentDirPath\\s*\\}\\}/g,\n context.componentDirPath ?? ''\n );\n"],"mappings":";;;;;AASA,MAAa,uBAAuB,OAClC,SACA,YACoB;AACpB,KAAI,OAAO,YAAY,WACrB,QAAO,MAAO,QAAgB,QAAQ;AAGxC,KAAI,OAAO,YAAY,YAAY,YAAY,QAAQ,QAAQ,QAAQ;EACrE,MAAM,gBAAiB,QAAgB,QAAQ;AAE/C,MAAI,eAAe;AACjB,OAAI,OAAO,kBAAkB,WAC3B,QAAO,MAAM,cAAc,QAAQ;AAErC,UAAO,mBAAmB,eAAe,QAAQ;;;AAIrD,KAAI,OAAO,YAAY,SACrB,QAAO,mBAAmB,SAAS,QAAQ;AAG7C,QAAO;;AAGT,MAAa,sBACX,SACA,YAEA,QACG,WAAW,yBAAyB,QAAQ,UAAU,GAAG,CACzD,WAAW,sBAAsB,QAAQ,OAAO,GAAG,CACnD,WAAW,2BAA2B,QAAQ,YAAY,GAAG,CAC7D,WAAW,4BAA4B,QAAQ,aAAa,GAAG,CAC/D,WACC,oCACA,QAAQ,qBAAqB,GAC9B,CACA,WACC,qCACA,QAAQ,sBAAsB,GAC/B,CACA,WAAW,yBAAyB,QAAQ,UAAU,GAAG,CACzD,WAAW,kCAAkC,QAAQ,mBAAmB,GAAG,CAC3E,WACC,mCACA,QAAQ,oBAAoB,GAC7B"}
|
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
import{extractErrorMessage
|
|
1
|
+
import { extractErrorMessage } from "./extractErrorMessage.mjs";
|
|
2
|
+
import { logger } from "../logger.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/retryManager.ts
|
|
5
|
+
const DEFAULT_MAX_RETRY = 3;
|
|
6
|
+
const DEFAULT_DELAY = 0;
|
|
7
|
+
/**
|
|
8
|
+
* Wrap an async function `fn` so it’s retried on failure.
|
|
9
|
+
*
|
|
10
|
+
* @param fn The async function to wrap
|
|
11
|
+
* @param options { maxRetry, delay }
|
|
12
|
+
* @returns A new function with the same signature as `fn`
|
|
13
|
+
*/
|
|
14
|
+
const retryManager = (fn, { maxRetry = DEFAULT_MAX_RETRY, delay = DEFAULT_DELAY, onError, onMaxTryReached } = {}) => async (...args) => {
|
|
15
|
+
let lastError;
|
|
16
|
+
for (let attempt = 0; attempt <= maxRetry; attempt++) try {
|
|
17
|
+
return await fn(...args);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
lastError = err;
|
|
20
|
+
const error = extractErrorMessage(err);
|
|
21
|
+
if (attempt >= maxRetry) {
|
|
22
|
+
if (onMaxTryReached) {
|
|
23
|
+
onMaxTryReached?.({
|
|
24
|
+
error,
|
|
25
|
+
attempt,
|
|
26
|
+
maxRetry
|
|
27
|
+
});
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
if (onError) onError?.({
|
|
33
|
+
error,
|
|
34
|
+
attempt,
|
|
35
|
+
maxRetry
|
|
36
|
+
});
|
|
37
|
+
else logger(error, { level: "error" });
|
|
38
|
+
if (delay > 0) await new Promise((res) => setTimeout(res, delay));
|
|
39
|
+
}
|
|
40
|
+
throw lastError ?? /* @__PURE__ */ new Error("Unexpected: retry loop completed without result");
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { retryManager };
|
|
2
45
|
//# sourceMappingURL=retryManager.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retryManager.mjs","names":[],"sources":["../../../src/utils/retryManager.ts"],"sourcesContent":["import { logger } from '../logger';\nimport { extractErrorMessage } from './extractErrorMessage';\n\nexport type RetryManagerOptions = {\n /** maximum number of retries before giving up */\n maxRetry?: number;\n /** delay between attempts, in milliseconds */\n delay?: number;\n /** function to call when an error occurs */\n onError?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n /** function to call when the maximum number of retries is reached */\n onMaxTryReached?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n};\n\nconst DEFAULT_MAX_RETRY = 3;\nconst DEFAULT_DELAY = 0;\n\n/**\n * Wrap an async function `fn` so it’s retried on failure.\n *\n * @param fn The async function to wrap\n * @param options { maxRetry, delay }\n * @returns A new function with the same signature as `fn`\n */\nexport const retryManager =\n <Args extends any[], R>(\n fn: (...args: Args) => Promise<R>,\n {\n maxRetry = DEFAULT_MAX_RETRY,\n delay = DEFAULT_DELAY,\n onError,\n onMaxTryReached,\n }: RetryManagerOptions = {}\n ): ((...args: Args) => Promise<R>) =>\n // ───────────────────────────────^ returned wrapper function\n async (...args: Args): Promise<R> => {\n let lastError: unknown;\n\n for (let attempt = 0; attempt <= maxRetry; attempt++) {\n try {\n return await fn(...args);\n } catch (err) {\n lastError = err;\n const error = extractErrorMessage(err);\n\n // If this was the last attempt, handle max retry reached\n if (attempt >= maxRetry) {\n if (onMaxTryReached) {\n onMaxTryReached?.({ error, attempt, maxRetry });\n return null as R;\n }\n\n // Otherwise, throw the error\n throw err;\n }\n\n if (onError) {\n onError?.({ error, attempt, maxRetry });\n } else {\n logger(error, {\n level: 'error',\n });\n }\n\n // Wait before retrying\n if (delay > 0) {\n await new Promise((res) => setTimeout(res, delay));\n }\n }\n }\n\n // This should never be reached, but TypeScript needs it\n throw (\n lastError ?? new Error('Unexpected: retry loop completed without result')\n );\n };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"retryManager.mjs","names":[],"sources":["../../../src/utils/retryManager.ts"],"sourcesContent":["import { logger } from '../logger';\nimport { extractErrorMessage } from './extractErrorMessage';\n\nexport type RetryManagerOptions = {\n /** maximum number of retries before giving up */\n maxRetry?: number;\n /** delay between attempts, in milliseconds */\n delay?: number;\n /** function to call when an error occurs */\n onError?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n /** function to call when the maximum number of retries is reached */\n onMaxTryReached?: (details: {\n error: string;\n attempt: number;\n maxRetry: number;\n }) => void;\n};\n\nconst DEFAULT_MAX_RETRY = 3;\nconst DEFAULT_DELAY = 0;\n\n/**\n * Wrap an async function `fn` so it’s retried on failure.\n *\n * @param fn The async function to wrap\n * @param options { maxRetry, delay }\n * @returns A new function with the same signature as `fn`\n */\nexport const retryManager =\n <Args extends any[], R>(\n fn: (...args: Args) => Promise<R>,\n {\n maxRetry = DEFAULT_MAX_RETRY,\n delay = DEFAULT_DELAY,\n onError,\n onMaxTryReached,\n }: RetryManagerOptions = {}\n ): ((...args: Args) => Promise<R>) =>\n // ───────────────────────────────^ returned wrapper function\n async (...args: Args): Promise<R> => {\n let lastError: unknown;\n\n for (let attempt = 0; attempt <= maxRetry; attempt++) {\n try {\n return await fn(...args);\n } catch (err) {\n lastError = err;\n const error = extractErrorMessage(err);\n\n // If this was the last attempt, handle max retry reached\n if (attempt >= maxRetry) {\n if (onMaxTryReached) {\n onMaxTryReached?.({ error, attempt, maxRetry });\n return null as R;\n }\n\n // Otherwise, throw the error\n throw err;\n }\n\n if (onError) {\n onError?.({ error, attempt, maxRetry });\n } else {\n logger(error, {\n level: 'error',\n });\n }\n\n // Wait before retrying\n if (delay > 0) {\n await new Promise((res) => setTimeout(res, delay));\n }\n }\n }\n\n // This should never be reached, but TypeScript needs it\n throw (\n lastError ?? new Error('Unexpected: retry loop completed without result')\n );\n };\n"],"mappings":";;;;AAsBA,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;;;;;;;;AAStB,MAAa,gBAET,IACA,EACE,WAAW,mBACX,QAAQ,eACR,SACA,oBACuB,EAAE,KAG7B,OAAO,GAAG,SAA2B;CACnC,IAAI;AAEJ,MAAK,IAAI,UAAU,GAAG,WAAW,UAAU,UACzC,KAAI;AACF,SAAO,MAAM,GAAG,GAAG,KAAK;UACjB,KAAK;AACZ,cAAY;EACZ,MAAM,QAAQ,oBAAoB,IAAI;AAGtC,MAAI,WAAW,UAAU;AACvB,OAAI,iBAAiB;AACnB,sBAAkB;KAAE;KAAO;KAAS;KAAU,CAAC;AAC/C,WAAO;;AAIT,SAAM;;AAGR,MAAI,QACF,WAAU;GAAE;GAAO;GAAS;GAAU,CAAC;MAEvC,QAAO,OAAO,EACZ,OAAO,SACR,CAAC;AAIJ,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,QAAQ,WAAW,KAAK,MAAM,CAAC;;AAMxD,OACE,6BAAa,IAAI,MAAM,kDAAkD"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/stringFormatter/camelCaseToKebabCase.ts
|
|
2
|
+
/**
|
|
3
|
+
* Convert a string to kebab-case
|
|
4
|
+
* e.g. "MyNewComponent" => "my-new-component"
|
|
5
|
+
*/
|
|
6
|
+
const camelCaseToKebabCase = (str) => {
|
|
7
|
+
return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { camelCaseToKebabCase };
|
|
2
12
|
//# sourceMappingURL=camelCaseToKebabCase.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camelCaseToKebabCase.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToKebabCase.ts"],"sourcesContent":["/**\n * Convert a string to kebab-case\n * e.g. \"MyNewComponent\" => \"my-new-component\"\n */\nexport const camelCaseToKebabCase = (str: string): string => {\n // Split on transition from lower->upper: \"MyNewComponent\" => [\"My\", \"New\", \"Component\"]\n // Then lowercase each chunk and join by \"-\"\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n};\n"],"mappings":"AAIA,MAAa,
|
|
1
|
+
{"version":3,"file":"camelCaseToKebabCase.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToKebabCase.ts"],"sourcesContent":["/**\n * Convert a string to kebab-case\n * e.g. \"MyNewComponent\" => \"my-new-component\"\n */\nexport const camelCaseToKebabCase = (str: string): string => {\n // Split on transition from lower->upper: \"MyNewComponent\" => [\"My\", \"New\", \"Component\"]\n // Then lowercase each chunk and join by \"-\"\n return str\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n};\n"],"mappings":";;;;;AAIA,MAAa,wBAAwB,QAAwB;AAG3D,QAAO,IACJ,QAAQ,mBAAmB,QAAQ,CACnC,QAAQ,wBAAwB,QAAQ,CACxC,aAAa"}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/stringFormatter/camelCaseToSentence.ts
|
|
2
|
+
/**
|
|
3
|
+
* Convert a string to sentence case
|
|
4
|
+
* e.g. 'my-new-component' → 'My new component'
|
|
5
|
+
*/
|
|
6
|
+
const camelCaseToSentence = (value) => {
|
|
7
|
+
if (!value) return "";
|
|
8
|
+
if (typeof value !== "string") return "";
|
|
9
|
+
const withSpaces = value.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
10
|
+
return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { camelCaseToSentence };
|
|
2
15
|
//# sourceMappingURL=camelCaseToSentence.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camelCaseToSentence.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToSentence.ts"],"sourcesContent":["/**\n * Convert a string to sentence case\n * e.g. 'my-new-component' → 'My new component'\n */\nexport const camelCaseToSentence = (value: string): string => {\n if (!value) return '';\n if (typeof value !== 'string') return '';\n\n // Insert space before all caps that follow lowercase letters\n const withSpaces = value\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n // Insert space between sequences like \"XMLParser\" → \"XML Parser\"\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');\n\n // Lowercase everything except the first character\n return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();\n};\n"],"mappings":"AAIA,MAAa,
|
|
1
|
+
{"version":3,"file":"camelCaseToSentence.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/camelCaseToSentence.ts"],"sourcesContent":["/**\n * Convert a string to sentence case\n * e.g. 'my-new-component' → 'My new component'\n */\nexport const camelCaseToSentence = (value: string): string => {\n if (!value) return '';\n if (typeof value !== 'string') return '';\n\n // Insert space before all caps that follow lowercase letters\n const withSpaces = value\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n // Insert space between sequences like \"XMLParser\" → \"XML Parser\"\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');\n\n // Lowercase everything except the first character\n return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1).toLowerCase();\n};\n"],"mappings":";;;;;AAIA,MAAa,uBAAuB,UAA0B;AAC5D,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,OAAO,UAAU,SAAU,QAAO;CAGtC,MAAM,aAAa,MAChB,QAAQ,mBAAmB,QAAQ,CAEnC,QAAQ,yBAAyB,QAAQ;AAG5C,QAAO,WAAW,OAAO,EAAE,CAAC,aAAa,GAAG,WAAW,MAAM,EAAE,CAAC,aAAa"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { camelCaseToKebabCase } from "./camelCaseToKebabCase.mjs";
|
|
2
|
+
import { camelCaseToSentence } from "./camelCaseToSentence.mjs";
|
|
3
|
+
import { kebabCaseToCamelCase } from "./kebabCaseToCamelCase.mjs";
|
|
4
|
+
import { toLowerCamelCase } from "./toLowerCamelCase.mjs";
|
|
5
|
+
|
|
6
|
+
export { camelCaseToKebabCase, camelCaseToSentence, kebabCaseToCamelCase, toLowerCamelCase };
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/stringFormatter/kebabCaseToCamelCase.ts
|
|
2
|
+
const kebabCaseToCamelCase = (name) => {
|
|
3
|
+
return name.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((word) => {
|
|
4
|
+
const lowerWord = word.toLowerCase();
|
|
5
|
+
let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1);
|
|
6
|
+
capitalized = capitalized.replace(/(\d)([a-z])/g, (_, number, char) => number + char.toUpperCase());
|
|
7
|
+
return capitalized;
|
|
8
|
+
}).join("");
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { kebabCaseToCamelCase };
|
|
2
13
|
//# sourceMappingURL=kebabCaseToCamelCase.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kebabCaseToCamelCase.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/kebabCaseToCamelCase.ts"],"sourcesContent":["export const kebabCaseToCamelCase = (name: string): string => {\n return name\n .split(/[^a-zA-Z0-9]+/) // Split on any non-alphanumeric character\n .filter(Boolean) // Remove any empty strings\n .map((word) => {\n // Convert the entire word to lowercase first\n const lowerWord = word.toLowerCase();\n\n // Capitalize the first character\n let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1);\n\n // Capitalize any letter that follows a number\n capitalized = capitalized.replace(\n /(\\d)([a-z])/g,\n (_, number, char) => number + char.toUpperCase()\n );\n\n return capitalized;\n })\n .join(''); // Concatenate all parts into a single string\n};\n"],"mappings":"AAAA,MAAa,
|
|
1
|
+
{"version":3,"file":"kebabCaseToCamelCase.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/kebabCaseToCamelCase.ts"],"sourcesContent":["export const kebabCaseToCamelCase = (name: string): string => {\n return name\n .split(/[^a-zA-Z0-9]+/) // Split on any non-alphanumeric character\n .filter(Boolean) // Remove any empty strings\n .map((word) => {\n // Convert the entire word to lowercase first\n const lowerWord = word.toLowerCase();\n\n // Capitalize the first character\n let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1);\n\n // Capitalize any letter that follows a number\n capitalized = capitalized.replace(\n /(\\d)([a-z])/g,\n (_, number, char) => number + char.toUpperCase()\n );\n\n return capitalized;\n })\n .join(''); // Concatenate all parts into a single string\n};\n"],"mappings":";AAAA,MAAa,wBAAwB,SAAyB;AAC5D,QAAO,KACJ,MAAM,gBAAgB,CACtB,OAAO,QAAQ,CACf,KAAK,SAAS;EAEb,MAAM,YAAY,KAAK,aAAa;EAGpC,IAAI,cAAc,UAAU,OAAO,EAAE,CAAC,aAAa,GAAG,UAAU,MAAM,EAAE;AAGxE,gBAAc,YAAY,QACxB,iBACC,GAAG,QAAQ,SAAS,SAAS,KAAK,aAAa,CACjD;AAED,SAAO;GACP,CACD,KAAK,GAAG"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/stringFormatter/toLowerCamelCase.ts
|
|
2
|
+
/**
|
|
3
|
+
* Convert a string to lowerCamelCase
|
|
4
|
+
* e.g. "MyComponent" => "myComponent"
|
|
5
|
+
* e.g. "auth-middleware" => "authMiddleware"
|
|
6
|
+
*/
|
|
7
|
+
const toLowerCamelCase = (str) => {
|
|
8
|
+
if (!str) return "";
|
|
9
|
+
if (str.includes("-")) return str.split("-").map((word, index) => {
|
|
10
|
+
if (index === 0) return word.toLowerCase();
|
|
11
|
+
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
12
|
+
}).join("");
|
|
13
|
+
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { toLowerCamelCase };
|
|
2
18
|
//# sourceMappingURL=toLowerCamelCase.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toLowerCamelCase.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/toLowerCamelCase.ts"],"sourcesContent":["/**\n * Convert a string to lowerCamelCase\n * e.g. \"MyComponent\" => \"myComponent\"\n * e.g. \"auth-middleware\" => \"authMiddleware\"\n */\nexport const toLowerCamelCase = (str: string): string => {\n if (!str) {\n return '';\n }\n\n // Handle kebab-case: \"auth-middleware\" => \"authMiddleware\"\n if (str.includes('-')) {\n return str\n .split('-')\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n }\n\n // Handle PascalCase: \"MyComponent\" => \"myComponent\"\n return str.charAt(0).toLowerCase() + str.slice(1);\n};\n"],"mappings":"AAKA,MAAa,
|
|
1
|
+
{"version":3,"file":"toLowerCamelCase.mjs","names":[],"sources":["../../../../src/utils/stringFormatter/toLowerCamelCase.ts"],"sourcesContent":["/**\n * Convert a string to lowerCamelCase\n * e.g. \"MyComponent\" => \"myComponent\"\n * e.g. \"auth-middleware\" => \"authMiddleware\"\n */\nexport const toLowerCamelCase = (str: string): string => {\n if (!str) {\n return '';\n }\n\n // Handle kebab-case: \"auth-middleware\" => \"authMiddleware\"\n if (str.includes('-')) {\n return str\n .split('-')\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n }\n\n // Handle PascalCase: \"MyComponent\" => \"myComponent\"\n return str.charAt(0).toLowerCase() + str.slice(1);\n};\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,QAAwB;AACvD,KAAI,CAAC,IACH,QAAO;AAIT,KAAI,IAAI,SAAS,IAAI,CACnB,QAAO,IACJ,MAAM,IAAI,CACV,KAAK,MAAM,UAAU;AACpB,MAAI,UAAU,EACZ,QAAO,KAAK,aAAa;AAE3B,SAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,aAAa;GACjE,CACD,KAAK,GAAG;AAIb,QAAO,IAAI,OAAO,EAAE,CAAC,aAAa,GAAG,IAAI,MAAM,EAAE"}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { extractErrorMessage } from "./utils/extractErrorMessage.js";
|
|
2
2
|
import { logStack } from "./utils/logStack.js";
|
|
3
3
|
import { normalizePath } from "./utils/normalizePath.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { camelCaseToKebabCase } from "./utils/stringFormatter/camelCaseToKebabCase.js";
|
|
5
|
+
import { camelCaseToSentence } from "./utils/stringFormatter/camelCaseToSentence.js";
|
|
6
|
+
import { kebabCaseToCamelCase } from "./utils/stringFormatter/kebabCaseToCamelCase.js";
|
|
7
|
+
import { toLowerCamelCase } from "./utils/stringFormatter/toLowerCamelCase.js";
|
|
8
8
|
export { camelCaseToKebabCase, camelCaseToSentence, extractErrorMessage, kebabCaseToCamelCase, logStack, normalizePath, toLowerCamelCase };
|
package/dist/types/colors.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
export { BEIGE, BLUE, BOLD, CYAN, GREEN, GREY, GREY_DARK, GREY_LIGHT, MAGENTA, ORANGE, RED, RESET, WHITE, YELLOW };
|
|
1
|
+
declare namespace colors_d_exports {
|
|
2
|
+
export { BEIGE, BLUE, BOLD, CYAN, GREEN, GREY, GREY_DARK, GREY_LIGHT, MAGENTA, ORANGE, RED, RESET, WHITE, YELLOW };
|
|
3
|
+
}
|
|
4
|
+
declare const RESET: "\u001B[0m";
|
|
5
|
+
declare const GREY: "\u001B[90m";
|
|
6
|
+
declare const GREY_DARK: "\u001B[38;5;239m";
|
|
7
|
+
declare const GREY_LIGHT: "\u001B[38;5;252m";
|
|
8
|
+
declare const BLUE: "\u001B[34m";
|
|
9
|
+
declare const RED: "\u001B[31m";
|
|
10
|
+
declare const GREEN: "\u001B[32m";
|
|
11
|
+
declare const YELLOW: "\u001B[38;5;226m";
|
|
12
|
+
declare const MAGENTA: "\u001B[35m";
|
|
13
|
+
declare const BEIGE: "\u001B[38;5;3m";
|
|
14
|
+
declare const ORANGE: "\u001B[38;5;208m";
|
|
15
|
+
declare const CYAN: "\u001B[36m";
|
|
16
|
+
declare const WHITE: "\u001B[37m";
|
|
17
|
+
declare const BOLD: "\u001B[1m";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { BEIGE, BLUE, BOLD, CYAN, GREEN, GREY, GREY_DARK, GREY_LIGHT, MAGENTA, ORANGE, RED, RESET, WHITE, YELLOW, colors_d_exports };
|
|
20
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","names":[],"sources":["../../src/colors.ts"],"mappings":";;;cAAa,KAAA;AAAA,cACA,IAAA;AAAA,cACA,SAAA;AAAA,cACA,UAAA;AAAA,cACA,IAAA;AAAA,cACA,GAAA;AAAA,cACA,KAAA;AAAA,cACA,MAAA;AAAA,cACA,OAAA;AAAA,cACA,KAAA;AAAA,cACA,MAAA;AAAA,cACA,IAAA;AAAA,cACA,KAAA;AAAA,cACA,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"mappings":";;;;;AAq5BA;cAAa,wBAAA,GACX,mBAAA,GAAsB,oBAAA,EACtB,OAAA,WACA,YAAA,GAAe,YAAA,KACd,cAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AiProviders } from "@intlayer/types/config";
|
|
2
|
-
import
|
|
2
|
+
import z from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/configFile/configurationSchema.d.ts
|
|
5
5
|
declare const internationalizationSchema: z.ZodObject<{
|
|
@@ -20,9 +20,9 @@ declare const cookiesAttributesSchema: z.ZodObject<{
|
|
|
20
20
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
21
21
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
22
22
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
none: "none";
|
|
23
24
|
strict: "strict";
|
|
24
25
|
lax: "lax";
|
|
25
|
-
none: "none";
|
|
26
26
|
}>>;
|
|
27
27
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
28
28
|
}, z.core.$strip>;
|
|
@@ -47,9 +47,9 @@ declare const storageSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodEnum
|
|
|
47
47
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
49
49
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
none: "none";
|
|
50
51
|
strict: "strict";
|
|
51
52
|
lax: "lax";
|
|
52
|
-
none: "none";
|
|
53
53
|
}>>;
|
|
54
54
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
55
55
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -72,9 +72,9 @@ declare const storageSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodEnum
|
|
|
72
72
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
73
73
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
74
74
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
none: "none";
|
|
75
76
|
strict: "strict";
|
|
76
77
|
lax: "lax";
|
|
77
|
-
none: "none";
|
|
78
78
|
}>>;
|
|
79
79
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
80
80
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -155,9 +155,9 @@ declare const routingSchema: z.ZodObject<{
|
|
|
155
155
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
156
156
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
157
157
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
158
|
+
none: "none";
|
|
158
159
|
strict: "strict";
|
|
159
160
|
lax: "lax";
|
|
160
|
-
none: "none";
|
|
161
161
|
}>>;
|
|
162
162
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
163
163
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -180,9 +180,9 @@ declare const routingSchema: z.ZodObject<{
|
|
|
180
180
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
181
181
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
182
182
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
183
|
+
none: "none";
|
|
183
184
|
strict: "strict";
|
|
184
185
|
lax: "lax";
|
|
185
|
-
none: "none";
|
|
186
186
|
}>>;
|
|
187
187
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
188
188
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -271,8 +271,8 @@ declare const buildSchema: z.ZodObject<{
|
|
|
271
271
|
}>>;
|
|
272
272
|
traversePattern: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
273
273
|
outputFormat: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
274
|
-
cjs: "cjs";
|
|
275
274
|
esm: "esm";
|
|
275
|
+
cjs: "cjs";
|
|
276
276
|
}>>>;
|
|
277
277
|
cache: z.ZodOptional<z.ZodBoolean>;
|
|
278
278
|
require: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -349,9 +349,9 @@ declare const intlayerConfigSchema: z.ZodObject<{
|
|
|
349
349
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
350
350
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
351
351
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
352
|
+
none: "none";
|
|
352
353
|
strict: "strict";
|
|
353
354
|
lax: "lax";
|
|
354
|
-
none: "none";
|
|
355
355
|
}>>;
|
|
356
356
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
357
357
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -374,9 +374,9 @@ declare const intlayerConfigSchema: z.ZodObject<{
|
|
|
374
374
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
375
375
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
376
376
|
sameSite: z.ZodOptional<z.ZodEnum<{
|
|
377
|
+
none: "none";
|
|
377
378
|
strict: "strict";
|
|
378
379
|
lax: "lax";
|
|
379
|
-
none: "none";
|
|
380
380
|
}>>;
|
|
381
381
|
expires: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodNumber]>>;
|
|
382
382
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -465,8 +465,8 @@ declare const intlayerConfigSchema: z.ZodObject<{
|
|
|
465
465
|
}>>;
|
|
466
466
|
traversePattern: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
467
467
|
outputFormat: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
468
|
-
cjs: "cjs";
|
|
469
468
|
esm: "esm";
|
|
469
|
+
cjs: "cjs";
|
|
470
470
|
}>>>;
|
|
471
471
|
cache: z.ZodOptional<z.ZodBoolean>;
|
|
472
472
|
require: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SandBoxContextOptions } from "../loadExternalFile/parseFileContent.js";
|
|
2
|
+
import { LoadExternalFileOptions } from "../loadExternalFile/loadExternalFile.js";
|
|
3
3
|
import { CustomIntlayerConfig, IntlayerConfig, LogFunctions } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/configFile/getConfiguration.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LoadExternalFileOptions } from "../loadExternalFile/loadExternalFile.js";
|
|
2
2
|
import { CustomIntlayerConfig } from "@intlayer/types/config";
|
|
3
3
|
|
|
4
4
|
//#region src/configFile/loadConfigurationFile.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadConfigurationFile.d.ts","names":[],"sources":["../../../src/configFile/loadConfigurationFile.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadConfigurationFile.d.ts","names":[],"sources":["../../../src/configFile/loadConfigurationFile.ts"],"mappings":";;;;;;AA4BA;;;;cAAa,qBAAA,GACX,cAAA,UACA,OAAA,GAAU,IAAA,CAAK,uBAAA,uBACd,oBAAA"}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/loadEnvFile.d.ts
|
|
2
|
+
type LoadEnvFileOptions = {
|
|
3
|
+
env?: string;
|
|
4
|
+
envFile?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const getEnvFilePath: (env?: string, envFile?: string) => string | undefined;
|
|
7
|
+
declare const loadEnvFile: (options?: Partial<LoadEnvFileOptions>) => {};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { LoadEnvFileOptions, getEnvFilePath, loadEnvFile };
|
|
10
|
+
//# sourceMappingURL=loadEnvFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadEnvFile.d.ts","names":[],"sources":["../../src/loadEnvFile.ts"],"mappings":";KAKY,kBAAA;EACV,GAAA;EACA,OAAA;AAAA;AAAA,cAGW,cAAA,GACX,GAAA,WACA,OAAA;AAAA,cASW,WAAA,GAAe,OAAA,GAAU,OAAA,CAAQ,kBAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { SandBoxContextOptions, getSandBoxContext, parseFileContent } from "./parseFileContent.js";
|
|
2
|
+
import { TranspileOptions, transpileTSToCJS, transpileTSToCJSSync } from "./transpileTSToCJS.js";
|
|
3
|
+
import { LoadExternalFileOptions, loadExternalFile, loadExternalFileSync } from "./loadExternalFile.js";
|
|
4
4
|
import { ESBuildPlugin, bundleFile, bundleFileSync, getLoader } from "./bundleFile.js";
|
|
5
5
|
import { bundleJSFile } from "./bundleJSFile.js";
|
|
6
6
|
export { ESBuildPlugin, LoadExternalFileOptions, SandBoxContextOptions, TranspileOptions, bundleFile, bundleFileSync, bundleJSFile, getLoader, getSandBoxContext, loadExternalFile, loadExternalFileSync, parseFileContent, transpileTSToCJS, transpileTSToCJSSync };
|
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SandBoxContextOptions } from "./parseFileContent.js";
|
|
2
|
+
import { TranspileOptions } from "./transpileTSToCJS.js";
|
|
3
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
|
+
|
|
5
|
+
//#region src/loadExternalFile/loadExternalFile.d.ts
|
|
6
|
+
type LoadExternalFileOptions = {
|
|
7
|
+
configuration?: IntlayerConfig;
|
|
8
|
+
buildOptions?: TranspileOptions;
|
|
9
|
+
logError?: boolean;
|
|
10
|
+
} & SandBoxContextOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Load the content declaration from the given path
|
|
13
|
+
*
|
|
14
|
+
* Accepts JSON, JS, MJS and TS files as configuration
|
|
15
|
+
*/
|
|
16
|
+
declare const loadExternalFileSync: (filePath: string, options?: LoadExternalFileOptions) => any | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Load the content declaration from the given path
|
|
19
|
+
*
|
|
20
|
+
* Accepts JSON, JS, MJS and TS files as configuration
|
|
21
|
+
*/
|
|
22
|
+
declare const loadExternalFile: (filePath: string, options?: LoadExternalFileOptions) => Promise<any | undefined>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { LoadExternalFileOptions, loadExternalFile, loadExternalFileSync };
|
|
25
|
+
//# sourceMappingURL=loadExternalFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadExternalFile.d.ts","names":[],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"mappings":";;;;;KAmBY,uBAAA;EACV,aAAA,GAAgB,cAAA;EAChB,YAAA,GAAe,gBAAA;EACf,QAAA;AAAA,IACE,qBAAA;;;;;;cAOS,oBAAA,GACX,QAAA,UACA,OAAA,GAAU,uBAAA;;;;;;cA4DC,gBAAA,GACX,QAAA,UACA,OAAA,GAAU,uBAAA,KACT,OAAA"}
|