@intlayer/config 9.7.0 → 9.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/built.cjs +2 -3
- package/dist/cjs/bundle/index.cjs +6 -7
- package/dist/cjs/bundle/logBundle.cjs +4 -5
- package/dist/cjs/callers/base.cjs +1 -2
- package/dist/cjs/callers/compat/i18next.cjs +1 -2
- package/dist/cjs/callers/compat/lingui.cjs +1 -2
- package/dist/cjs/callers/compat/nextIntl.cjs +1 -2
- package/dist/cjs/callers/compat/ngxTranslate.cjs +1 -2
- package/dist/cjs/callers/compat/nuxtjsI18n.cjs +1 -2
- package/dist/cjs/callers/compat/reactI18next.cjs +1 -2
- package/dist/cjs/callers/compat/reactIntl.cjs +1 -2
- package/dist/cjs/callers/compat/svelteI18n.cjs +1 -2
- package/dist/cjs/callers/compat/useIntl.cjs +1 -2
- package/dist/cjs/callers/compat/vueI18n.cjs +1 -2
- package/dist/cjs/callers/index.cjs +13 -14
- package/dist/cjs/callers/transform.cjs +1 -2
- package/dist/cjs/client.cjs +15 -9
- package/dist/cjs/colors.cjs +1 -2
- package/dist/cjs/configFile/buildBrowserConfiguration.cjs +7 -8
- package/dist/cjs/configFile/buildConfigurationFields.cjs +10 -11
- package/dist/cjs/configFile/configurationSchema.cjs +2 -3
- package/dist/cjs/configFile/editorServerOverride.cjs +1 -2
- package/dist/cjs/configFile/getConfiguration.cjs +7 -8
- package/dist/cjs/configFile/index.cjs +6 -6
- package/dist/cjs/configFile/loadConfigurationFile.cjs +3 -4
- package/dist/cjs/configFile/searchConfigurationFile.cjs +3 -4
- package/dist/cjs/defaultValues/analytics.cjs +1 -2
- package/dist/cjs/defaultValues/build.cjs +1 -2
- package/dist/cjs/defaultValues/compiler.cjs +1 -2
- package/dist/cjs/defaultValues/content.cjs +1 -2
- package/dist/cjs/defaultValues/dictionary.cjs +1 -2
- package/dist/cjs/defaultValues/editor.cjs +1 -2
- package/dist/cjs/defaultValues/index.cjs +10 -10
- package/dist/cjs/defaultValues/internationalization.cjs +1 -2
- package/dist/cjs/defaultValues/log.cjs +2 -3
- package/dist/cjs/defaultValues/routing.cjs +1 -2
- package/dist/cjs/defaultValues/system.cjs +1 -2
- package/dist/cjs/dictionaryPreload.cjs +2 -3
- package/dist/cjs/envVars/envVars.cjs +1 -2
- package/dist/cjs/envVars/index.cjs +1 -1
- package/dist/cjs/extract/constants.cjs +1 -2
- package/dist/cjs/extract/index.cjs +2 -2
- package/dist/cjs/extract/shouldExtract.cjs +1 -2
- package/dist/cjs/loadEnvFile.cjs +2 -3
- package/dist/cjs/loadExternalFile/bundleFile.cjs +1 -2
- package/dist/cjs/loadExternalFile/bundleJSFile.cjs +1 -2
- package/dist/cjs/loadExternalFile/index.cjs +5 -5
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs +5 -6
- package/dist/cjs/loadExternalFile/parseFileContent.cjs +4 -5
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs +4 -5
- package/dist/cjs/loadExternalFile/transpileTSToCJS.cjs.map +1 -1
- package/dist/cjs/logger.cjs +2 -3
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/node.cjs +6 -6
- package/dist/cjs/secrets.browser.cjs +1 -2
- package/dist/cjs/secrets.cjs +1 -2
- package/dist/cjs/utils/ESMxCJSHelpers.cjs +2 -3
- package/dist/cjs/utils/alias.cjs +3 -4
- package/dist/cjs/utils/alias.cjs.map +1 -1
- package/dist/cjs/utils/builtConfigKeys.cjs +1 -2
- package/dist/cjs/utils/cacheDisk.cjs +3 -4
- package/dist/cjs/utils/cacheDisk.cjs.map +1 -1
- package/dist/cjs/utils/cacheMemory.cjs +1 -2
- package/dist/cjs/utils/chunkArray.cjs +22 -0
- package/dist/cjs/utils/chunkArray.cjs.map +1 -0
- package/dist/cjs/utils/clearModuleCache.cjs +2 -3
- package/dist/cjs/utils/compareVersions.cjs +1 -2
- package/dist/cjs/utils/extractErrorMessage.cjs +1 -2
- package/dist/cjs/utils/getDictionarySelectorUsage.cjs +1 -2
- package/dist/cjs/utils/getExtension.cjs +1 -2
- package/dist/cjs/utils/getPackageJsonPath.cjs +2 -3
- package/dist/cjs/utils/getStorageAttributes.cjs +2 -3
- package/dist/cjs/utils/getUsedNodeTypes.cjs +1 -2
- package/dist/cjs/utils/index.cjs +31 -24
- package/dist/cjs/utils/isPackageInstalled.cjs +2 -3
- package/dist/cjs/utils/logStack.cjs +3 -4
- package/dist/cjs/utils/normalizePath.cjs +1 -2
- package/dist/cjs/utils/pLimit.cjs +132 -0
- package/dist/cjs/utils/pLimit.cjs.map +1 -0
- package/dist/cjs/utils/parallelize.cjs +11 -0
- package/dist/cjs/utils/parallelize.cjs.map +1 -0
- package/dist/cjs/utils/parseFilePathPattern.cjs +1 -2
- package/dist/cjs/utils/pathSecurity.cjs +1 -2
- package/dist/cjs/utils/retryManager.cjs +3 -4
- package/dist/cjs/utils/setIntlayerIdentifier.cjs +1 -2
- package/dist/cjs/utils/stringFormatter/camelCaseToKebabCase.cjs +1 -2
- package/dist/cjs/utils/stringFormatter/camelCaseToSentence.cjs +1 -2
- package/dist/cjs/utils/stringFormatter/index.cjs +4 -4
- package/dist/cjs/utils/stringFormatter/kebabCaseToCamelCase.cjs +1 -2
- package/dist/cjs/utils/stringFormatter/toLowerCamelCase.cjs +1 -2
- package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/esm/built.mjs +1 -2
- package/dist/esm/bundle/index.mjs +2 -3
- package/dist/esm/bundle/logBundle.mjs +2 -3
- package/dist/esm/callers/base.mjs +1 -2
- package/dist/esm/callers/compat/i18next.mjs +1 -2
- package/dist/esm/callers/compat/lingui.mjs +1 -2
- package/dist/esm/callers/compat/nextIntl.mjs +1 -2
- package/dist/esm/callers/compat/ngxTranslate.mjs +1 -2
- package/dist/esm/callers/compat/nuxtjsI18n.mjs +1 -2
- package/dist/esm/callers/compat/reactI18next.mjs +1 -2
- package/dist/esm/callers/compat/reactIntl.mjs +1 -2
- package/dist/esm/callers/compat/svelteI18n.mjs +1 -2
- package/dist/esm/callers/compat/useIntl.mjs +1 -2
- package/dist/esm/callers/compat/vueI18n.mjs +1 -2
- package/dist/esm/callers/index.mjs +1 -2
- package/dist/esm/callers/transform.mjs +1 -2
- package/dist/esm/client.mjs +4 -1
- package/dist/esm/colors.mjs +1 -2
- package/dist/esm/configFile/buildBrowserConfiguration.mjs +1 -2
- package/dist/esm/configFile/buildConfigurationFields.mjs +2 -3
- package/dist/esm/configFile/configurationSchema.mjs +1 -2
- package/dist/esm/configFile/editorServerOverride.mjs +1 -2
- package/dist/esm/configFile/getConfiguration.mjs +1 -2
- package/dist/esm/configFile/index.mjs +2 -2
- package/dist/esm/configFile/loadConfigurationFile.mjs +2 -3
- package/dist/esm/configFile/searchConfigurationFile.mjs +1 -2
- package/dist/esm/defaultValues/analytics.mjs +1 -2
- package/dist/esm/defaultValues/build.mjs +1 -2
- package/dist/esm/defaultValues/compiler.mjs +1 -2
- package/dist/esm/defaultValues/content.mjs +1 -2
- package/dist/esm/defaultValues/dictionary.mjs +1 -2
- package/dist/esm/defaultValues/editor.mjs +1 -2
- package/dist/esm/defaultValues/index.mjs +4 -4
- package/dist/esm/defaultValues/internationalization.mjs +1 -2
- package/dist/esm/defaultValues/log.mjs +1 -2
- package/dist/esm/defaultValues/routing.mjs +1 -2
- package/dist/esm/defaultValues/system.mjs +1 -2
- package/dist/esm/dictionaryPreload.mjs +1 -2
- package/dist/esm/envVars/envVars.mjs +1 -2
- package/dist/esm/extract/constants.mjs +1 -2
- package/dist/esm/extract/shouldExtract.mjs +1 -2
- package/dist/esm/loadEnvFile.mjs +1 -2
- package/dist/esm/loadExternalFile/bundleFile.mjs +1 -2
- package/dist/esm/loadExternalFile/bundleJSFile.mjs +1 -2
- package/dist/esm/loadExternalFile/index.mjs +3 -3
- package/dist/esm/loadExternalFile/loadExternalFile.mjs +1 -2
- package/dist/esm/loadExternalFile/parseFileContent.mjs +1 -2
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs +1 -2
- package/dist/esm/loadExternalFile/transpileTSToCJS.mjs.map +1 -1
- package/dist/esm/logger.mjs +1 -2
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/node.mjs +2 -2
- package/dist/esm/secrets.browser.mjs +1 -2
- package/dist/esm/secrets.mjs +1 -2
- package/dist/esm/utils/ESMxCJSHelpers.mjs +1 -2
- package/dist/esm/utils/alias.mjs +2 -3
- package/dist/esm/utils/alias.mjs.map +1 -1
- package/dist/esm/utils/builtConfigKeys.mjs +1 -2
- package/dist/esm/utils/cacheDisk.mjs +1 -2
- package/dist/esm/utils/cacheDisk.mjs.map +1 -1
- package/dist/esm/utils/cacheMemory.mjs +1 -2
- package/dist/esm/utils/chunkArray.mjs +21 -0
- package/dist/esm/utils/chunkArray.mjs.map +1 -0
- package/dist/esm/utils/clearModuleCache.mjs +1 -2
- package/dist/esm/utils/compareVersions.mjs +1 -2
- package/dist/esm/utils/extractErrorMessage.mjs +1 -2
- package/dist/esm/utils/getDictionarySelectorUsage.mjs +1 -2
- package/dist/esm/utils/getExtension.mjs +1 -2
- package/dist/esm/utils/getPackageJsonPath.mjs +1 -2
- package/dist/esm/utils/getStorageAttributes.mjs +1 -2
- package/dist/esm/utils/getUsedNodeTypes.mjs +1 -2
- package/dist/esm/utils/index.mjs +17 -14
- package/dist/esm/utils/isPackageInstalled.mjs +1 -2
- package/dist/esm/utils/logStack.mjs +1 -2
- package/dist/esm/utils/normalizePath.mjs +1 -2
- package/dist/esm/utils/pLimit.mjs +130 -0
- package/dist/esm/utils/pLimit.mjs.map +1 -0
- package/dist/esm/utils/parallelize.mjs +10 -0
- package/dist/esm/utils/parallelize.mjs.map +1 -0
- package/dist/esm/utils/parseFilePathPattern.mjs +1 -2
- package/dist/esm/utils/pathSecurity.mjs +1 -2
- package/dist/esm/utils/retryManager.mjs +2 -3
- package/dist/esm/utils/setIntlayerIdentifier.mjs +1 -2
- package/dist/esm/utils/stringFormatter/camelCaseToKebabCase.mjs +1 -2
- package/dist/esm/utils/stringFormatter/camelCaseToSentence.mjs +1 -2
- package/dist/esm/utils/stringFormatter/kebabCaseToCamelCase.mjs +1 -2
- package/dist/esm/utils/stringFormatter/toLowerCamelCase.mjs +1 -2
- package/dist/types/built.d.ts +0 -2
- package/dist/types/built.d.ts.map +1 -1
- package/dist/types/bundle/index.d.ts +0 -2
- package/dist/types/bundle/index.d.ts.map +1 -1
- package/dist/types/bundle/logBundle.d.ts +0 -2
- package/dist/types/bundle/logBundle.d.ts.map +1 -1
- package/dist/types/callers/base.d.ts +0 -2
- package/dist/types/callers/base.d.ts.map +1 -1
- package/dist/types/callers/compat/i18next.d.ts +0 -2
- package/dist/types/callers/compat/i18next.d.ts.map +1 -1
- package/dist/types/callers/compat/lingui.d.ts +0 -2
- package/dist/types/callers/compat/lingui.d.ts.map +1 -1
- package/dist/types/callers/compat/nextIntl.d.ts +0 -2
- package/dist/types/callers/compat/nextIntl.d.ts.map +1 -1
- package/dist/types/callers/compat/ngxTranslate.d.ts +0 -2
- package/dist/types/callers/compat/ngxTranslate.d.ts.map +1 -1
- package/dist/types/callers/compat/nuxtjsI18n.d.ts +0 -2
- package/dist/types/callers/compat/nuxtjsI18n.d.ts.map +1 -1
- package/dist/types/callers/compat/reactI18next.d.ts +0 -2
- package/dist/types/callers/compat/reactI18next.d.ts.map +1 -1
- package/dist/types/callers/compat/reactIntl.d.ts +0 -2
- package/dist/types/callers/compat/reactIntl.d.ts.map +1 -1
- package/dist/types/callers/compat/svelteI18n.d.ts +0 -2
- package/dist/types/callers/compat/svelteI18n.d.ts.map +1 -1
- package/dist/types/callers/compat/useIntl.d.ts +0 -2
- package/dist/types/callers/compat/useIntl.d.ts.map +1 -1
- package/dist/types/callers/compat/vueI18n.d.ts +0 -2
- package/dist/types/callers/compat/vueI18n.d.ts.map +1 -1
- package/dist/types/callers/index.d.ts +0 -2
- package/dist/types/callers/index.d.ts.map +1 -1
- package/dist/types/callers/transform.d.ts +0 -2
- package/dist/types/callers/transform.d.ts.map +1 -1
- package/dist/types/callers/types.d.ts +0 -2
- package/dist/types/callers/types.d.ts.map +1 -1
- package/dist/types/client.d.ts +5 -1
- package/dist/types/colors.d.ts +0 -1
- package/dist/types/configFile/buildBrowserConfiguration.d.ts +0 -2
- package/dist/types/configFile/buildBrowserConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/buildConfigurationFields.d.ts +0 -2
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/configurationSchema.d.ts +0 -2
- package/dist/types/configFile/configurationSchema.d.ts.map +1 -1
- package/dist/types/configFile/editorServerOverride.d.ts +0 -2
- package/dist/types/configFile/editorServerOverride.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts +1 -3
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/index.d.ts +1 -1
- package/dist/types/configFile/loadConfigurationFile.d.ts +0 -2
- package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
- package/dist/types/configFile/searchConfigurationFile.d.ts +1 -2
- package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
- package/dist/types/defaultValues/analytics.d.ts +0 -2
- package/dist/types/defaultValues/analytics.d.ts.map +1 -1
- package/dist/types/defaultValues/build.d.ts +0 -2
- package/dist/types/defaultValues/build.d.ts.map +1 -1
- package/dist/types/defaultValues/compiler.d.ts +0 -2
- package/dist/types/defaultValues/compiler.d.ts.map +1 -1
- package/dist/types/defaultValues/content.d.ts +0 -2
- package/dist/types/defaultValues/content.d.ts.map +1 -1
- package/dist/types/defaultValues/dictionary.d.ts +0 -2
- package/dist/types/defaultValues/dictionary.d.ts.map +1 -1
- package/dist/types/defaultValues/editor.d.ts +0 -2
- package/dist/types/defaultValues/editor.d.ts.map +1 -1
- package/dist/types/defaultValues/internationalization.d.ts +1 -3
- package/dist/types/defaultValues/internationalization.d.ts.map +1 -1
- package/dist/types/defaultValues/log.d.ts +0 -2
- package/dist/types/defaultValues/log.d.ts.map +1 -1
- package/dist/types/defaultValues/routing.d.ts +0 -2
- package/dist/types/defaultValues/routing.d.ts.map +1 -1
- package/dist/types/defaultValues/system.d.ts +0 -2
- package/dist/types/defaultValues/system.d.ts.map +1 -1
- package/dist/types/dictionaryPreload.d.ts +0 -2
- package/dist/types/dictionaryPreload.d.ts.map +1 -1
- package/dist/types/envVars/envVars.d.ts +0 -2
- package/dist/types/envVars/envVars.d.ts.map +1 -1
- package/dist/types/extract/constants.d.ts +0 -2
- package/dist/types/extract/constants.d.ts.map +1 -1
- package/dist/types/extract/index.d.ts +11 -0
- package/dist/types/extract/shouldExtract.d.ts +0 -2
- package/dist/types/extract/shouldExtract.d.ts.map +1 -1
- package/dist/types/loadEnvFile.d.ts +0 -2
- package/dist/types/loadEnvFile.d.ts.map +1 -1
- package/dist/types/loadExternalFile/bundleFile.d.ts +0 -2
- package/dist/types/loadExternalFile/bundleFile.d.ts.map +1 -1
- package/dist/types/loadExternalFile/bundleJSFile.d.ts +0 -2
- package/dist/types/loadExternalFile/bundleJSFile.d.ts.map +1 -1
- package/dist/types/loadExternalFile/index.d.ts +3 -3
- package/dist/types/loadExternalFile/loadExternalFile.d.ts +0 -2
- package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -1
- package/dist/types/loadExternalFile/parseFileContent.d.ts +0 -2
- package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -1
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts +0 -2
- package/dist/types/loadExternalFile/transpileTSToCJS.d.ts.map +1 -1
- package/dist/types/logger.d.ts +1 -3
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/node.d.ts +1 -1
- package/dist/types/secrets.browser.d.ts +0 -2
- package/dist/types/secrets.browser.d.ts.map +1 -1
- package/dist/types/secrets.d.ts +0 -2
- package/dist/types/secrets.d.ts.map +1 -1
- package/dist/types/utils/ESMxCJSHelpers.d.ts +0 -2
- package/dist/types/utils/ESMxCJSHelpers.d.ts.map +1 -1
- package/dist/types/utils/alias.d.ts +0 -2
- package/dist/types/utils/alias.d.ts.map +1 -1
- package/dist/types/utils/builtConfigKeys.d.ts +0 -2
- package/dist/types/utils/builtConfigKeys.d.ts.map +1 -1
- package/dist/types/utils/cacheDisk.d.ts +1 -2
- package/dist/types/utils/cacheDisk.d.ts.map +1 -1
- package/dist/types/utils/cacheMemory.d.ts +1 -2
- package/dist/types/utils/cacheMemory.d.ts.map +1 -1
- package/dist/types/utils/chunkArray.d.ts +13 -0
- package/dist/types/utils/chunkArray.d.ts.map +1 -0
- package/dist/types/utils/clearModuleCache.d.ts +0 -2
- package/dist/types/utils/clearModuleCache.d.ts.map +1 -1
- package/dist/types/utils/compareVersions.d.ts +0 -2
- package/dist/types/utils/compareVersions.d.ts.map +1 -1
- package/dist/types/utils/extractErrorMessage.d.ts +0 -2
- package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
- package/dist/types/utils/getDictionarySelectorUsage.d.ts +1 -2
- package/dist/types/utils/getDictionarySelectorUsage.d.ts.map +1 -1
- package/dist/types/utils/getExtension.d.ts +0 -2
- package/dist/types/utils/getExtension.d.ts.map +1 -1
- package/dist/types/utils/getPackageJsonPath.d.ts +1 -2
- package/dist/types/utils/getPackageJsonPath.d.ts.map +1 -1
- package/dist/types/utils/getStorageAttributes.d.ts +0 -2
- package/dist/types/utils/getStorageAttributes.d.ts.map +1 -1
- package/dist/types/utils/getUsedNodeTypes.d.ts +0 -2
- package/dist/types/utils/getUsedNodeTypes.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +15 -11
- package/dist/types/utils/isPackageInstalled.d.ts +0 -2
- package/dist/types/utils/isPackageInstalled.d.ts.map +1 -1
- package/dist/types/utils/logStack.d.ts +0 -2
- package/dist/types/utils/logStack.d.ts.map +1 -1
- package/dist/types/utils/normalizePath.d.ts +0 -2
- package/dist/types/utils/normalizePath.d.ts.map +1 -1
- package/dist/types/utils/pLimit.d.ts +13 -0
- package/dist/types/utils/pLimit.d.ts.map +1 -0
- package/dist/types/utils/parallelize.d.ts +2 -0
- package/dist/types/utils/parallelize.d.ts.map +1 -0
- package/dist/types/utils/parseFilePathPattern.d.ts +0 -2
- package/dist/types/utils/parseFilePathPattern.d.ts.map +1 -1
- package/dist/types/utils/pathSecurity.d.ts +0 -2
- package/dist/types/utils/pathSecurity.d.ts.map +1 -1
- package/dist/types/utils/retryManager.d.ts +0 -2
- package/dist/types/utils/retryManager.d.ts.map +1 -1
- package/dist/types/utils/setIntlayerIdentifier.d.ts +1 -2
- package/dist/types/utils/setIntlayerIdentifier.d.ts.map +1 -1
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts +0 -2
- package/dist/types/utils/stringFormatter/camelCaseToKebabCase.d.ts.map +1 -1
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts +0 -2
- package/dist/types/utils/stringFormatter/camelCaseToSentence.d.ts.map +1 -1
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts +0 -2
- package/dist/types/utils/stringFormatter/kebabCaseToCamelCase.d.ts.map +1 -1
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts +0 -2
- package/dist/types/utils/stringFormatter/toLowerCamelCase.d.ts.map +1 -1
- package/package.json +73 -73
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/defaultValues/dictionary.ts
|
|
3
3
|
const FILL = true;
|
|
4
4
|
const LOCATION = "local";
|
|
5
5
|
const CONTENT_AUTO_TRANSFORMATION = false;
|
|
@@ -42,7 +42,6 @@ const PRELOADED_DYNAMIC_KEY = "__intlayerPreloaded";
|
|
|
42
42
|
*/
|
|
43
43
|
const DYNAMIC_ENTRY_LOADER_MAP_IDENTIFIER = "content";
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.CONTENT_AUTO_TRANSFORMATION = CONTENT_AUTO_TRANSFORMATION;
|
|
47
46
|
exports.DYNAMIC_DICTIONARIES_JSON_SUBDIR = DYNAMIC_DICTIONARIES_JSON_SUBDIR;
|
|
48
47
|
exports.DYNAMIC_ENTRY_LOADER_MAP_IDENTIFIER = DYNAMIC_ENTRY_LOADER_MAP_IDENTIFIER;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/defaultValues/editor.ts
|
|
3
3
|
const APPLICATION_URL = void 0;
|
|
4
4
|
const EDITOR_URL = "http://localhost:8000";
|
|
5
5
|
const CMS_URL = "https://app.intlayer.org";
|
|
@@ -10,7 +10,6 @@ const LIVE_SYNC = false;
|
|
|
10
10
|
const DICTIONARY_PRIORITY_STRATEGY = "local_first";
|
|
11
11
|
const LIVE_SYNC_PORT = 4e3;
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
exports.APPLICATION_URL = APPLICATION_URL;
|
|
15
14
|
exports.BACKEND_URL = BACKEND_URL;
|
|
16
15
|
exports.CMS_URL = CMS_URL;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_defaultValues_analytics = require(
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const require_defaultValues_system = require(
|
|
2
|
+
const require_defaultValues_analytics = require("./analytics.cjs");
|
|
3
|
+
const require_defaultValues_build = require("./build.cjs");
|
|
4
|
+
const require_defaultValues_compiler = require("./compiler.cjs");
|
|
5
|
+
const require_defaultValues_content = require("./content.cjs");
|
|
6
|
+
const require_defaultValues_dictionary = require("./dictionary.cjs");
|
|
7
|
+
const require_defaultValues_editor = require("./editor.cjs");
|
|
8
|
+
const require_defaultValues_internationalization = require("./internationalization.cjs");
|
|
9
|
+
const require_defaultValues_log = require("./log.cjs");
|
|
10
|
+
const require_defaultValues_routing = require("./routing.cjs");
|
|
11
|
+
const require_defaultValues_system = require("./system.cjs");
|
|
12
12
|
|
|
13
13
|
exports.ANALYTICS_ENABLED = require_defaultValues_analytics.ANALYTICS_ENABLED;
|
|
14
14
|
exports.ANALYTICS_FLUSH_INTERVAL = require_defaultValues_analytics.ANALYTICS_FLUSH_INTERVAL;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/defaultValues/internationalization.ts
|
|
3
3
|
const LOCALES = ["en"];
|
|
4
4
|
const REQUIRED_LOCALES = [];
|
|
5
5
|
const DEFAULT_LOCALE = "en";
|
|
6
6
|
const STRICT_MODE = "inclusive";
|
|
7
7
|
|
|
8
|
-
//#endregion
|
|
9
8
|
exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
|
10
9
|
exports.LOCALES = LOCALES;
|
|
11
10
|
exports.REQUIRED_LOCALES = REQUIRED_LOCALES;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_colors = require(
|
|
2
|
+
const require_colors = require("../colors.cjs");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/defaultValues/log.ts
|
|
5
5
|
const MODE = "default";
|
|
6
6
|
const PREFIX = `${require_colors.GREY_DARK}[intlayer] ${require_colors.RESET}`;
|
|
7
7
|
|
|
8
|
-
//#endregion
|
|
9
8
|
exports.MODE = MODE;
|
|
10
9
|
exports.PREFIX = PREFIX;
|
|
11
10
|
//# sourceMappingURL=log.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/defaultValues/routing.ts
|
|
3
3
|
const HEADER_NAME = "x-intlayer-locale";
|
|
4
4
|
const COOKIE_NAME = "INTLAYER_LOCALE";
|
|
5
5
|
const LOCALE_STORAGE_NAME = "INTLAYER_LOCALE";
|
|
@@ -15,7 +15,6 @@ const ROUTING_MODE = "prefix-no-default";
|
|
|
15
15
|
const ENABLE_PROXY = void 0;
|
|
16
16
|
const STORAGE = ["cookie", "header"];
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.BASE_PATH = BASE_PATH;
|
|
20
19
|
exports.COOKIE_NAME = COOKIE_NAME;
|
|
21
20
|
exports.ENABLE_PROXY = ENABLE_PROXY;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/defaultValues/system.ts
|
|
3
3
|
const MAIN_DIR = ".intlayer/main";
|
|
4
4
|
const DICTIONARIES_DIR = ".intlayer/dictionary";
|
|
5
5
|
const MASKS_DIR = ".intlayer/mask";
|
|
@@ -13,7 +13,6 @@ const CONFIG_DIR = ".intlayer/config";
|
|
|
13
13
|
const CACHE_DIR = ".intlayer/cache";
|
|
14
14
|
const TEMP_DIR = ".intlayer/tmp";
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
exports.CACHE_DIR = CACHE_DIR;
|
|
18
17
|
exports.CONFIG_DIR = CONFIG_DIR;
|
|
19
18
|
exports.DICTIONARIES_DIR = DICTIONARIES_DIR;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_defaultValues_dictionary = require(
|
|
2
|
+
const require_defaultValues_dictionary = require("./defaultValues/dictionary.cjs");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/dictionaryPreload.ts
|
|
6
6
|
/**
|
|
7
7
|
* Matches a generated dynamic entry point, whose layout is
|
|
8
8
|
* `<dynamicDictionariesDir>/<key>.mjs`. The per-locale JSON chunks it imports
|
|
@@ -140,7 +140,6 @@ const addDynamicEntryPreload = (code, preloadModuleId) => {
|
|
|
140
140
|
return { code: buildPreloadImport(preloadModuleId) + code + PRELOAD_PREAMBLE };
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
//#endregion
|
|
144
143
|
exports.DYNAMIC_ENTRY_PATTERN = DYNAMIC_ENTRY_PATTERN;
|
|
145
144
|
exports.PRELOAD_MODULE_SPECIFIER = PRELOAD_MODULE_SPECIFIER;
|
|
146
145
|
exports.addDynamicEntryPreload = addDynamicEntryPreload;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/envVars/envVars.ts
|
|
3
3
|
/**
|
|
4
4
|
* Converts a camelCase node-type string to SCREAMING_SNAKE_CASE so that
|
|
5
5
|
* the generated env-var name matches what the plugin source files check.
|
|
@@ -93,7 +93,6 @@ const getConfigEnvVars = (config, wrapKey = (key) => key, wrapValue = (value) =>
|
|
|
93
93
|
return envVars;
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
//#endregion
|
|
97
96
|
exports.formatDictionarySelectorEnvVar = formatDictionarySelectorEnvVar;
|
|
98
97
|
exports.formatNodeTypeToEnvVar = formatNodeTypeToEnvVar;
|
|
99
98
|
exports.formatOptimizedNestingEnvVar = formatOptimizedNestingEnvVar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_envVars_envVars = require(
|
|
2
|
+
const require_envVars_envVars = require("./envVars.cjs");
|
|
3
3
|
|
|
4
4
|
exports.formatDictionarySelectorEnvVar = require_envVars_envVars.formatDictionarySelectorEnvVar;
|
|
5
5
|
exports.formatNodeTypeToEnvVar = require_envVars_envVars.formatNodeTypeToEnvVar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/extract/constants.ts
|
|
3
3
|
/**
|
|
4
4
|
* Attributes that should be extracted as translatable strings from JSX/HTML elements.
|
|
5
5
|
* This is the single source of truth shared across all Intlayer compiler packages
|
|
@@ -14,6 +14,5 @@ const ATTRIBUTES_TO_EXTRACT = [
|
|
|
14
14
|
"label"
|
|
15
15
|
];
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.ATTRIBUTES_TO_EXTRACT = ATTRIBUTES_TO_EXTRACT;
|
|
19
18
|
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_extract_constants = require(
|
|
3
|
-
const require_extract_shouldExtract = require(
|
|
2
|
+
const require_extract_constants = require("./constants.cjs");
|
|
3
|
+
const require_extract_shouldExtract = require("./shouldExtract.cjs");
|
|
4
4
|
|
|
5
5
|
exports.ATTRIBUTES_TO_EXTRACT = require_extract_constants.ATTRIBUTES_TO_EXTRACT;
|
|
6
6
|
exports.shouldExtract = require_extract_shouldExtract.shouldExtract;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/extract/shouldExtract.ts
|
|
3
3
|
/**
|
|
4
4
|
* Checks whether the given text should be extracted as a translatable string.
|
|
5
5
|
*
|
|
@@ -33,6 +33,5 @@ const shouldExtract = (text) => {
|
|
|
33
33
|
return true;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
exports.shouldExtract = shouldExtract;
|
|
38
37
|
//# sourceMappingURL=shouldExtract.cjs.map
|
package/dist/cjs/loadEnvFile.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
2
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
let dotenv = require("dotenv");
|
|
5
5
|
dotenv = require_runtime.__toESM(dotenv);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/loadEnvFile.ts
|
|
8
8
|
const DEFAULT_ENV = process.env.NODE_ENV ?? "development";
|
|
9
9
|
const getEnvFilePath = (env = process.env.NODE_ENV ?? "development", envFile) => {
|
|
10
10
|
return (envFile ? [envFile] : [
|
|
@@ -65,7 +65,6 @@ const loadEnvFile = (options) => {
|
|
|
65
65
|
return parsedEnv;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
//#endregion
|
|
69
68
|
exports.getEnvFilePath = getEnvFilePath;
|
|
70
69
|
exports.loadEnvFile = loadEnvFile;
|
|
71
70
|
//# sourceMappingURL=loadEnvFile.cjs.map
|
|
@@ -3,7 +3,7 @@ let node_path = require("node:path");
|
|
|
3
3
|
let esbuild = require("esbuild");
|
|
4
4
|
let node_url = require("node:url");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/loadExternalFile/bundleFile.ts
|
|
7
7
|
const getLoader = (extension) => {
|
|
8
8
|
switch (extension) {
|
|
9
9
|
case ".js": return "js";
|
|
@@ -68,7 +68,6 @@ const bundleFile = async (code, filePath, options) => {
|
|
|
68
68
|
})).outputFiles?.[0].text;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
//#endregion
|
|
72
71
|
exports.bundleFile = bundleFile;
|
|
73
72
|
exports.bundleFileSync = bundleFileSync;
|
|
74
73
|
exports.getLoader = getLoader;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let esbuild = require("esbuild");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/loadExternalFile/bundleJSFile.ts
|
|
5
5
|
const commonBuildOptions = {
|
|
6
6
|
bundle: true,
|
|
7
7
|
format: "cjs",
|
|
@@ -28,6 +28,5 @@ const bundleJSFile = async (buildOptions) => await (0, esbuild.build)({
|
|
|
28
28
|
...buildOptions
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
//#endregion
|
|
32
31
|
exports.bundleJSFile = bundleJSFile;
|
|
33
32
|
//# sourceMappingURL=bundleJSFile.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
2
|
+
const require_loadExternalFile_bundleFile = require("./bundleFile.cjs");
|
|
3
|
+
const require_loadExternalFile_bundleJSFile = require("./bundleJSFile.cjs");
|
|
4
|
+
const require_loadExternalFile_loadExternalFile = require("./loadExternalFile.cjs");
|
|
5
|
+
const require_loadExternalFile_parseFileContent = require("./parseFileContent.cjs");
|
|
6
|
+
const require_loadExternalFile_transpileTSToCJS = require("./transpileTSToCJS.cjs");
|
|
7
7
|
|
|
8
8
|
exports.bundleFile = require_loadExternalFile_bundleFile.bundleFile;
|
|
9
9
|
exports.bundleFileSync = require_loadExternalFile_bundleFile.bundleFileSync;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require_logger = require(
|
|
4
|
-
const require_loadExternalFile_parseFileContent = require(
|
|
5
|
-
const require_loadExternalFile_transpileTSToCJS = require(
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_logger = require("../logger.cjs");
|
|
4
|
+
const require_loadExternalFile_parseFileContent = require("./parseFileContent.cjs");
|
|
5
|
+
const require_loadExternalFile_transpileTSToCJS = require("./transpileTSToCJS.cjs");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let json5 = require("json5");
|
|
10
10
|
json5 = require_runtime.__toESM(json5);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/loadExternalFile/loadExternalFile.ts
|
|
13
13
|
const parseJSON5 = json5.default.parse || json5.default.default?.parse;
|
|
14
14
|
/**
|
|
15
15
|
* Load the content declaration from the given path
|
|
@@ -94,7 +94,6 @@ const loadExternalFile = async (filePath, options) => {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
//#endregion
|
|
98
97
|
exports.loadExternalFile = loadExternalFile;
|
|
99
98
|
exports.loadExternalFileSync = loadExternalFileSync;
|
|
100
99
|
//# sourceMappingURL=loadExternalFile.cjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require_loadEnvFile = require(
|
|
4
|
-
const require_utils_ESMxCJSHelpers = require(
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_loadEnvFile = require("../loadEnvFile.cjs");
|
|
4
|
+
const require_utils_ESMxCJSHelpers = require("../utils/ESMxCJSHelpers.cjs");
|
|
5
5
|
let node_vm = require("node:vm");
|
|
6
6
|
let esbuild = require("esbuild");
|
|
7
7
|
esbuild = require_runtime.__toESM(esbuild);
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/loadExternalFile/parseFileContent.ts
|
|
10
10
|
const NODE_GLOBALS = [
|
|
11
11
|
"Buffer",
|
|
12
12
|
"setTimeout",
|
|
@@ -135,7 +135,6 @@ const parseFileContent = (fileContentString, options) => {
|
|
|
135
135
|
return result;
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
//#endregion
|
|
139
138
|
exports.getSandBoxContext = getSandBoxContext;
|
|
140
139
|
exports.parseFileContent = parseFileContent;
|
|
141
140
|
//# sourceMappingURL=parseFileContent.cjs.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_cacheMemory = require(
|
|
3
|
-
const require_utils_getPackageJsonPath = require(
|
|
4
|
-
const require_loadExternalFile_bundleFile = require(
|
|
2
|
+
const require_utils_cacheMemory = require("../utils/cacheMemory.cjs");
|
|
3
|
+
const require_utils_getPackageJsonPath = require("../utils/getPackageJsonPath.cjs");
|
|
4
|
+
const require_loadExternalFile_bundleFile = require("./bundleFile.cjs");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
let node_path = require("node:path");
|
|
7
7
|
let node_module = require("node:module");
|
|
8
8
|
let esbuild = require("esbuild");
|
|
9
9
|
let node_url = require("node:url");
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/loadExternalFile/transpileTSToCJS.ts
|
|
12
12
|
/**
|
|
13
13
|
* Cache of resolved tsconfig paths keyed by the file's directory.
|
|
14
14
|
* Avoids re-walking to package.json + existsSync on every transpilation.
|
|
@@ -182,7 +182,6 @@ const transpileTSToCJS = async (code, filePath, options) => {
|
|
|
182
182
|
return moduleResultString;
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
-
//#endregion
|
|
186
185
|
exports.clearTranspileCache = clearTranspileCache;
|
|
187
186
|
exports.transpileTSToCJS = transpileTSToCJS;
|
|
188
187
|
exports.transpileTSToCJSSync = transpileTSToCJSSync;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transpileTSToCJS.cjs","names":["dirname","join","getPackageJsonPath","existsSync","pathToFileURL","statSync","resolve","isAbsolute","extname","getLoader","computeKeyId","buildSync","createRequire","build"],"sources":["../../../src/loadExternalFile/transpileTSToCJS.ts"],"sourcesContent":["import { existsSync, statSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, extname, isAbsolute, join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport {\n type BuildOptions,\n type BuildResult,\n build,\n buildSync,\n type Metafile,\n} from 'esbuild';\nimport { computeKeyId } from '../utils/cacheMemory';\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\n/**\n * Cache of resolved tsconfig paths keyed by the file's directory.\n * Avoids re-walking to package.json + existsSync on every transpilation.\n */\nconst tsConfigPathCache = new Map<string, string | undefined>();\n\nconst getTsConfigPath = (filePath: string): string | undefined => {\n const fileDirectory = dirname(filePath);\n\n if (tsConfigPathCache.has(fileDirectory)) {\n return tsConfigPathCache.get(fileDirectory);\n }\n\n let resolvedPath: string | undefined;\n try {\n const tsconfigPath = join(\n getPackageJsonPath(fileDirectory).baseDir,\n 'tsconfig.json'\n );\n\n // Only return the tsconfig path if it exists\n resolvedPath = existsSync(tsconfigPath) ? tsconfigPath : undefined;\n } catch {\n // No package.json found up the tree — transpile without a tsconfig\n resolvedPath = undefined;\n }\n\n tsConfigPathCache.set(fileDirectory, resolvedPath);\n\n return resolvedPath;\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 // The metafile lists every bundled input, which the transpile cache uses to\n // invalidate when an imported file changes (the entry itself is keyed by hash).\n metafile: true,\n tsconfig: getTsConfigPath(filePath),\n define: {\n 'import.meta.url': JSON.stringify(pathToFileURL(filePath).href),\n 'import.meta.env': 'process.env',\n },\n});\n\n/** Fingerprint of a bundled input file, used to detect changes without re-reading it. */\ntype TranspileCacheInput = {\n path: string;\n mtimeMs: number;\n size: number;\n};\n\ntype TranspileCacheEntry = {\n /** Hash of the entry file's source code. */\n codeHash: string;\n /** Hash of the build options, so different option sets don't collide. */\n optionsKey: string;\n /** The transpiled CJS output. */\n output: string;\n /** Fingerprints of every non-entry input bundled into the output. */\n inputs: TranspileCacheInput[];\n};\n\n/**\n * In-memory cache of transpiled outputs keyed by entry file path (one entry\n * per file, so re-transpilations replace rather than accumulate).\n * The entry file is validated by content hash; bundled relative imports are\n * validated by mtime + size so an edited dependency invalidates the cache.\n */\nconst transpileCache = new Map<string, TranspileCacheEntry>();\n\nconst isInputUnchanged = (input: TranspileCacheInput): boolean => {\n try {\n const stats = statSync(input.path);\n return stats.mtimeMs === input.mtimeMs && stats.size === input.size;\n } catch {\n // File removed or unreadable — treat as changed\n return false;\n }\n};\n\nconst getCachedTranspilation = (\n filePath: string,\n codeHash: string,\n optionsKey: string\n): string | undefined => {\n const cacheEntry = transpileCache.get(filePath);\n\n if (!cacheEntry) return undefined;\n if (cacheEntry.codeHash !== codeHash) return undefined;\n if (cacheEntry.optionsKey !== optionsKey) return undefined;\n if (!cacheEntry.inputs.every(isInputUnchanged)) return undefined;\n\n return cacheEntry.output;\n};\n\n/**\n * Extracts the fingerprints of every bundled input from the esbuild metafile.\n * Returns `undefined` when an input cannot be fingerprinted (the result should\n * then not be cached, as invalidation would be unreliable).\n */\nconst getInputFingerprints = (\n metafile: Metafile | undefined,\n entryFilePath: string\n): TranspileCacheInput[] | undefined => {\n if (!metafile) return undefined;\n\n const resolvedEntryFilePath = resolve(entryFilePath);\n const inputs: TranspileCacheInput[] = [];\n\n for (const inputPath of Object.keys(metafile.inputs)) {\n // The entry itself is provided via stdin and validated by content hash.\n // esbuild labels it \"<stdin>\", or with the sourcefile path when set.\n if (inputPath === '<stdin>') continue;\n // Virtual modules from plugins (e.g. \"plugin:...\") cannot be fingerprinted\n if (inputPath.includes(':') && !isAbsolute(inputPath)) return undefined;\n\n const absoluteInputPath = isAbsolute(inputPath)\n ? inputPath\n : resolve(process.cwd(), inputPath);\n\n if (absoluteInputPath === resolvedEntryFilePath) continue;\n\n try {\n const stats = statSync(absoluteInputPath);\n inputs.push({\n path: absoluteInputPath,\n mtimeMs: stats.mtimeMs,\n size: stats.size,\n });\n } catch {\n return undefined;\n }\n }\n\n return inputs;\n};\n\nconst setCachedTranspilation = (\n filePath: string,\n codeHash: string,\n optionsKey: string,\n moduleResult: BuildResult,\n output: string\n): void => {\n const inputs = getInputFingerprints(moduleResult.metafile, filePath);\n\n // Without a usable metafile the cache cannot be invalidated reliably — skip\n if (!inputs) return;\n\n transpileCache.set(filePath, { codeHash, optionsKey, output, inputs });\n};\n\n/** Clears the in-memory transpilation cache (mainly for tests). */\nexport const clearTranspileCache = (): void => {\n transpileCache.clear();\n tsConfigPathCache.clear();\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\n const codeHash = computeKeyId([code]);\n const optionsKey = computeKeyId([buildOptions]);\n\n const cachedOutput = getCachedTranspilation(filePath, codeHash, optionsKey);\n if (typeof cachedOutput === 'string') return cachedOutput;\n\n const esbuildBuildSync = esbuildInstance?.buildSync ?? buildSync;\n\n // esbuild's worker thread service calls `new Worker(__filename, …)` on first use.\n // In Vite's SSR module runner the SSR-optimised chunk is ESM and __filename is\n // never declared (confirmed: accessing it throws ReferenceError, not undefined).\n // Because there is no local declaration the bare `__filename` lookup falls\n // through to globalThis, so we set it there to esbuild's own CJS entry-point –\n // the exact path esbuild would use if it were loaded in a normal CJS context.\n //\n // IMPORTANT: We save/restore the globals so this temporary shim does not leak\n // to other Vite plugins (e.g. `@vitejs/plugin-react-swc`) that check\n // `typeof __dirname !== \"undefined\"` to locate their own assets.\n const g = globalThis as Record<string, unknown>;\n const hadFilename = typeof g.__filename === 'string';\n const prevFilename = g.__filename;\n const prevDirname = g.__dirname;\n\n if (!hadFilename) {\n try {\n const _require = createRequire(import.meta.url);\n const esbuildEntry = _require.resolve('esbuild');\n g.__filename = esbuildEntry;\n g.__dirname = dirname(esbuildEntry);\n } catch {\n // Best-effort: if esbuild can't be resolved the caller's catch handles it\n }\n }\n\n let moduleResult: BuildResult;\n try {\n moduleResult = 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 } finally {\n // Always restore the previous values so the globals don't linger.\n if (!hadFilename) {\n if (prevFilename === undefined) {\n // biome-ignore lint/performance/noDelete: the global must be truly absent — assigning undefined would leave the key present and break `typeof __filename` checks in other tools\n delete g.__filename;\n } else {\n g.__filename = prevFilename;\n }\n if (prevDirname === undefined) {\n // biome-ignore lint/performance/noDelete: same as __filename above\n delete g.__dirname;\n } else {\n g.__dirname = prevDirname;\n }\n }\n }\n\n const moduleResultString = moduleResult!.outputFiles?.[0]?.text;\n\n if (typeof moduleResultString === 'string') {\n setCachedTranspilation(\n filePath,\n codeHash,\n optionsKey,\n moduleResult!,\n moduleResultString\n );\n }\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\n const codeHash = computeKeyId([code]);\n const optionsKey = computeKeyId([buildOptions]);\n\n const cachedOutput = getCachedTranspilation(filePath, codeHash, optionsKey);\n if (typeof cachedOutput === 'string') return cachedOutput;\n\n // A one-shot build() releases its Go-side resources on completion and costs a\n // single service round-trip (context()+rebuild()+dispose() costs three).\n const esbuildBuild = esbuildInstance?.build ?? build;\n\n const moduleResult = await esbuildBuild({\n stdin: {\n contents: code,\n loader,\n resolveDir: dirname(filePath),\n sourcefile: filePath,\n },\n ...getTransformationOptions(filePath),\n ...buildOptions,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0]?.text;\n\n if (typeof moduleResultString === 'string') {\n setCachedTranspilation(\n filePath,\n codeHash,\n optionsKey,\n moduleResult,\n moduleResultString\n );\n }\n\n return moduleResultString;\n};\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,MAAM,oCAAoB,IAAI,IAAgC;AAE9D,MAAM,mBAAmB,aAAyC;CAChE,MAAM,oBAAgBA,mBAAQ,QAAQ;CAEtC,IAAI,kBAAkB,IAAI,aAAa,GACrC,OAAO,kBAAkB,IAAI,aAAa;CAG5C,IAAI;CACJ,IAAI;EACF,MAAM,mBAAeC,gBACnBC,oDAAmB,aAAa,CAAC,CAAC,SAClC,eACF;EAGA,mBAAeC,oBAAW,YAAY,IAAI,eAAe;CAC3D,QAAQ;EAEN,eAAe;CACjB;CAEA,kBAAkB,IAAI,eAAe,YAAY;CAEjD,OAAO;AACT;AAEA,MAAM,4BAA4B,cAAoC;CACpE,QAAQ;EACN,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,OAAO;EACP,QAAQ;CACV;CACA,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,OAAO;CACP,UAAU;CACV,QAAQ;CAGR,UAAU;CACV,UAAU,gBAAgB,QAAQ;CAClC,QAAQ;EACN,mBAAmB,KAAK,cAAUC,wBAAc,QAAQ,CAAC,CAAC,IAAI;EAC9D,mBAAmB;CACrB;AACF;;;;;;;AA0BA,MAAM,iCAAiB,IAAI,IAAiC;AAE5D,MAAM,oBAAoB,UAAwC;CAChE,IAAI;EACF,MAAM,YAAQC,kBAAS,MAAM,IAAI;EACjC,OAAO,MAAM,YAAY,MAAM,WAAW,MAAM,SAAS,MAAM;CACjE,QAAQ;EAEN,OAAO;CACT;AACF;AAEA,MAAM,0BACJ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;CAM7C,MAAM,eAAe,OAFA,iBAAiB,SAASG,cAER,CAAC;EACtC,OAAO;GACL,UAAU;GACV;GACA,gBAAYb,mBAAQ,QAAQ;GAC5B,YAAY;EACd;EACA,GAAG,yBAAyB,QAAQ;EACpC,GAAG;CACL,CAAC;CAED,MAAM,qBAAqB,aAAa,cAAc,EAAE,EAAE;CAE1D,IAAI,OAAO,uBAAuB,UAChC,uBACE,UACA,UACA,YACA,cACA,kBACF;CAGF,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"transpileTSToCJS.cjs","names":["dirname","join","getPackageJsonPath","existsSync","pathToFileURL","statSync","resolve","isAbsolute","extname","getLoader","computeKeyId","buildSync","createRequire","build"],"sources":["../../../src/loadExternalFile/transpileTSToCJS.ts"],"sourcesContent":["import { existsSync, statSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, extname, isAbsolute, join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport {\n type BuildOptions,\n type BuildResult,\n build,\n buildSync,\n type Metafile,\n} from 'esbuild';\nimport { computeKeyId } from '../utils/cacheMemory';\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\n/**\n * Cache of resolved tsconfig paths keyed by the file's directory.\n * Avoids re-walking to package.json + existsSync on every transpilation.\n */\nconst tsConfigPathCache = new Map<string, string | undefined>();\n\nconst getTsConfigPath = (filePath: string): string | undefined => {\n const fileDirectory = dirname(filePath);\n\n if (tsConfigPathCache.has(fileDirectory)) {\n return tsConfigPathCache.get(fileDirectory);\n }\n\n let resolvedPath: string | undefined;\n try {\n const tsconfigPath = join(\n getPackageJsonPath(fileDirectory).baseDir,\n 'tsconfig.json'\n );\n\n // Only return the tsconfig path if it exists\n resolvedPath = existsSync(tsconfigPath) ? tsconfigPath : undefined;\n } catch {\n // No package.json found up the tree — transpile without a tsconfig\n resolvedPath = undefined;\n }\n\n tsConfigPathCache.set(fileDirectory, resolvedPath);\n\n return resolvedPath;\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 // The metafile lists every bundled input, which the transpile cache uses to\n // invalidate when an imported file changes (the entry itself is keyed by hash).\n metafile: true,\n tsconfig: getTsConfigPath(filePath),\n define: {\n 'import.meta.url': JSON.stringify(pathToFileURL(filePath).href),\n 'import.meta.env': 'process.env',\n },\n});\n\n/** Fingerprint of a bundled input file, used to detect changes without re-reading it. */\ntype TranspileCacheInput = {\n path: string;\n mtimeMs: number;\n size: number;\n};\n\ntype TranspileCacheEntry = {\n /** Hash of the entry file's source code. */\n codeHash: string;\n /** Hash of the build options, so different option sets don't collide. */\n optionsKey: string;\n /** The transpiled CJS output. */\n output: string;\n /** Fingerprints of every non-entry input bundled into the output. */\n inputs: TranspileCacheInput[];\n};\n\n/**\n * In-memory cache of transpiled outputs keyed by entry file path (one entry\n * per file, so re-transpilations replace rather than accumulate).\n * The entry file is validated by content hash; bundled relative imports are\n * validated by mtime + size so an edited dependency invalidates the cache.\n */\nconst transpileCache = new Map<string, TranspileCacheEntry>();\n\nconst isInputUnchanged = (input: TranspileCacheInput): boolean => {\n try {\n const stats = statSync(input.path);\n return stats.mtimeMs === input.mtimeMs && stats.size === input.size;\n } catch {\n // File removed or unreadable — treat as changed\n return false;\n }\n};\n\nconst getCachedTranspilation = (\n filePath: string,\n codeHash: string,\n optionsKey: string\n): string | undefined => {\n const cacheEntry = transpileCache.get(filePath);\n\n if (!cacheEntry) return undefined;\n if (cacheEntry.codeHash !== codeHash) return undefined;\n if (cacheEntry.optionsKey !== optionsKey) return undefined;\n if (!cacheEntry.inputs.every(isInputUnchanged)) return undefined;\n\n return cacheEntry.output;\n};\n\n/**\n * Extracts the fingerprints of every bundled input from the esbuild metafile.\n * Returns `undefined` when an input cannot be fingerprinted (the result should\n * then not be cached, as invalidation would be unreliable).\n */\nconst getInputFingerprints = (\n metafile: Metafile | undefined,\n entryFilePath: string\n): TranspileCacheInput[] | undefined => {\n if (!metafile) return undefined;\n\n const resolvedEntryFilePath = resolve(entryFilePath);\n const inputs: TranspileCacheInput[] = [];\n\n for (const inputPath of Object.keys(metafile.inputs)) {\n // The entry itself is provided via stdin and validated by content hash.\n // esbuild labels it \"<stdin>\", or with the sourcefile path when set.\n if (inputPath === '<stdin>') continue;\n // Virtual modules from plugins (e.g. \"plugin:...\") cannot be fingerprinted\n if (inputPath.includes(':') && !isAbsolute(inputPath)) return undefined;\n\n const absoluteInputPath = isAbsolute(inputPath)\n ? inputPath\n : resolve(process.cwd(), inputPath);\n\n if (absoluteInputPath === resolvedEntryFilePath) continue;\n\n try {\n const stats = statSync(absoluteInputPath);\n inputs.push({\n path: absoluteInputPath,\n mtimeMs: stats.mtimeMs,\n size: stats.size,\n });\n } catch {\n return undefined;\n }\n }\n\n return inputs;\n};\n\nconst setCachedTranspilation = (\n filePath: string,\n codeHash: string,\n optionsKey: string,\n moduleResult: BuildResult,\n output: string\n): void => {\n const inputs = getInputFingerprints(moduleResult.metafile, filePath);\n\n // Without a usable metafile the cache cannot be invalidated reliably — skip\n if (!inputs) return;\n\n transpileCache.set(filePath, { codeHash, optionsKey, output, inputs });\n};\n\n/** Clears the in-memory transpilation cache (mainly for tests). */\nexport const clearTranspileCache = (): void => {\n transpileCache.clear();\n tsConfigPathCache.clear();\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\n const codeHash = computeKeyId([code]);\n const optionsKey = computeKeyId([buildOptions]);\n\n const cachedOutput = getCachedTranspilation(filePath, codeHash, optionsKey);\n if (typeof cachedOutput === 'string') return cachedOutput;\n\n const esbuildBuildSync = esbuildInstance?.buildSync ?? buildSync;\n\n // esbuild's worker thread service calls `new Worker(__filename, …)` on first use.\n // In Vite's SSR module runner the SSR-optimised chunk is ESM and __filename is\n // never declared (confirmed: accessing it throws ReferenceError, not undefined).\n // Because there is no local declaration the bare `__filename` lookup falls\n // through to globalThis, so we set it there to esbuild's own CJS entry-point –\n // the exact path esbuild would use if it were loaded in a normal CJS context.\n //\n // IMPORTANT: We save/restore the globals so this temporary shim does not leak\n // to other Vite plugins (e.g. `@vitejs/plugin-react-swc`) that check\n // `typeof __dirname !== \"undefined\"` to locate their own assets.\n const g = globalThis as Record<string, unknown>;\n const hadFilename = typeof g.__filename === 'string';\n const prevFilename = g.__filename;\n const prevDirname = g.__dirname;\n\n if (!hadFilename) {\n try {\n const _require = createRequire(import.meta.url);\n const esbuildEntry = _require.resolve('esbuild');\n g.__filename = esbuildEntry;\n g.__dirname = dirname(esbuildEntry);\n } catch {\n // Best-effort: if esbuild can't be resolved the caller's catch handles it\n }\n }\n\n let moduleResult: BuildResult;\n try {\n moduleResult = 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 } finally {\n // Always restore the previous values so the globals don't linger.\n if (!hadFilename) {\n if (prevFilename === undefined) {\n // oxlint-disable-next-line typescript/no-dynamic-delete -- the global must be truly absent — assigning undefined would leave the key present and break `typeof __filename` checks in other tools\n delete g.__filename;\n } else {\n g.__filename = prevFilename;\n }\n if (prevDirname === undefined) {\n // oxlint-disable-next-line typescript/no-dynamic-delete -- same as __filename above\n delete g.__dirname;\n } else {\n g.__dirname = prevDirname;\n }\n }\n }\n\n const moduleResultString = moduleResult!.outputFiles?.[0]?.text;\n\n if (typeof moduleResultString === 'string') {\n setCachedTranspilation(\n filePath,\n codeHash,\n optionsKey,\n moduleResult!,\n moduleResultString\n );\n }\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\n const codeHash = computeKeyId([code]);\n const optionsKey = computeKeyId([buildOptions]);\n\n const cachedOutput = getCachedTranspilation(filePath, codeHash, optionsKey);\n if (typeof cachedOutput === 'string') return cachedOutput;\n\n // A one-shot build() releases its Go-side resources on completion and costs a\n // single service round-trip (context()+rebuild()+dispose() costs three).\n const esbuildBuild = esbuildInstance?.build ?? build;\n\n const moduleResult = await esbuildBuild({\n stdin: {\n contents: code,\n loader,\n resolveDir: dirname(filePath),\n sourcefile: filePath,\n },\n ...getTransformationOptions(filePath),\n ...buildOptions,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0]?.text;\n\n if (typeof moduleResultString === 'string') {\n setCachedTranspilation(\n filePath,\n codeHash,\n optionsKey,\n moduleResult,\n moduleResultString\n );\n }\n\n return moduleResultString;\n};\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,MAAM,oCAAoB,IAAI,IAAgC;AAE9D,MAAM,mBAAmB,aAAyC;CAChE,MAAM,oBAAgBA,mBAAQ,QAAQ;CAEtC,IAAI,kBAAkB,IAAI,aAAa,GACrC,OAAO,kBAAkB,IAAI,aAAa;CAG5C,IAAI;CACJ,IAAI;EACF,MAAM,mBAAeC,gBACnBC,oDAAmB,aAAa,CAAC,CAAC,SAClC,eACF;EAGA,mBAAeC,oBAAW,YAAY,IAAI,eAAe;CAC3D,QAAQ;EAEN,eAAe;CACjB;CAEA,kBA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ACH,UAAU;EAER,IAAI,CAAC,aAAa;GAChB,IAAI,iBAAiB,QAEnB,OAAO,EAAE;QAET,EAAE,aAAa;GAEjB,IAAI,gBAAgB,QAElB,OAAO,EAAE;QAET,EAAE,YAAY;EAElB;CACF;CAEA,MAAM,qBAAqB,aAAc,cAAc,EAAE,EAAE;CAE3D,IAAI,OAAO,uBAAuB,UAChC,uBACE,UACA,UACA,YACA,cACA,kBACF;CAGF,OAAO;AACT;AAEA,MAAa,mBAAmB,OAC9B,MACA,UACA,YACgC;CAChC,MAAM,gBAAYQ,mBAAQ,QAAQ;CAClC,MAAM,SAASC,8CAAU,SAAS;CAElC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,WAAW,CAAC;CAEzD,MAAM,WAAWC,uCAAa,CAAC,IAAI,CAAC;CACpC,MAAM,aAAaA,uCAAa,CAAC,YAAY,CAAC;CAE9C,MAAM,eAAe,uBAAuB,UAAU,UAAU,UAAU;CAC1E,IAAI,OAAO,iBAAiB,UAAU,OAAO;CAM7C,MAAM,eAAe,OAFA,iBAAiB,SAASG,cAER,CAAC;EACtC,OAAO;GACL,UAAU;GACV;GACA,gBAAYb,mBAAQ,QAAQ;GAC5B,YAAY;EACd;EACA,GAAG,yBAAyB,QAAQ;EACpC,GAAG;CACL,CAAC;CAED,MAAM,qBAAqB,aAAa,cAAc,EAAE,EAAE;CAE1D,IAAI,OAAO,uBAAuB,UAChC,uBACE,UACA,UACA,YACA,cACA,kBACF;CAGF,OAAO;AACT"}
|
package/dist/cjs/logger.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_colors = require(
|
|
2
|
+
const require_colors = require("./colors.cjs");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/logger.ts
|
|
5
5
|
let loggerPrefix;
|
|
6
6
|
const setPrefix = (prefix) => {
|
|
7
7
|
loggerPrefix = prefix;
|
|
@@ -136,7 +136,6 @@ const x = colorize("✗", require_colors.RED);
|
|
|
136
136
|
const v = colorize("✓", require_colors.GREEN);
|
|
137
137
|
const clock = colorize("⏲", require_colors.BLUE);
|
|
138
138
|
|
|
139
|
-
//#endregion
|
|
140
139
|
exports.clock = clock;
|
|
141
140
|
exports.colon = colon;
|
|
142
141
|
exports.colorize = colorize;
|
package/dist/cjs/logger.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.cjs","names":["RESET","GREEN","BEIGE","GREY","BLUE","GREY_DARK","WHITE","GREY_LIGHT","RED"],"sources":["../../src/logger.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type {\n CustomIntlayerConfig,\n IntlayerConfig,\n} from '@intlayer/types/config';\nimport type * as ANSIColorsTypes from './colors';\nimport {\n BEIGE,\n BLUE,\n GREEN,\n GREY,\n GREY_DARK,\n GREY_LIGHT,\n RED,\n RESET,\n WHITE,\n} from './colors';\n\nexport type ANSIColorsType =\n (typeof ANSIColorsTypes)[keyof typeof ANSIColorsTypes];\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 config = details?.config ?? {};\n const mode = config.mode ?? 'default';\n\n if (mode === 'disabled' || (details?.isVerbose && mode !== 'verbose')) return;\n\n const prefix = getPrefix(config.prefix);\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n const level = details?.level ?? 'info';\n\n const logMethod =\n config[level] ?? console[level] ?? config.log ?? console.log;\n\n logMethod(...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?: Pick<IntlayerConfig, 'log'>, 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 string: string,\n color?: ANSIColorsType,\n reset?: boolean | ANSIColorsType\n): string =>\n color && typeof window === 'undefined'\n ? `${color}${string}${reset ? (typeof reset === 'boolean' ? RESET : reset) : RESET}`\n : string;\n\nexport const colorizeLocales = (\n locales: Locale | Locale[],\n color: ANSIColorsType = GREEN,\n reset: boolean | ANSIColorsType = 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: ANSIColorsType = BEIGE,\n reset: boolean | ANSIColorsType = 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: ANSIColorsType = GREY,\n reset: boolean | ANSIColorsType = RESET\n) =>\n [path]\n .flat()\n .map((path) => colorize(path, color, reset))\n .join(`, `);\n\nexport const colorizeNumber = (\n number: number | string,\n options: Partial<Record<Intl.LDMLPluralRule, ANSIColorsType>> = {\n zero: BLUE,\n one: BLUE,\n two: BLUE,\n few: BLUE,\n many: BLUE,\n other: BLUE,\n }\n): string => {\n if (number === 0 || number === '0') {\n const color = options.zero ?? GREEN;\n return colorize(number.toString(), color);\n }\n\n // Kept inside the function. Top-level instantiation of classes/APIs\n // is treated as a side-effect and prevents tree-shaking if the function is unused.\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 colorizeObject = (\n obj: any,\n indentLevel = 0,\n indentSize = 2,\n key?: string\n): string => {\n const indent = ' '.repeat(indentLevel * indentSize);\n const nextIndent = ' '.repeat((indentLevel + 1) * indentSize);\n\n if (obj === null) {\n return colorize('null', BLUE);\n }\n\n if (typeof obj === 'boolean') {\n return colorize(obj.toString(), BLUE);\n }\n\n if (typeof obj === 'number') {\n return colorize(obj.toString(), BLUE);\n }\n\n if (typeof obj === 'string') {\n const isDateString = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/.test(obj);\n const isUrl = obj.startsWith('http://') || obj.startsWith('https://');\n const isGlob = obj.includes('*') || obj.includes('?') || obj.includes('{');\n const isPath =\n obj.startsWith('/') ||\n obj.startsWith('./') ||\n obj.startsWith('../') ||\n /\\.[a-zA-Z0-9]{2,5}$/.test(obj);\n const isSecret =\n /^[0-9a-fA-F]{24,}$/.test(obj) || (obj.length >= 40 && !/\\s/.test(obj));\n const hasSpaces = /\\s/.test(obj);\n\n if (isDateString) return colorize(`\"${obj}\"`, BEIGE);\n if (isUrl) return colorize(`\"${obj}\"`, GREY_DARK);\n if (isGlob) return colorize(`\"${obj}\"`, GREY);\n if (isPath) return colorize(`\"${obj}\"`, GREY_DARK);\n if (isSecret) return colorize(`\"${obj}\"`, GREY);\n if (hasSpaces) return colorize(`\"${obj}\"`, WHITE);\n return colorize(`\"${obj}\"`, BLUE);\n }\n\n if (Array.isArray(obj)) {\n if (obj.length === 0) {\n return '[]';\n }\n const items = obj\n .map(\n (item) =>\n `${nextIndent}${colorizeObject(item, indentLevel + 1, indentSize, key)}`\n )\n .join(',\\n');\n return `[\\n${items}\\n${indent}]`;\n }\n\n if (typeof obj === 'object') {\n const keys = Object.keys(obj);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n const fields = keys\n .map((key) => {\n const coloredKey = colorize(`\"${key}\"`, GREY_LIGHT);\n const value = obj[key];\n const coloredValue = colorizeObject(\n value,\n indentLevel + 1,\n indentSize,\n key\n );\n return `${nextIndent}${coloredKey}: ${coloredValue}`;\n })\n .join(',\\n');\n return `{\\n${fields}\\n${indent}}`;\n }\n\n return colorize(String(obj), GREY);\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 (\n Array.isArray(length) &&\n length.every((locale) => typeof locale === 'string')\n ) {\n value = Math.max(...length.map((str) => str.length));\n }\n if (\n Array.isArray(length) &&\n length.every((locale) => typeof locale === 'number')\n ) {\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('✗', RED);\nexport const v = colorize('✓', GREEN);\nexport const clock = colorize('⏲', BLUE);\n"],"mappings":";;;;AA6BA,IAAI;AAEJ,MAAa,aAAa,WAA+B;CACvD,eAAe;AACjB;AAEA,MAAa,aAAa,iBAA8C;CACtE,IAAI,OAAO,iBAAiB,aAC1B,OAAO;CAGT,OAAO;AACT;AAE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WAAW,QAAQ,GAEnD,QAAQ,KAAK,IAAI,GAAG,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC;CAErD,IACE,MAAM,QAAQ,MAAM,KACpB,OAAO,OAAO,WAAW,OAAO,WAAW,QAAQ,GAEnD,QAAQ,KAAK,IAAI,GAAG,MAAM;CAE5B,OAAO,KAAK,IAAI,OAAO,CAAC;AAC1B;AAEA,MAAM,sBAAsB;CAC1B,SAAS;CACT,SAAS;CACT,SAAS;CACT,KAAK;CACL,SAAS;AACX;;;;;;;AAQA,MAAa,SACX,MACA,YAQA,CAAC,IAAI,CAAC,CACH,KAAK,CAAC,CACN,KAAK,SAAS;CACb,MAAM,EAAE,SAAS,SAAS,SAAS,QAAQ;EACzC,GAAG;EACH,GAAI,WAAW,CAAC;CAClB;CAEA,MAAM,SAAS,UAAU,OAAO;CAChC,MAAM,eAAe,KAAK,IACxB,SACA,KAAK,IAAI,SAAU,SAAS,YAAY,IAAI,CAAC,CAAC,MAAM,CACtD;CAEA,IAAI,QAAQ,QACV,OAAO,GAAG,IAAI,OAAO,YAAY,IAAI;CAGvC,OAAO,GAAG,OAAO,IAAI,OAAO,YAAY;AAC1C,CAAC,CAAC,CACD,KAAK,EAAE;AAEZ,MAAa,IAAI,SAAS,KAAKK,kBAAG;AAClC,MAAa,IAAI,SAAS,KAAKP,oBAAK;AACpC,MAAa,QAAQ,SAAS,KAAKG,mBAAI"}
|
|
1
|
+
{"version":3,"file":"logger.cjs","names":["RESET","GREEN","BEIGE","GREY","BLUE","GREY_DARK","WHITE","GREY_LIGHT","RED"],"sources":["../../src/logger.ts"],"sourcesContent":["import type { Locale } from '@intlayer/types/allLocales';\nimport type {\n CustomIntlayerConfig,\n IntlayerConfig,\n} from '@intlayer/types/config';\nimport type * as ANSIColorsTypes from './colors';\nimport {\n BEIGE,\n BLUE,\n GREEN,\n GREY,\n GREY_DARK,\n GREY_LIGHT,\n RED,\n RESET,\n WHITE,\n} from './colors';\n\nexport type ANSIColorsType =\n (typeof ANSIColorsTypes)[keyof typeof ANSIColorsTypes];\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 config = details?.config ?? {};\n const mode = config.mode ?? 'default';\n\n if (mode === 'disabled' || (details?.isVerbose && mode !== 'verbose')) return;\n\n const prefix = getPrefix(config.prefix);\n const flatContent = prefix ? [prefix, ...[content].flat()] : [content].flat();\n const level = details?.level ?? 'info';\n\n const logMethod =\n config[level] ?? console[level] ?? config.log ?? console.log;\n\n logMethod(...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?: Pick<IntlayerConfig, 'log'>, 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 string: string,\n color?: ANSIColorsType,\n reset?: boolean | ANSIColorsType\n): string =>\n color && typeof window === 'undefined'\n ? `${color}${string}${reset ? (typeof reset === 'boolean' ? RESET : reset) : RESET}`\n : string;\n\nexport const colorizeLocales = (\n locales: Locale | Locale[],\n color: ANSIColorsType = GREEN,\n reset: boolean | ANSIColorsType = 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: ANSIColorsType = BEIGE,\n reset: boolean | ANSIColorsType = 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: ANSIColorsType = GREY,\n reset: boolean | ANSIColorsType = RESET\n) =>\n [path]\n .flat()\n .map((path) => colorize(path, color, reset))\n .join(`, `);\n\nexport const colorizeNumber = (\n number: number | string,\n options: Partial<Record<Intl.LDMLPluralRule, ANSIColorsType>> = {\n zero: BLUE,\n one: BLUE,\n two: BLUE,\n few: BLUE,\n many: BLUE,\n other: BLUE,\n }\n): string => {\n if (number === 0 || number === '0') {\n const color = options.zero ?? GREEN;\n return colorize(number.toString(), color);\n }\n\n // Kept inside the function. Top-level instantiation of classes/APIs\n // is treated as a side-effect and prevents tree-shaking if the function is unused.\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 colorizeObject = (\n obj: any,\n indentLevel = 0,\n indentSize = 2,\n key?: string\n): string => {\n const indent = ' '.repeat(indentLevel * indentSize);\n const nextIndent = ' '.repeat((indentLevel + 1) * indentSize);\n\n if (obj === null) {\n return colorize('null', BLUE);\n }\n\n if (typeof obj === 'boolean') {\n return colorize(obj.toString(), BLUE);\n }\n\n if (typeof obj === 'number') {\n return colorize(obj.toString(), BLUE);\n }\n\n if (typeof obj === 'string') {\n const isDateString = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/.test(obj);\n const isUrl = obj.startsWith('http://') || obj.startsWith('https://');\n const isGlob = obj.includes('*') || obj.includes('?') || obj.includes('{');\n const isPath =\n obj.startsWith('/') ||\n obj.startsWith('./') ||\n obj.startsWith('../') ||\n /\\.[a-zA-Z0-9]{2,5}$/.test(obj);\n const isSecret =\n /^[0-9a-fA-F]{24,}$/.test(obj) || (obj.length >= 40 && !/\\s/.test(obj));\n const hasSpaces = /\\s/.test(obj);\n\n if (isDateString) return colorize(`\"${obj}\"`, BEIGE);\n if (isUrl) return colorize(`\"${obj}\"`, GREY_DARK);\n if (isGlob) return colorize(`\"${obj}\"`, GREY);\n if (isPath) return colorize(`\"${obj}\"`, GREY_DARK);\n if (isSecret) return colorize(`\"${obj}\"`, GREY);\n if (hasSpaces) return colorize(`\"${obj}\"`, WHITE);\n return colorize(`\"${obj}\"`, BLUE);\n }\n\n if (Array.isArray(obj)) {\n if (obj.length === 0) {\n return '[]';\n }\n const items = obj\n .map(\n (item) =>\n `${nextIndent}${colorizeObject(item, indentLevel + 1, indentSize, key)}`\n )\n .join(',\\n');\n return `[\\n${items}\\n${indent}]`;\n }\n\n if (typeof obj === 'object') {\n const keys = Object.keys(obj);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n const fields = keys\n .map((key) => {\n const coloredKey = colorize(`\"${key}\"`, GREY_LIGHT);\n const value = obj[key];\n const coloredValue = colorizeObject(\n value,\n indentLevel + 1,\n indentSize,\n key\n );\n return `${nextIndent}${coloredKey}: ${coloredValue}`;\n })\n .join(',\\n');\n return `{\\n${fields}\\n${indent}}`;\n }\n\n return colorize(String(obj), GREY);\n};\n\nexport const removeColor = (text: string) =>\n // oxlint-disable-next-line no-control-regex -- 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 (\n Array.isArray(length) &&\n length.every((locale) => typeof locale === 'string')\n ) {\n value = Math.max(...length.map((str) => str.length));\n }\n if (\n Array.isArray(length) &&\n length.every((locale) => typeof locale === 'number')\n ) {\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('✗', RED);\nexport const v = colorize('✓', GREEN);\nexport const clock = colorize('⏲', BLUE);\n"],"mappings":";;;;AA6BA,IAAI;AAEJ,MAAa,aAAa,WAA+B;CACvD,eAAe;AACjB;AAEA,MAAa,aAAa,iBAA8C;CACtE,IAAI,OAAO,iBAAiB,aAC1B,OAAO;CAGT,OAAO;AACT;AAEA,MAAa,UAAkB,SAAS,YAAY;CAClD,MAAM,SAAS,SAAS,UAAU,CAAC;CACnC,MAAM,OAAO,OAAO,QAAQ;CAE5B,IAAI,SAAS,cAAe,SAAS,aAAa,SAAS,WAAY;CAEvE,MAAM,SAAS,UAAU,OAAO,MAAM;CACtC,MAAM,cAAc,SAAS,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK;CAC5E,MAAM,QAAQ,SAAS,SAAS;CAKhC,CAFE,OAAO,UAAU,QAAQ,UAAU,OAAO,OAAO,QAAQ,IAElD,CAAC,GAAG,WAAW;AAC1B;AAEA,MAAa,gBAAgB;CAAC;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAAG;;;;;;AAO9E,MAAa,gBACV,eAA6C,mBAC7C,SAAc,YACb,OAAO,SAAS;CACd,GAAI,WAAW,CAAC;CAChB,QAAQ;EACN,GAAG,eAAe;EAClB,G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AAQ,QACV,OAAO,GAAG,IAAI,OAAO,YAAY,IAAI;CAGvC,OAAO,GAAG,OAAO,IAAI,OAAO,YAAY;AAC1C,CAAC,CAAC,CACD,KAAK,EAAE;AAEZ,MAAa,IAAI,SAAS,KAAKK,kBAAG;AAClC,MAAa,IAAI,SAAS,KAAKP,oBAAK;AACpC,MAAa,QAAQ,SAAS,KAAKG,mBAAI"}
|
package/dist/cjs/node.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_configFile_buildBrowserConfiguration = require(
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const require_configFile_editorServerOverride = require(
|
|
6
|
-
const
|
|
7
|
-
const
|
|
2
|
+
const require_configFile_buildBrowserConfiguration = require("./configFile/buildBrowserConfiguration.cjs");
|
|
3
|
+
const require_configFile_buildConfigurationFields = require("./configFile/buildConfigurationFields.cjs");
|
|
4
|
+
const require_configFile_configurationSchema = require("./configFile/configurationSchema.cjs");
|
|
5
|
+
const require_configFile_editorServerOverride = require("./configFile/editorServerOverride.cjs");
|
|
6
|
+
const require_configFile_getConfiguration = require("./configFile/getConfiguration.cjs");
|
|
7
|
+
const require_configFile_searchConfigurationFile = require("./configFile/searchConfigurationFile.cjs");
|
|
8
8
|
|
|
9
9
|
exports.EDITOR_SERVER_PORT_ENV_VAR = require_configFile_editorServerOverride.EDITOR_SERVER_PORT_ENV_VAR;
|
|
10
10
|
exports.aiSchema = require_configFile_configurationSchema.aiSchema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/secrets.browser.ts
|
|
3
3
|
/**
|
|
4
4
|
* Browser stub for {@link file://./secrets.ts}.
|
|
5
5
|
*
|
|
@@ -16,6 +16,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
16
16
|
*/
|
|
17
17
|
const getEditorClientSecret = () => void 0;
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.getEditorClientSecret = getEditorClientSecret;
|
|
21
20
|
//# sourceMappingURL=secrets.browser.cjs.map
|
package/dist/cjs/secrets.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/secrets.ts
|
|
3
3
|
/**
|
|
4
4
|
* Server-only access to the sensitive parts of the Intlayer configuration.
|
|
5
5
|
*
|
|
@@ -42,6 +42,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
42
42
|
*/
|
|
43
43
|
const getEditorClientSecret = () => typeof process === "undefined" ? void 0 : process.env?.INTLAYER_CLIENT_SECRET;
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.getEditorClientSecret = getEditorClientSecret;
|
|
47
46
|
//# sourceMappingURL=secrets.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_getPackageJsonPath = require(
|
|
2
|
+
const require_utils_getPackageJsonPath = require("./getPackageJsonPath.cjs");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/ESMxCJSHelpers.ts
|
|
6
6
|
const isESModule = typeof require("url").pathToFileURL(__filename).href === "string";
|
|
7
7
|
/**
|
|
8
8
|
* Require relative to the user project
|
|
@@ -20,7 +20,6 @@ const getProjectRequire = (startDir) => {
|
|
|
20
20
|
*/
|
|
21
21
|
const configESMxCJSRequire = isESModule ? (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href) : require;
|
|
22
22
|
|
|
23
|
-
//#endregion
|
|
24
23
|
exports.configESMxCJSRequire = configESMxCJSRequire;
|
|
25
24
|
exports.getProjectRequire = getProjectRequire;
|
|
26
25
|
exports.isESModule = isESModule;
|
package/dist/cjs/utils/alias.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_utils_getExtension = require("./getExtension.cjs");
|
|
3
|
+
const require_utils_normalizePath = require("./normalizePath.cjs");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/utils/alias.ts
|
|
7
7
|
/**
|
|
8
8
|
* Generated entry files of `.intlayer/main`, keyed by the
|
|
9
9
|
* `@intlayer/dictionaries-entry` subpath that resolves to them.
|
|
@@ -35,6 +35,5 @@ const getAlias = ({ configuration, format, formatter = (value) => value }) => {
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
exports.getAlias = getAlias;
|
|
40
39
|
//# sourceMappingURL=alias.cjs.map
|