@intlayer/config 8.4.1 → 8.4.3
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/chunk-Bmb41Sf3.cjs +1 -0
- package/dist/cjs/client.cjs +1 -1
- package/dist/cjs/colors.cjs +2 -0
- package/dist/cjs/colors.cjs.map +1 -0
- package/dist/cjs/configFile/buildConfigurationFields.cjs +1 -1
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/configurationSchema.cjs +1 -1
- package/dist/cjs/configFile/configurationSchema.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
- package/dist/cjs/defaultValues/build.cjs +1 -1
- package/dist/cjs/defaultValues/build.cjs.map +1 -1
- package/dist/cjs/defaultValues/compiler.cjs +1 -1
- package/dist/cjs/defaultValues/content.cjs +1 -1
- package/dist/cjs/defaultValues/content.cjs.map +1 -1
- package/dist/cjs/defaultValues/dictionary.cjs +1 -1
- package/dist/cjs/defaultValues/dictionary.cjs.map +1 -1
- package/dist/cjs/defaultValues/editor.cjs +1 -1
- package/dist/cjs/defaultValues/editor.cjs.map +1 -1
- package/dist/cjs/defaultValues/index.cjs +1 -2
- package/dist/cjs/defaultValues/internationalization.cjs +1 -1
- package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
- package/dist/cjs/defaultValues/log.cjs +1 -1
- package/dist/cjs/defaultValues/log.cjs.map +1 -1
- package/dist/cjs/defaultValues/routing.cjs +1 -1
- package/dist/cjs/defaultValues/routing.cjs.map +1 -1
- package/dist/cjs/defaultValues/system.cjs +1 -1
- package/dist/cjs/defaultValues/system.cjs.map +1 -1
- package/dist/cjs/loadEnvFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/bundleFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/bundleJSFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs +1 -1
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/parseFileContent.cjs +1 -1
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +1 -1
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
- package/dist/cjs/logger.cjs +1 -1
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/node.cjs +1 -1
- package/dist/cjs/utils/ESMxCJSHelpers.cjs +1 -1
- package/dist/cjs/utils/alias.cjs +1 -1
- package/dist/cjs/utils/cacheDisk.cjs +1 -1
- package/dist/cjs/utils/cacheMemory.cjs +1 -1
- package/dist/cjs/utils/getPackageJsonPath.cjs +1 -1
- package/dist/cjs/utils/logStack.cjs +1 -1
- package/dist/cjs/utils/logStack.cjs.map +1 -1
- package/dist/cjs/utils/retryManager.cjs +1 -1
- package/dist/esm/ESMxCJSHelpers-BAuqwNXV.mjs +2 -0
- package/dist/esm/ESMxCJSHelpers-BAuqwNXV.mjs.map +1 -0
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/colors.mjs +2 -0
- package/dist/esm/colors.mjs.map +1 -0
- package/dist/esm/configFile/buildConfigurationFields.mjs +1 -1
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/configurationSchema.mjs +1 -1
- package/dist/esm/configFile/configurationSchema.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +1 -1
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/loadConfigurationFile.mjs +1 -1
- package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
- package/dist/esm/defaultValues/build.mjs +1 -1
- package/dist/esm/defaultValues/build.mjs.map +1 -1
- package/dist/esm/defaultValues/compiler.mjs +1 -1
- package/dist/esm/defaultValues/compiler.mjs.map +1 -1
- package/dist/esm/defaultValues/content.mjs +1 -1
- package/dist/esm/defaultValues/content.mjs.map +1 -1
- package/dist/esm/defaultValues/dictionary.mjs +1 -1
- package/dist/esm/defaultValues/dictionary.mjs.map +1 -1
- package/dist/esm/defaultValues/editor.mjs +1 -1
- package/dist/esm/defaultValues/editor.mjs.map +1 -1
- package/dist/esm/defaultValues/index.mjs +1 -2
- package/dist/esm/defaultValues/internationalization.mjs +1 -1
- package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
- package/dist/esm/defaultValues/log.mjs +1 -1
- package/dist/esm/defaultValues/log.mjs.map +1 -1
- package/dist/esm/defaultValues/routing.mjs +1 -1
- package/dist/esm/defaultValues/routing.mjs.map +1 -1
- package/dist/esm/defaultValues/system.mjs +1 -1
- package/dist/esm/defaultValues/system.mjs.map +1 -1
- package/dist/esm/loadExternalFile/loadExternalFile.mjs +1 -1
- package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/parseFileContent.mjs +1 -1
- package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -1
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +1 -1
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
- package/dist/esm/logger.mjs +1 -1
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/node.mjs +1 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs +1 -2
- package/dist/esm/utils/clearModuleCache.mjs +1 -1
- package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/logStack.mjs +1 -1
- package/dist/esm/utils/logStack.mjs.map +1 -1
- package/dist/esm/utils/retryManager.mjs +1 -1
- package/dist/types/{camelCaseToKebabCase-91HKVxf2.d.ts → camelCaseToKebabCase-BV_lLJHR.d.ts} +1 -1
- package/dist/types/camelCaseToKebabCase-BV_lLJHR.d.ts.map +1 -0
- package/dist/types/{camelCaseToSentence-LKuKkD3M.d.ts → camelCaseToSentence-DAbbkwe6.d.ts} +1 -1
- package/dist/types/camelCaseToSentence-DAbbkwe6.d.ts.map +1 -0
- package/dist/types/client.d.ts +5 -6
- package/dist/types/colors-BbZeGWYU.d.ts +20 -0
- package/dist/types/colors-BbZeGWYU.d.ts.map +1 -0
- package/dist/types/colors.d.ts +2 -0
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/configurationSchema.d.ts +0 -6
- package/dist/types/configFile/configurationSchema.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts +3 -1
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
- package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
- package/dist/types/defaultValues/build.d.ts +10 -2
- package/dist/types/defaultValues/build.d.ts.map +1 -0
- package/dist/types/defaultValues/compiler.d.ts +8 -2
- package/dist/types/defaultValues/compiler.d.ts.map +1 -0
- package/dist/types/defaultValues/content.d.ts +11 -2
- package/dist/types/defaultValues/content.d.ts.map +1 -0
- package/dist/types/defaultValues/dictionary.d.ts +10 -2
- package/dist/types/defaultValues/dictionary.d.ts.map +1 -0
- package/dist/types/defaultValues/editor.d.ts +13 -2
- package/dist/types/defaultValues/editor.d.ts.map +1 -0
- package/dist/types/defaultValues/index.d.ts +10 -17
- package/dist/types/defaultValues/internationalization.d.ts +11 -2
- package/dist/types/defaultValues/internationalization.d.ts.map +1 -0
- package/dist/types/defaultValues/log.d.ts +6 -2
- package/dist/types/defaultValues/log.d.ts.map +1 -0
- package/dist/types/defaultValues/routing.d.ts +13 -2
- package/dist/types/defaultValues/routing.d.ts.map +1 -0
- package/dist/types/defaultValues/system.d.ts +16 -2
- package/dist/types/defaultValues/system.d.ts.map +1 -0
- package/dist/types/{kebabCaseToCamelCase-BR4yfbUC.d.ts → kebabCaseToCamelCase-h9PkNVuO.d.ts} +1 -1
- package/dist/types/kebabCaseToCamelCase-h9PkNVuO.d.ts.map +1 -0
- package/dist/types/{loadEnvFile-Dk80Swa9.d.ts → loadEnvFile-BiTBX4fe.d.ts} +1 -1
- package/dist/types/{loadEnvFile-Dk80Swa9.d.ts.map → loadEnvFile-BiTBX4fe.d.ts.map} +1 -1
- package/dist/types/loadEnvFile.d.ts +1 -1
- package/dist/types/loadExternalFile/index.d.ts +4 -4
- package/dist/types/loadExternalFile/loadExternalFile.d.ts +2 -25
- package/dist/types/loadExternalFile/parseFileContent.d.ts +1 -1
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +2 -8
- package/dist/types/loadExternalFile-DmM_TGcA.d.ts +25 -0
- package/dist/types/loadExternalFile-DmM_TGcA.d.ts.map +1 -0
- package/dist/types/logger.d.ts +8 -22
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/node.d.ts +1 -2
- package/dist/types/{parseFileContent-CriV5Luv.d.ts → parseFileContent--o_QlW5j.d.ts} +2 -2
- package/dist/types/{parseFileContent-CriV5Luv.d.ts.map → parseFileContent--o_QlW5j.d.ts.map} +1 -1
- package/dist/types/{toLowerCamelCase-CfYCuChC.d.ts → toLowerCamelCase-DUdT00I1.d.ts} +1 -1
- package/dist/types/toLowerCamelCase-DUdT00I1.d.ts.map +1 -0
- package/dist/types/transpileTSToCJS-OifpV3zk.d.ts +19 -0
- package/dist/types/transpileTSToCJS-OifpV3zk.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -4
- package/dist/types/utils/logStack.d.ts.map +1 -1
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts +1 -1
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts +1 -1
- package/dist/types/utils/stringFormatter/index.d.ts +4 -4
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts +1 -1
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts +1 -1
- package/package.json +18 -2
- package/dist/cjs/chunk-D-qHiVGv.cjs +0 -1
- package/dist/cjs/defaultValues/index.cjs.map +0 -1
- package/dist/esm/chunk-DXQkyQJp.mjs +0 -1
- package/dist/esm/defaultValues/index.mjs.map +0 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs.map +0 -1
- package/dist/types/build-BGWWxAP2.d.ts +0 -12
- package/dist/types/build-BGWWxAP2.d.ts.map +0 -1
- package/dist/types/camelCaseToKebabCase-91HKVxf2.d.ts.map +0 -1
- package/dist/types/camelCaseToSentence-LKuKkD3M.d.ts.map +0 -1
- package/dist/types/compiler-BKn6YjPf.d.ts +0 -10
- package/dist/types/compiler-BKn6YjPf.d.ts.map +0 -1
- package/dist/types/content-CEqOvNcs.d.ts +0 -13
- package/dist/types/content-CEqOvNcs.d.ts.map +0 -1
- package/dist/types/defaultValues/index.d.ts.map +0 -1
- package/dist/types/dictionary-n4jBpRU_.d.ts +0 -13
- package/dist/types/dictionary-n4jBpRU_.d.ts.map +0 -1
- package/dist/types/editor-Bhh3J_sb.d.ts +0 -15
- package/dist/types/editor-Bhh3J_sb.d.ts.map +0 -1
- package/dist/types/internationalization-0cqNGQ-O.d.ts +0 -14
- package/dist/types/internationalization-0cqNGQ-O.d.ts.map +0 -1
- package/dist/types/kebabCaseToCamelCase-BR4yfbUC.d.ts.map +0 -1
- package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +0 -1
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +0 -1
- package/dist/types/log-C5gSYuVB.d.ts +0 -8
- package/dist/types/log-C5gSYuVB.d.ts.map +0 -1
- package/dist/types/routing-DlVdUHPZ.d.ts +0 -16
- package/dist/types/routing-DlVdUHPZ.d.ts.map +0 -1
- package/dist/types/system-BFYob741.d.ts +0 -18
- package/dist/types/system-BFYob741.d.ts.map +0 -1
- package/dist/types/toLowerCamelCase-CfYCuChC.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cacheMemory as e}from"../utils/cacheMemory.mjs";import{getPackageJsonPath as t}from"../utils/getPackageJsonPath.mjs";import{buildConfigurationFields as n}from"./buildConfigurationFields.mjs";import{loadConfigurationFile as r}from"./loadConfigurationFile.mjs";import{searchConfigurationFile as i}from"./searchConfigurationFile.mjs";import{defu as a}from"defu";const o=o=>{let s;try{s=o?.baseDir??t().baseDir}catch{return{configuration:n({},o?.baseDir,o?.logFunctions),customConfiguration:void 0,numCustomConfiguration:0,configurationFilePath:void 0}}let c=e.get(o);if(c)return c;let{configurationFilePath:l,numCustomConfiguration:u}=i(s),d,f;l?(f=r(l,{projectRequire:o?.require,envVarOptions:{env:o?.env,envFile:o?.envFile},additionalEnvVars:o?.additionalEnvVars,aliases:o?.aliases}),d=n(f,o?.baseDir,o?.logFunctions)):d=n({},o?.baseDir,o?.logFunctions);let p=a(o?.require?{build:{require:o?.require,cache:o?.cache}}:{},d),m=a(o?.override??{},p);return e.set(o,{configuration:m,customConfiguration:f,numCustomConfiguration:u,configurationFilePath:l}),{configuration:m,customConfiguration:f,numCustomConfiguration:u,configurationFilePath:l}},s=e=>o(e).configuration;export{s as getConfiguration,o as getConfigurationAndFilePath};
|
|
1
|
+
import{cacheMemory as e}from"../utils/cacheMemory.mjs";import{getPackageJsonPath as t}from"../utils/getPackageJsonPath.mjs";import{buildConfigurationFields as n}from"./buildConfigurationFields.mjs";import{loadConfigurationFile as r}from"./loadConfigurationFile.mjs";import{searchConfigurationFile as i}from"./searchConfigurationFile.mjs";import{defu as a}from"defu";const o=o=>{let s;try{s=o?.baseDir??t().baseDir}catch{return{configuration:n({},o?.baseDir,o?.logFunctions),customConfiguration:void 0,numCustomConfiguration:0,configurationFilePath:void 0}}let c=e.get(o);if(c)return c;let{configurationFilePath:l,numCustomConfiguration:u}=i(s),d,f;l?(f=r(l,{projectRequire:o?.require,envVarOptions:{env:o?.env,envFile:o?.envFile},additionalEnvVars:o?.additionalEnvVars,aliases:o?.aliases,buildOptions:o?.buildOptions}),d=n(f,o?.baseDir,o?.logFunctions)):d=n({},o?.baseDir,o?.logFunctions);let p=a(o?.require?{build:{require:o?.require,cache:o?.cache}}:{},d),m=a(o?.override??{},p);return e.set(o,{configuration:m,customConfiguration:f,numCustomConfiguration:u,configurationFilePath:l}),{configuration:m,customConfiguration:f,numCustomConfiguration:u,configurationFilePath:l}},s=e=>o(e).configuration;export{s as getConfiguration,o as getConfigurationAndFilePath};
|
|
2
2
|
//# sourceMappingURL=getConfiguration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.mjs","names":[],"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":["import type {\n CustomIntlayerConfig,\n IntlayerConfig,\n LogFunctions,\n} from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { SandBoxContextOptions } from '../loadExternalFile/parseFileContent';\nimport { cacheMemory } from '../utils/cacheMemory';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\nimport { buildConfigurationFields } from './buildConfigurationFields';\nimport { loadConfigurationFile } from './loadConfigurationFile';\nimport { searchConfigurationFile } from './searchConfigurationFile';\n\nexport type GetConfigurationOptions = {\n baseDir?: string;\n override?: CustomIntlayerConfig;\n // Dotenv options\n env?: string;\n envFile?: string;\n // Log functions\n logFunctions?: LogFunctions;\n // Require function\n require?: NodeJS.Require;\n // cache\n cache?: boolean;\n} & Omit<SandBoxContextOptions, 'projectRequire'>;\n\nexport type GetConfigurationAndFilePathResult = {\n configuration: IntlayerConfig;\n customConfiguration: CustomIntlayerConfig | undefined;\n numCustomConfiguration: number;\n configurationFilePath: string | undefined;\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfigurationAndFilePath = (\n options?: GetConfigurationOptions\n): GetConfigurationAndFilePathResult => {\n let baseDir: string | undefined;\n\n try {\n // Can fail in some environments (e.g. MCP server, VScode extension)\n baseDir = options?.baseDir ?? getPackageJsonPath().baseDir;\n } catch (_err) {\n // Return default config if the package.json is not found\n return {\n configuration: buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n ),\n customConfiguration: undefined,\n numCustomConfiguration: 0,\n configurationFilePath: undefined,\n };\n }\n\n const cachedConfiguration =\n cacheMemory.get<GetConfigurationAndFilePathResult>(options);\n\n if (cachedConfiguration) return cachedConfiguration;\n\n // Search for configuration files\n const { configurationFilePath, numCustomConfiguration } =\n searchConfigurationFile(baseDir);\n\n let storedConfiguration: IntlayerConfig;\n let customConfiguration: CustomIntlayerConfig | undefined;\n\n if (configurationFilePath) {\n // Load the custom configuration\n customConfiguration = loadConfigurationFile(configurationFilePath, {\n projectRequire: options?.require,\n // Dotenv options\n envVarOptions: {\n env: options?.env,\n envFile: options?.envFile,\n },\n // Sandbox context additional variables\n additionalEnvVars: options?.additionalEnvVars,\n aliases: options?.aliases,\n });\n\n // Save the configuration to avoid reading the file again\n storedConfiguration = buildConfigurationFields(\n customConfiguration,\n options?.baseDir,\n options?.logFunctions\n );\n } else {\n // No configuration file found, use default configuration\n storedConfiguration = buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n );\n }\n\n // Log warning if multiple configuration files are found\n const projectRequireConfig: CustomIntlayerConfig = options?.require\n ? {\n build: {\n require: options?.require,\n cache: options?.cache,\n },\n }\n : {};\n\n const configWithProjectRequire = defu(\n projectRequireConfig,\n storedConfiguration\n ) as IntlayerConfig;\n\n const configuration = defu(\n options?.override ?? {},\n configWithProjectRequire\n ) as IntlayerConfig;\n\n cacheMemory.set(options, {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n });\n\n return {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n };\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfiguration = (\n options?: GetConfigurationOptions\n): IntlayerConfig => getConfigurationAndFilePath(options).configuration;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getConfiguration.mjs","names":[],"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":["import type {\n CustomIntlayerConfig,\n IntlayerConfig,\n LogFunctions,\n} from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { LoadExternalFileOptions } from '../loadExternalFile/loadExternalFile';\nimport type { SandBoxContextOptions } from '../loadExternalFile/parseFileContent';\nimport { cacheMemory } from '../utils/cacheMemory';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\nimport { buildConfigurationFields } from './buildConfigurationFields';\nimport { loadConfigurationFile } from './loadConfigurationFile';\nimport { searchConfigurationFile } from './searchConfigurationFile';\n\nexport type GetConfigurationOptions = {\n baseDir?: string;\n override?: CustomIntlayerConfig;\n // Dotenv options\n env?: string;\n envFile?: string;\n // Log functions\n logFunctions?: LogFunctions;\n // Require function\n require?: NodeJS.Require;\n // cache\n cache?: boolean;\n // Build options for TypeScript transpilation (e.g. custom esbuild instance)\n buildOptions?: LoadExternalFileOptions['buildOptions'];\n} & Omit<SandBoxContextOptions, 'projectRequire'>;\n\nexport type GetConfigurationAndFilePathResult = {\n configuration: IntlayerConfig;\n customConfiguration: CustomIntlayerConfig | undefined;\n numCustomConfiguration: number;\n configurationFilePath: string | undefined;\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfigurationAndFilePath = (\n options?: GetConfigurationOptions\n): GetConfigurationAndFilePathResult => {\n let baseDir: string | undefined;\n\n try {\n // Can fail in some environments (e.g. MCP server, VScode extension)\n baseDir = options?.baseDir ?? getPackageJsonPath().baseDir;\n } catch (_err) {\n // Return default config if the package.json is not found\n return {\n configuration: buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n ),\n customConfiguration: undefined,\n numCustomConfiguration: 0,\n configurationFilePath: undefined,\n };\n }\n\n const cachedConfiguration =\n cacheMemory.get<GetConfigurationAndFilePathResult>(options);\n\n if (cachedConfiguration) return cachedConfiguration;\n\n // Search for configuration files\n const { configurationFilePath, numCustomConfiguration } =\n searchConfigurationFile(baseDir);\n\n let storedConfiguration: IntlayerConfig;\n let customConfiguration: CustomIntlayerConfig | undefined;\n\n if (configurationFilePath) {\n // Load the custom configuration\n customConfiguration = loadConfigurationFile(configurationFilePath, {\n projectRequire: options?.require,\n // Dotenv options\n envVarOptions: {\n env: options?.env,\n envFile: options?.envFile,\n },\n // Sandbox context additional variables\n additionalEnvVars: options?.additionalEnvVars,\n aliases: options?.aliases,\n // Build options for TypeScript transpilation (e.g. custom esbuild instance)\n buildOptions: options?.buildOptions,\n });\n\n // Save the configuration to avoid reading the file again\n storedConfiguration = buildConfigurationFields(\n customConfiguration,\n options?.baseDir,\n options?.logFunctions\n );\n } else {\n // No configuration file found, use default configuration\n storedConfiguration = buildConfigurationFields(\n {},\n options?.baseDir,\n options?.logFunctions\n );\n }\n\n // Log warning if multiple configuration files are found\n const projectRequireConfig: CustomIntlayerConfig = options?.require\n ? {\n build: {\n require: options?.require,\n cache: options?.cache,\n },\n }\n : {};\n\n const configWithProjectRequire = defu(\n projectRequireConfig,\n storedConfiguration\n ) as IntlayerConfig;\n\n const configuration = defu(\n options?.override ?? {},\n configWithProjectRequire\n ) as IntlayerConfig;\n\n cacheMemory.set(options, {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n });\n\n return {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n };\n};\n\n/**\n * Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)\n */\nexport const getConfiguration = (\n options?: GetConfigurationOptions\n): IntlayerConfig => getConfigurationAndFilePath(options).configuration;\n"],"mappings":"8WAwCA,MAAa,EACX,GACsC,CACtC,IAAI,EAEJ,GAAI,CAEF,EAAU,GAAS,SAAW,GAAoB,CAAC,aACtC,CAEb,MAAO,CACL,cAAe,EACb,EAAE,CACF,GAAS,QACT,GAAS,aACV,CACD,oBAAqB,IAAA,GACrB,uBAAwB,EACxB,sBAAuB,IAAA,GACxB,CAGH,IAAM,EACJ,EAAY,IAAuC,EAAQ,CAE7D,GAAI,EAAqB,OAAO,EAGhC,GAAM,CAAE,wBAAuB,0BAC7B,EAAwB,EAAQ,CAE9B,EACA,EAEA,GAEF,EAAsB,EAAsB,EAAuB,CACjE,eAAgB,GAAS,QAEzB,cAAe,CACb,IAAK,GAAS,IACd,QAAS,GAAS,QACnB,CAED,kBAAmB,GAAS,kBAC5B,QAAS,GAAS,QAElB,aAAc,GAAS,aACxB,CAAC,CAGF,EAAsB,EACpB,EACA,GAAS,QACT,GAAS,aACV,EAGD,EAAsB,EACpB,EAAE,CACF,GAAS,QACT,GAAS,aACV,CAaH,IAAM,EAA2B,EATkB,GAAS,QACxD,CACE,MAAO,CACL,QAAS,GAAS,QAClB,MAAO,GAAS,MACjB,CACF,CACD,EAAE,CAIJ,EACD,CAEK,EAAgB,EACpB,GAAS,UAAY,EAAE,CACvB,EACD,CASD,OAPA,EAAY,IAAI,EAAS,CACvB,gBACA,sBACA,yBACA,wBACD,CAAC,CAEK,CACL,gBACA,sBACA,yBACA,wBACD,EAMU,EACX,GACmB,EAA4B,EAAQ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"../ESMxCJSHelpers-BAuqwNXV.mjs";import{loadExternalFileSync as t}from"../loadExternalFile/loadExternalFile.mjs";const n=t=>{try{return{...t?.aliases,intlayer:e.resolve(`@intlayer/types`)}}catch{return t?.aliases}},r=(e,r)=>t(e,{...r,aliases:n(r)});export{r as loadConfigurationFile};
|
|
2
2
|
//# sourceMappingURL=loadConfigurationFile.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadConfigurationFile.mjs","names":[],"sources":["../../../src/configFile/loadConfigurationFile.ts"],"sourcesContent":["import type { CustomIntlayerConfig } from '@intlayer/types/config';\nimport {\n type LoadExternalFileOptions,\n loadExternalFileSync,\n} from '../loadExternalFile/loadExternalFile';\nimport { configESMxCJSRequire } from '../utils/ESMxCJSHelpers';\n\nconst getAliases = (\n options?: Omit<LoadExternalFileOptions, 'configuration'>\n) => {\n // Can fail if CJS hot removed from the module (e.g. in Tanstack Start + Nitro)\n try {\n return {\n ...options?.aliases,\n // Replace intlayer with @intlayer/types to avoid circular dependency intlayer -> @intlayer/config -> intlayer\n intlayer: configESMxCJSRequire.resolve('@intlayer/types'),\n };\n } catch {\n return options?.aliases;\n }\n};\n\n/**\n * Load the configuration file from the given path\n * Example of configuration file: intlayer.config.js\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadConfigurationFile = (\n configFilePath: string,\n options?: Omit<LoadExternalFileOptions, 'configuration'>\n): CustomIntlayerConfig | undefined => {\n const fileContent = loadExternalFileSync(configFilePath, {\n ...options,\n aliases: getAliases(options),\n });\n\n return fileContent;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadConfigurationFile.mjs","names":[],"sources":["../../../src/configFile/loadConfigurationFile.ts"],"sourcesContent":["import type { CustomIntlayerConfig } from '@intlayer/types/config';\nimport {\n type LoadExternalFileOptions,\n loadExternalFileSync,\n} from '../loadExternalFile/loadExternalFile';\nimport { configESMxCJSRequire } from '../utils/ESMxCJSHelpers';\n\nconst getAliases = (\n options?: Omit<LoadExternalFileOptions, 'configuration'>\n) => {\n // Can fail if CJS hot removed from the module (e.g. in Tanstack Start + Nitro)\n try {\n return {\n ...options?.aliases,\n // Replace intlayer with @intlayer/types to avoid circular dependency intlayer -> @intlayer/config -> intlayer\n intlayer: configESMxCJSRequire.resolve('@intlayer/types'),\n };\n } catch {\n return options?.aliases;\n }\n};\n\n/**\n * Load the configuration file from the given path\n * Example of configuration file: intlayer.config.js\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadConfigurationFile = (\n configFilePath: string,\n options?: Omit<LoadExternalFileOptions, 'configuration'>\n): CustomIntlayerConfig | undefined => {\n const fileContent = loadExternalFileSync(configFilePath, {\n ...options,\n aliases: getAliases(options),\n });\n\n return fileContent;\n};\n"],"mappings":"mIAOA,MAAM,EACJ,GACG,CAEH,GAAI,CACF,MAAO,CACL,GAAG,GAAS,QAEZ,SAAU,EAAqB,QAAQ,kBAAkB,CAC1D,MACK,CACN,OAAO,GAAS,UAUP,GACX,EACA,IAEoB,EAAqB,EAAgB,CACvD,GAAG,EACH,QAAS,EAAW,EAAQ,CAC7B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getPackageJsonPath as e}from"../utils/getPackageJsonPath.mjs";import{logger as t}from"../logger.mjs";import{existsSync as n}from"node:fs";import{resolve as r}from"node:path";const i=[`intlayer.config.ts`,`intlayer.config.js`,`intlayer.config.json`,`intlayer.config.json5`,`intlayer.config.jsonc`,`intlayer.config.cjs`,`intlayer.config.mjs`,`.intlayerrc`],a=new Map,o=o=>{let s,c=0;if(a.has(o))return a.get(o);let{baseDir:l}=e(o);for(let e of i)try{let t=r(l,e);n(t)&&(c+=1,s||=t)}catch(n){t(`${e}: ${n}`,{level:`error`})}return{configurationFilePath:s,numCustomConfiguration:c}};export{i as configurationFilesCandidates,o as searchConfigurationFile};
|
|
2
2
|
//# sourceMappingURL=searchConfigurationFile.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchConfigurationFile.mjs","names":[],"sources":["../../../src/configFile/searchConfigurationFile.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { logger } from '../logger';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\n\nexport const configurationFilesCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.js',\n 'intlayer.config.json',\n 'intlayer.config.json5',\n 'intlayer.config.jsonc',\n 'intlayer.config.cjs',\n 'intlayer.config.mjs',\n '.intlayerrc',\n] as const;\n\ntype SearchConfigurationFileResult = {\n configurationFilePath?: string;\n numCustomConfiguration: number;\n};\n\n/**\n * Search for the configuration file in the given path\n *\n * List of detected configuration files:\n * - intlayer.config.ts\n * - intlayer.config.js\n * - intlayer.config.json\n * - intlayer.config.cjs\n * - intlayer.config.mjs\n * - .intlayerrc\n */\nexport const searchConfigurationFile = (\n startDir: string\n): SearchConfigurationFileResult => {\n let configurationFilePath: string | undefined;\n let numCustomConfiguration = 0;\n\n const { baseDir } = getPackageJsonPath(startDir);\n\n for (const fileName of configurationFilesCandidates) {\n try {\n const filePath = resolve(baseDir, fileName);\n\n // Check if the file exists\n if (!existsSync(filePath)) {\n } else {\n numCustomConfiguration += 1;\n\n if (!configurationFilePath) {\n configurationFilePath = filePath;\n }\n }\n } catch (error) {\n // Return \"Cannot use import statement outside a module\"\n logger(`${fileName}: ${error as string}`, { level: 'error' });\n }\n }\n\n return { configurationFilePath, numCustomConfiguration };\n};\n"],"mappings":"qLAKA,MAAa,EAA+B,CAC1C,qBACA,qBACA,uBACA,wBACA,wBACA,sBACA,sBACA,cACD,
|
|
1
|
+
{"version":3,"file":"searchConfigurationFile.mjs","names":[],"sources":["../../../src/configFile/searchConfigurationFile.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { logger } from '../logger';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\n\nexport const configurationFilesCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.js',\n 'intlayer.config.json',\n 'intlayer.config.json5',\n 'intlayer.config.jsonc',\n 'intlayer.config.cjs',\n 'intlayer.config.mjs',\n '.intlayerrc',\n] as const;\n\ntype SearchConfigurationFileResult = {\n configurationFilePath?: string;\n numCustomConfiguration: number;\n};\n\n// CACHE: Store results to avoid re-walking the file system for the same path\nconst rootPathCache = new Map<string, SearchConfigurationFileResult>();\n\n/**\n * Search for the configuration file in the given path\n *\n * List of detected configuration files:\n * - intlayer.config.ts\n * - intlayer.config.js\n * - intlayer.config.json\n * - intlayer.config.cjs\n * - intlayer.config.mjs\n * - .intlayerrc\n */\nexport const searchConfigurationFile = (\n startDir: string\n): SearchConfigurationFileResult => {\n let configurationFilePath: string | undefined;\n let numCustomConfiguration = 0;\n\n // OPTIMIZATION: Return cached result immediately\n if (rootPathCache.has(startDir)) {\n return rootPathCache.get(startDir) as SearchConfigurationFileResult;\n }\n\n const { baseDir } = getPackageJsonPath(startDir);\n\n for (const fileName of configurationFilesCandidates) {\n try {\n const filePath = resolve(baseDir, fileName);\n\n // Check if the file exists\n if (!existsSync(filePath)) {\n } else {\n numCustomConfiguration += 1;\n\n if (!configurationFilePath) {\n configurationFilePath = filePath;\n }\n }\n } catch (error) {\n // Return \"Cannot use import statement outside a module\"\n logger(`${fileName}: ${error as string}`, { level: 'error' });\n }\n }\n\n return { configurationFilePath, numCustomConfiguration };\n};\n"],"mappings":"qLAKA,MAAa,EAA+B,CAC1C,qBACA,qBACA,uBACA,wBACA,wBACA,sBACA,sBACA,cACD,CAQK,EAAgB,IAAI,IAab,EACX,GACkC,CAClC,IAAI,EACA,EAAyB,EAG7B,GAAI,EAAc,IAAI,EAAS,CAC7B,OAAO,EAAc,IAAI,EAAS,CAGpC,GAAM,CAAE,WAAY,EAAmB,EAAS,CAEhD,IAAK,IAAM,KAAY,EACrB,GAAI,CACF,IAAM,EAAW,EAAQ,EAAS,EAAS,CAGtC,EAAW,EAAS,GAEvB,GAA0B,EAE1B,AACE,IAAwB,SAGrB,EAAO,CAEd,EAAO,GAAG,EAAS,IAAI,IAAmB,CAAE,MAAO,QAAS,CAAC,CAIjE,MAAO,CAAE,wBAAuB,yBAAwB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=`auto`,t=void 0,n=[`**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}`,`!**/node_modules/**`,`!**/dist/**`,`!**/build/**`,`!**/.intlayer/**`,`!**/.next/**`,`!**/.nuxt/**`,`!**/.expo/**`,`!**/.vercel/**`,`!**/.turbo/**`,`!**/.tanstack/**`,`!**/*.config.*`,`!**/*.test.*`,`!**/*.spec.*`,`!**/*.stories.*`,`!**/*.d.ts`,`!**/*.d.ts.map`],r=[`esm`,`cjs`],i=!0,a=!1;export{e as BUILD_MODE,i as CACHE,t as OPTIMIZE,r as OUTPUT_FORMAT,n as TRAVERSE_PATTERN,a as TYPE_CHECKING};
|
|
2
2
|
//# sourceMappingURL=build.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.mjs","names":[],"sources":["../../../src/defaultValues/build.ts"],"sourcesContent":["export const BUILD_MODE = 'auto';\n\nexport const OPTIMIZE = undefined;\n\nexport const TRAVERSE_PATTERN = [\n '**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}',\n\n '!**/node_modules/**',\n '!**/dist/**',\n '!**/build/**',\n '!**/.intlayer/**',\n '!**/.next/**',\n '!**/.nuxt/**',\n '!**/.expo/**',\n '!**/.vercel/**',\n '!**/.turbo/**',\n '!**/.tanstack/**',\n\n '!**/*.config.*',\n '!**/*.test.*',\n '!**/*.spec.*',\n '!**/*.stories.*',\n '!**/*.d.ts',\n '!**/*.d.ts.map',\n];\n\nexport const OUTPUT_FORMAT: ('cjs' | 'esm')[] = ['esm', 'cjs'];\n\nexport const CACHE = true;\n\nexport const TYPE_CHECKING = false;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.mjs","names":[],"sources":["../../../src/defaultValues/build.ts"],"sourcesContent":["export const BUILD_MODE = 'auto';\n\nexport const OPTIMIZE = undefined;\n\nexport const TRAVERSE_PATTERN = [\n '**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}',\n\n '!**/node_modules/**',\n '!**/dist/**',\n '!**/build/**',\n '!**/.intlayer/**',\n '!**/.next/**',\n '!**/.nuxt/**',\n '!**/.expo/**',\n '!**/.vercel/**',\n '!**/.turbo/**',\n '!**/.tanstack/**',\n\n '!**/*.config.*',\n '!**/*.test.*',\n '!**/*.spec.*',\n '!**/*.stories.*',\n '!**/*.d.ts',\n '!**/*.d.ts.map',\n];\n\nexport const OUTPUT_FORMAT: ('cjs' | 'esm')[] = ['esm', 'cjs'];\n\nexport const CACHE = true;\n\nexport const TYPE_CHECKING = false;\n"],"mappings":"AAAA,MAAa,EAAa,OAEb,EAAW,IAAA,GAEX,EAAmB,CAC9B,+CAEA,sBACA,cACA,eACA,mBACA,eACA,eACA,eACA,iBACA,gBACA,mBAEA,iBACA,eACA,eACA,kBACA,aACA,iBACD,CAEY,EAAmC,CAAC,MAAO,MAAM,CAEjD,EAAQ,GAER,EAAgB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=!0,t=``,n=!1,r=!1;export{t as COMPILER_DICTIONARY_KEY_PREFIX,e as COMPILER_ENABLED,n as COMPILER_NO_METADATA,r as COMPILER_SAVE_COMPONENTS};
|
|
2
2
|
//# sourceMappingURL=compiler.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.mjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\n\nexport const COMPILER_DICTIONARY_KEY_PREFIX = '';\n\nexport const COMPILER_NO_METADATA = false;\n\nexport const COMPILER_SAVE_COMPONENTS = false;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"compiler.mjs","names":[],"sources":["../../../src/defaultValues/compiler.ts"],"sourcesContent":["export const COMPILER_ENABLED = true;\n\nexport const COMPILER_DICTIONARY_KEY_PREFIX = '';\n\nexport const COMPILER_NO_METADATA = false;\n\nexport const COMPILER_SAVE_COMPONENTS = false;\n"],"mappings":"AAAA,MAAa,EAAmB,GAEnB,EAAiC,GAEjC,EAAuB,GAEvB,EAA2B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=[`.content.ts`,`.content.js`,`.content.cjs`,`.content.mjs`,`.content.json`,`.content.json5`,`.content.jsonc`,`.content.tsx`,`.content.jsx`],t=[`**/node_modules/**`,`**/dist/**`,`**/build/**`,`**/.intlayer/**`,`**/.next/**`,`**/.nuxt/**`,`**/.expo/**`,`**/.vercel/**`,`**/.turbo/**`,`**/.tanstack/**`],n=[`.`],r=[`.`],i=`i18next_resources`,a=`intl_messages`,o=!0;export{r as CODE_DIR,n as CONTENT_DIR,t as EXCLUDED_PATHS,e as FILE_EXTENSIONS,i as I18NEXT_DICTIONARIES_DIR,a as REACT_INTL_MESSAGES_DIR,o as WATCH};
|
|
2
2
|
//# sourceMappingURL=content.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.mjs","names":[],"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["export const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.mjs',\n '.content.json',\n '.content.json5',\n '.content.jsonc',\n '.content.tsx',\n '.content.jsx',\n];\n\nexport const EXCLUDED_PATHS = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.intlayer/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n];\n\nexport const CONTENT_DIR = ['.'];\n\nexport const CODE_DIR = ['.'];\n\nexport const I18NEXT_DICTIONARIES_DIR = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR = 'intl_messages';\n\nexport const WATCH = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.mjs","names":[],"sources":["../../../src/defaultValues/content.ts"],"sourcesContent":["export const FILE_EXTENSIONS = [\n '.content.ts',\n '.content.js',\n '.content.cjs',\n '.content.mjs',\n '.content.json',\n '.content.json5',\n '.content.jsonc',\n '.content.tsx',\n '.content.jsx',\n];\n\nexport const EXCLUDED_PATHS = [\n '**/node_modules/**',\n '**/dist/**',\n '**/build/**',\n '**/.intlayer/**',\n '**/.next/**',\n '**/.nuxt/**',\n '**/.expo/**',\n '**/.vercel/**',\n '**/.turbo/**',\n '**/.tanstack/**',\n];\n\nexport const CONTENT_DIR = ['.'];\n\nexport const CODE_DIR = ['.'];\n\nexport const I18NEXT_DICTIONARIES_DIR = 'i18next_resources';\n\nexport const REACT_INTL_MESSAGES_DIR = 'intl_messages';\n\nexport const WATCH = true;\n"],"mappings":"AAAA,MAAa,EAAkB,CAC7B,cACA,cACA,eACA,eACA,gBACA,iBACA,iBACA,eACA,eACD,CAEY,EAAiB,CAC5B,qBACA,aACA,cACA,kBACA,cACA,cACA,cACA,gBACA,eACA,kBACD,CAEY,EAAc,CAAC,IAAI,CAEnB,EAAW,CAAC,IAAI,CAEhB,EAA2B,oBAE3B,EAA0B,gBAE1B,EAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=!0,t=`local`,n=!1,r=`static`;export{n as CONTENT_AUTO_TRANSFORMATION,e as FILL,r as IMPORT_MODE,t as LOCATION};
|
|
2
2
|
//# sourceMappingURL=dictionary.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.mjs","names":[],"sources":["../../../src/defaultValues/dictionary.ts"],"sourcesContent":["import type { DictionaryLocation } from '@intlayer/types/dictionary';\n\nexport const FILL = true;\nexport const LOCATION: DictionaryLocation = 'local';\nexport const CONTENT_AUTO_TRANSFORMATION = false;\nexport const IMPORT_MODE = 'static';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.mjs","names":[],"sources":["../../../src/defaultValues/dictionary.ts"],"sourcesContent":["import type { DictionaryLocation } from '@intlayer/types/dictionary';\n\nexport const FILL = true;\nexport const LOCATION: DictionaryLocation = 'local';\nexport const CONTENT_AUTO_TRANSFORMATION = false;\nexport const IMPORT_MODE = 'static';\n"],"mappings":"AAEA,MAAa,EAAO,GACP,EAA+B,QAC/B,EAA8B,GAC9B,EAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=void 0,t=`http://localhost:8000`,n=`https://app.intlayer.org`,r=`https://back.intlayer.org`,i=8e3,a=!1,o=!0,s=`local_first`,c=4e3;export{e as APPLICATION_URL,r as BACKEND_URL,n as CMS_URL,s as DICTIONARY_PRIORITY_STRATEGY,t as EDITOR_URL,a as IS_ENABLED,o as LIVE_SYNC,c as LIVE_SYNC_PORT,i as PORT};
|
|
2
2
|
//# sourceMappingURL=editor.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.mjs","names":[],"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const APPLICATION_URL = undefined;\nexport const EDITOR_URL = 'http://localhost:8000';\nexport const CMS_URL = 'https://app.intlayer.org';\nexport const BACKEND_URL = 'https://back.intlayer.org';\nexport const PORT = 8000;\nexport const IS_ENABLED = false;\nexport const LIVE_SYNC = true;\nexport const DICTIONARY_PRIORITY_STRATEGY = 'local_first';\nexport const LIVE_SYNC_PORT = 4000;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor.mjs","names":[],"sources":["../../../src/defaultValues/editor.ts"],"sourcesContent":["export const APPLICATION_URL = undefined;\nexport const EDITOR_URL = 'http://localhost:8000';\nexport const CMS_URL = 'https://app.intlayer.org';\nexport const BACKEND_URL = 'https://back.intlayer.org';\nexport const PORT = 8000;\nexport const IS_ENABLED = false;\nexport const LIVE_SYNC = true;\nexport const DICTIONARY_PRIORITY_STRATEGY = 'local_first';\nexport const LIVE_SYNC_PORT = 4000;\n"],"mappings":"AAAA,MAAa,EAAkB,IAAA,GAClB,EAAa,wBACb,EAAU,2BACV,EAAc,4BACd,EAAO,IACP,EAAa,GACb,EAAY,GACZ,EAA+B,cAC/B,EAAiB"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import{BUILD_MODE as e,CACHE as t,OPTIMIZE as n,OUTPUT_FORMAT as r,TRAVERSE_PATTERN as i,TYPE_CHECKING as a}from"./build.mjs";import{COMPILER_DICTIONARY_KEY_PREFIX as o,COMPILER_ENABLED as s,COMPILER_NO_METADATA as c,COMPILER_SAVE_COMPONENTS as l}from"./compiler.mjs";import{CODE_DIR as u,CONTENT_DIR as d,EXCLUDED_PATHS as f,FILE_EXTENSIONS as p,I18NEXT_DICTIONARIES_DIR as m,REACT_INTL_MESSAGES_DIR as h,WATCH as g}from"./content.mjs";import{CONTENT_AUTO_TRANSFORMATION as _,FILL as v,IMPORT_MODE as y,LOCATION as b}from"./dictionary.mjs";import{APPLICATION_URL as x,BACKEND_URL as S,CMS_URL as C,DICTIONARY_PRIORITY_STRATEGY as w,EDITOR_URL as T,IS_ENABLED as E,LIVE_SYNC as D,LIVE_SYNC_PORT as O,PORT as k}from"./editor.mjs";import{DEFAULT_LOCALE as A,LOCALES as j,REQUIRED_LOCALES as M,STRICT_MODE as N}from"./internationalization.mjs";import{MODE as P,PREFIX as F}from"./log.mjs";import{BASE_PATH as I,COOKIE_NAME as L,HEADER_NAME as R,LOCALE_STORAGE_NAME as z,ROUTING_MODE as B,SERVER_SET_COOKIE as V,STORAGE as H}from"./routing.mjs";import{CACHE_DIR as U,CONFIG_DIR as W,DICTIONARIES_DIR as G,DYNAMIC_DICTIONARIES_DIR as K,FETCH_DICTIONARIES_DIR as q,MAIN_DIR as J,MASKS_DIR as Y,MODULE_AUGMENTATION_DIR as X,REMOTE_DICTIONARIES_DIR as Z,TEMP_DIR as Q,TYPES_DIR as $,UNMERGED_DICTIONARIES_DIR as ee}from"./system.mjs";export{x as APPLICATION_URL,S as BACKEND_URL,I as BASE_PATH,e as BUILD_MODE,t as CACHE,U as CACHE_DIR,C as CMS_URL,u as CODE_DIR,o as COMPILER_DICTIONARY_KEY_PREFIX,s as COMPILER_ENABLED,c as COMPILER_NO_METADATA,l as COMPILER_SAVE_COMPONENTS,W as CONFIG_DIR,_ as CONTENT_AUTO_TRANSFORMATION,d as CONTENT_DIR,L as COOKIE_NAME,A as DEFAULT_LOCALE,G as DICTIONARIES_DIR,w as DICTIONARY_PRIORITY_STRATEGY,K as DYNAMIC_DICTIONARIES_DIR,T as EDITOR_URL,f as EXCLUDED_PATHS,q as FETCH_DICTIONARIES_DIR,p as FILE_EXTENSIONS,v as FILL,R as HEADER_NAME,m as I18NEXT_DICTIONARIES_DIR,y as IMPORT_MODE,E as IS_ENABLED,D as LIVE_SYNC,O as LIVE_SYNC_PORT,j as LOCALES,z as LOCALE_STORAGE_NAME,b as LOCATION,J as MAIN_DIR,Y as MASKS_DIR,P as MODE,X as MODULE_AUGMENTATION_DIR,n as OPTIMIZE,r as OUTPUT_FORMAT,k as PORT,F as PREFIX,h as REACT_INTL_MESSAGES_DIR,Z as REMOTE_DICTIONARIES_DIR,M as REQUIRED_LOCALES,B as ROUTING_MODE,V as SERVER_SET_COOKIE,H as STORAGE,N as STRICT_MODE,Q as TEMP_DIR,i as TRAVERSE_PATTERN,$ as TYPES_DIR,a as TYPE_CHECKING,ee as UNMERGED_DICTIONARIES_DIR,g as WATCH};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ENGLISH as e}from"@intlayer/types/locales";const t=[e],n=[],r=e,i=`inclusive`;export{r as DEFAULT_LOCALE,t as LOCALES,n as REQUIRED_LOCALES,i as STRICT_MODE};
|
|
2
2
|
//# sourceMappingURL=internationalization.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internationalization.mjs","names":[],"sources":["../../../src/defaultValues/internationalization.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { StrictMode } from '@intlayer/types/config';\nimport { ENGLISH } from '@intlayer/types/locales';\n\nexport const LOCALES: Locale[] = [ENGLISH];\n\nexport const REQUIRED_LOCALES: Locale[] = [];\n\nexport const DEFAULT_LOCALE: Locale = ENGLISH;\n\nexport const STRICT_MODE: StrictMode = 'inclusive';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"internationalization.mjs","names":[],"sources":["../../../src/defaultValues/internationalization.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { StrictMode } from '@intlayer/types/config';\nimport { ENGLISH } from '@intlayer/types/locales';\n\nexport const LOCALES: Locale[] = [ENGLISH];\n\nexport const REQUIRED_LOCALES: Locale[] = [];\n\nexport const DEFAULT_LOCALE: Locale = ENGLISH;\n\nexport const STRICT_MODE: StrictMode = 'inclusive';\n"],"mappings":"kDAIA,MAAa,EAAoB,CAAC,EAAQ,CAE7B,EAA6B,EAAE,CAE/B,EAAyB,EAEzB,EAA0B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{GREY_DARK as e,RESET as t}from"../colors.mjs";const n=`default`,r=`${e}[intlayer] ${t}`;export{n as MODE,r as PREFIX};
|
|
2
2
|
//# sourceMappingURL=log.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.mjs","names":[],"sources":["../../../src/defaultValues/log.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"log.mjs","names":["ANSIColors.GREY_DARK","ANSIColors.RESET"],"sources":["../../../src/defaultValues/log.ts"],"sourcesContent":["import * as ANSIColors from '../colors';\n\nexport const MODE = 'default';\n\nexport const PREFIX = `${ANSIColors.GREY_DARK}[intlayer] ${ANSIColors.RESET}`;\n"],"mappings":"qDAEA,MAAa,EAAO,UAEP,EAAS,GAAGA,EAAqB,aAAaC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=`x-intlayer-locale`,t=`INTLAYER_LOCALE`,n=`INTLAYER_LOCALE`,r=``,i=`always`,a=`prefix-no-default`,o=[`cookie`,`header`];export{r as BASE_PATH,t as COOKIE_NAME,e as HEADER_NAME,n as LOCALE_STORAGE_NAME,a as ROUTING_MODE,i as SERVER_SET_COOKIE,o as STORAGE};
|
|
2
2
|
//# sourceMappingURL=routing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.mjs","names":[],"sources":["../../../src/defaultValues/routing.ts"],"sourcesContent":["import type { RoutingConfig } from '@intlayer/types/config';\n\nexport const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\nexport const LOCALE_STORAGE_NAME = 'INTLAYER_LOCALE';\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const ROUTING_MODE = 'prefix-no-default';\n\nexport const STORAGE: RoutingConfig['storage'] = ['cookie', 'header'];\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"routing.mjs","names":[],"sources":["../../../src/defaultValues/routing.ts"],"sourcesContent":["import type { RoutingConfig } from '@intlayer/types/config';\n\nexport const HEADER_NAME = 'x-intlayer-locale';\n\nexport const COOKIE_NAME = 'INTLAYER_LOCALE';\nexport const LOCALE_STORAGE_NAME = 'INTLAYER_LOCALE';\n\nexport const BASE_PATH = '';\n\nexport const SERVER_SET_COOKIE = 'always';\n\nexport const ROUTING_MODE = 'prefix-no-default';\n\nexport const STORAGE: RoutingConfig['storage'] = ['cookie', 'header'];\n"],"mappings":"AAEA,MAAa,EAAc,oBAEd,EAAc,kBACd,EAAsB,kBAEtB,EAAY,GAEZ,EAAoB,SAEpB,EAAe,oBAEf,EAAoC,CAAC,SAAU,SAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
const e=`.intlayer/main`,t=`.intlayer/dictionary`,n=`.intlayer/mask`,r=`.intlayer/remote_dictionary`,i=`.intlayer/unmerged_dictionary`,a=`.intlayer/dynamic_dictionary`,o=`.intlayer/fetch_dictionary`,s=`.intlayer/types`,c=`.intlayer/types`,l=`.intlayer/config`,u=`.intlayer/cache`,d=`.intlayer/tmp`;export{u as CACHE_DIR,l as CONFIG_DIR,t as DICTIONARIES_DIR,a as DYNAMIC_DICTIONARIES_DIR,o as FETCH_DICTIONARIES_DIR,e as MAIN_DIR,n as MASKS_DIR,c as MODULE_AUGMENTATION_DIR,r as REMOTE_DICTIONARIES_DIR,d as TEMP_DIR,s as TYPES_DIR,i as UNMERGED_DICTIONARIES_DIR};
|
|
2
2
|
//# sourceMappingURL=system.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.mjs","names":[],"sources":["../../../src/defaultValues/system.ts"],"sourcesContent":["export const MAIN_DIR = '.intlayer/main';\n\nexport const DICTIONARIES_DIR = '.intlayer/dictionary';\n\nexport const MASKS_DIR = '.intlayer/mask';\n\nexport const REMOTE_DICTIONARIES_DIR = '.intlayer/remote_dictionary';\n\nexport const UNMERGED_DICTIONARIES_DIR = '.intlayer/unmerged_dictionary';\n\nexport const DYNAMIC_DICTIONARIES_DIR = '.intlayer/dynamic_dictionary';\n\nexport const FETCH_DICTIONARIES_DIR = '.intlayer/fetch_dictionary';\n\nexport const TYPES_DIR = '.intlayer/types';\n\nexport const MODULE_AUGMENTATION_DIR = '.intlayer/types';\n\nexport const CONFIG_DIR = '.intlayer/config';\n\nexport const CACHE_DIR = '.intlayer/cache';\n\nexport const TEMP_DIR = '.intlayer/tmp';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"system.mjs","names":[],"sources":["../../../src/defaultValues/system.ts"],"sourcesContent":["export const MAIN_DIR = '.intlayer/main';\n\nexport const DICTIONARIES_DIR = '.intlayer/dictionary';\n\nexport const MASKS_DIR = '.intlayer/mask';\n\nexport const REMOTE_DICTIONARIES_DIR = '.intlayer/remote_dictionary';\n\nexport const UNMERGED_DICTIONARIES_DIR = '.intlayer/unmerged_dictionary';\n\nexport const DYNAMIC_DICTIONARIES_DIR = '.intlayer/dynamic_dictionary';\n\nexport const FETCH_DICTIONARIES_DIR = '.intlayer/fetch_dictionary';\n\nexport const TYPES_DIR = '.intlayer/types';\n\nexport const MODULE_AUGMENTATION_DIR = '.intlayer/types';\n\nexport const CONFIG_DIR = '.intlayer/config';\n\nexport const CACHE_DIR = '.intlayer/cache';\n\nexport const TEMP_DIR = '.intlayer/tmp';\n"],"mappings":"AAAA,MAAa,EAAW,iBAEX,EAAmB,uBAEnB,EAAY,iBAEZ,EAA0B,8BAE1B,EAA4B,gCAE5B,EAA2B,+BAE3B,EAAyB,6BAEzB,EAAY,kBAEZ,EAA0B,kBAE1B,EAAa,mBAEb,EAAY,kBAEZ,EAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{colorizePath as e,logger as t}from"../logger.mjs";import{parseFileContent as n}from"./parseFileContent.mjs";import{transpileTSToCJS as r,transpileTSToCJSSync as i}from"./transpileTSToCJS.mjs";import{readFileSync as a}from"node:fs";import{extname as o}from"node:path";import{readFile as s}from"node:fs/promises";import
|
|
1
|
+
import{colorizePath as e,logger as t}from"../logger.mjs";import{parseFileContent as n}from"./parseFileContent.mjs";import{transpileTSToCJS as r,transpileTSToCJSSync as i}from"./transpileTSToCJS.mjs";import{readFileSync as a}from"node:fs";import{extname as o}from"node:path";import{readFile as s}from"node:fs/promises";import c from"json5";const l=c.parse||c.default?.parse,u=(e,r)=>{let s=o(e)||`.json`;try{if(s===`.json`||s===`.json5`||s===`.jsonc`)return l(a(e,`utf-8`));let o=i(a(e,`utf-8`),e,r?.buildOptions);if(!o){t(`File could not be loaded.`,{level:`error`});return}let c=n(o,{projectRequire:r?.projectRequire,envVarOptions:r?.envVarOptions,additionalEnvVars:r?.additionalEnvVars,mocks:r?.mocks,aliases:r?.aliases});if(c===void 0){t(`File could not be loaded. Path : ${e}`);return}return c}catch(e){t([`Error: ${e.message} - `,JSON.stringify(e.stack,null,2)],{level:`error`})}},d=async(i,a)=>{let c=o(i);try{if(c===`.json`||c===`.json5`||c===`.jsonc`)return l(await s(i,`utf-8`));let o=await r(await s(i,`utf-8`),i,a?.buildOptions);if(!o){t(`File could not be loaded.`,{level:`error`});return}let u=n(o,{projectRequire:a?.projectRequire,envVarOptions:a?.envVarOptions,additionalEnvVars:a?.additionalEnvVars,mocks:a?.mocks,aliases:a?.aliases});if(u===void 0){t(`File could not be loaded. Path : ${e(i)}`);return}return u}catch(e){(a?.logError??!0)&&t([`Error: ${e.message} - `,JSON.stringify(e.stack,null,2)],{level:`error`})}};export{d as loadExternalFile,u as loadExternalFileSync};
|
|
2
2
|
//# sourceMappingURL=loadExternalFile.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadExternalFile.mjs","names":[],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport
|
|
1
|
+
{"version":3,"file":"loadExternalFile.mjs","names":[],"sources":["../../../src/loadExternalFile/loadExternalFile.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { extname } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport JSON5 from 'json5';\nimport { colorizePath, logger } from '../logger';\nimport {\n parseFileContent,\n type SandBoxContextOptions,\n} from './parseFileContent';\nimport {\n type TranspileOptions,\n transpileTSToCJS,\n transpileTSToCJSSync,\n} from './transpileTSToCJS';\n\n// CJS MJS cross usage\nconst parseJSON5 = JSON5.parse || (JSON5 as any).default?.parse;\n\nexport type LoadExternalFileOptions = {\n configuration?: IntlayerConfig;\n buildOptions?: TranspileOptions;\n logError?: boolean;\n} & SandBoxContextOptions;\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFileSync = (\n filePath: string,\n options?: LoadExternalFileOptions\n): any | undefined => {\n const fileExtension = extname(filePath) || '.json';\n\n try {\n if (\n fileExtension === '.json' ||\n fileExtension === '.json5' ||\n fileExtension === '.jsonc'\n ) {\n // Assume JSON\n return parseJSON5(readFileSync(filePath, 'utf-8'));\n }\n\n // Rest is JS, MJS or TS\n const code = readFileSync(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = transpileTSToCJSSync(\n code,\n filePath,\n options?.buildOptions\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File could not be loaded. Path : ${filePath}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nexport const loadExternalFile = async (\n filePath: string,\n options?: LoadExternalFileOptions\n): Promise<any | undefined> => {\n const fileExtension = extname(filePath);\n\n try {\n if (\n fileExtension === '.json' ||\n fileExtension === '.json5' ||\n fileExtension === '.jsonc'\n ) {\n // Remove cache to force getting fresh content\n const fileContent = await readFile(filePath, 'utf-8');\n return parseJSON5(fileContent);\n }\n\n // Rest is JS, MJS or TS\n const code = await readFile(filePath, 'utf-8');\n\n const moduleResultString: string | undefined = await transpileTSToCJS(\n code,\n filePath,\n options?.buildOptions\n );\n\n if (!moduleResultString) {\n logger('File could not be loaded.', { level: 'error' });\n return undefined;\n }\n\n const fileContent = parseFileContent(moduleResultString, {\n projectRequire: options?.projectRequire,\n envVarOptions: options?.envVarOptions,\n additionalEnvVars: options?.additionalEnvVars,\n mocks: options?.mocks,\n aliases: options?.aliases,\n });\n\n if (typeof fileContent === 'undefined') {\n logger(`File could not be loaded. Path : ${colorizePath(filePath)}`);\n return undefined;\n }\n\n return fileContent;\n } catch (error) {\n if (options?.logError ?? true) {\n logger(\n [\n `Error: ${(error as Error).message} - `,\n JSON.stringify((error as Error).stack, null, 2),\n ],\n {\n level: 'error',\n }\n );\n }\n }\n};\n"],"mappings":"mVAiBA,MAAM,EAAa,EAAM,OAAU,EAAc,SAAS,MAa7C,GACX,EACA,IACoB,CACpB,IAAM,EAAgB,EAAQ,EAAS,EAAI,QAE3C,GAAI,CACF,GACE,IAAkB,SAClB,IAAkB,UAClB,IAAkB,SAGlB,OAAO,EAAW,EAAa,EAAU,QAAQ,CAAC,CAMpD,IAAM,EAAyC,EAFlC,EAAa,EAAU,QAAQ,CAI1C,EACA,GAAS,aACV,CAED,GAAI,CAAC,EAAoB,CACvB,EAAO,4BAA6B,CAAE,MAAO,QAAS,CAAC,CACvD,OAGF,IAAM,EAAc,EAAiB,EAAoB,CACvD,eAAgB,GAAS,eACzB,cAAe,GAAS,cACxB,kBAAmB,GAAS,kBAC5B,MAAO,GAAS,MAChB,QAAS,GAAS,QACnB,CAAC,CAEF,GAAW,IAAgB,OAAa,CACtC,EAAO,oCAAoC,IAAW,CACtD,OAGF,OAAO,QACA,EAAO,CACd,EACE,CACE,UAAW,EAAgB,QAAQ,KACnC,KAAK,UAAW,EAAgB,MAAO,KAAM,EAAE,CAChD,CACD,CACE,MAAO,QACR,CACF,GASQ,EAAmB,MAC9B,EACA,IAC6B,CAC7B,IAAM,EAAgB,EAAQ,EAAS,CAEvC,GAAI,CACF,GACE,IAAkB,SAClB,IAAkB,UAClB,IAAkB,SAIlB,OAAO,EADa,MAAM,EAAS,EAAU,QAAQ,CACvB,CAMhC,IAAM,EAAyC,MAAM,EAFxC,MAAM,EAAS,EAAU,QAAQ,CAI5C,EACA,GAAS,aACV,CAED,GAAI,CAAC,EAAoB,CACvB,EAAO,4BAA6B,CAAE,MAAO,QAAS,CAAC,CACvD,OAGF,IAAM,EAAc,EAAiB,EAAoB,CACvD,eAAgB,GAAS,eACzB,cAAe,GAAS,cACxB,kBAAmB,GAAS,kBAC5B,MAAO,GAAS,MAChB,QAAS,GAAS,QACnB,CAAC,CAEF,GAAW,IAAgB,OAAa,CACtC,EAAO,oCAAoC,EAAa,EAAS,GAAG,CACpE,OAGF,OAAO,QACA,EAAO,EACV,GAAS,UAAY,KACvB,EACE,CACE,UAAW,EAAgB,QAAQ,KACnC,KAAK,UAAW,EAAgB,MAAO,KAAM,EAAE,CAChD,CACD,CACE,MAAO,QACR,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e}from"../ESMxCJSHelpers-BAuqwNXV.mjs";import{loadEnvFile as t}from"../loadEnvFile.mjs";import{runInNewContext as n}from"node:vm";import*as r from"esbuild";const i=n=>{let{envVarOptions:i,projectRequire:a,additionalEnvVars:o,mocks:s,aliases:c}=n??{},l={},u=typeof a==`function`?a:e(),d=(()=>{let e=Object.assign({esbuild:r},s),t=Object.assign({},c),n=function(n){let r=t?.[n]?t[n]:n;return e&&Object.hasOwn(e,r)?e[r]:r!==n&&e&&Object.hasOwn(e,n)?e[n]:u(r)};return n.resolve=u.resolve.bind(u),n.main=u.main,n.extensions=u.extensions,n.cache=u.cache,n})();try{l={React:u(`react`)}}catch{l={React:{createElement:(e,t,...n)=>({type:e,props:{...t,children:n.length<=1?n[0]:n}}),Fragment:Symbol.for(`react.fragment`)}}}let f={exports:{default:{}},module:{exports:{}},process:{...process,env:{...process.env,...t(i),...o}},console,require:d,...l};return Object.getOwnPropertyNames(globalThis).forEach(e=>{e in f||(f[e]=globalThis[e])}),f},a=(e,t)=>{let r=i(t);n(`"use strict";\n${e}`,r);let a=[r.exports?.default,r.module?.exports?.defaults,r.module?.exports?.default,r.module?.exports];for(let e of a)if(e&&typeof e==`object`&&Object.keys(e).length>0)return e};export{i as getSandBoxContext,a as parseFileContent};
|
|
2
2
|
//# sourceMappingURL=parseFileContent.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseFileContent.mjs","names":[],"sources":["../../../src/loadExternalFile/parseFileContent.ts"],"sourcesContent":["import { type Context, runInNewContext } from 'node:vm';\nimport * as esbuild from 'esbuild';\nimport { type LoadEnvFileOptions, loadEnvFile } from '../loadEnvFile';\nimport { getProjectRequire } from '../utils/ESMxCJSHelpers';\n\nexport type SandBoxContextOptions = {\n envVarOptions?: LoadEnvFileOptions;\n projectRequire?: NodeJS.Require;\n additionalEnvVars?: Record<string, string>;\n /**\n * Map of specifier -> mocked export to be returned when code in the VM calls require(specifier).\n * Example:\n * mocks: {\n * '@intlayer/config/built': { getConfig: () => ({}), Locales: {} }\n * }\n */\n mocks?: Record<string, any>;\n /**\n * Optional alias map if you want to redirect specifiers.\n * Useful when user code imports a subpath you want to collapse.\n * Example:\n * aliases: { '@intlayer/config/built': '@intlayer/config' }\n */\n aliases?: Record<string, string>;\n};\n\nexport const getSandBoxContext = (options?: SandBoxContextOptions): Context => {\n const { envVarOptions, projectRequire, additionalEnvVars, mocks, aliases } =\n options ?? {};\n\n let additionalGlobalVar = {};\n\n const baseRequire: NodeJS.Require =\n typeof projectRequire === 'function' ? projectRequire : getProjectRequire();\n\n // Wrap require to honor mocks and aliases inside the VM\n const mockedRequire: NodeJS.Require = (() => {\n const mockTable = Object.assign(\n {\n esbuild,\n },\n mocks\n );\n const aliasTable = Object.assign({}, aliases);\n\n const wrappedRequire = function mockableRequire(id: string) {\n const target = aliasTable?.[id] ? aliasTable[id] : id;\n\n if (mockTable && Object.hasOwn(mockTable, target)) {\n return mockTable[target];\n }\n\n // If the original id was aliased, allow mocks to be defined on either key.\n if (target !== id && mockTable && Object.hasOwn(mockTable, id)) {\n return mockTable[id];\n }\n\n return baseRequire(target);\n } as NodeJS.Require;\n\n // Mirror NodeJS.Require properties\n wrappedRequire.resolve = baseRequire.resolve.bind(baseRequire);\n wrappedRequire.main = baseRequire.main;\n wrappedRequire.extensions = baseRequire.extensions;\n wrappedRequire.cache = baseRequire.cache;\n\n return wrappedRequire;\n })();\n\n try {\n // Dynamically try to require React if it's installed in the project\n additionalGlobalVar = {\n React: baseRequire('react'),\n };\n } catch (_err) {\n // React is not installed, so we inject a dummy React object to capture JSX elements\n // This allows using JSX in content declarations even if React is not installed (e.g. in Solid.js or Vue projects)\n // because esbuild's tsx loader defaults to React.createElement.\n additionalGlobalVar = {\n React: {\n createElement: (type: any, props: any, ...children: any[]) => ({\n type,\n props: {\n ...props,\n children: children.length <= 1 ? children[0] : children,\n },\n }),\n Fragment: Symbol.for('react.fragment'),\n },\n };\n }\n\n const sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n process: {\n ...process,\n env: {\n ...process.env,\n ...loadEnvFile(envVarOptions),\n ...additionalEnvVars,\n },\n },\n console,\n require: mockedRequire,\n ...additionalGlobalVar,\n };\n\n // Dynamically inject all global variables\n Object.getOwnPropertyNames(globalThis).forEach((key) => {\n if (!(key in sandboxContext)) {\n sandboxContext[key] = globalThis[key as keyof typeof globalThis];\n }\n });\n\n return sandboxContext;\n};\n\nexport const parseFileContent = <T>(\n fileContentString: string,\n options?: SandBoxContextOptions\n): T | undefined => {\n const sandboxContext = getSandBoxContext(options);\n\n // Force strict mode so illegal writes throw instead of silently failing.\n runInNewContext(`\"use strict\";\\n${fileContentString}`, sandboxContext);\n\n const candidates: unknown[] = [\n sandboxContext.exports?.default,\n sandboxContext.module?.exports?.defaults,\n sandboxContext.module?.exports?.default,\n sandboxContext.module?.exports,\n ];\n\n for (const candidate of candidates) {\n if (\n candidate &&\n typeof candidate === 'object' &&\n Object.keys(candidate as object).length > 0\n ) {\n return candidate as T;\n }\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseFileContent.mjs","names":[],"sources":["../../../src/loadExternalFile/parseFileContent.ts"],"sourcesContent":["import { type Context, runInNewContext } from 'node:vm';\nimport * as esbuild from 'esbuild';\nimport { type LoadEnvFileOptions, loadEnvFile } from '../loadEnvFile';\nimport { getProjectRequire } from '../utils/ESMxCJSHelpers';\n\nexport type SandBoxContextOptions = {\n envVarOptions?: LoadEnvFileOptions;\n projectRequire?: NodeJS.Require;\n additionalEnvVars?: Record<string, string>;\n /**\n * Map of specifier -> mocked export to be returned when code in the VM calls require(specifier).\n * Example:\n * mocks: {\n * '@intlayer/config/built': { getConfig: () => ({}), Locales: {} }\n * }\n */\n mocks?: Record<string, any>;\n /**\n * Optional alias map if you want to redirect specifiers.\n * Useful when user code imports a subpath you want to collapse.\n * Example:\n * aliases: { '@intlayer/config/built': '@intlayer/config' }\n */\n aliases?: Record<string, string>;\n};\n\nexport const getSandBoxContext = (options?: SandBoxContextOptions): Context => {\n const { envVarOptions, projectRequire, additionalEnvVars, mocks, aliases } =\n options ?? {};\n\n let additionalGlobalVar = {};\n\n const baseRequire: NodeJS.Require =\n typeof projectRequire === 'function' ? projectRequire : getProjectRequire();\n\n // Wrap require to honor mocks and aliases inside the VM\n const mockedRequire: NodeJS.Require = (() => {\n const mockTable = Object.assign(\n {\n esbuild,\n },\n mocks\n );\n const aliasTable = Object.assign({}, aliases);\n\n const wrappedRequire = function mockableRequire(id: string) {\n const target = aliasTable?.[id] ? aliasTable[id] : id;\n\n if (mockTable && Object.hasOwn(mockTable, target)) {\n return mockTable[target];\n }\n\n // If the original id was aliased, allow mocks to be defined on either key.\n if (target !== id && mockTable && Object.hasOwn(mockTable, id)) {\n return mockTable[id];\n }\n\n return baseRequire(target);\n } as NodeJS.Require;\n\n // Mirror NodeJS.Require properties\n wrappedRequire.resolve = baseRequire.resolve.bind(baseRequire);\n wrappedRequire.main = baseRequire.main;\n wrappedRequire.extensions = baseRequire.extensions;\n wrappedRequire.cache = baseRequire.cache;\n\n return wrappedRequire;\n })();\n\n try {\n // Dynamically try to require React if it's installed in the project\n additionalGlobalVar = {\n React: baseRequire('react'),\n };\n } catch (_err) {\n // React is not installed, so we inject a dummy React object to capture JSX elements\n // This allows using JSX in content declarations even if React is not installed (e.g. in Solid.js or Vue projects)\n // because esbuild's tsx loader defaults to React.createElement.\n additionalGlobalVar = {\n React: {\n createElement: (type: any, props: any, ...children: any[]) => ({\n type,\n props: {\n ...props,\n children: children.length <= 1 ? children[0] : children,\n },\n }),\n Fragment: Symbol.for('react.fragment'),\n },\n };\n }\n\n const sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n process: {\n ...process,\n env: {\n ...process.env,\n ...loadEnvFile(envVarOptions),\n ...additionalEnvVars,\n },\n },\n console,\n require: mockedRequire,\n ...additionalGlobalVar,\n };\n\n // Dynamically inject all global variables\n Object.getOwnPropertyNames(globalThis).forEach((key) => {\n if (!(key in sandboxContext)) {\n sandboxContext[key] = globalThis[key as keyof typeof globalThis];\n }\n });\n\n return sandboxContext;\n};\n\nexport const parseFileContent = <T>(\n fileContentString: string,\n options?: SandBoxContextOptions\n): T | undefined => {\n const sandboxContext = getSandBoxContext(options);\n\n // Force strict mode so illegal writes throw instead of silently failing.\n runInNewContext(`\"use strict\";\\n${fileContentString}`, sandboxContext);\n\n const candidates: unknown[] = [\n sandboxContext.exports?.default,\n sandboxContext.module?.exports?.defaults,\n sandboxContext.module?.exports?.default,\n sandboxContext.module?.exports,\n ];\n\n for (const candidate of candidates) {\n if (\n candidate &&\n typeof candidate === 'object' &&\n Object.keys(candidate as object).length > 0\n ) {\n return candidate as T;\n }\n }\n};\n"],"mappings":"wKA0BA,MAAa,EAAqB,GAA6C,CAC7E,GAAM,CAAE,gBAAe,iBAAgB,oBAAmB,QAAO,WAC/D,GAAW,EAAE,CAEX,EAAsB,EAAE,CAEtB,EACJ,OAAO,GAAmB,WAAa,EAAiB,GAAmB,CAGvE,OAAuC,CAC3C,IAAM,EAAY,OAAO,OACvB,CACE,UACD,CACD,EACD,CACK,EAAa,OAAO,OAAO,EAAE,CAAE,EAAQ,CAEvC,EAAiB,SAAyB,EAAY,CAC1D,IAAM,EAAS,IAAa,GAAM,EAAW,GAAM,EAWnD,OATI,GAAa,OAAO,OAAO,EAAW,EAAO,CACxC,EAAU,GAIf,IAAW,GAAM,GAAa,OAAO,OAAO,EAAW,EAAG,CACrD,EAAU,GAGZ,EAAY,EAAO,EAS5B,MALA,GAAe,QAAU,EAAY,QAAQ,KAAK,EAAY,CAC9D,EAAe,KAAO,EAAY,KAClC,EAAe,WAAa,EAAY,WACxC,EAAe,MAAQ,EAAY,MAE5B,KACL,CAEJ,GAAI,CAEF,EAAsB,CACpB,MAAO,EAAY,QAAQ,CAC5B,MACY,CAIb,EAAsB,CACpB,MAAO,CACL,eAAgB,EAAW,EAAY,GAAG,KAAqB,CAC7D,OACA,MAAO,CACL,GAAG,EACH,SAAU,EAAS,QAAU,EAAI,EAAS,GAAK,EAChD,CACF,EACD,SAAU,OAAO,IAAI,iBAAiB,CACvC,CACF,CAGH,IAAM,EAA0B,CAC9B,QAAS,CACP,QAAS,EAAE,CACZ,CACD,OAAQ,CACN,QAAS,EAAE,CACZ,CACD,QAAS,CACP,GAAG,QACH,IAAK,CACH,GAAG,QAAQ,IACX,GAAG,EAAY,EAAc,CAC7B,GAAG,EACJ,CACF,CACD,QACA,QAAS,EACT,GAAG,EACJ,CASD,OANA,OAAO,oBAAoB,WAAW,CAAC,QAAS,GAAQ,CAChD,KAAO,IACX,EAAe,GAAO,WAAW,KAEnC,CAEK,GAGI,GACX,EACA,IACkB,CAClB,IAAM,EAAiB,EAAkB,EAAQ,CAGjD,EAAgB,kBAAkB,IAAqB,EAAe,CAEtE,IAAM,EAAwB,CAC5B,EAAe,SAAS,QACxB,EAAe,QAAQ,SAAS,SAChC,EAAe,QAAQ,SAAS,QAChC,EAAe,QAAQ,QACxB,CAED,IAAK,IAAM,KAAa,EACtB,GACE,GACA,OAAO,GAAc,UACrB,OAAO,KAAK,EAAoB,CAAC,OAAS,EAE1C,OAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getPackageJsonPath as e}from"../utils/getPackageJsonPath.mjs";import{getLoader as t}from"./bundleFile.mjs";import{existsSync as n}from"node:fs";import{dirname as r,extname as i,join as a}from"node:path";import{build as o,buildSync as s}from"esbuild";import{pathToFileURL as c}from"node:url";const l=t=>{let i=a(e(r(t)).baseDir,`tsconfig.json`);return n(i)?i:void 0},u=e=>({loader:{".js":`js`,".jsx":`jsx`,".mjs":`js`,".ts":`ts`,".tsx":`tsx`,".cjs":`js`,".json":`json`,".md":`text`,".mdx":`text`},format:`cjs`,target:`node20`,platform:`node`,write:!1,packages:`external`,bundle:!0,tsconfig:l(e),define:{"import.meta.url":JSON.stringify(c(e).href)}}),d=(e,n,a)=>s({stdin:{contents:e,loader:
|
|
1
|
+
import{getPackageJsonPath as e}from"../utils/getPackageJsonPath.mjs";import{getLoader as t}from"./bundleFile.mjs";import{existsSync as n}from"node:fs";import{dirname as r,extname as i,join as a}from"node:path";import{build as o,buildSync as s}from"esbuild";import{pathToFileURL as c}from"node:url";const l=t=>{let i=a(e(r(t)).baseDir,`tsconfig.json`);return n(i)?i:void 0},u=e=>({loader:{".js":`js`,".jsx":`jsx`,".mjs":`js`,".ts":`ts`,".tsx":`tsx`,".cjs":`js`,".json":`json`,".md":`text`,".mdx":`text`},format:`cjs`,target:`node20`,platform:`node`,write:!1,packages:`external`,bundle:!0,tsconfig:l(e),define:{"import.meta.url":JSON.stringify(c(e).href)}}),d=(e,n,a)=>{let o=t(i(n)),{esbuildInstance:c,...l}=a??{};return(c?.buildSync??s)({stdin:{contents:e,loader:o,resolveDir:r(n),sourcefile:n},...u(n),...l}).outputFiles?.[0].text},f=async(e,n,a)=>{let s=t(i(n)),{esbuildInstance:c,...l}=a??{};return(await(c?.build??o)({stdin:{contents:e,loader:s,resolveDir:r(n),sourcefile:n},...u(n),...l})).outputFiles?.[0].text};export{f as transpileTSToCJS,d as transpileTSToCJSSync};
|
|
2
2
|
//# sourceMappingURL=transpileTSToCJS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpileTSToCJS.mjs","names":[],"sources":["../../../src/loadExternalFile/transpileTSToCJS.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, extname, join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { type BuildOptions, type BuildResult, build, buildSync } from 'esbuild';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\nimport { getLoader } from './bundleFile';\n\nconst getTsConfigPath = (filePath: string): string | undefined => {\n const tsconfigPath = join(\n getPackageJsonPath(dirname(filePath)).baseDir,\n 'tsconfig.json'\n );\n\n // Only return the tsconfig path if it exists\n return existsSync(tsconfigPath) ? tsconfigPath : undefined;\n};\n\nconst getTransformationOptions = (filePath: string): BuildOptions => ({\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n '.md': 'text',\n '.mdx': 'text',\n },\n format: 'cjs',\n target: 'node20',\n platform: 'node',\n write: false,\n packages: 'external',\n bundle: true,\n tsconfig: getTsConfigPath(filePath),\n define: {\n 'import.meta.url': JSON.stringify(pathToFileURL(filePath).href),\n },\n});\n\nexport const transpileTSToCJSSync = (\n code: string,\n filePath: string,\n options?:
|
|
1
|
+
{"version":3,"file":"transpileTSToCJS.mjs","names":[],"sources":["../../../src/loadExternalFile/transpileTSToCJS.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, extname, join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { type BuildOptions, type BuildResult, build, buildSync } from 'esbuild';\nimport { getPackageJsonPath } from '../utils/getPackageJsonPath';\nimport { getLoader } from './bundleFile';\n\nexport type TranspileOptions = BuildOptions & {\n /**\n * Optional custom esbuild instance to use for transpilation.\n * Useful in environments (e.g. VS Code extensions) where the bundled\n * esbuild binary may not match the host platform.\n * When provided, its `buildSync`/`build` methods are used instead of\n * the ones imported from the `esbuild` package.\n */\n esbuildInstance?: typeof import('esbuild');\n};\n\nconst getTsConfigPath = (filePath: string): string | undefined => {\n const tsconfigPath = join(\n getPackageJsonPath(dirname(filePath)).baseDir,\n 'tsconfig.json'\n );\n\n // Only return the tsconfig path if it exists\n return existsSync(tsconfigPath) ? tsconfigPath : undefined;\n};\n\nconst getTransformationOptions = (filePath: string): BuildOptions => ({\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n '.md': 'text',\n '.mdx': 'text',\n },\n format: 'cjs',\n target: 'node20',\n platform: 'node',\n write: false,\n packages: 'external',\n bundle: true,\n tsconfig: getTsConfigPath(filePath),\n define: {\n 'import.meta.url': JSON.stringify(pathToFileURL(filePath).href),\n },\n});\n\nexport const transpileTSToCJSSync = (\n code: string,\n filePath: string,\n options?: TranspileOptions\n): string | undefined => {\n const extension = extname(filePath);\n const loader = getLoader(extension);\n\n const { esbuildInstance, ...buildOptions } = options ?? {};\n const esbuildBuildSync = esbuildInstance?.buildSync ?? buildSync;\n\n const moduleResult: BuildResult = esbuildBuildSync({\n stdin: {\n contents: code,\n loader,\n resolveDir: dirname(filePath), // Add resolveDir to resolve imports relative to the file's location\n sourcefile: filePath, // Add sourcefile for better error messages\n },\n ...getTransformationOptions(filePath),\n ...buildOptions,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n return moduleResultString;\n};\n\nexport const transpileTSToCJS = async (\n code: string,\n filePath: string,\n options?: TranspileOptions\n): Promise<string | undefined> => {\n const extension = extname(filePath);\n const loader = getLoader(extension);\n\n const { esbuildInstance, ...buildOptions } = options ?? {};\n const esbuildBuild = esbuildInstance?.build ?? build;\n\n const moduleResult: BuildResult = await esbuildBuild({\n stdin: {\n contents: code,\n loader,\n resolveDir: dirname(filePath), // Add resolveDir to resolve imports relative to the file's location\n sourcefile: filePath, // Add sourcefile for better error messages\n },\n ...getTransformationOptions(filePath),\n ...buildOptions,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n return moduleResultString;\n};\n"],"mappings":"0SAkBA,MAAM,EAAmB,GAAyC,CAChE,IAAM,EAAe,EACnB,EAAmB,EAAQ,EAAS,CAAC,CAAC,QACtC,gBACD,CAGD,OAAO,EAAW,EAAa,CAAG,EAAe,IAAA,IAG7C,EAA4B,IAAoC,CACpE,OAAQ,CACN,MAAO,KACP,OAAQ,MACR,OAAQ,KACR,MAAO,KACP,OAAQ,MACR,OAAQ,KACR,QAAS,OACT,MAAO,OACP,OAAQ,OACT,CACD,OAAQ,MACR,OAAQ,SACR,SAAU,OACV,MAAO,GACP,SAAU,WACV,OAAQ,GACR,SAAU,EAAgB,EAAS,CACnC,OAAQ,CACN,kBAAmB,KAAK,UAAU,EAAc,EAAS,CAAC,KAAK,CAChE,CACF,EAEY,GACX,EACA,EACA,IACuB,CAEvB,IAAM,EAAS,EADG,EAAQ,EAAS,CACA,CAE7B,CAAE,kBAAiB,GAAG,GAAiB,GAAW,EAAE,CAgB1D,OAfyB,GAAiB,WAAa,GAEJ,CACjD,MAAO,CACL,SAAU,EACV,SACA,WAAY,EAAQ,EAAS,CAC7B,WAAY,EACb,CACD,GAAG,EAAyB,EAAS,CACrC,GAAG,EACJ,CAAC,CAEsC,cAAc,GAAG,MAK9C,EAAmB,MAC9B,EACA,EACA,IACgC,CAEhC,IAAM,EAAS,EADG,EAAQ,EAAS,CACA,CAE7B,CAAE,kBAAiB,GAAG,GAAiB,GAAW,EAAE,CAgB1D,OAbkC,MAFb,GAAiB,OAAS,GAEM,CACnD,MAAO,CACL,SAAU,EACV,SACA,WAAY,EAAQ,EAAS,CAC7B,WAAY,EACb,CACD,GAAG,EAAyB,EAAS,CACrC,GAAG,EACJ,CAAC,EAEsC,cAAc,GAAG"}
|
package/dist/esm/logger.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{BEIGE as e,BLUE as t,GREEN as n,GREY as r,RED as i,RESET as a}from"./colors.mjs";let o;const s=e=>{o=e},c=e=>o===void 0?e:o,l=(e,t)=>{let n=t?.isVerbose??!1,r=t?.config?.mode??`default`,i=t?.level??`info`,a=c(t?.config?.prefix),o=t?.config?.log??console.log,s=t?.config?.info??console.info,l=t?.config?.warn??console.warn,u=t?.config?.error??console.error,d=t?.config?.debug??console.debug;if(r===`disabled`||n&&r!==`verbose`)return;let f=a?[a,...[e].flat()]:[e].flat();if(i===`debug`)return d(...f);if(i===`info`)return s(...f);if(i===`warn`)return l(...f);if(i===`error`)return u(...f);o(...f)},u=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`],d=(e,t)=>(n,r)=>l(n,{...r??{},config:{...e?.log,...t?.config,...r?.config??{}}}),f=(e,t,n)=>t?`${t}${e}${n?typeof n==`boolean`?a:n:a}`:e,p=(e,t=n,r=a)=>[e].flat().map(e=>f(e,t,r)).join(`, `),m=(t,n=e,r=a)=>[t].flat().map(e=>f(e,n,r)).join(`, `),h=(e,t=r,n=a)=>[e].flat().map(e=>f(e,t,n)).join(`, `),g=(e,n={zero:t,one:t,two:t,few:t,many:t,other:t})=>{if(e===0){let t=n.zero??`\x1B[32m`;return f(e.toString(),t)}let r=n[new Intl.PluralRules(`en`).select(Number(e))];return f(e.toString(),r)},_=e=>e.replace(/\x1b\[[0-9;]*m/g,``),v=e=>{let t=0;return typeof e==`number`&&(t=e),typeof e==`string`&&(t=e.length),Array.isArray(e)&&e.every(e=>typeof e==`string`)&&(t=Math.max(...e.map(e=>e.length))),Array.isArray(e)&&e.every(e=>typeof e==`number`)&&(t=Math.max(...e)),Math.max(t,0)},y={colSize:0,minSize:0,maxSize:1/0,pad:`right`,padChar:`0`},b=(e,t)=>[e].flat().map(e=>{let{colSize:n,minSize:r,maxSize:i,pad:a}={...y,...t??{}},o=v(n),s=Math.max(r,Math.min(i,o-_(e).length));return a===`left`?`${` `.repeat(s)}${e}`:`${e}${` `.repeat(s)}`}).join(``),x=f(`✗`,i),S=f(`✓`,n),C=f(`⏲`,t);export{C as clock,b as colon,f as colorize,m as colorizeKey,p as colorizeLocales,g as colorizeNumber,h as colorizePath,d as getAppLogger,c as getPrefix,l as logger,_ as removeColor,s as setPrefix,u as spinnerFrames,S as v,x};
|
|
2
2
|
//# sourceMappingURL=logger.mjs.map
|
package/dist/esm/logger.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.mjs","names":[],"sources":["../../src/logger.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { CustomIntlayerConfig } from '@intlayer/types/config';\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: CustomIntlayerConfig['log'];\n};\n\nexport type Logger = (content: any, details?: Details) => void;\n\nlet loggerPrefix: string | undefined;\n\nexport const setPrefix = (prefix: string | undefined) => {\n loggerPrefix = prefix;\n};\n\nexport const getPrefix = (configPrefix?: string): string | undefined => {\n if (typeof loggerPrefix !== 'undefined') {\n return loggerPrefix;\n }\n\n return configPrefix;\n};\n\nexport const logger: Logger = (content, details) => {\n const isVerbose = details?.isVerbose ?? false;\n const mode = details?.config?.mode ?? 'default';\n const level = details?.level ?? 'info';\n const prefix = getPrefix(details?.config?.prefix);\n const log = details?.config?.log ?? console.log;\n const info = details?.config?.info ?? console.info;\n const warn = details?.config?.warn ?? console.warn;\n const error = details?.config?.error ?? console.error;\n const debug = details?.config?.debug ?? console.debug;\n\n if (mode === 'disabled') return;\n\n if (isVerbose && mode !== 'verbose') return;\n\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n\n if (level === 'debug') {\n return debug(...flatContent);\n }\n\n if (level === 'info') {\n return info(...flatContent);\n }\n\n if (level === 'warn') {\n return warn(...flatContent);\n }\n\n if (level === 'error') {\n return error(...flatContent);\n }\n\n log(...flatContent);\n};\n\nexport
|
|
1
|
+
{"version":3,"file":"logger.mjs","names":["ANSIColors.RESET","ANSIColors.GREEN","ANSIColors.BEIGE","ANSIColors.GREY","ANSIColors.BLUE","ANSIColors.RED"],"sources":["../../src/logger.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type { CustomIntlayerConfig } from '@intlayer/types/config';\nimport * as ANSIColors from './colors';\n\nexport type ANSIColorsType = (typeof ANSIColors)[keyof typeof ANSIColors];\n\nexport type Details = {\n isVerbose?: boolean;\n level?: 'info' | 'warn' | 'error' | 'debug';\n config?: CustomIntlayerConfig['log'];\n};\n\nexport type Logger = (content: any, details?: Details) => void;\n\nlet loggerPrefix: string | undefined;\n\nexport const setPrefix = (prefix: string | undefined) => {\n loggerPrefix = prefix;\n};\n\nexport const getPrefix = (configPrefix?: string): string | undefined => {\n if (typeof loggerPrefix !== 'undefined') {\n return loggerPrefix;\n }\n\n return configPrefix;\n};\n\nexport const logger: Logger = (content, details) => {\n const isVerbose = details?.isVerbose ?? false;\n const mode = details?.config?.mode ?? 'default';\n const level = details?.level ?? 'info';\n const prefix = getPrefix(details?.config?.prefix);\n const log = details?.config?.log ?? console.log;\n const info = details?.config?.info ?? console.info;\n const warn = details?.config?.warn ?? console.warn;\n const error = details?.config?.error ?? console.error;\n const debug = details?.config?.debug ?? console.debug;\n\n if (mode === 'disabled') return;\n\n if (isVerbose && mode !== 'verbose') return;\n\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n\n if (level === 'debug') {\n return debug(...flatContent);\n }\n\n if (level === 'info') {\n return info(...flatContent);\n }\n\n if (level === 'warn') {\n return warn(...flatContent);\n }\n\n if (level === 'error') {\n return error(...flatContent);\n }\n\n log(...flatContent);\n};\n\nexport const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n\n/**\n * The appLogger function takes the logger and merges it with the configuration from the intlayer config file.\n * It allows overriding the default configuration by passing a config object in the details parameter.\n * The configuration is merged with the default configuration from the intlayer config file.\n */\nexport const getAppLogger =\n (configuration?: CustomIntlayerConfig, globalDetails?: Details) =>\n (content: any, details?: Details) =>\n logger(content, {\n ...(details ?? {}),\n config: {\n ...configuration?.log,\n ...globalDetails?.config,\n ...(details?.config ?? {}),\n },\n });\n\nexport const colorize = (\n s: string,\n color?: ANSIColorsType,\n reset?: boolean | ANSIColorsType\n): string =>\n color\n ? `${color}${s}${reset ? (typeof reset === 'boolean' ? ANSIColors.RESET : reset) : ANSIColors.RESET}`\n : s;\n\nexport const colorizeLocales = (\n locales: Locale | Locale[],\n color = ANSIColors.GREEN,\n reset: boolean | ANSIColorsType = ANSIColors.RESET\n) =>\n [locales]\n .flat()\n .map((locale) => colorize(locale, color, reset))\n .join(`, `);\n\nexport const colorizeKey = (\n keyPath: string | string[],\n color = ANSIColors.BEIGE,\n reset: boolean | ANSIColorsType = ANSIColors.RESET\n) =>\n [keyPath]\n .flat()\n .map((key) => colorize(key, color, reset))\n .join(`, `);\n\nexport const colorizePath = (\n path: string | string[],\n color = ANSIColors.GREY,\n reset: boolean | ANSIColorsType = ANSIColors.RESET\n) =>\n [path]\n .flat()\n .map((path) => colorize(path, color, reset))\n .join(`, `);\n\n/**\n * Colorize numeric value using Intl.NumberFormat and optional ANSI colors.\n *\n * Examples:\n * colorizeNumber(2, [{ pluralRule: 'one' , color: ANSIColors.GREEN}, { pluralRule: 'other' , color: ANSIColors.RED}]) // \"'\\x1b[31m2\\x1b[0m\"\n */\nexport const colorizeNumber = (\n number: number | string,\n options: Partial<Record<Intl.LDMLPluralRule, ANSIColorsType>> = {\n zero: ANSIColors.BLUE,\n one: ANSIColors.BLUE,\n two: ANSIColors.BLUE,\n few: ANSIColors.BLUE,\n many: ANSIColors.BLUE,\n other: ANSIColors.BLUE,\n }\n): string => {\n if (number === 0) {\n const color = options.zero ?? ANSIColors.GREEN;\n return colorize(number.toString(), color);\n }\n\n const rule = new Intl.PluralRules('en').select(Number(number));\n const color = options[rule];\n return colorize(number.toString(), color);\n};\n\nexport const removeColor = (text: string) =>\n // biome-ignore lint/suspicious/noControlCharactersInRegex: we need to remove the color codes\n text.replace(/\\x1b\\[[0-9;]*m/g, '');\n\nconst getLength = (length: number | number[] | string | string[]): number => {\n let value: number = 0;\n if (typeof length === 'number') {\n value = length;\n }\n if (typeof length === 'string') {\n value = length.length;\n }\n if (Array.isArray(length) && length.every((l) => typeof l === 'string')) {\n value = Math.max(...length.map((str) => str.length));\n }\n if (Array.isArray(length) && length.every((l) => typeof l === 'number')) {\n value = Math.max(...length);\n }\n return Math.max(value, 0);\n};\n\nconst defaultColonOptions = {\n colSize: 0,\n minSize: 0,\n maxSize: Infinity,\n pad: 'right',\n padChar: '0',\n};\n\n/**\n * Create a string of spaces of a given length.\n *\n * @param colSize - The length of the string to create.\n * @returns A string of spaces.\n */\nexport const colon = (\n text: string | string[],\n options?: {\n colSize?: number | number[] | string | string[];\n minSize?: number;\n maxSize?: number;\n pad?: 'left' | 'right';\n padChar?: string;\n }\n): string =>\n [text]\n .flat()\n .map((text) => {\n const { colSize, minSize, maxSize, pad } = {\n ...defaultColonOptions,\n ...(options ?? {}),\n };\n\n const length = getLength(colSize);\n const spacesLength = Math.max(\n minSize!,\n Math.min(maxSize!, length - removeColor(text).length)\n );\n\n if (pad === 'left') {\n return `${' '.repeat(spacesLength)}${text}`;\n }\n\n return `${text}${' '.repeat(spacesLength)}`;\n })\n .join('');\n\nexport const x = colorize('✗', ANSIColors.RED);\nexport const v = colorize('✓', ANSIColors.GREEN);\nexport const clock = colorize('⏲', ANSIColors.BLUE);\n"],"mappings":"wFAcA,IAAI,EAEJ,MAAa,EAAa,GAA+B,CACvD,EAAe,GAGJ,EAAa,GACb,IAAiB,OAIrB,EAHE,EAME,GAAkB,EAAS,IAAY,CAClD,IAAM,EAAY,GAAS,WAAa,GAClC,EAAO,GAAS,QAAQ,MAAQ,UAChC,EAAQ,GAAS,OAAS,OAC1B,EAAS,EAAU,GAAS,QAAQ,OAAO,CAC3C,EAAM,GAAS,QAAQ,KAAO,QAAQ,IACtC,EAAO,GAAS,QAAQ,MAAQ,QAAQ,KACxC,EAAO,GAAS,QAAQ,MAAQ,QAAQ,KACxC,EAAQ,GAAS,QAAQ,OAAS,QAAQ,MAC1C,EAAQ,GAAS,QAAQ,OAAS,QAAQ,MAIhD,GAFI,IAAS,YAET,GAAa,IAAS,UAAW,OAErC,IAAM,EAAc,EAAS,CAAC,EAAQ,GAAG,CAAC,EAAQ,CAAC,MAAM,CAAC,CAAG,CAAC,EAAQ,CAAC,MAAM,CAE7E,GAAI,IAAU,QACZ,OAAO,EAAM,GAAG,EAAY,CAG9B,GAAI,IAAU,OACZ,OAAO,EAAK,GAAG,EAAY,CAG7B,GAAI,IAAU,OACZ,OAAO,EAAK,GAAG,EAAY,CAG7B,GAAI,IAAU,QACZ,OAAO,EAAM,GAAG,EAAY,CAG9B,EAAI,GAAG,EAAY,EAGR,EAAgB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAI,CAOlE,GACV,EAAsC,KACtC,EAAc,IACb,EAAO,EAAS,CACd,GAAI,GAAW,EAAE,CACjB,OAAQ,CACN,GAAG,GAAe,IAClB,GAAG,GAAe,OAClB,GAAI,GAAS,QAAU,EAAE,CAC1B,CACF,CAAC,CAEO,GACX,EACA,EACA,IAEA,EACI,GAAG,IAAQ,IAAI,EAAS,OAAO,GAAU,UAAYA,EAAmB,EAASA,IACjF,EAEO,GACX,EACA,EAAQC,EACR,EAAkCD,IAElC,CAAC,EAAQ,CACN,MAAM,CACN,IAAK,GAAW,EAAS,EAAQ,EAAO,EAAM,CAAC,CAC/C,KAAK,KAAK,CAEF,GACX,EACA,EAAQE,EACR,EAAkCF,IAElC,CAAC,EAAQ,CACN,MAAM,CACN,IAAK,GAAQ,EAAS,EAAK,EAAO,EAAM,CAAC,CACzC,KAAK,KAAK,CAEF,GACX,EACA,EAAQG,EACR,EAAkCH,IAElC,CAAC,EAAK,CACH,MAAM,CACN,IAAK,GAAS,EAAS,EAAM,EAAO,EAAM,CAAC,CAC3C,KAAK,KAAK,CAQF,GACX,EACA,EAAgE,CAC9D,KAAMI,EACN,IAAKA,EACL,IAAKA,EACL,IAAKA,EACL,KAAMA,EACN,MAAOA,EACR,GACU,CACX,GAAI,IAAW,EAAG,CAChB,IAAM,EAAQ,EAAQ,MAAQ,WAC9B,OAAO,EAAS,EAAO,UAAU,CAAE,EAAM,CAI3C,IAAM,EAAQ,EADD,IAAI,KAAK,YAAY,KAAK,CAAC,OAAO,OAAO,EAAO,CAAC,EAE9D,OAAO,EAAS,EAAO,UAAU,CAAE,EAAM,EAG9B,EAAe,GAE1B,EAAK,QAAQ,kBAAmB,GAAG,CAE/B,EAAa,GAA0D,CAC3E,IAAI,EAAgB,EAapB,OAZI,OAAO,GAAW,WACpB,EAAQ,GAEN,OAAO,GAAW,WACpB,EAAQ,EAAO,QAEb,MAAM,QAAQ,EAAO,EAAI,EAAO,MAAO,GAAM,OAAO,GAAM,SAAS,GACrE,EAAQ,KAAK,IAAI,GAAG,EAAO,IAAK,GAAQ,EAAI,OAAO,CAAC,EAElD,MAAM,QAAQ,EAAO,EAAI,EAAO,MAAO,GAAM,OAAO,GAAM,SAAS,GACrE,EAAQ,KAAK,IAAI,GAAG,EAAO,EAEtB,KAAK,IAAI,EAAO,EAAE,EAGrB,EAAsB,CAC1B,QAAS,EACT,QAAS,EACT,QAAS,IACT,IAAK,QACL,QAAS,IACV,CAQY,GACX,EACA,IAQA,CAAC,EAAK,CACH,MAAM,CACN,IAAK,GAAS,CACb,GAAM,CAAE,UAAS,UAAS,UAAS,OAAQ,CACzC,GAAG,EACH,GAAI,GAAW,EAAE,CAClB,CAEK,EAAS,EAAU,EAAQ,CAC3B,EAAe,KAAK,IACxB,EACA,KAAK,IAAI,EAAU,EAAS,EAAY,EAAK,CAAC,OAAO,CACtD,CAMD,OAJI,IAAQ,OACH,GAAG,IAAI,OAAO,EAAa,GAAG,IAGhC,GAAG,IAAO,IAAI,OAAO,EAAa,IACzC,CACD,KAAK,GAAG,CAEA,EAAI,EAAS,IAAKC,EAAe,CACjC,EAAI,EAAS,IAAKJ,EAAiB,CACnC,EAAQ,EAAS,IAAKG,EAAgB"}
|
package/dist/esm/node.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildConfigurationFields as e}from"./configFile/buildConfigurationFields.mjs";import{aiSchema as t,buildSchema as n,compilerSchema as r,contentSchema as i,cookiesAttributesSchema as a,dictionarySchema as o,editorSchema as s,internationalizationSchema as c,intlayerConfigSchema as l,logSchema as u,rewriteObjectSchema as d,rewriteRuleSchema as f,rewriteRulesSchema as p,routingSchema as m,storageAttributesSchema as h,storageSchema as g,systemSchema as _}from"./configFile/configurationSchema.mjs";import{configurationFilesCandidates as v,searchConfigurationFile as y}from"./configFile/searchConfigurationFile.mjs";import{getConfiguration as b,getConfigurationAndFilePath as x}from"./configFile/getConfiguration.mjs";
|
|
1
|
+
import{buildConfigurationFields as e}from"./configFile/buildConfigurationFields.mjs";import{aiSchema as t,buildSchema as n,compilerSchema as r,contentSchema as i,cookiesAttributesSchema as a,dictionarySchema as o,editorSchema as s,internationalizationSchema as c,intlayerConfigSchema as l,logSchema as u,rewriteObjectSchema as d,rewriteRuleSchema as f,rewriteRulesSchema as p,routingSchema as m,storageAttributesSchema as h,storageSchema as g,systemSchema as _}from"./configFile/configurationSchema.mjs";import{configurationFilesCandidates as v,searchConfigurationFile as y}from"./configFile/searchConfigurationFile.mjs";import{getConfiguration as b,getConfigurationAndFilePath as x}from"./configFile/getConfiguration.mjs";export{t as aiSchema,e as buildConfigurationFields,n as buildSchema,r as compilerSchema,v as configurationFilesCandidates,i as contentSchema,a as cookiesAttributesSchema,o as dictionarySchema,s as editorSchema,b as getConfiguration,x as getConfigurationAndFilePath,c as internationalizationSchema,l as intlayerConfigSchema,u as logSchema,d as rewriteObjectSchema,f as rewriteRuleSchema,p as rewriteRulesSchema,m as routingSchema,y as searchConfigurationFile,h as storageAttributesSchema,g as storageSchema,_ as systemSchema};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{n as e
|
|
2
|
-
//# sourceMappingURL=ESMxCJSHelpers.mjs.map
|
|
1
|
+
import{n as e,r as t,t as n}from"../ESMxCJSHelpers-BAuqwNXV.mjs";export{n as configESMxCJSRequire,e as getProjectRequire,t as isESModule};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"../ESMxCJSHelpers-BAuqwNXV.mjs";const t=(n,r=new Set)=>{if(!r.has(n)){r.add(n);try{let i=e.resolve(n),a=e.cache[i];a&&(a.children&&a.children.forEach(e=>{t(e.filename,r)}),delete e.cache[i])}catch(e){console.warn(`Could not clear cache for module: ${n}`,e)}}};export{t as clearModuleCache};
|
|
2
2
|
//# sourceMappingURL=clearModuleCache.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearModuleCache.mjs","names":[],"sources":["../../../src/utils/clearModuleCache.ts"],"sourcesContent":["import { configESMxCJSRequire } from './ESMxCJSHelpers';\n\n/**\n * Recursively clears the require cache for a module and all its dependencies\n */\nexport const clearModuleCache = (\n modulePath: string,\n visited = new Set<string>()\n) => {\n // Avoid infinite loops\n if (visited.has(modulePath)) {\n return;\n }\n visited.add(modulePath);\n\n try {\n const resolvedPath = configESMxCJSRequire.resolve(modulePath);\n\n // Get the cached module\n const cachedModule = configESMxCJSRequire.cache[resolvedPath];\n\n if (cachedModule) {\n // Clear cache for all children (dependencies) first\n if (cachedModule.children) {\n cachedModule.children.forEach((child) => {\n clearModuleCache(child.filename, visited);\n });\n }\n\n // Clear the cache for this module\n delete configESMxCJSRequire.cache[resolvedPath];\n }\n } catch (error) {\n // Module might not exist or be resolvable, skip it\n console.warn(`Could not clear cache for module: ${modulePath}`, error);\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"clearModuleCache.mjs","names":[],"sources":["../../../src/utils/clearModuleCache.ts"],"sourcesContent":["import { configESMxCJSRequire } from './ESMxCJSHelpers';\n\n/**\n * Recursively clears the require cache for a module and all its dependencies\n */\nexport const clearModuleCache = (\n modulePath: string,\n visited = new Set<string>()\n) => {\n // Avoid infinite loops\n if (visited.has(modulePath)) {\n return;\n }\n visited.add(modulePath);\n\n try {\n const resolvedPath = configESMxCJSRequire.resolve(modulePath);\n\n // Get the cached module\n const cachedModule = configESMxCJSRequire.cache[resolvedPath];\n\n if (cachedModule) {\n // Clear cache for all children (dependencies) first\n if (cachedModule.children) {\n cachedModule.children.forEach((child) => {\n clearModuleCache(child.filename, visited);\n });\n }\n\n // Clear the cache for this module\n delete configESMxCJSRequire.cache[resolvedPath];\n }\n } catch (error) {\n // Module might not exist or be resolvable, skip it\n console.warn(`Could not clear cache for module: ${modulePath}`, error);\n }\n};\n"],"mappings":"mDAKA,MAAa,GACX,EACA,EAAU,IAAI,MACX,CAEC,MAAQ,IAAI,EAAW,CAG3B,GAAQ,IAAI,EAAW,CAEvB,GAAI,CACF,IAAM,EAAe,EAAqB,QAAQ,EAAW,CAGvD,EAAe,EAAqB,MAAM,GAE5C,IAEE,EAAa,UACf,EAAa,SAAS,QAAS,GAAU,CACvC,EAAiB,EAAM,SAAU,EAAQ,EACzC,CAIJ,OAAO,EAAqB,MAAM,UAE7B,EAAO,CAEd,QAAQ,KAAK,qCAAqC,IAAc,EAAM"}
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e,r as t,t as n}from"../ESMxCJSHelpers-BAuqwNXV.mjs";import{getExtension as r}from"./getExtension.mjs";import{normalizePath as i}from"./normalizePath.mjs";import{getAlias as a}from"./alias.mjs";import{cacheMemory as o,clearAllCache as s,clearCache as c,computeKeyId as l,getCache as u,setCache as d,stableStringify as f}from"./cacheMemory.mjs";import{cacheDisk as p}from"./cacheDisk.mjs";import{getPackageJsonPath as m}from"./getPackageJsonPath.mjs";import{clearModuleCache as h}from"./clearModuleCache.mjs";import{compareVersions as g}from"./compareVersions.mjs";import{extractErrorMessage as _}from"./extractErrorMessage.mjs";import{logStack as v}from"./logStack.mjs";import{parseFilePathPattern as y,parseStringPattern as b}from"./parseFilePathPattern.mjs";import{retryManager as x}from"./retryManager.mjs";import{camelCaseToKebabCase as S}from"./stringFormatter/camelCaseToKebabCase.mjs";import{camelCaseToSentence as C}from"./stringFormatter/camelCaseToSentence.mjs";import{kebabCaseToCamelCase as w}from"./stringFormatter/kebabCaseToCamelCase.mjs";import{toLowerCamelCase as T}from"./stringFormatter/toLowerCamelCase.mjs";export{p as cacheDisk,o as cacheMemory,S as camelCaseToKebabCase,C as camelCaseToSentence,s as clearAllCache,c as clearCache,h as clearModuleCache,g as compareVersions,l as computeKeyId,n as configESMxCJSRequire,_ as extractErrorMessage,a as getAlias,u as getCache,r as getExtension,m as getPackageJsonPath,e as getProjectRequire,t as isESModule,w as kebabCaseToCamelCase,v as logStack,i as normalizePath,y as parseFilePathPattern,b as parseStringPattern,x as retryManager,d as setCache,f as stableStringify,T as toLowerCamelCase};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{BLUE as e,YELLOW as t}from"../colors.mjs";import{colorize as n}from"../logger.mjs";const r=(r,i={limit:50})=>{Error.stackTraceLimit=i.limit;try{throw Error(`test`)}catch(i){console.log(n(r,t)),console.log(n(i.stack??``,e))}};export{r as logStack};
|
|
2
2
|
//# sourceMappingURL=logStack.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logStack.mjs","names":[],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":["import
|
|
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":"0FAGA,MAAa,GACX,EACA,EAA6B,CAAE,MAAO,GAAI,GACvC,CACH,MAAM,gBAAkB,EAAQ,MAEhC,GAAI,CACF,MAAU,MAAM,OAAO,OAChB,EAAO,CACd,QAAQ,IAAI,EAAS,EAASA,EAAkB,CAAC,CACjD,QAAQ,IAAI,EAAU,EAAgB,OAAS,GAAIC,EAAgB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{extractErrorMessage as e}from"./extractErrorMessage.mjs";import{logger as t}from"../logger.mjs";const n=(n,{maxRetry:r=3,delay:i=0,onError:a,onMaxTryReached:o}={})=>async(...s)=>{let c;for(let l=0;l<=r;l++)try{return await n(...s)}catch(n){c=n;let s=e(n);if(l>=r){if(o)return o?.({error:s,attempt:l,maxRetry:r}),null;throw n}a?a?.({error:s,attempt:l,maxRetry:r}):t(s,{level:`error`}),i>0&&await new Promise(e=>setTimeout(e,i))}throw c??Error(`Unexpected: retry loop completed without result`)};export{n as retryManager};
|
|
2
2
|
//# sourceMappingURL=retryManager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelCaseToKebabCase-BV_lLJHR.d.ts","names":[],"sources":["../../src/utils/stringFormatter/camelCaseToKebabCase.ts"],"mappings":";;AAIA;;;cAAa,oBAAA,GAAwB,GAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelCaseToSentence-DAbbkwe6.d.ts","names":[],"sources":["../../src/utils/stringFormatter/camelCaseToSentence.ts"],"mappings":";;AAIA;;;cAAa,mBAAA,GAAuB,KAAA"}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { t as index_d_exports } from "./defaultValues/index.js";
|
|
2
1
|
import { extractErrorMessage } from "./utils/extractErrorMessage.js";
|
|
3
2
|
import { logStack } from "./utils/logStack.js";
|
|
4
3
|
import { normalizePath } from "./utils/normalizePath.js";
|
|
5
|
-
import { t as camelCaseToKebabCase } from "./camelCaseToKebabCase-
|
|
6
|
-
import { t as camelCaseToSentence } from "./camelCaseToSentence-
|
|
7
|
-
import { t as kebabCaseToCamelCase } from "./kebabCaseToCamelCase-
|
|
8
|
-
import { t as toLowerCamelCase } from "./toLowerCamelCase-
|
|
9
|
-
export {
|
|
4
|
+
import { t as camelCaseToKebabCase } from "./camelCaseToKebabCase-BV_lLJHR.js";
|
|
5
|
+
import { t as camelCaseToSentence } from "./camelCaseToSentence-DAbbkwe6.js";
|
|
6
|
+
import { t as kebabCaseToCamelCase } from "./kebabCaseToCamelCase-h9PkNVuO.js";
|
|
7
|
+
import { t as toLowerCamelCase } from "./toLowerCamelCase-DUdT00I1.js";
|
|
8
|
+
export { camelCaseToKebabCase, camelCaseToSentence, extractErrorMessage, kebabCaseToCamelCase, logStack, normalizePath, toLowerCamelCase };
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { GREEN as a, GREY_LIGHT as c, RED as d, RESET as f, colors_d_exports as h, CYAN as i, MAGENTA as l, YELLOW as m, BLUE as n, GREY as o, WHITE as p, BOLD as r, GREY_DARK as s, BEIGE as t, ORANGE as u };
|
|
20
|
+
//# sourceMappingURL=colors-BbZeGWYU.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors-BbZeGWYU.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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as GREEN, c as GREY_LIGHT, d as RED, f as RESET, i as CYAN, l as MAGENTA, m as YELLOW, n as BLUE, o as GREY, p as WHITE, r as BOLD, s as GREY_DARK, t as BEIGE, u as ORANGE } from "./colors-BbZeGWYU.js";
|
|
2
|
+
export { BEIGE, BLUE, BOLD, CYAN, GREEN, GREY, GREY_DARK, GREY_LIGHT, MAGENTA, ORANGE, RED, RESET, WHITE, YELLOW };
|