@intlayer/docs 7.0.9-canary.0 → 7.0.9-canary.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/README.md +2 -1
- package/dist/cjs/generated/docs.entry.cjs +19 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/packages/@intlayer/config/dist/esm/_virtual/rolldown_runtime.cjs +10 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/_virtual/rolldown_runtime.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/utils/ESMxCJSHelpers.cjs +26 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/utils/ESMxCJSHelpers.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/utils/cache.cjs +262 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/utils/cache.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/utils/getPackageJsonPath.cjs +34 -0
- package/dist/cjs/packages/@intlayer/config/dist/esm/utils/getPackageJsonPath.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/_virtual/rolldown_runtime.cjs +10 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/_virtual/rolldown_runtime.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/built.cjs +8 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/built.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/buildConfigurationFields.cjs +119 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/buildConfigurationFields.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/getConfiguration.cjs +69 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/getConfiguration.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/loadConfigurationFile.cjs +26 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/loadConfigurationFile.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/searchConfigurationFile.cjs +51 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/searchConfigurationFile.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/build.cjs +24 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/build.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/content.cjs +78 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/content.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/dictionary.cjs +7 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/dictionary.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/editor.cjs +36 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/editor.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/index.cjs +21 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/index.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/internationalization.cjs +22 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/internationalization.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/log.cjs +16 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/log.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/routing.cjs +26 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/routing.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadEnvFile.cjs +26 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadEnvFile.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/bundleFile.cjs +23 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/bundleFile.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/loadExternalFile.cjs +48 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/loadExternalFile.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/parseFileContent.cjs +65 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/parseFileContent.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/transpileTSToMJS.cjs +45 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/transpileTSToMJS.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/logger.cjs +47 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/logger.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/_virtual/rolldown_runtime.cjs +15 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/_virtual/rolldown_runtime.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/locales.cjs +1128 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/locales.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/ESMxCJSHelpers.cjs +27 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/ESMxCJSHelpers.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/cache.cjs +262 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/cache.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/getPackageJsonPath.cjs +34 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/getPackageJsonPath.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/normalizePath.cjs +17 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/utils/normalizePath.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/localization/getLocalizedUrl.cjs +46 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/localization/getLocalizedUrl.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/localization/getMultilingualUrls.cjs +70 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/localization/getMultilingualUrls.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/localization/getPathWithoutLocale.cjs +53 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/localization/getPathWithoutLocale.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.cjs +23 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/utils/checkIsURLAbsolute.cjs +7 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/utils/checkIsURLAbsolute.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/utils/parseYaml.cjs +322 -0
- package/dist/cjs/packages/@intlayer/core/dist/esm/utils/parseYaml.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/types/dist/esm/_virtual/rolldown_runtime.cjs +15 -0
- package/dist/cjs/packages/@intlayer/types/dist/esm/_virtual/rolldown_runtime.cjs.map +1 -0
- package/dist/cjs/packages/@intlayer/types/dist/esm/locales.cjs +1128 -0
- package/dist/cjs/packages/@intlayer/types/dist/esm/locales.cjs.map +1 -0
- package/dist/esm/_virtual/rolldown_runtime.mjs +8 -0
- package/dist/esm/generated/docs.entry.mjs +19 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/packages/@intlayer/core/dist/esm/_virtual/rolldown_runtime.mjs +11 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/_virtual/rolldown_runtime.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.mjs +20 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/built.mjs +8 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/built.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/buildConfigurationFields.mjs +118 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/getConfiguration.mjs +67 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/getConfiguration.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/loadConfigurationFile.mjs +26 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/searchConfigurationFile.mjs +50 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/build.mjs +19 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/build.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/content.mjs +64 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/content.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/dictionary.mjs +6 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/dictionary.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/editor.mjs +27 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/editor.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/index.mjs +21 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/index.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/internationalization.mjs +18 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/internationalization.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/log.mjs +14 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/log.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/routing.mjs +23 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/defaultValues/routing.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadEnvFile.mjs +24 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadEnvFile.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/bundleFile.mjs +23 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/loadExternalFile.mjs +47 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/parseFileContent.mjs +63 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/transpileTSToMJS.mjs +44 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/loadExternalFile/transpileTSToMJS.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/logger.mjs +45 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/logger.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/_virtual/rolldown_runtime.mjs +14 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/_virtual/rolldown_runtime.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/locales.mjs +1128 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/types/dist/esm/locales.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/ESMxCJSHelpers.mjs +25 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/cache.mjs +263 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/cache.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/getPackageJsonPath.mjs +33 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/getPackageJsonPath.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/normalizePath.mjs +16 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/config/dist/esm/utils/normalizePath.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/localization/getLocalizedUrl.mjs +46 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/localization/getLocalizedUrl.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/localization/getMultilingualUrls.mjs +70 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/localization/getMultilingualUrls.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/localization/getPathWithoutLocale.mjs +53 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +23 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/utils/checkIsURLAbsolute.mjs +6 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/utils/parseYaml.mjs +321 -0
- package/dist/esm/packages/@intlayer/core/dist/esm/utils/parseYaml.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/types/dist/esm/_virtual/rolldown_runtime.mjs +14 -0
- package/dist/esm/packages/@intlayer/types/dist/esm/_virtual/rolldown_runtime.mjs.map +1 -0
- package/dist/esm/packages/@intlayer/types/dist/esm/locales.mjs +1128 -0
- package/dist/esm/packages/@intlayer/types/dist/esm/locales.mjs.map +1 -0
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/en/packages/intlayer/getLocalizedUrl.md +116 -97
- package/docs/en/packages/intlayer/getMultilingualUrls.md +194 -54
- package/docs/en/packages/intlayer/getPrefix.md +201 -0
- package/docs/en/readme.md +2 -0
- package/package.json +20 -17
- package/src/generated/docs.entry.ts +19 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../packages/@intlayer/config/dist/esm/_virtual/rolldown_runtime.mjs
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.__require = __require;
|
|
10
|
+
//# sourceMappingURL=rolldown_runtime.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolldown_runtime.cjs","names":[],"sources":["../../../../../../../../../packages/@intlayer/config/dist/esm/_virtual/rolldown_runtime.mjs"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __export = (all) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\treturn target;\n};\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, { get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b] }) : x)(function(x) {\n\tif (typeof require !== \"undefined\") return require.apply(this, arguments);\n\tthrow Error(\"Calling `require` for \\\"\" + x + \"\\\" in an environment that doesn't expose the `require` function.\");\n});\n\n//#endregion\nexport { __export, __require };"],"mappings":";;AAUA,IAAI,YAA4B,kBAAE,MAAM,OAAO,YAAY,cAAc,UAAU,OAAO,UAAU,cAAc,IAAI,MAAM,GAAG,EAAE,MAAM,GAAG,OAAO,OAAO,YAAY,cAAc,UAAU,GAAG,IAAI,CAAC,GAAG,GAAG,SAAS,GAAG;AACrN,KAAI,OAAO,YAAY,YAAa,QAAO,QAAQ,MAAM,MAAM,UAAU;AACzE,OAAM,MAAM,6BAA6B,IAAI,mEAAmE;EAC/G"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_getPackageJsonPath = require('./getPackageJsonPath.cjs');
|
|
3
|
+
const require_rolldown_runtime$1 = require('../_virtual/rolldown_runtime.cjs');
|
|
4
|
+
let node_module = require("node:module");
|
|
5
|
+
|
|
6
|
+
//#region ../packages/@intlayer/config/dist/esm/utils/ESMxCJSHelpers.mjs
|
|
7
|
+
const isESModule = typeof require("url").pathToFileURL(__filename).href === "string";
|
|
8
|
+
/**
|
|
9
|
+
* Require relative to the user project
|
|
10
|
+
*
|
|
11
|
+
* Note: Can resolve package that are installed in the user project, ex `'intlayer'`
|
|
12
|
+
*/
|
|
13
|
+
const getProjectRequire = (startDir) => {
|
|
14
|
+
const { packageJsonPath } = require_getPackageJsonPath.getPackageJsonPath(startDir);
|
|
15
|
+
return (0, node_module.createRequire)(packageJsonPath);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Require relative to the @intlayer/config package
|
|
19
|
+
*
|
|
20
|
+
* Note: Can resolve package that are installed in the config package, ex `'@intlayer/types'`
|
|
21
|
+
*/
|
|
22
|
+
const configESMxCJSRequire = isESModule ? (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href) : require_rolldown_runtime$1.__require;
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.getProjectRequire = getProjectRequire;
|
|
26
|
+
//# sourceMappingURL=ESMxCJSHelpers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ESMxCJSHelpers.cjs","names":["getPackageJsonPath","__require"],"sources":["../../../../../../../../../packages/@intlayer/config/dist/esm/utils/ESMxCJSHelpers.mjs"],"sourcesContent":["import { __require } from \"../_virtual/rolldown_runtime.mjs\";\nimport { getPackageJsonPath } from \"./getPackageJsonPath.mjs\";\nimport { createRequire } from \"node:module\";\n\n//#region src/utils/ESMxCJSHelpers.ts\nconst isESModule = typeof import.meta.url === \"string\";\n/**\n* Require relative to the user project\n*\n* Note: Can resolve package that are installed in the user project, ex `'intlayer'`\n*/\nconst getProjectRequire = (startDir) => {\n\tconst { packageJsonPath } = getPackageJsonPath(startDir);\n\treturn createRequire(packageJsonPath);\n};\n/**\n* Require relative to the @intlayer/config package\n*\n* Note: Can resolve package that are installed in the config package, ex `'@intlayer/types'`\n*/\nconst configESMxCJSRequire = isESModule ? createRequire(import.meta.url) : __require;\n\n//#endregion\nexport { configESMxCJSRequire, getProjectRequire, isESModule };\n//# sourceMappingURL=ESMxCJSHelpers.mjs.map"],"mappings":";;;;;;AAKA,MAAM,aAAa,yDAA2B;;;;;;AAM9C,MAAM,qBAAqB,aAAa;CACvC,MAAM,EAAE,oBAAoBA,8CAAmB,SAAS;AACxD,uCAAqB,gBAAgB;;;;;;;AAOtC,MAAM,uBAAuB,0FAA2C,GAAGC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_crypto = require("node:crypto");
|
|
4
|
+
let node_fs_promises = require("node:fs/promises");
|
|
5
|
+
|
|
6
|
+
//#region ../packages/@intlayer/config/dist/esm/utils/cache.mjs
|
|
7
|
+
/** ------------------------- Utilities ------------------------- **/
|
|
8
|
+
/** Prefer a fast non-crypto hash if available, then fast crypto, then sha256. */
|
|
9
|
+
const pickHashAlgorithm = () => {
|
|
10
|
+
try {
|
|
11
|
+
(0, node_crypto.createHash)("xxhash64").update("test").digest();
|
|
12
|
+
return "xxhash64";
|
|
13
|
+
} catch {}
|
|
14
|
+
try {
|
|
15
|
+
(0, node_crypto.createHash)("sha1").update("test").digest();
|
|
16
|
+
return "sha1";
|
|
17
|
+
} catch {}
|
|
18
|
+
return "sha256";
|
|
19
|
+
};
|
|
20
|
+
const HASH_ALGORITHM = pickHashAlgorithm();
|
|
21
|
+
/** Base64url without padding for compact, file-system-safe ids. */
|
|
22
|
+
const toBase64Url = (buffer) => buffer.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
23
|
+
/** Token helpers to minimize collisions while streaming to the hasher. */
|
|
24
|
+
const token = {
|
|
25
|
+
start: (hasher, tag) => hasher.update(`<${tag}>`),
|
|
26
|
+
sep: (hasher) => hasher.update("|"),
|
|
27
|
+
end: (hasher, tag) => hasher.update(`</${tag}>`),
|
|
28
|
+
str: (hasher, stringValue) => {
|
|
29
|
+
hasher.update(`${stringValue.length}#`);
|
|
30
|
+
hasher.update(stringValue);
|
|
31
|
+
},
|
|
32
|
+
num: (hasher, numberValue) => hasher.update(Number.isNaN(numberValue) ? "NaN" : numberValue === Infinity ? "Inf" : numberValue === -Infinity ? "-Inf" : String(numberValue)),
|
|
33
|
+
big: (hasher, bigintValue) => hasher.update(bigintValue.toString(10)),
|
|
34
|
+
bool: (hasher, booleanValue) => hasher.update(booleanValue ? "1" : "0")
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Streams a canonical representation of `value` into `hasher` without
|
|
38
|
+
* constructing large intermediate strings. Objects/Maps/Sets are normalized.
|
|
39
|
+
*/
|
|
40
|
+
const stableHashValue = (hasher, value, seen) => {
|
|
41
|
+
const valueType = typeof value;
|
|
42
|
+
if (value === null) {
|
|
43
|
+
token.start(hasher, "null");
|
|
44
|
+
token.end(hasher, "null");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (valueType === "undefined") {
|
|
48
|
+
token.start(hasher, "undef");
|
|
49
|
+
token.end(hasher, "undef");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (valueType === "number") {
|
|
53
|
+
token.start(hasher, "num");
|
|
54
|
+
token.num(hasher, value);
|
|
55
|
+
token.end(hasher, "num");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (valueType === "bigint") {
|
|
59
|
+
token.start(hasher, "big");
|
|
60
|
+
token.big(hasher, value);
|
|
61
|
+
token.end(hasher, "big");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (valueType === "boolean") {
|
|
65
|
+
token.start(hasher, "bool");
|
|
66
|
+
token.bool(hasher, value);
|
|
67
|
+
token.end(hasher, "bool");
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (valueType === "string") {
|
|
71
|
+
token.start(hasher, "str");
|
|
72
|
+
token.str(hasher, value);
|
|
73
|
+
token.end(hasher, "str");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (valueType === "symbol") {
|
|
77
|
+
token.start(hasher, "sym");
|
|
78
|
+
token.str(hasher, String(value));
|
|
79
|
+
token.end(hasher, "sym");
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (valueType === "function") {
|
|
83
|
+
const functionValue = value;
|
|
84
|
+
token.start(hasher, "fn");
|
|
85
|
+
token.str(hasher, functionValue.name ?? "");
|
|
86
|
+
token.sep(hasher);
|
|
87
|
+
token.num(hasher, functionValue.length);
|
|
88
|
+
token.end(hasher, "fn");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (Array.isArray(value)) {
|
|
92
|
+
if (seen.has(value)) {
|
|
93
|
+
token.start(hasher, "arr");
|
|
94
|
+
token.str(hasher, "Circular");
|
|
95
|
+
token.end(hasher, "arr");
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
seen.add(value);
|
|
99
|
+
token.start(hasher, "arr");
|
|
100
|
+
for (let i = 0; i < value.length; i++) {
|
|
101
|
+
token.sep(hasher);
|
|
102
|
+
stableHashValue(hasher, value[i], seen);
|
|
103
|
+
}
|
|
104
|
+
token.end(hasher, "arr");
|
|
105
|
+
seen.delete(value);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (value instanceof Date) {
|
|
109
|
+
token.start(hasher, "date");
|
|
110
|
+
token.str(hasher, value.toISOString());
|
|
111
|
+
token.end(hasher, "date");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (value instanceof RegExp) {
|
|
115
|
+
const regex = value;
|
|
116
|
+
token.start(hasher, "re");
|
|
117
|
+
token.str(hasher, regex.source);
|
|
118
|
+
token.sep(hasher);
|
|
119
|
+
token.str(hasher, regex.flags);
|
|
120
|
+
token.end(hasher, "re");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (value instanceof Set) {
|
|
124
|
+
const setValue = value;
|
|
125
|
+
if (seen.has(setValue)) {
|
|
126
|
+
token.start(hasher, "set");
|
|
127
|
+
token.str(hasher, "Circular");
|
|
128
|
+
token.end(hasher, "set");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
seen.add(setValue);
|
|
132
|
+
const items = [];
|
|
133
|
+
for (const v of setValue) items.push(stableStringify(v));
|
|
134
|
+
items.sort();
|
|
135
|
+
token.start(hasher, "set");
|
|
136
|
+
for (const item of items) {
|
|
137
|
+
token.sep(hasher);
|
|
138
|
+
token.str(hasher, item);
|
|
139
|
+
}
|
|
140
|
+
token.end(hasher, "set");
|
|
141
|
+
seen.delete(setValue);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (value instanceof Map) {
|
|
145
|
+
const mapObject = value;
|
|
146
|
+
if (seen.has(mapObject)) {
|
|
147
|
+
token.start(hasher, "map");
|
|
148
|
+
token.str(hasher, "Circular");
|
|
149
|
+
token.end(hasher, "map");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
seen.add(mapObject);
|
|
153
|
+
const entries = [];
|
|
154
|
+
for (const [k, v] of mapObject.entries()) entries.push([stableStringify(k), v]);
|
|
155
|
+
entries.sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0);
|
|
156
|
+
token.start(hasher, "map");
|
|
157
|
+
for (const [keyFingerprint, entryValue] of entries) {
|
|
158
|
+
token.sep(hasher);
|
|
159
|
+
token.str(hasher, keyFingerprint);
|
|
160
|
+
token.sep(hasher);
|
|
161
|
+
stableHashValue(hasher, entryValue, seen);
|
|
162
|
+
}
|
|
163
|
+
token.end(hasher, "map");
|
|
164
|
+
seen.delete(mapObject);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (ArrayBuffer.isView(value)) {
|
|
168
|
+
const view = value;
|
|
169
|
+
token.start(hasher, "typed");
|
|
170
|
+
token.str(hasher, Object.getPrototypeOf(view).constructor.name);
|
|
171
|
+
token.sep(hasher);
|
|
172
|
+
hasher.update(Buffer.from(view.buffer, view.byteOffset, view.byteLength));
|
|
173
|
+
token.end(hasher, "typed");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (value instanceof ArrayBuffer) {
|
|
177
|
+
const buffer = Buffer.from(value);
|
|
178
|
+
token.start(hasher, "ab");
|
|
179
|
+
hasher.update(buffer);
|
|
180
|
+
token.end(hasher, "ab");
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (typeof URL !== "undefined" && value instanceof URL) {
|
|
184
|
+
token.start(hasher, "url");
|
|
185
|
+
token.str(hasher, value.toString());
|
|
186
|
+
token.end(hasher, "url");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (value instanceof Error) {
|
|
190
|
+
const errorValue = value;
|
|
191
|
+
token.start(hasher, "err");
|
|
192
|
+
token.str(hasher, errorValue.name || "");
|
|
193
|
+
token.sep(hasher);
|
|
194
|
+
token.str(hasher, errorValue.message || "");
|
|
195
|
+
token.sep(hasher);
|
|
196
|
+
token.str(hasher, errorValue.stack || "");
|
|
197
|
+
token.end(hasher, "err");
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (valueType === "object") {
|
|
201
|
+
const objectValue = value;
|
|
202
|
+
if (seen.has(objectValue)) {
|
|
203
|
+
token.start(hasher, "obj");
|
|
204
|
+
token.str(hasher, "Circular");
|
|
205
|
+
token.end(hasher, "obj");
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
seen.add(objectValue);
|
|
209
|
+
const keys = Object.keys(objectValue).sort();
|
|
210
|
+
token.start(hasher, "obj");
|
|
211
|
+
for (const key of keys) {
|
|
212
|
+
token.sep(hasher);
|
|
213
|
+
token.str(hasher, key);
|
|
214
|
+
token.sep(hasher);
|
|
215
|
+
stableHashValue(hasher, objectValue[key], seen);
|
|
216
|
+
}
|
|
217
|
+
token.end(hasher, "obj");
|
|
218
|
+
seen.delete(objectValue);
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
token.start(hasher, "other");
|
|
222
|
+
token.str(hasher, String(value));
|
|
223
|
+
token.end(hasher, "other");
|
|
224
|
+
};
|
|
225
|
+
/** Public stringify kept for convenience / debugging (now faster & broader). */
|
|
226
|
+
const stableStringify = (value, _stack = /* @__PURE__ */ new WeakSet()) => {
|
|
227
|
+
const hasher = (0, node_crypto.createHash)(HASH_ALGORITHM);
|
|
228
|
+
stableHashValue(hasher, value, _stack);
|
|
229
|
+
return toBase64Url(hasher.digest());
|
|
230
|
+
};
|
|
231
|
+
/** Compute a compact, stable id for arbitrary key tuples. */
|
|
232
|
+
const computeKeyId = (keyParts) => {
|
|
233
|
+
const h = (0, node_crypto.createHash)(HASH_ALGORITHM);
|
|
234
|
+
token.start(h, "keys");
|
|
235
|
+
for (let i = 0; i < keyParts.length; i++) {
|
|
236
|
+
token.sep(h);
|
|
237
|
+
stableHashValue(h, keyParts[i], /* @__PURE__ */ new WeakSet());
|
|
238
|
+
}
|
|
239
|
+
token.end(h, "keys");
|
|
240
|
+
return toBase64Url(h.digest());
|
|
241
|
+
};
|
|
242
|
+
const cacheMap = /* @__PURE__ */ new Map();
|
|
243
|
+
const getCache = (...key) => {
|
|
244
|
+
return cacheMap.get(computeKeyId(key));
|
|
245
|
+
};
|
|
246
|
+
const setCache = (...args) => {
|
|
247
|
+
const value = args[args.length - 1];
|
|
248
|
+
const key = args.slice(0, -1);
|
|
249
|
+
cacheMap.set(computeKeyId(key), value);
|
|
250
|
+
};
|
|
251
|
+
const clearCache = (idOrKey) => {
|
|
252
|
+
cacheMap.delete(idOrKey);
|
|
253
|
+
};
|
|
254
|
+
const cache = {
|
|
255
|
+
get: getCache,
|
|
256
|
+
set: setCache,
|
|
257
|
+
clear: clearCache
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
//#endregion
|
|
261
|
+
exports.cache = cache;
|
|
262
|
+
//# sourceMappingURL=cache.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.cjs","names":[],"sources":["../../../../../../../../../packages/@intlayer/config/dist/esm/utils/cache.mjs"],"sourcesContent":["import { version } from \"../config/package.mjs\";\nimport { dirname, join } from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { mkdir, readFile, rename, rm, stat, unlink, writeFile } from \"node:fs/promises\";\nimport { deserialize, serialize } from \"node:v8\";\nimport { gunzipSync, gzipSync } from \"node:zlib\";\n\n//#region src/utils/cache.ts\n/** ------------------------- Utilities ------------------------- **/\n/** Prefer a fast non-crypto hash if available, then fast crypto, then sha256. */\nconst pickHashAlgorithm = () => {\n\ttry {\n\t\tcreateHash(\"xxhash64\").update(\"test\").digest();\n\t\treturn \"xxhash64\";\n\t} catch {}\n\ttry {\n\t\tcreateHash(\"sha1\").update(\"test\").digest();\n\t\treturn \"sha1\";\n\t} catch {}\n\treturn \"sha256\";\n};\nconst HASH_ALGORITHM = pickHashAlgorithm();\n/** Base64url without padding for compact, file-system-safe ids. */\nconst toBase64Url = (buffer) => buffer.toString(\"base64\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/g, \"\");\n/** Token helpers to minimize collisions while streaming to the hasher. */\nconst token = {\n\tstart: (hasher, tag) => hasher.update(`<${tag}>`),\n\tsep: (hasher) => hasher.update(\"|\"),\n\tend: (hasher, tag) => hasher.update(`</${tag}>`),\n\tstr: (hasher, stringValue) => {\n\t\thasher.update(`${stringValue.length}#`);\n\t\thasher.update(stringValue);\n\t},\n\tnum: (hasher, numberValue) => hasher.update(Number.isNaN(numberValue) ? \"NaN\" : numberValue === Infinity ? \"Inf\" : numberValue === -Infinity ? \"-Inf\" : String(numberValue)),\n\tbig: (hasher, bigintValue) => hasher.update(bigintValue.toString(10)),\n\tbool: (hasher, booleanValue) => hasher.update(booleanValue ? \"1\" : \"0\")\n};\n/**\n* Streams a canonical representation of `value` into `hasher` without\n* constructing large intermediate strings. Objects/Maps/Sets are normalized.\n*/\nconst stableHashValue = (hasher, value, seen) => {\n\tconst valueType = typeof value;\n\tif (value === null) {\n\t\ttoken.start(hasher, \"null\");\n\t\ttoken.end(hasher, \"null\");\n\t\treturn;\n\t}\n\tif (valueType === \"undefined\") {\n\t\ttoken.start(hasher, \"undef\");\n\t\ttoken.end(hasher, \"undef\");\n\t\treturn;\n\t}\n\tif (valueType === \"number\") {\n\t\ttoken.start(hasher, \"num\");\n\t\ttoken.num(hasher, value);\n\t\ttoken.end(hasher, \"num\");\n\t\treturn;\n\t}\n\tif (valueType === \"bigint\") {\n\t\ttoken.start(hasher, \"big\");\n\t\ttoken.big(hasher, value);\n\t\ttoken.end(hasher, \"big\");\n\t\treturn;\n\t}\n\tif (valueType === \"boolean\") {\n\t\ttoken.start(hasher, \"bool\");\n\t\ttoken.bool(hasher, value);\n\t\ttoken.end(hasher, \"bool\");\n\t\treturn;\n\t}\n\tif (valueType === \"string\") {\n\t\ttoken.start(hasher, \"str\");\n\t\ttoken.str(hasher, value);\n\t\ttoken.end(hasher, \"str\");\n\t\treturn;\n\t}\n\tif (valueType === \"symbol\") {\n\t\ttoken.start(hasher, \"sym\");\n\t\ttoken.str(hasher, String(value));\n\t\ttoken.end(hasher, \"sym\");\n\t\treturn;\n\t}\n\tif (valueType === \"function\") {\n\t\tconst functionValue = value;\n\t\ttoken.start(hasher, \"fn\");\n\t\ttoken.str(hasher, functionValue.name ?? \"\");\n\t\ttoken.sep(hasher);\n\t\ttoken.num(hasher, functionValue.length);\n\t\ttoken.end(hasher, \"fn\");\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tif (seen.has(value)) {\n\t\t\ttoken.start(hasher, \"arr\");\n\t\t\ttoken.str(hasher, \"Circular\");\n\t\t\ttoken.end(hasher, \"arr\");\n\t\t\treturn;\n\t\t}\n\t\tseen.add(value);\n\t\ttoken.start(hasher, \"arr\");\n\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\ttoken.sep(hasher);\n\t\t\tstableHashValue(hasher, value[i], seen);\n\t\t}\n\t\ttoken.end(hasher, \"arr\");\n\t\tseen.delete(value);\n\t\treturn;\n\t}\n\tif (value instanceof Date) {\n\t\ttoken.start(hasher, \"date\");\n\t\ttoken.str(hasher, value.toISOString());\n\t\ttoken.end(hasher, \"date\");\n\t\treturn;\n\t}\n\tif (value instanceof RegExp) {\n\t\tconst regex = value;\n\t\ttoken.start(hasher, \"re\");\n\t\ttoken.str(hasher, regex.source);\n\t\ttoken.sep(hasher);\n\t\ttoken.str(hasher, regex.flags);\n\t\ttoken.end(hasher, \"re\");\n\t\treturn;\n\t}\n\tif (value instanceof Set) {\n\t\tconst setValue = value;\n\t\tif (seen.has(setValue)) {\n\t\t\ttoken.start(hasher, \"set\");\n\t\t\ttoken.str(hasher, \"Circular\");\n\t\t\ttoken.end(hasher, \"set\");\n\t\t\treturn;\n\t\t}\n\t\tseen.add(setValue);\n\t\tconst items = [];\n\t\tfor (const v of setValue) items.push(stableStringify(v));\n\t\titems.sort();\n\t\ttoken.start(hasher, \"set\");\n\t\tfor (const item of items) {\n\t\t\ttoken.sep(hasher);\n\t\t\ttoken.str(hasher, item);\n\t\t}\n\t\ttoken.end(hasher, \"set\");\n\t\tseen.delete(setValue);\n\t\treturn;\n\t}\n\tif (value instanceof Map) {\n\t\tconst mapObject = value;\n\t\tif (seen.has(mapObject)) {\n\t\t\ttoken.start(hasher, \"map\");\n\t\t\ttoken.str(hasher, \"Circular\");\n\t\t\ttoken.end(hasher, \"map\");\n\t\t\treturn;\n\t\t}\n\t\tseen.add(mapObject);\n\t\tconst entries = [];\n\t\tfor (const [k, v] of mapObject.entries()) entries.push([stableStringify(k), v]);\n\t\tentries.sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0);\n\t\ttoken.start(hasher, \"map\");\n\t\tfor (const [keyFingerprint, entryValue] of entries) {\n\t\t\ttoken.sep(hasher);\n\t\t\ttoken.str(hasher, keyFingerprint);\n\t\t\ttoken.sep(hasher);\n\t\t\tstableHashValue(hasher, entryValue, seen);\n\t\t}\n\t\ttoken.end(hasher, \"map\");\n\t\tseen.delete(mapObject);\n\t\treturn;\n\t}\n\tif (ArrayBuffer.isView(value)) {\n\t\tconst view = value;\n\t\ttoken.start(hasher, \"typed\");\n\t\ttoken.str(hasher, Object.getPrototypeOf(view).constructor.name);\n\t\ttoken.sep(hasher);\n\t\thasher.update(Buffer.from(view.buffer, view.byteOffset, view.byteLength));\n\t\ttoken.end(hasher, \"typed\");\n\t\treturn;\n\t}\n\tif (value instanceof ArrayBuffer) {\n\t\tconst buffer = Buffer.from(value);\n\t\ttoken.start(hasher, \"ab\");\n\t\thasher.update(buffer);\n\t\ttoken.end(hasher, \"ab\");\n\t\treturn;\n\t}\n\tif (typeof URL !== \"undefined\" && value instanceof URL) {\n\t\ttoken.start(hasher, \"url\");\n\t\ttoken.str(hasher, value.toString());\n\t\ttoken.end(hasher, \"url\");\n\t\treturn;\n\t}\n\tif (value instanceof Error) {\n\t\tconst errorValue = value;\n\t\ttoken.start(hasher, \"err\");\n\t\ttoken.str(hasher, errorValue.name || \"\");\n\t\ttoken.sep(hasher);\n\t\ttoken.str(hasher, errorValue.message || \"\");\n\t\ttoken.sep(hasher);\n\t\ttoken.str(hasher, errorValue.stack || \"\");\n\t\ttoken.end(hasher, \"err\");\n\t\treturn;\n\t}\n\tif (valueType === \"object\") {\n\t\tconst objectValue = value;\n\t\tif (seen.has(objectValue)) {\n\t\t\ttoken.start(hasher, \"obj\");\n\t\t\ttoken.str(hasher, \"Circular\");\n\t\t\ttoken.end(hasher, \"obj\");\n\t\t\treturn;\n\t\t}\n\t\tseen.add(objectValue);\n\t\tconst keys = Object.keys(objectValue).sort();\n\t\ttoken.start(hasher, \"obj\");\n\t\tfor (const key of keys) {\n\t\t\ttoken.sep(hasher);\n\t\t\ttoken.str(hasher, key);\n\t\t\ttoken.sep(hasher);\n\t\t\tstableHashValue(hasher, objectValue[key], seen);\n\t\t}\n\t\ttoken.end(hasher, \"obj\");\n\t\tseen.delete(objectValue);\n\t\treturn;\n\t}\n\ttoken.start(hasher, \"other\");\n\ttoken.str(hasher, String(value));\n\ttoken.end(hasher, \"other\");\n};\n/** Public stringify kept for convenience / debugging (now faster & broader). */\nconst stableStringify = (value, _stack = /* @__PURE__ */ new WeakSet()) => {\n\tconst hasher = createHash(HASH_ALGORITHM);\n\tstableHashValue(hasher, value, _stack);\n\treturn toBase64Url(hasher.digest());\n};\n/** Compute a compact, stable id for arbitrary key tuples. */\nconst computeKeyId = (keyParts) => {\n\tconst h = createHash(HASH_ALGORITHM);\n\ttoken.start(h, \"keys\");\n\tfor (let i = 0; i < keyParts.length; i++) {\n\t\ttoken.sep(h);\n\t\tstableHashValue(h, keyParts[i], /* @__PURE__ */ new WeakSet());\n\t}\n\ttoken.end(h, \"keys\");\n\treturn toBase64Url(h.digest());\n};\nconst cacheMap = /* @__PURE__ */ new Map();\nconst getCache = (...key) => {\n\treturn cacheMap.get(computeKeyId(key));\n};\nconst setCache = (...args) => {\n\tconst value = args[args.length - 1];\n\tconst key = args.slice(0, -1);\n\tcacheMap.set(computeKeyId(key), value);\n};\nconst clearCache = (idOrKey) => {\n\tcacheMap.delete(idOrKey);\n};\nconst clearAllCache = () => {\n\tcacheMap.clear();\n};\nconst cache = {\n\tget: getCache,\n\tset: setCache,\n\tclear: clearCache\n};\nconst DEFAULTS = { compress: true };\nconst ensureDir = async (dir) => {\n\tawait mkdir(dir, { recursive: true });\n};\nconst atomicWriteFile = async (file, data) => {\n\tconst tmp = `${file}.tmp-${process.pid}-${Math.random().toString(36).slice(2)}`;\n\tawait writeFile(tmp, data);\n\tawait rename(tmp, file);\n};\nconst shouldUseCompression = (buf, force) => force === true || force !== false && buf.byteLength > 1024;\n/** Derive on-disk path from config dir + namespace + key id. */\nconst cachePath = (cacheDir, id, ns) => join(cacheDir, ns ? join(ns, id) : id);\n/** ------------------------- Local cache facade ------------------------- **/\nconst localCache = (intlayerConfig, keys, options) => {\n\tconst { cacheDir } = intlayerConfig.content;\n\tconst buildCacheEnabled = intlayerConfig.build.cache ?? true;\n\tconst persistent = options?.persistent === true || typeof options?.persistent === \"undefined\" && buildCacheEnabled;\n\tconst { compress, ttlMs, maxTimeMs, namespace } = {\n\t\t...DEFAULTS,\n\t\t...options\n\t};\n\tconst id = computeKeyId(keys);\n\tconst filePath = cachePath(cacheDir, id, namespace);\n\tconst readFromDisk = async () => {\n\t\ttry {\n\t\t\tconst statValue = await stat(filePath).catch(() => void 0);\n\t\t\tif (!statValue) return void 0;\n\t\t\tif (typeof ttlMs === \"number\" && ttlMs > 0) {\n\t\t\t\tif (Date.now() - statValue.mtimeMs > ttlMs) return void 0;\n\t\t\t}\n\t\t\tlet raw = await readFile(filePath);\n\t\t\tconst flag = raw[0];\n\t\t\traw = raw.subarray(1);\n\t\t\tconst deserialized = deserialize(flag === 1 ? gunzipSync(raw) : raw);\n\t\t\tlet value;\n\t\t\tconst maybeObj = deserialized;\n\t\t\tif (!!maybeObj && typeof maybeObj === \"object\" && typeof maybeObj.v === \"string\" && typeof maybeObj.ts === \"number\" && Object.hasOwn(maybeObj, \"d\")) {\n\t\t\t\tconst entry = maybeObj;\n\t\t\t\tif (entry.v !== version) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait unlink(filePath);\n\t\t\t\t\t} catch {}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (typeof maxTimeMs === \"number\" && maxTimeMs > 0) {\n\t\t\t\t\tif (Date.now() - entry.ts > maxTimeMs) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait unlink(filePath);\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = entry.d;\n\t\t\t} else {\n\t\t\t\tif (typeof maxTimeMs === \"number\" && maxTimeMs > 0) {\n\t\t\t\t\tif (Date.now() - statValue.mtimeMs > maxTimeMs) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait unlink(filePath);\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalue = deserialized;\n\t\t\t}\n\t\t\tcacheMap.set(id, value);\n\t\t\treturn value;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t};\n\tconst writeToDisk = async (value) => {\n\t\ttry {\n\t\t\tawait ensureDir(dirname(filePath));\n\t\t\tconst envelope = {\n\t\t\t\tv: version,\n\t\t\t\tts: Date.now(),\n\t\t\t\td: value\n\t\t\t};\n\t\t\tconst payload = Buffer.from(serialize(envelope));\n\t\t\tconst gz = shouldUseCompression(payload, compress) ? gzipSync(payload) : payload;\n\t\t\tawait atomicWriteFile(filePath, Buffer.concat([Buffer.from([gz === payload ? 0 : 1]), gz]));\n\t\t} catch {}\n\t};\n\treturn {\n\t\tget: async () => {\n\t\t\tconst mem = cacheMap.get(id);\n\t\t\tif (mem !== void 0) return mem;\n\t\t\tif (persistent && buildCacheEnabled) return await readFromDisk();\n\t\t},\n\t\tset: async (value) => {\n\t\t\tcacheMap.set(id, value);\n\t\t\tif (persistent && buildCacheEnabled) await writeToDisk(value);\n\t\t},\n\t\tclear: async () => {\n\t\t\tcacheMap.delete(id);\n\t\t\ttry {\n\t\t\t\tawait unlink(filePath);\n\t\t\t} catch {}\n\t\t},\n\t\tclearAll: async () => {\n\t\t\tclearAllCache();\n\t\t\tif (persistent && buildCacheEnabled) {\n\t\t\t\tconst base = namespace ? join(cacheDir, namespace) : cacheDir;\n\t\t\t\ttry {\n\t\t\t\t\tawait rm(base, {\n\t\t\t\t\t\trecursive: true,\n\t\t\t\t\t\tforce: true\n\t\t\t\t\t});\n\t\t\t\t} catch {}\n\t\t\t\ttry {\n\t\t\t\t\tawait mkdir(base, { recursive: true });\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t},\n\t\tisValid: async () => {\n\t\t\tif (cacheMap.get(id) !== void 0) return true;\n\t\t\tif (!persistent || !buildCacheEnabled) return false;\n\t\t\ttry {\n\t\t\t\tconst statValue = await stat(filePath).catch(() => void 0);\n\t\t\t\tif (!statValue) return false;\n\t\t\t\tif (typeof ttlMs === \"number\" && ttlMs > 0) {\n\t\t\t\t\tif (Date.now() - statValue.mtimeMs > ttlMs) return false;\n\t\t\t\t}\n\t\t\t\tlet raw = await readFile(filePath);\n\t\t\t\tconst flag = raw[0];\n\t\t\t\traw = raw.subarray(1);\n\t\t\t\tconst maybeObj = deserialize(flag === 1 ? gunzipSync(raw) : raw);\n\t\t\t\tif (!!maybeObj && typeof maybeObj === \"object\" && typeof maybeObj.v === \"string\" && typeof maybeObj.ts === \"number\" && Object.hasOwn(maybeObj, \"d\")) {\n\t\t\t\t\tconst entry = maybeObj;\n\t\t\t\t\tif (entry.v !== version) return false;\n\t\t\t\t\tif (typeof maxTimeMs === \"number\" && maxTimeMs > 0) {\n\t\t\t\t\t\tif (Date.now() - entry.ts > maxTimeMs) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (typeof maxTimeMs === \"number\" && maxTimeMs > 0) {\n\t\t\t\t\tif (Date.now() - statValue.mtimeMs > maxTimeMs) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tid,\n\t\tfilePath\n\t};\n};\n\n//#endregion\nexport { cache, clearAllCache, clearCache, getCache, localCache, setCache, stableStringify };\n//# sourceMappingURL=cache.mjs.map"],"mappings":";;;;;;;;AAUA,MAAM,0BAA0B;AAC/B,KAAI;AACH,8BAAW,WAAW,CAAC,OAAO,OAAO,CAAC,QAAQ;AAC9C,SAAO;SACA;AACR,KAAI;AACH,8BAAW,OAAO,CAAC,OAAO,OAAO,CAAC,QAAQ;AAC1C,SAAO;SACA;AACR,QAAO;;AAER,MAAM,iBAAiB,mBAAmB;;AAE1C,MAAM,eAAe,WAAW,OAAO,SAAS,SAAS,CAAC,QAAQ,OAAO,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,QAAQ,QAAQ,GAAG;;AAErH,MAAM,QAAQ;CACb,QAAQ,QAAQ,QAAQ,OAAO,OAAO,IAAI,IAAI,GAAG;CACjD,MAAM,WAAW,OAAO,OAAO,IAAI;CACnC,MAAM,QAAQ,QAAQ,OAAO,OAAO,KAAK,IAAI,GAAG;CAChD,MAAM,QAAQ,gBAAgB;AAC7B,SAAO,OAAO,GAAG,YAAY,OAAO,GAAG;AACvC,SAAO,OAAO,YAAY;;CAE3B,MAAM,QAAQ,gBAAgB,OAAO,OAAO,OAAO,MAAM,YAAY,GAAG,QAAQ,gBAAgB,WAAW,QAAQ,gBAAgB,YAAY,SAAS,OAAO,YAAY,CAAC;CAC5K,MAAM,QAAQ,gBAAgB,OAAO,OAAO,YAAY,SAAS,GAAG,CAAC;CACrE,OAAO,QAAQ,iBAAiB,OAAO,OAAO,eAAe,MAAM,IAAI;CACvE;;;;;AAKD,MAAM,mBAAmB,QAAQ,OAAO,SAAS;CAChD,MAAM,YAAY,OAAO;AACzB,KAAI,UAAU,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AAE,QAAQ,CAAC;;AAE/B,MAAM,2BAA2B,IAAI,KAAK;AAC1C,MAAM,YAAY,GAAG,QAAQ;AAC5B,QAAO,SAAS,IAAI,aAAa,IAAI,CAAC;;AAEvC,MAAM,YAAY,GAAG,SAAS;CAC7B,MAAM,QAAQ,KAAK,KAAK,SAAS;CACjC,MAAM,MAAM,KAAK,MAAM,GAAG,GAAG;AAC7B,UAAS,IAAI,aAAa,IAAI,EAAE,MAAM;;AAEvC,MAAM,cAAc,YAAY;AAC/B,UAAS,OAAO,QAAQ;;AAKzB,MAAM,QAAQ;CACb,KAAK;CACL,KAAK;CACL,OAAO;CACP"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_cache = require('./cache.cjs');
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
let node_fs = require("node:fs");
|
|
5
|
+
|
|
6
|
+
//#region ../packages/@intlayer/config/dist/esm/utils/getPackageJsonPath.mjs
|
|
7
|
+
const isESModule = typeof require("url").pathToFileURL(__filename).href === "string";
|
|
8
|
+
const MAX_LEVELS = 15;
|
|
9
|
+
const getPackageJsonPath = (startDir = process.cwd()) => {
|
|
10
|
+
const checkedCache = require_cache.cache.get("packageJsonPath", startDir);
|
|
11
|
+
if (checkedCache) return checkedCache;
|
|
12
|
+
let currentDir = startDir;
|
|
13
|
+
for (let level = 0; level < MAX_LEVELS; level++) {
|
|
14
|
+
const packageJsonPath = (0, node_path.join)(currentDir, "package.json");
|
|
15
|
+
if ((0, node_fs.existsSync)(packageJsonPath)) {
|
|
16
|
+
require_cache.cache.set("packageJsonPath", startDir, {
|
|
17
|
+
packageJsonPath,
|
|
18
|
+
baseDir: currentDir
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
packageJsonPath,
|
|
22
|
+
baseDir: currentDir
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const parentDir = (0, node_path.dirname)(currentDir);
|
|
26
|
+
if (parentDir === currentDir) break;
|
|
27
|
+
currentDir = parentDir;
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.getPackageJsonPath = getPackageJsonPath;
|
|
34
|
+
//# sourceMappingURL=getPackageJsonPath.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPackageJsonPath.cjs","names":["cache"],"sources":["../../../../../../../../../packages/@intlayer/config/dist/esm/utils/getPackageJsonPath.mjs"],"sourcesContent":["import { cache } from \"./cache.mjs\";\nimport { dirname, join } from \"node:path\";\nimport { existsSync } from \"node:fs\";\n\n//#region src/utils/getPackageJsonPath.ts\nconst isESModule = typeof import.meta.url === \"string\";\nconst MAX_LEVELS = 15;\nconst getPackageJsonPath = (startDir = process.cwd()) => {\n\tconst checkedCache = cache.get(\"packageJsonPath\", startDir);\n\tif (checkedCache) return checkedCache;\n\tlet currentDir = startDir;\n\tfor (let level = 0; level < MAX_LEVELS; level++) {\n\t\tconst packageJsonPath = join(currentDir, \"package.json\");\n\t\tif (existsSync(packageJsonPath)) {\n\t\t\tcache.set(\"packageJsonPath\", startDir, {\n\t\t\t\tpackageJsonPath,\n\t\t\t\tbaseDir: currentDir\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tpackageJsonPath,\n\t\t\t\tbaseDir: currentDir\n\t\t\t};\n\t\t}\n\t\tconst parentDir = dirname(currentDir);\n\t\tif (parentDir === currentDir) break;\n\t\tcurrentDir = parentDir;\n\t}\n\tthrow new Error(`Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${startDir}`);\n};\n\n//#endregion\nexport { getPackageJsonPath, isESModule };\n//# sourceMappingURL=getPackageJsonPath.mjs.map"],"mappings":";;;;;;AAKA,MAAM,aAAa,yDAA2B;AAC9C,MAAM,aAAa;AACnB,MAAM,sBAAsB,WAAW,QAAQ,KAAK,KAAK;CACxD,MAAM,eAAeA,oBAAM,IAAI,mBAAmB,SAAS;AAC3D,KAAI,aAAc,QAAO;CACzB,IAAI,aAAa;AACjB,MAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,SAAS;EAChD,MAAM,sCAAuB,YAAY,eAAe;AACxD,8BAAe,gBAAgB,EAAE;AAChC,uBAAM,IAAI,mBAAmB,UAAU;IACtC;IACA,SAAS;IACT,CAAC;AACF,UAAO;IACN;IACA,SAAS;IACT;;EAEF,MAAM,mCAAoB,WAAW;AACrC,MAAI,cAAc,WAAY;AAC9B,eAAa;;AAEd,OAAM,IAAI,MAAM,kEAAkE,WAAW,sCAAsC,WAAW"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../packages/@intlayer/core/dist/esm/_virtual/rolldown_runtime.mjs
|
|
3
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.__require = __require;
|
|
10
|
+
//# sourceMappingURL=rolldown_runtime.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolldown_runtime.cjs","names":[],"sources":["../../../../../../../../../packages/@intlayer/core/dist/esm/_virtual/rolldown_runtime.mjs"],"sourcesContent":["//#region rolldown:runtime\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, { get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b] }) : x)(function(x) {\n\tif (typeof require !== \"undefined\") return require.apply(this, arguments);\n\tthrow Error(\"Calling `require` for \\\"\" + x + \"\\\" in an environment that doesn't expose the `require` function.\");\n});\n\n//#endregion\nexport { __require };"],"mappings":";;AACA,IAAI,YAA4B,kBAAE,MAAM,OAAO,YAAY,cAAc,UAAU,OAAO,UAAU,cAAc,IAAI,MAAM,GAAG,EAAE,MAAM,GAAG,OAAO,OAAO,YAAY,cAAc,UAAU,GAAG,IAAI,CAAC,GAAG,GAAG,SAAS,GAAG;AACrN,KAAI,OAAO,YAAY,YAAa,QAAO,QAAQ,MAAM,MAAM,UAAU;AACzE,OAAM,MAAM,6BAA6B,IAAI,mEAAmE;EAC/G"}
|
package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.cjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.mjs
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __export = (all) => {
|
|
6
|
+
let target = {};
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
var __require$1 = /* @__PURE__ */ ((x) => typeof require_rolldown_runtime.__require !== "undefined" ? require_rolldown_runtime.__require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require_rolldown_runtime.__require !== "undefined" ? require_rolldown_runtime.__require : a)[b] }) : x)(function(x) {
|
|
14
|
+
if (typeof require_rolldown_runtime.__require !== "undefined") return require_rolldown_runtime.__require.apply(this, arguments);
|
|
15
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.__export = __export;
|
|
20
|
+
exports.__require = __require$1;
|
|
21
|
+
//# sourceMappingURL=rolldown_runtime.cjs.map
|
package/dist/cjs/packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolldown_runtime.cjs","names":["__require","__require$1"],"sources":["../../../../../../../../../../../../packages/@intlayer/core/dist/esm/config/dist/esm/_virtual/rolldown_runtime.mjs"],"sourcesContent":["import { __require as __require$1 } from \"../../../../_virtual/rolldown_runtime.mjs\";\n\n//#region ../config/dist/esm/_virtual/rolldown_runtime.mjs\nvar __defProp = Object.defineProperty;\nvar __export = (all) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\treturn target;\n};\nvar __require = /* @__PURE__ */ ((x) => typeof __require$1 !== \"undefined\" ? __require$1 : typeof Proxy !== \"undefined\" ? new Proxy(x, { get: (a, b) => (typeof __require$1 !== \"undefined\" ? __require$1 : a)[b] }) : x)(function(x) {\n\tif (typeof __require$1 !== \"undefined\") return __require$1.apply(this, arguments);\n\tthrow Error(\"Calling `require` for \\\"\" + x + \"\\\" in an environment that doesn't expose the `require` function.\");\n});\n\n//#endregion\nexport { __export, __require };\n//# sourceMappingURL=rolldown_runtime.mjs.map"],"mappings":";;;AAGA,IAAI,YAAY,OAAO;AACvB,IAAI,YAAY,QAAQ;CACvB,IAAI,SAAS,EAAE;AACf,MAAK,IAAI,QAAQ,IAAK,WAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;EACZ,CAAC;AACF,QAAO;;AAER,IAAIA,cAA4B,kBAAE,MAAM,OAAOC,uCAAgB,cAAcA,qCAAc,OAAO,UAAU,cAAc,IAAI,MAAM,GAAG,EAAE,MAAM,GAAG,OAAO,OAAOA,uCAAgB,cAAcA,qCAAc,GAAG,IAAI,CAAC,GAAG,GAAG,SAAS,GAAG;AACrO,KAAI,OAAOA,uCAAgB,YAAa,QAAOA,mCAAY,MAAM,MAAM,UAAU;AACjF,OAAM,MAAM,6BAA6B,IAAI,mEAAmE;EAC/G"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_getConfiguration = require('./configFile/getConfiguration.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../packages/@intlayer/core/dist/esm/config/dist/esm/built.mjs
|
|
4
|
+
var built_default = require_getConfiguration.getConfiguration();
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.built_default = built_default;
|
|
8
|
+
//# sourceMappingURL=built.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built.cjs","names":["getConfiguration"],"sources":["../../../../../../../../../../../packages/@intlayer/core/dist/esm/config/dist/esm/built.mjs"],"sourcesContent":["import { getConfiguration } from \"./configFile/getConfiguration.mjs\";\n\n//#region ../config/dist/esm/built.mjs\nvar built_default = getConfiguration();\n\n//#endregion\nexport { built_default };\n//# sourceMappingURL=built.mjs.map"],"mappings":";;;AAGA,IAAI,gBAAgBA,2CAAkB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_build = require('../defaultValues/build.cjs');
|
|
3
|
+
const require_content = require('../defaultValues/content.cjs');
|
|
4
|
+
const require_editor = require('../defaultValues/editor.cjs');
|
|
5
|
+
const require_internationalization = require('../defaultValues/internationalization.cjs');
|
|
6
|
+
const require_log = require('../defaultValues/log.cjs');
|
|
7
|
+
const require_routing = require('../defaultValues/routing.cjs');
|
|
8
|
+
const require_normalizePath = require('../utils/normalizePath.cjs');
|
|
9
|
+
const require_dictionary = require('../defaultValues/dictionary.cjs');
|
|
10
|
+
let node_path = require("node:path");
|
|
11
|
+
|
|
12
|
+
//#region ../packages/@intlayer/core/dist/esm/config/dist/esm/configFile/buildConfigurationFields.mjs
|
|
13
|
+
let storedConfiguration;
|
|
14
|
+
const buildInternationalizationFields = (customConfiguration) => ({
|
|
15
|
+
locales: customConfiguration?.locales ?? require_internationalization.LOCALES,
|
|
16
|
+
requiredLocales: customConfiguration?.requiredLocales ?? customConfiguration?.locales ?? require_internationalization.REQUIRED_LOCALES,
|
|
17
|
+
strictMode: customConfiguration?.strictMode ?? require_internationalization.STRICT_MODE,
|
|
18
|
+
defaultLocale: customConfiguration?.defaultLocale ?? require_internationalization.DEFAULT_LOCALE
|
|
19
|
+
});
|
|
20
|
+
const buildRoutingFields = (customConfiguration) => ({
|
|
21
|
+
mode: customConfiguration?.mode ?? require_routing.ROUTING_MODE,
|
|
22
|
+
storage: customConfiguration?.storage ?? require_routing.STORAGE,
|
|
23
|
+
basePath: customConfiguration?.basePath ?? require_routing.BASE_PATH
|
|
24
|
+
});
|
|
25
|
+
const buildContentFields = (customConfiguration, baseDir) => {
|
|
26
|
+
const notDerivedContentConfig = {
|
|
27
|
+
fileExtensions: customConfiguration?.fileExtensions ?? require_content.FILE_EXTENSIONS,
|
|
28
|
+
baseDir: customConfiguration?.baseDir ?? baseDir ?? process.cwd(),
|
|
29
|
+
excludedPath: customConfiguration?.excludedPath ?? require_content.EXCLUDED_PATHS,
|
|
30
|
+
watch: customConfiguration?.watch ?? require_content.WATCH,
|
|
31
|
+
formatCommand: customConfiguration?.formatCommand
|
|
32
|
+
};
|
|
33
|
+
const optionalJoinBaseDir = (path) => {
|
|
34
|
+
if ((0, node_path.isAbsolute)(path)) return path;
|
|
35
|
+
return (0, node_path.join)(notDerivedContentConfig.baseDir, path);
|
|
36
|
+
};
|
|
37
|
+
const baseDirDerivedConfiguration = {
|
|
38
|
+
contentDir: (customConfiguration?.contentDir ?? require_content.CONTENT_DIR).map(optionalJoinBaseDir),
|
|
39
|
+
moduleAugmentationDir: optionalJoinBaseDir(customConfiguration?.moduleAugmentationDir ?? require_content.MODULE_AUGMENTATION_DIR),
|
|
40
|
+
unmergedDictionariesDir: optionalJoinBaseDir(customConfiguration?.unmergedDictionariesDir ?? require_content.UNMERGED_DICTIONARIES_DIR),
|
|
41
|
+
remoteDictionariesDir: optionalJoinBaseDir(customConfiguration?.remoteDictionariesDir ?? require_content.REMOTE_DICTIONARIES_DIR),
|
|
42
|
+
dictionariesDir: optionalJoinBaseDir(customConfiguration?.dictionariesDir ?? require_content.DICTIONARIES_DIR),
|
|
43
|
+
dynamicDictionariesDir: optionalJoinBaseDir(customConfiguration?.dynamicDictionariesDir ?? require_content.DYNAMIC_DICTIONARIES_DIR),
|
|
44
|
+
fetchDictionariesDir: optionalJoinBaseDir(customConfiguration?.fetchDictionariesDir ?? require_content.FETCH_DICTIONARIES_DIR),
|
|
45
|
+
typesDir: optionalJoinBaseDir(customConfiguration?.typesDir ?? require_content.TYPES_DIR),
|
|
46
|
+
mainDir: optionalJoinBaseDir(customConfiguration?.mainDir ?? require_content.MAIN_DIR),
|
|
47
|
+
configDir: optionalJoinBaseDir(customConfiguration?.configDir ?? require_content.CONFIG_DIR),
|
|
48
|
+
cacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? require_content.CACHE_DIR)
|
|
49
|
+
};
|
|
50
|
+
const patternsConfiguration = {
|
|
51
|
+
watchedFilesPattern: notDerivedContentConfig.fileExtensions.map((ext) => `/**/*${ext}`),
|
|
52
|
+
watchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.flatMap((ext) => baseDirDerivedConfiguration.contentDir.map((contentDir) => `${require_normalizePath.normalizePath(contentDir)}/**/*${ext}`)),
|
|
53
|
+
outputFilesPatternWithPath: `${require_normalizePath.normalizePath(baseDirDerivedConfiguration.dictionariesDir)}/**/*.json`
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
...notDerivedContentConfig,
|
|
57
|
+
...baseDirDerivedConfiguration,
|
|
58
|
+
...patternsConfiguration
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const buildEditorFields = (customConfiguration) => ({
|
|
62
|
+
applicationURL: customConfiguration?.applicationURL ?? require_editor.APPLICATION_URL,
|
|
63
|
+
editorURL: customConfiguration?.editorURL ?? require_editor.EDITOR_URL,
|
|
64
|
+
cmsURL: customConfiguration?.cmsURL ?? require_editor.CMS_URL,
|
|
65
|
+
backendURL: customConfiguration?.backendURL ?? require_editor.BACKEND_URL,
|
|
66
|
+
port: customConfiguration?.port ?? require_editor.PORT,
|
|
67
|
+
enabled: customConfiguration?.enabled ?? require_editor.IS_ENABLED,
|
|
68
|
+
clientId: customConfiguration?.clientId ?? void 0,
|
|
69
|
+
clientSecret: customConfiguration?.clientSecret ?? void 0,
|
|
70
|
+
dictionaryPriorityStrategy: customConfiguration?.dictionaryPriorityStrategy ?? require_editor.DICTIONARY_PRIORITY_STRATEGY,
|
|
71
|
+
liveSync: customConfiguration?.liveSync ?? require_editor.LIVE_SYNC,
|
|
72
|
+
liveSyncPort: customConfiguration?.liveSyncPort ?? require_editor.LIVE_SYNC_PORT,
|
|
73
|
+
liveSyncURL: customConfiguration?.liveSyncURL ?? `http://localhost:${customConfiguration?.liveSyncPort ?? require_editor.LIVE_SYNC_PORT}`
|
|
74
|
+
});
|
|
75
|
+
const buildLogFields = (customConfiguration, logFunctions) => ({
|
|
76
|
+
mode: customConfiguration?.mode ?? require_log.MODE,
|
|
77
|
+
prefix: customConfiguration?.prefix ?? require_log.PREFIX,
|
|
78
|
+
error: logFunctions?.error,
|
|
79
|
+
log: logFunctions?.log,
|
|
80
|
+
info: logFunctions?.info,
|
|
81
|
+
warn: logFunctions?.warn
|
|
82
|
+
});
|
|
83
|
+
const buildAiFields = (customConfiguration) => ({
|
|
84
|
+
provider: customConfiguration?.provider,
|
|
85
|
+
apiKey: customConfiguration?.apiKey,
|
|
86
|
+
model: customConfiguration?.model,
|
|
87
|
+
temperature: customConfiguration?.temperature,
|
|
88
|
+
applicationContext: customConfiguration?.applicationContext
|
|
89
|
+
});
|
|
90
|
+
const buildBuildFields = (customConfiguration) => ({
|
|
91
|
+
optimize: customConfiguration?.optimize ?? require_build.OPTIMIZE,
|
|
92
|
+
importMode: customConfiguration?.importMode ?? require_build.IMPORT_MODE,
|
|
93
|
+
traversePattern: customConfiguration?.traversePattern ?? require_build.TRAVERSE_PATTERN,
|
|
94
|
+
outputFormat: customConfiguration?.outputFormat ?? require_build.OUTPUT_FORMAT,
|
|
95
|
+
cache: customConfiguration?.cache ?? require_build.CACHE,
|
|
96
|
+
require: customConfiguration?.require
|
|
97
|
+
});
|
|
98
|
+
const buildDictionaryFields = (customConfiguration) => ({ fill: customConfiguration?.fill ?? require_dictionary.FILL });
|
|
99
|
+
/**
|
|
100
|
+
* Build the configuration fields by merging the default values with the custom configuration
|
|
101
|
+
*/
|
|
102
|
+
const buildConfigurationFields = (customConfiguration, baseDir, logFunctions) => {
|
|
103
|
+
storedConfiguration = {
|
|
104
|
+
internationalization: buildInternationalizationFields(customConfiguration?.internationalization),
|
|
105
|
+
routing: buildRoutingFields(customConfiguration?.routing),
|
|
106
|
+
content: buildContentFields(customConfiguration?.content, baseDir),
|
|
107
|
+
editor: buildEditorFields(customConfiguration?.editor),
|
|
108
|
+
log: buildLogFields(customConfiguration?.log, logFunctions),
|
|
109
|
+
ai: buildAiFields(customConfiguration?.ai),
|
|
110
|
+
build: buildBuildFields(customConfiguration?.build),
|
|
111
|
+
dictionary: buildDictionaryFields(customConfiguration?.dictionary),
|
|
112
|
+
plugins: customConfiguration?.plugins
|
|
113
|
+
};
|
|
114
|
+
return storedConfiguration;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
exports.buildConfigurationFields = buildConfigurationFields;
|
|
119
|
+
//# sourceMappingURL=buildConfigurationFields.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.cjs","names":["LOCALES","REQUIRED_LOCALES","STRICT_MODE","DEFAULT_LOCALE","ROUTING_MODE","STORAGE","BASE_PATH","FILE_EXTENSIONS","EXCLUDED_PATHS","WATCH","CONTENT_DIR","MODULE_AUGMENTATION_DIR","UNMERGED_DICTIONARIES_DIR","REMOTE_DICTIONARIES_DIR","DICTIONARIES_DIR","DYNAMIC_DICTIONARIES_DIR","FETCH_DICTIONARIES_DIR","TYPES_DIR","MAIN_DIR","CONFIG_DIR","CACHE_DIR","normalizePath","APPLICATION_URL","EDITOR_URL","CMS_URL","BACKEND_URL","PORT","IS_ENABLED","DICTIONARY_PRIORITY_STRATEGY","LIVE_SYNC","LIVE_SYNC_PORT","MODE","PREFIX","OPTIMIZE","IMPORT_MODE","TRAVERSE_PATTERN","OUTPUT_FORMAT","CACHE","FILL"],"sources":["../../../../../../../../../../../../packages/@intlayer/core/dist/esm/config/dist/esm/configFile/buildConfigurationFields.mjs"],"sourcesContent":["import { CACHE, IMPORT_MODE, OPTIMIZE, OUTPUT_FORMAT, TRAVERSE_PATTERN } from \"../defaultValues/build.mjs\";\nimport { CACHE_DIR, CONFIG_DIR, CONTENT_DIR, DICTIONARIES_DIR, DYNAMIC_DICTIONARIES_DIR, EXCLUDED_PATHS, FETCH_DICTIONARIES_DIR, FILE_EXTENSIONS, MAIN_DIR, MODULE_AUGMENTATION_DIR, REMOTE_DICTIONARIES_DIR, TYPES_DIR, UNMERGED_DICTIONARIES_DIR, WATCH } from \"../defaultValues/content.mjs\";\nimport { APPLICATION_URL, BACKEND_URL, CMS_URL, DICTIONARY_PRIORITY_STRATEGY, EDITOR_URL, IS_ENABLED, LIVE_SYNC, LIVE_SYNC_PORT, PORT } from \"../defaultValues/editor.mjs\";\nimport { DEFAULT_LOCALE, LOCALES, REQUIRED_LOCALES, STRICT_MODE } from \"../defaultValues/internationalization.mjs\";\nimport { MODE, PREFIX } from \"../defaultValues/log.mjs\";\nimport { BASE_PATH, ROUTING_MODE, STORAGE } from \"../defaultValues/routing.mjs\";\nimport { normalizePath } from \"../utils/normalizePath.mjs\";\nimport { FILL } from \"../defaultValues/dictionary.mjs\";\nimport { isAbsolute, join } from \"node:path\";\n\n//#region ../config/dist/esm/configFile/buildConfigurationFields.mjs\nlet storedConfiguration;\nconst buildInternationalizationFields = (customConfiguration) => ({\n\tlocales: customConfiguration?.locales ?? LOCALES,\n\trequiredLocales: customConfiguration?.requiredLocales ?? customConfiguration?.locales ?? REQUIRED_LOCALES,\n\tstrictMode: customConfiguration?.strictMode ?? STRICT_MODE,\n\tdefaultLocale: customConfiguration?.defaultLocale ?? DEFAULT_LOCALE\n});\nconst buildRoutingFields = (customConfiguration) => ({\n\tmode: customConfiguration?.mode ?? ROUTING_MODE,\n\tstorage: customConfiguration?.storage ?? STORAGE,\n\tbasePath: customConfiguration?.basePath ?? BASE_PATH\n});\nconst buildContentFields = (customConfiguration, baseDir) => {\n\tconst notDerivedContentConfig = {\n\t\tfileExtensions: customConfiguration?.fileExtensions ?? FILE_EXTENSIONS,\n\t\tbaseDir: customConfiguration?.baseDir ?? baseDir ?? process.cwd(),\n\t\texcludedPath: customConfiguration?.excludedPath ?? EXCLUDED_PATHS,\n\t\twatch: customConfiguration?.watch ?? WATCH,\n\t\tformatCommand: customConfiguration?.formatCommand\n\t};\n\tconst optionalJoinBaseDir = (path) => {\n\t\tif (isAbsolute(path)) return path;\n\t\treturn join(notDerivedContentConfig.baseDir, path);\n\t};\n\tconst baseDirDerivedConfiguration = {\n\t\tcontentDir: (customConfiguration?.contentDir ?? CONTENT_DIR).map(optionalJoinBaseDir),\n\t\tmoduleAugmentationDir: optionalJoinBaseDir(customConfiguration?.moduleAugmentationDir ?? MODULE_AUGMENTATION_DIR),\n\t\tunmergedDictionariesDir: optionalJoinBaseDir(customConfiguration?.unmergedDictionariesDir ?? UNMERGED_DICTIONARIES_DIR),\n\t\tremoteDictionariesDir: optionalJoinBaseDir(customConfiguration?.remoteDictionariesDir ?? REMOTE_DICTIONARIES_DIR),\n\t\tdictionariesDir: optionalJoinBaseDir(customConfiguration?.dictionariesDir ?? DICTIONARIES_DIR),\n\t\tdynamicDictionariesDir: optionalJoinBaseDir(customConfiguration?.dynamicDictionariesDir ?? DYNAMIC_DICTIONARIES_DIR),\n\t\tfetchDictionariesDir: optionalJoinBaseDir(customConfiguration?.fetchDictionariesDir ?? FETCH_DICTIONARIES_DIR),\n\t\ttypesDir: optionalJoinBaseDir(customConfiguration?.typesDir ?? TYPES_DIR),\n\t\tmainDir: optionalJoinBaseDir(customConfiguration?.mainDir ?? MAIN_DIR),\n\t\tconfigDir: optionalJoinBaseDir(customConfiguration?.configDir ?? CONFIG_DIR),\n\t\tcacheDir: optionalJoinBaseDir(customConfiguration?.cacheDir ?? CACHE_DIR)\n\t};\n\tconst patternsConfiguration = {\n\t\twatchedFilesPattern: notDerivedContentConfig.fileExtensions.map((ext) => `/**/*${ext}`),\n\t\twatchedFilesPatternWithPath: notDerivedContentConfig.fileExtensions.flatMap((ext) => baseDirDerivedConfiguration.contentDir.map((contentDir) => `${normalizePath(contentDir)}/**/*${ext}`)),\n\t\toutputFilesPatternWithPath: `${normalizePath(baseDirDerivedConfiguration.dictionariesDir)}/**/*.json`\n\t};\n\treturn {\n\t\t...notDerivedContentConfig,\n\t\t...baseDirDerivedConfiguration,\n\t\t...patternsConfiguration\n\t};\n};\nconst buildEditorFields = (customConfiguration) => ({\n\tapplicationURL: customConfiguration?.applicationURL ?? APPLICATION_URL,\n\teditorURL: customConfiguration?.editorURL ?? EDITOR_URL,\n\tcmsURL: customConfiguration?.cmsURL ?? CMS_URL,\n\tbackendURL: customConfiguration?.backendURL ?? BACKEND_URL,\n\tport: customConfiguration?.port ?? PORT,\n\tenabled: customConfiguration?.enabled ?? IS_ENABLED,\n\tclientId: customConfiguration?.clientId ?? void 0,\n\tclientSecret: customConfiguration?.clientSecret ?? void 0,\n\tdictionaryPriorityStrategy: customConfiguration?.dictionaryPriorityStrategy ?? DICTIONARY_PRIORITY_STRATEGY,\n\tliveSync: customConfiguration?.liveSync ?? LIVE_SYNC,\n\tliveSyncPort: customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT,\n\tliveSyncURL: customConfiguration?.liveSyncURL ?? `http://localhost:${customConfiguration?.liveSyncPort ?? LIVE_SYNC_PORT}`\n});\nconst buildLogFields = (customConfiguration, logFunctions) => ({\n\tmode: customConfiguration?.mode ?? MODE,\n\tprefix: customConfiguration?.prefix ?? PREFIX,\n\terror: logFunctions?.error,\n\tlog: logFunctions?.log,\n\tinfo: logFunctions?.info,\n\twarn: logFunctions?.warn\n});\nconst buildAiFields = (customConfiguration) => ({\n\tprovider: customConfiguration?.provider,\n\tapiKey: customConfiguration?.apiKey,\n\tmodel: customConfiguration?.model,\n\ttemperature: customConfiguration?.temperature,\n\tapplicationContext: customConfiguration?.applicationContext\n});\nconst buildBuildFields = (customConfiguration) => ({\n\toptimize: customConfiguration?.optimize ?? OPTIMIZE,\n\timportMode: customConfiguration?.importMode ?? IMPORT_MODE,\n\ttraversePattern: customConfiguration?.traversePattern ?? TRAVERSE_PATTERN,\n\toutputFormat: customConfiguration?.outputFormat ?? OUTPUT_FORMAT,\n\tcache: customConfiguration?.cache ?? CACHE,\n\trequire: customConfiguration?.require\n});\nconst buildDictionaryFields = (customConfiguration) => ({ fill: customConfiguration?.fill ?? FILL });\n/**\n* Build the configuration fields by merging the default values with the custom configuration\n*/\nconst buildConfigurationFields = (customConfiguration, baseDir, logFunctions) => {\n\tstoredConfiguration = {\n\t\tinternationalization: buildInternationalizationFields(customConfiguration?.internationalization),\n\t\trouting: buildRoutingFields(customConfiguration?.routing),\n\t\tcontent: buildContentFields(customConfiguration?.content, baseDir),\n\t\teditor: buildEditorFields(customConfiguration?.editor),\n\t\tlog: buildLogFields(customConfiguration?.log, logFunctions),\n\t\tai: buildAiFields(customConfiguration?.ai),\n\t\tbuild: buildBuildFields(customConfiguration?.build),\n\t\tdictionary: buildDictionaryFields(customConfiguration?.dictionary),\n\t\tplugins: customConfiguration?.plugins\n\t};\n\treturn storedConfiguration;\n};\n\n//#endregion\nexport { buildConfigurationFields };\n//# sourceMappingURL=buildConfigurationFields.mjs.map"],"mappings":";;;;;;;;;;;;AAWA,IAAI;AACJ,MAAM,mCAAmC,yBAAyB;CACjE,SAAS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