@intlayer/config 6.1.6 → 7.0.0-canary.1
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 +34 -0
- package/dist/cjs/alias.cjs +27 -100
- package/dist/cjs/alias.cjs.map +1 -1
- package/dist/cjs/built.cjs +7 -25
- package/dist/cjs/built.cjs.map +1 -1
- package/dist/cjs/bundleJSFile.cjs +30 -51
- package/dist/cjs/bundleJSFile.cjs.map +1 -1
- package/dist/cjs/client.cjs +19 -52
- package/dist/cjs/configFile/buildConfigurationFields.cjs +100 -657
- package/dist/cjs/configFile/buildConfigurationFields.cjs.map +1 -1
- package/dist/cjs/configFile/getConfiguration.cjs +60 -114
- package/dist/cjs/configFile/getConfiguration.cjs.map +1 -1
- package/dist/cjs/configFile/index.cjs +8 -25
- package/dist/cjs/configFile/loadConfigurationFile.cjs +22 -47
- package/dist/cjs/configFile/loadConfigurationFile.cjs.map +1 -1
- package/dist/cjs/configFile/searchConfigurationFile.cjs +49 -55
- package/dist/cjs/configFile/searchConfigurationFile.cjs.map +1 -1
- package/dist/cjs/defaultValues/build.cjs +23 -35
- package/dist/cjs/defaultValues/build.cjs.map +1 -1
- package/dist/cjs/defaultValues/content.cjs +68 -70
- package/dist/cjs/defaultValues/content.cjs.map +1 -1
- package/dist/cjs/defaultValues/editor.cjs +29 -41
- package/dist/cjs/defaultValues/editor.cjs.map +1 -1
- package/dist/cjs/defaultValues/index.cjs +62 -0
- package/dist/cjs/defaultValues/index.cjs.map +1 -0
- package/dist/cjs/defaultValues/internationalization.cjs +23 -34
- package/dist/cjs/defaultValues/internationalization.cjs.map +1 -1
- package/dist/cjs/defaultValues/log.cjs +17 -29
- package/dist/cjs/defaultValues/log.cjs.map +1 -1
- package/dist/cjs/defaultValues/routing.cjs +38 -0
- package/dist/cjs/defaultValues/routing.cjs.map +1 -0
- package/dist/cjs/extractErrorMessage.cjs +95 -0
- package/dist/cjs/extractErrorMessage.cjs.map +1 -0
- package/dist/cjs/index.cjs +67 -98
- package/dist/cjs/loadEnvFile.cjs +30 -51
- package/dist/cjs/loadEnvFile.cjs.map +1 -1
- package/dist/cjs/loadExternalFile/bundleFile.cjs +74 -0
- package/dist/cjs/loadExternalFile/bundleFile.cjs.map +1 -0
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs +86 -0
- package/dist/cjs/loadExternalFile/loadExternalFile.cjs.map +1 -0
- package/dist/cjs/loadExternalFile/parseFileContent.cjs +67 -0
- package/dist/cjs/loadExternalFile/parseFileContent.cjs.map +1 -0
- package/dist/cjs/loadExternalFile/transpileTSToMJS.cjs +60 -0
- package/dist/cjs/loadExternalFile/transpileTSToMJS.cjs.map +1 -0
- package/dist/cjs/logger.cjs +124 -152
- package/dist/cjs/logger.cjs.map +1 -1
- package/dist/cjs/package.cjs +12 -0
- package/dist/cjs/package.cjs.map +1 -0
- package/dist/cjs/retryManager.cjs +42 -49
- package/dist/cjs/retryManager.cjs.map +1 -1
- package/dist/cjs/utils/ESMxCJSHelpers.cjs +24 -33
- package/dist/cjs/utils/ESMxCJSHelpers.cjs.map +1 -1
- package/dist/cjs/utils/cache.cjs +426 -0
- package/dist/cjs/utils/cache.cjs.map +1 -0
- package/dist/cjs/utils/clearModuleCache.cjs +23 -46
- package/dist/cjs/utils/clearModuleCache.cjs.map +1 -1
- package/dist/cjs/utils/extractErrorMessage.cjs +95 -0
- package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -0
- package/dist/cjs/utils/getExtension.cjs +12 -35
- package/dist/cjs/utils/getExtension.cjs.map +1 -1
- package/dist/cjs/utils/getPackageJsonPath.cjs +37 -0
- package/dist/cjs/utils/getPackageJsonPath.cjs.map +1 -0
- package/dist/cjs/utils/logStack.cjs +16 -0
- package/dist/cjs/utils/logStack.cjs.map +1 -0
- package/dist/cjs/utils/normalizePath.cjs +15 -27
- package/dist/cjs/utils/normalizePath.cjs.map +1 -1
- package/dist/esm/_virtual/rolldown_runtime.mjs +17 -0
- package/dist/esm/alias.mjs +23 -74
- package/dist/esm/alias.mjs.map +1 -1
- package/dist/esm/built.mjs +5 -3
- package/dist/esm/built.mjs.map +1 -1
- package/dist/esm/bundleJSFile.mjs +26 -25
- package/dist/esm/bundleJSFile.mjs.map +1 -1
- package/dist/esm/client.mjs +4 -31
- package/dist/esm/configFile/buildConfigurationFields.mjs +97 -674
- package/dist/esm/configFile/buildConfigurationFields.mjs.map +1 -1
- package/dist/esm/configFile/getConfiguration.mjs +52 -75
- package/dist/esm/configFile/getConfiguration.mjs.map +1 -1
- package/dist/esm/configFile/index.mjs +5 -3
- package/dist/esm/configFile/loadConfigurationFile.mjs +22 -23
- package/dist/esm/configFile/loadConfigurationFile.mjs.map +1 -1
- package/dist/esm/configFile/searchConfigurationFile.mjs +45 -30
- package/dist/esm/configFile/searchConfigurationFile.mjs.map +1 -1
- package/dist/esm/defaultValues/build.mjs +16 -11
- package/dist/esm/defaultValues/build.mjs.map +1 -1
- package/dist/esm/defaultValues/content.mjs +48 -34
- package/dist/esm/defaultValues/content.mjs.map +1 -1
- package/dist/esm/defaultValues/editor.mjs +17 -11
- package/dist/esm/defaultValues/editor.mjs.map +1 -1
- package/dist/esm/defaultValues/index.mjs +21 -0
- package/dist/esm/defaultValues/index.mjs.map +1 -0
- package/dist/esm/defaultValues/internationalization.mjs +13 -7
- package/dist/esm/defaultValues/internationalization.mjs.map +1 -1
- package/dist/esm/defaultValues/log.mjs +10 -4
- package/dist/esm/defaultValues/log.mjs.map +1 -1
- package/dist/esm/defaultValues/routing.mjs +25 -0
- package/dist/esm/defaultValues/routing.mjs.map +1 -0
- package/dist/esm/extractErrorMessage.mjs +94 -0
- package/dist/esm/extractErrorMessage.mjs.map +1 -0
- package/dist/esm/index.mjs +18 -61
- package/dist/esm/loadEnvFile.mjs +27 -17
- package/dist/esm/loadEnvFile.mjs.map +1 -1
- package/dist/esm/loadExternalFile/bundleFile.mjs +68 -0
- package/dist/esm/loadExternalFile/bundleFile.mjs.map +1 -0
- package/dist/esm/loadExternalFile/loadExternalFile.mjs +81 -0
- package/dist/esm/loadExternalFile/loadExternalFile.mjs.map +1 -0
- package/dist/esm/loadExternalFile/parseFileContent.mjs +63 -0
- package/dist/esm/loadExternalFile/parseFileContent.mjs.map +1 -0
- package/dist/esm/loadExternalFile/transpileTSToMJS.mjs +55 -0
- package/dist/esm/loadExternalFile/transpileTSToMJS.mjs.map +1 -0
- package/dist/esm/logger.mjs +110 -115
- package/dist/esm/logger.mjs.map +1 -1
- package/dist/esm/package.mjs +6 -0
- package/dist/esm/package.mjs.map +1 -0
- package/dist/esm/retryManager.mjs +40 -23
- package/dist/esm/retryManager.mjs.map +1 -1
- package/dist/esm/utils/ESMxCJSHelpers.mjs +20 -6
- package/dist/esm/utils/ESMxCJSHelpers.mjs.map +1 -1
- package/dist/esm/utils/cache.mjs +414 -0
- package/dist/esm/utils/cache.mjs.map +1 -0
- package/dist/esm/utils/clearModuleCache.mjs +22 -21
- package/dist/esm/utils/clearModuleCache.mjs.map +1 -1
- package/dist/esm/utils/extractErrorMessage.mjs +94 -0
- package/dist/esm/utils/extractErrorMessage.mjs.map +1 -0
- package/dist/esm/utils/getExtension.mjs +11 -11
- package/dist/esm/utils/getExtension.mjs.map +1 -1
- package/dist/esm/utils/getPackageJsonPath.mjs +33 -0
- package/dist/esm/utils/getPackageJsonPath.mjs.map +1 -0
- package/dist/esm/utils/logStack.mjs +16 -0
- package/dist/esm/utils/logStack.mjs.map +1 -0
- package/dist/esm/utils/normalizePath.mjs +14 -3
- package/dist/esm/utils/normalizePath.mjs.map +1 -1
- package/dist/types/alias.d.ts +20 -12
- package/dist/types/alias.d.ts.map +1 -1
- package/dist/types/built.d.ts +7 -6
- package/dist/types/built.d.ts.map +1 -1
- package/dist/types/bundleJSFile.d.ts +97 -93
- package/dist/types/bundleJSFile.d.ts.map +1 -1
- package/dist/types/client.d.ts +3 -5
- package/dist/types/configFile/buildConfigurationFields.d.ts +7 -2
- package/dist/types/configFile/buildConfigurationFields.d.ts.map +1 -1
- package/dist/types/configFile/getConfiguration.d.ts +19 -15
- package/dist/types/configFile/getConfiguration.d.ts.map +1 -1
- package/dist/types/configFile/index.d.ts +4 -3
- package/dist/types/configFile/loadConfigurationFile.d.ts +8 -3
- package/dist/types/configFile/loadConfigurationFile.d.ts.map +1 -1
- package/dist/types/configFile/searchConfigurationFile.d.ts +6 -4
- package/dist/types/configFile/searchConfigurationFile.d.ts.map +1 -1
- package/dist/types/defaultValues/build.d.ts +10 -4
- package/dist/types/defaultValues/build.d.ts.map +1 -1
- package/dist/types/defaultValues/content.d.ts +23 -16
- package/dist/types/defaultValues/content.d.ts.map +1 -1
- package/dist/types/defaultValues/editor.d.ts +14 -9
- package/dist/types/defaultValues/editor.d.ts.map +1 -1
- package/dist/types/defaultValues/index.d.ts +14 -0
- package/dist/types/defaultValues/index.d.ts.map +1 -0
- package/dist/types/defaultValues/internationalization.d.ts +12 -6
- package/dist/types/defaultValues/internationalization.d.ts.map +1 -1
- package/dist/types/defaultValues/log.d.ts +7 -2
- package/dist/types/defaultValues/log.d.ts.map +1 -1
- package/dist/types/defaultValues/routing.d.ts +14 -0
- package/dist/types/defaultValues/routing.d.ts.map +1 -0
- package/dist/types/extractErrorMessage.d.ts +5 -0
- package/dist/types/extractErrorMessage.d.ts.map +1 -0
- package/dist/types/index.d.ts +21 -17
- package/dist/types/loadEnvFile.d.ts +8 -5
- package/dist/types/loadEnvFile.d.ts.map +1 -1
- package/dist/types/loadExternalFile/bundleFile.d.ts +10 -0
- package/dist/types/loadExternalFile/bundleFile.d.ts.map +1 -0
- package/dist/types/loadExternalFile/loadExternalFile.d.ts +25 -0
- package/dist/types/loadExternalFile/loadExternalFile.d.ts.map +1 -0
- package/dist/types/loadExternalFile/parseFileContent.d.ts +29 -0
- package/dist/types/loadExternalFile/parseFileContent.d.ts.map +1 -0
- package/dist/types/loadExternalFile/transpileTSToMJS.d.ts +9 -0
- package/dist/types/loadExternalFile/transpileTSToMJS.d.ts.map +1 -0
- package/dist/types/logger.d.ts +41 -37
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/retryManager.d.ts +26 -8
- package/dist/types/retryManager.d.ts.map +1 -1
- package/dist/types/utils/ESMxCJSHelpers.d.ts +16 -2
- package/dist/types/utils/ESMxCJSHelpers.d.ts.map +1 -1
- package/dist/types/utils/cache.d.ts +50 -0
- package/dist/types/utils/cache.d.ts.map +1 -0
- package/dist/types/utils/clearModuleCache.d.ts +4 -1
- package/dist/types/utils/clearModuleCache.d.ts.map +1 -1
- package/dist/types/utils/extractErrorMessage.d.ts +5 -0
- package/dist/types/utils/extractErrorMessage.d.ts.map +1 -0
- package/dist/types/utils/getExtension.d.ts +6 -2
- package/dist/types/utils/getExtension.d.ts.map +1 -1
- package/dist/types/utils/getPackageJsonPath.d.ts +10 -0
- package/dist/types/utils/getPackageJsonPath.d.ts.map +1 -0
- package/dist/types/utils/logStack.d.ts +7 -0
- package/dist/types/utils/logStack.d.ts.map +1 -0
- package/dist/types/utils/normalizePath.d.ts +4 -1
- package/dist/types/utils/normalizePath.d.ts.map +1 -1
- package/package.json +40 -35
- package/LICENSE +0 -202
- package/dist/cjs/client.cjs.map +0 -1
- package/dist/cjs/configFile/index.cjs.map +0 -1
- package/dist/cjs/defaultValues/middleware.cjs +0 -47
- package/dist/cjs/defaultValues/middleware.cjs.map +0 -1
- package/dist/cjs/getSandboxContext.cjs +0 -64
- package/dist/cjs/getSandboxContext.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/loadExternalFile.cjs +0 -105
- package/dist/cjs/loadExternalFile.cjs.map +0 -1
- package/dist/cjs/types/config.cjs +0 -17
- package/dist/cjs/types/config.cjs.map +0 -1
- package/dist/cjs/types/locales.cjs +0 -310
- package/dist/cjs/types/locales.cjs.map +0 -1
- package/dist/esm/client.mjs.map +0 -1
- package/dist/esm/configFile/index.mjs.map +0 -1
- package/dist/esm/defaultValues/middleware.mjs +0 -17
- package/dist/esm/defaultValues/middleware.mjs.map +0 -1
- package/dist/esm/getSandboxContext.mjs +0 -40
- package/dist/esm/getSandboxContext.mjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/loadExternalFile.mjs +0 -81
- package/dist/esm/loadExternalFile.mjs.map +0 -1
- package/dist/esm/types/config.mjs +0 -1
- package/dist/esm/types/config.mjs.map +0 -1
- package/dist/esm/types/locales.mjs +0 -286
- package/dist/esm/types/locales.mjs.map +0 -1
- package/dist/types/client.d.ts.map +0 -1
- package/dist/types/configFile/index.d.ts.map +0 -1
- package/dist/types/defaultValues/middleware.d.ts +0 -8
- package/dist/types/defaultValues/middleware.d.ts.map +0 -1
- package/dist/types/getSandboxContext.d.ts +0 -4
- package/dist/types/getSandboxContext.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/loadExternalFile.d.ts +0 -8
- package/dist/types/loadExternalFile.d.ts.map +0 -1
- package/dist/types/types/config.d.ts +0 -659
- package/dist/types/types/config.d.ts.map +0 -1
- package/dist/types/types/locales.d.ts +0 -564
- package/dist/types/types/locales.d.ts.map +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//#region src/utils/extractErrorMessage.ts
|
|
2
|
+
const extractErrorMessage = (error) => {
|
|
3
|
+
const trimToSingleLine = (text) => text.split(/\r?\n/).map((s) => s.trim()).filter(Boolean)[0] ?? text.trim();
|
|
4
|
+
const looksLikeJson = (value) => {
|
|
5
|
+
const s = value.trim();
|
|
6
|
+
if (!s) return false;
|
|
7
|
+
const first = s[0];
|
|
8
|
+
return first === "{" || first === "[" || first === "\"";
|
|
9
|
+
};
|
|
10
|
+
const sanitizeUnexpectedTokenMessage = (text) => {
|
|
11
|
+
const t = text.trim();
|
|
12
|
+
if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {
|
|
13
|
+
const quoted = t.match(/"([^"]+)"/);
|
|
14
|
+
if (quoted?.[1]) return quoted[1];
|
|
15
|
+
const afterColon = t.split(":").slice(1).join(":").trim();
|
|
16
|
+
if (afterColon) return afterColon;
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
const pickFieldsFromObject = (value, seen) => {
|
|
21
|
+
if (!value || typeof value !== "object") return void 0;
|
|
22
|
+
if (seen.has(value)) return void 0;
|
|
23
|
+
seen.add(value);
|
|
24
|
+
const obj = value;
|
|
25
|
+
if (typeof obj.message === "string" && obj.message.trim()) return obj.message;
|
|
26
|
+
if (typeof obj.error_description === "string" && obj.error_description.trim()) return obj.error_description;
|
|
27
|
+
if (typeof obj.error === "string" && obj.error.trim()) return obj.error;
|
|
28
|
+
const title = typeof obj.title === "string" ? obj.title.trim() : "";
|
|
29
|
+
const code = typeof obj.code === "string" ? obj.code.trim() : "";
|
|
30
|
+
if (title && code) return `${title} (${code})`;
|
|
31
|
+
if (title) return title;
|
|
32
|
+
if (code) return code;
|
|
33
|
+
if (typeof obj.statusText === "string" && obj.statusText.trim()) return obj.statusText;
|
|
34
|
+
const response = obj.response;
|
|
35
|
+
if (response && typeof response === "object") {
|
|
36
|
+
const data$1 = response.data;
|
|
37
|
+
const fromData$1 = pickFieldsFromObject(data$1, seen);
|
|
38
|
+
if (fromData$1) return fromData$1;
|
|
39
|
+
}
|
|
40
|
+
const data = obj.data;
|
|
41
|
+
const fromData = pickFieldsFromObject(data, seen);
|
|
42
|
+
if (fromData) return fromData;
|
|
43
|
+
const cause = obj.cause;
|
|
44
|
+
const fromCause = pickFieldsFromObject(cause, seen) ?? (typeof cause?.message === "string" ? cause.message : void 0);
|
|
45
|
+
if (fromCause) return fromCause;
|
|
46
|
+
const errors = obj.errors;
|
|
47
|
+
if (Array.isArray(errors)) for (const item of errors) {
|
|
48
|
+
const fromItem = pickFieldsFromObject(item, seen);
|
|
49
|
+
if (fromItem) return fromItem;
|
|
50
|
+
if (typeof item?.message === "string") return item.message;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const tryParseJsonString = (maybeJson) => {
|
|
54
|
+
if (!looksLikeJson(maybeJson)) return void 0;
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(maybeJson);
|
|
57
|
+
const picked = pickFieldsFromObject(parsed, /* @__PURE__ */ new Set());
|
|
58
|
+
if (picked) return picked;
|
|
59
|
+
if (typeof parsed === "string") return parsed;
|
|
60
|
+
return;
|
|
61
|
+
} catch {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
if (typeof error === "string") {
|
|
66
|
+
const cleaned = sanitizeUnexpectedTokenMessage(error);
|
|
67
|
+
return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);
|
|
68
|
+
}
|
|
69
|
+
if (error && typeof error === "object") {
|
|
70
|
+
if (error instanceof Error) {
|
|
71
|
+
const cleaned = sanitizeUnexpectedTokenMessage(error.message);
|
|
72
|
+
const fromMessage = tryParseJsonString(cleaned);
|
|
73
|
+
if (fromMessage) return trimToSingleLine(fromMessage);
|
|
74
|
+
const fromCause = extractErrorMessage(error.cause);
|
|
75
|
+
if (fromCause && fromCause !== "An unknown error occurred") return trimToSingleLine(fromCause);
|
|
76
|
+
return trimToSingleLine(cleaned);
|
|
77
|
+
}
|
|
78
|
+
const fromObject = pickFieldsFromObject(error, /* @__PURE__ */ new Set());
|
|
79
|
+
if (fromObject) {
|
|
80
|
+
const cleaned = sanitizeUnexpectedTokenMessage(fromObject);
|
|
81
|
+
return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
return trimToSingleLine(JSON.stringify(error));
|
|
85
|
+
} catch {
|
|
86
|
+
return trimToSingleLine(String(error));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return "An unknown error occurred";
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { extractErrorMessage };
|
|
94
|
+
//# sourceMappingURL=extractErrorMessage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractErrorMessage.mjs","names":["data","fromData"],"sources":["../../../src/utils/extractErrorMessage.ts"],"sourcesContent":["export const extractErrorMessage = (error: unknown): string => {\n const trimToSingleLine = (text: string): string =>\n text\n .split(/\\r?\\n/)\n .map((s) => s.trim())\n .filter(Boolean)[0] ?? text.trim();\n\n const looksLikeJson = (value: string): boolean => {\n const s = value.trim();\n if (!s) return false;\n const first = s[0];\n return first === '{' || first === '[' || first === '\"';\n };\n\n const sanitizeUnexpectedTokenMessage = (text: string): string => {\n // If the text mentions an invalid JSON parse, try to extract the meaningful part\n const t = text.trim();\n if (/Unexpected token/i.test(t) && /not valid JSON/i.test(t)) {\n const quoted = t.match(/\"([^\"]+)\"/);\n if (quoted?.[1]) return quoted[1];\n // Fallback: drop the leading parser error description\n const afterColon = t.split(':').slice(1).join(':').trim();\n if (afterColon) return afterColon;\n }\n return t;\n };\n\n const pickFieldsFromObject = (\n value: unknown,\n seen: Set<unknown>\n ): string | undefined => {\n if (!value || typeof value !== 'object') return undefined;\n if (seen.has(value)) return undefined;\n seen.add(value);\n\n const obj = value as Record<string, unknown>;\n\n // Check for message first (highest priority)\n if (typeof obj.message === 'string' && obj.message.trim()) {\n return obj.message;\n }\n\n // Check for error_description\n if (\n typeof obj.error_description === 'string' &&\n obj.error_description.trim()\n ) {\n return obj.error_description;\n }\n\n // Check for error\n if (typeof obj.error === 'string' && obj.error.trim()) {\n return obj.error;\n }\n\n // Handle title and code combination\n const title = typeof obj.title === 'string' ? obj.title.trim() : '';\n const code = typeof obj.code === 'string' ? obj.code.trim() : '';\n\n if (title && code) {\n return `${title} (${code})`;\n }\n\n if (title) {\n return title;\n }\n\n if (code) {\n return code;\n }\n\n // Check for statusText\n if (typeof obj.statusText === 'string' && obj.statusText.trim()) {\n return obj.statusText;\n }\n\n // Common nested structures (Axios/Fetch-like)\n const response = obj.response as Record<string, unknown> | undefined;\n if (response && typeof response === 'object') {\n const data = response.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n if (fromData) return fromData;\n }\n\n const data = obj.data as unknown;\n const fromData = pickFieldsFromObject(data, seen);\n if (fromData) return fromData;\n\n // Nested cause chain\n const cause = (obj as { cause?: unknown }).cause;\n const fromCause =\n pickFieldsFromObject(cause, seen) ??\n (typeof (cause as any)?.message === 'string'\n ? (cause as any).message\n : undefined);\n if (fromCause) return fromCause;\n\n // Arrays of errors\n const errors = obj.errors as unknown;\n if (Array.isArray(errors)) {\n for (const item of errors) {\n const fromItem = pickFieldsFromObject(item, seen);\n if (fromItem) return fromItem;\n if (typeof (item as any)?.message === 'string')\n return (item as any).message;\n }\n }\n\n return undefined;\n };\n\n const tryParseJsonString = (maybeJson: string): string | undefined => {\n if (!looksLikeJson(maybeJson)) return undefined;\n try {\n const parsed = JSON.parse(maybeJson);\n const picked = pickFieldsFromObject(parsed, new Set());\n if (picked) return picked;\n if (typeof parsed === 'string') return parsed;\n return undefined;\n } catch {\n return undefined;\n }\n };\n\n if (typeof error === 'string') {\n const cleaned = sanitizeUnexpectedTokenMessage(error);\n return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);\n }\n\n if (error && typeof error === 'object') {\n // Native Error instance\n if (error instanceof Error) {\n const cleaned = sanitizeUnexpectedTokenMessage(error.message);\n const fromMessage = tryParseJsonString(cleaned);\n if (fromMessage) return trimToSingleLine(fromMessage);\n // Dive into cause when present\n const fromCause = extractErrorMessage(error.cause as unknown);\n if (fromCause && fromCause !== 'An unknown error occurred')\n return trimToSingleLine(fromCause);\n return trimToSingleLine(cleaned);\n }\n\n // Generic object\n const seen = new Set<unknown>();\n const fromObject = pickFieldsFromObject(error, seen);\n if (fromObject) {\n const cleaned = sanitizeUnexpectedTokenMessage(fromObject);\n return tryParseJsonString(cleaned) ?? trimToSingleLine(cleaned);\n }\n\n try {\n const serialized = JSON.stringify(error);\n return trimToSingleLine(serialized);\n } catch {\n return trimToSingleLine(String(error));\n }\n }\n\n return 'An unknown error occurred';\n};\n"],"mappings":";AAAA,MAAa,uBAAuB,UAA2B;CAC7D,MAAM,oBAAoB,SACxB,KACG,MAAM,QAAQ,CACd,KAAK,MAAM,EAAE,MAAM,CAAC,CACpB,OAAO,QAAQ,CAAC,MAAM,KAAK,MAAM;CAEtC,MAAM,iBAAiB,UAA2B;EAChD,MAAM,IAAI,MAAM,MAAM;AACtB,MAAI,CAAC,EAAG,QAAO;EACf,MAAM,QAAQ,EAAE;AAChB,SAAO,UAAU,OAAO,UAAU,OAAO,UAAU;;CAGrD,MAAM,kCAAkC,SAAyB;EAE/D,MAAM,IAAI,KAAK,MAAM;AACrB,MAAI,oBAAoB,KAAK,EAAE,IAAI,kBAAkB,KAAK,EAAE,EAAE;GAC5D,MAAM,SAAS,EAAE,MAAM,YAAY;AACnC,OAAI,SAAS,GAAI,QAAO,OAAO;GAE/B,MAAM,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC,MAAM;AACzD,OAAI,WAAY,QAAO;;AAEzB,SAAO;;CAGT,MAAM,wBACJ,OACA,SACuB;AACvB,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,MAAI,KAAK,IAAI,MAAM,CAAE,QAAO;AAC5B,OAAK,IAAI,MAAM;EAEf,MAAM,MAAM;AAGZ,MAAI,OAAO,IAAI,YAAY,YAAY,IAAI,QAAQ,MAAM,CACvD,QAAO,IAAI;AAIb,MACE,OAAO,IAAI,sBAAsB,YACjC,IAAI,kBAAkB,MAAM,CAE5B,QAAO,IAAI;AAIb,MAAI,OAAO,IAAI,UAAU,YAAY,IAAI,MAAM,MAAM,CACnD,QAAO,IAAI;EAIb,MAAM,QAAQ,OAAO,IAAI,UAAU,WAAW,IAAI,MAAM,MAAM,GAAG;EACjE,MAAM,OAAO,OAAO,IAAI,SAAS,WAAW,IAAI,KAAK,MAAM,GAAG;AAE9D,MAAI,SAAS,KACX,QAAO,GAAG,MAAM,IAAI,KAAK;AAG3B,MAAI,MACF,QAAO;AAGT,MAAI,KACF,QAAO;AAIT,MAAI,OAAO,IAAI,eAAe,YAAY,IAAI,WAAW,MAAM,CAC7D,QAAO,IAAI;EAIb,MAAM,WAAW,IAAI;AACrB,MAAI,YAAY,OAAO,aAAa,UAAU;GAC5C,MAAMA,SAAO,SAAS;GACtB,MAAMC,aAAW,qBAAqBD,QAAM,KAAK;AACjD,OAAIC,WAAU,QAAOA;;EAGvB,MAAM,OAAO,IAAI;EACjB,MAAM,WAAW,qBAAqB,MAAM,KAAK;AACjD,MAAI,SAAU,QAAO;EAGrB,MAAM,QAAS,IAA4B;EAC3C,MAAM,YACJ,qBAAqB,OAAO,KAAK,KAChC,OAAQ,OAAe,YAAY,WAC/B,MAAc,UACf;AACN,MAAI,UAAW,QAAO;EAGtB,MAAM,SAAS,IAAI;AACnB,MAAI,MAAM,QAAQ,OAAO,CACvB,MAAK,MAAM,QAAQ,QAAQ;GACzB,MAAM,WAAW,qBAAqB,MAAM,KAAK;AACjD,OAAI,SAAU,QAAO;AACrB,OAAI,OAAQ,MAAc,YAAY,SACpC,QAAQ,KAAa;;;CAO7B,MAAM,sBAAsB,cAA0C;AACpE,MAAI,CAAC,cAAc,UAAU,CAAE,QAAO;AACtC,MAAI;GACF,MAAM,SAAS,KAAK,MAAM,UAAU;GACpC,MAAM,SAAS,qBAAqB,wBAAQ,IAAI,KAAK,CAAC;AACtD,OAAI,OAAQ,QAAO;AACnB,OAAI,OAAO,WAAW,SAAU,QAAO;AACvC;UACM;AACN;;;AAIJ,KAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,UAAU,+BAA+B,MAAM;AACrD,SAAO,mBAAmB,QAAQ,IAAI,iBAAiB,QAAQ;;AAGjE,KAAI,SAAS,OAAO,UAAU,UAAU;AAEtC,MAAI,iBAAiB,OAAO;GAC1B,MAAM,UAAU,+BAA+B,MAAM,QAAQ;GAC7D,MAAM,cAAc,mBAAmB,QAAQ;AAC/C,OAAI,YAAa,QAAO,iBAAiB,YAAY;GAErD,MAAM,YAAY,oBAAoB,MAAM,MAAiB;AAC7D,OAAI,aAAa,cAAc,4BAC7B,QAAO,iBAAiB,UAAU;AACpC,UAAO,iBAAiB,QAAQ;;EAKlC,MAAM,aAAa,qBAAqB,uBAD3B,IAAI,KAAc,CACqB;AACpD,MAAI,YAAY;GACd,MAAM,UAAU,+BAA+B,WAAW;AAC1D,UAAO,mBAAmB,QAAQ,IAAI,iBAAiB,QAAQ;;AAGjE,MAAI;AAEF,UAAO,iBADY,KAAK,UAAU,MAAM,CACL;UAC7B;AACN,UAAO,iBAAiB,OAAO,MAAM,CAAC;;;AAI1C,QAAO"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
const getExtension = (configuration
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
getExtension
|
|
1
|
+
//#region src/utils/getExtension.ts
|
|
2
|
+
const getExtension = (configuration, format) => {
|
|
3
|
+
const outputFormats = configuration.build.outputFormat;
|
|
4
|
+
if (format === "cjs") return "cjs";
|
|
5
|
+
if (format === "esm") return "mjs";
|
|
6
|
+
if (outputFormats.includes("cjs")) return "cjs";
|
|
7
|
+
if (outputFormats.includes("esm")) return "mjs";
|
|
8
|
+
return "cjs";
|
|
12
9
|
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { getExtension };
|
|
13
13
|
//# sourceMappingURL=getExtension.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/getExtension.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"getExtension.mjs","names":[],"sources":["../../../src/utils/getExtension.ts"],"sourcesContent":["import type { IntlayerConfig } from '@intlayer/types';\n\nexport const getExtension = (\n configuration: IntlayerConfig,\n format?: 'esm' | 'cjs' | undefined\n) => {\n const outputFormats = configuration.build.outputFormat;\n\n if (format === 'cjs') return 'cjs';\n if (format === 'esm') return 'mjs';\n\n if (outputFormats.includes('cjs')) return 'cjs';\n if (outputFormats.includes('esm')) return 'mjs';\n\n return 'cjs';\n};\n"],"mappings":";AAEA,MAAa,gBACX,eACA,WACG;CACH,MAAM,gBAAgB,cAAc,MAAM;AAE1C,KAAI,WAAW,MAAO,QAAO;AAC7B,KAAI,WAAW,MAAO,QAAO;AAE7B,KAAI,cAAc,SAAS,MAAM,CAAE,QAAO;AAC1C,KAAI,cAAc,SAAS,MAAM,CAAE,QAAO;AAE1C,QAAO"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cache } from "./cache.mjs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/getPackageJsonPath.ts
|
|
6
|
+
const isESModule = typeof import.meta.url === "string";
|
|
7
|
+
const MAX_LEVELS = 15;
|
|
8
|
+
const getPackageJsonPath = (startDir = process.cwd()) => {
|
|
9
|
+
const checkedCache = cache.get("packageJsonPath", startDir);
|
|
10
|
+
if (checkedCache) return checkedCache;
|
|
11
|
+
let currentDir = startDir;
|
|
12
|
+
for (let level = 0; level < MAX_LEVELS; level++) {
|
|
13
|
+
const packageJsonPath = join(currentDir, "package.json");
|
|
14
|
+
if (existsSync(packageJsonPath)) {
|
|
15
|
+
cache.set("packageJsonPath", startDir, {
|
|
16
|
+
packageJsonPath,
|
|
17
|
+
baseDir: currentDir
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
packageJsonPath,
|
|
21
|
+
baseDir: currentDir
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const parentDir = dirname(currentDir);
|
|
25
|
+
if (parentDir === currentDir) break;
|
|
26
|
+
currentDir = parentDir;
|
|
27
|
+
}
|
|
28
|
+
throw new Error(`Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${process.cwd()}`);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getPackageJsonPath, isESModule };
|
|
33
|
+
//# sourceMappingURL=getPackageJsonPath.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPackageJsonPath.mjs","names":[],"sources":["../../../src/utils/getPackageJsonPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { cache } from './cache';\n\nexport const isESModule = typeof import.meta.url === 'string';\n\nconst MAX_LEVELS = 15;\n\ntype PackageJsonPathCache = {\n packageJsonPath: string;\n baseDir: string;\n};\n\nexport const getPackageJsonPath = (\n startDir: string = process.cwd()\n): PackageJsonPathCache => {\n const checkedCache = cache.get<PackageJsonPathCache>(\n 'packageJsonPath',\n startDir\n );\n\n if (checkedCache) return checkedCache;\n\n let currentDir = startDir;\n\n for (let level = 0; level < MAX_LEVELS; level++) {\n const packageJsonPath = join(currentDir, 'package.json');\n\n if (existsSync(packageJsonPath)) {\n cache.set('packageJsonPath', startDir, {\n packageJsonPath,\n baseDir: currentDir,\n });\n\n return { packageJsonPath, baseDir: currentDir };\n }\n\n const parentDir = dirname(currentDir);\n\n // If we've reached the root directory, stop\n if (parentDir === currentDir) {\n break;\n }\n\n currentDir = parentDir;\n }\n\n throw new Error(\n `Could not find package.json in current directory or any of the ${MAX_LEVELS} parent directories. Searched from: ${process.cwd()}`\n );\n};\n"],"mappings":";;;;;AAIA,MAAa,aAAa,OAAO,OAAO,KAAK,QAAQ;AAErD,MAAM,aAAa;AAOnB,MAAa,sBACX,WAAmB,QAAQ,KAAK,KACP;CACzB,MAAM,eAAe,MAAM,IACzB,mBACA,SACD;AAED,KAAI,aAAc,QAAO;CAEzB,IAAI,aAAa;AAEjB,MAAK,IAAI,QAAQ,GAAG,QAAQ,YAAY,SAAS;EAC/C,MAAM,kBAAkB,KAAK,YAAY,eAAe;AAExD,MAAI,WAAW,gBAAgB,EAAE;AAC/B,SAAM,IAAI,mBAAmB,UAAU;IACrC;IACA,SAAS;IACV,CAAC;AAEF,UAAO;IAAE;IAAiB,SAAS;IAAY;;EAGjD,MAAM,YAAY,QAAQ,WAAW;AAGrC,MAAI,cAAc,WAChB;AAGF,eAAa;;AAGf,OAAM,IAAI,MACR,kEAAkE,WAAW,sCAAsC,QAAQ,KAAK,GACjI"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ANSIColors, colorize } from "../logger.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/logStack.ts
|
|
4
|
+
const logStack = (message, options = { limit: 50 }) => {
|
|
5
|
+
Error.stackTraceLimit = options.limit;
|
|
6
|
+
try {
|
|
7
|
+
throw new Error("test");
|
|
8
|
+
} catch (error) {
|
|
9
|
+
console.log(colorize(message, ANSIColors.YELLOW));
|
|
10
|
+
console.log(colorize(error.stack ?? "", ANSIColors.BLUE));
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { logStack };
|
|
16
|
+
//# sourceMappingURL=logStack.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logStack.mjs","names":[],"sources":["../../../src/utils/logStack.ts"],"sourcesContent":["import { ANSIColors, colorize } from '../logger';\n\nexport const logStack = (\n message: string,\n options: { limit: number } = { limit: 50 }\n) => {\n Error.stackTraceLimit = options.limit;\n\n try {\n throw new Error('test');\n } catch (error) {\n console.log(colorize(message, ANSIColors.YELLOW));\n console.log(colorize((error as Error).stack ?? '', ANSIColors.BLUE));\n }\n};\n"],"mappings":";;;AAEA,MAAa,YACX,SACA,UAA6B,EAAE,OAAO,IAAI,KACvC;AACH,OAAM,kBAAkB,QAAQ;AAEhC,KAAI;AACF,QAAM,IAAI,MAAM,OAAO;UAChB,OAAO;AACd,UAAQ,IAAI,SAAS,SAAS,WAAW,OAAO,CAAC;AACjD,UAAQ,IAAI,SAAU,MAAgB,SAAS,IAAI,WAAW,KAAK,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
//#region src/utils/normalizePath.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a path for glob by replacing backslashes with forward slashes
|
|
4
|
+
*
|
|
5
|
+
* Utils for Windows compatibility, as Glob pattern as `**\\*.js` is not supported
|
|
6
|
+
*
|
|
7
|
+
* C:\\Users\\John\\Desktop\\test.txt -> C:/Users/John/Desktop/test.txt
|
|
8
|
+
*
|
|
9
|
+
* @param path - The path to normalize
|
|
10
|
+
* @returns The normalized path
|
|
11
|
+
*/
|
|
1
12
|
const normalizePath = (path) => path.replace(/\\/g, "/");
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { normalizePath };
|
|
5
16
|
//# sourceMappingURL=normalizePath.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":["/**\n * Normalize a path for glob by replacing backslashes with forward slashes\n *\n * Utils for Windows compatibility, as Glob pattern as `**\\\\*.js` is not supported\n *\n * C:\\\\Users\\\\John\\\\Desktop\\\\test.txt -> C:/Users/John/Desktop/test.txt\n *\n * @param path - The path to normalize\n * @returns The normalized path\n */\nexport const normalizePath = (path: string): string => path.replace(/\\\\/g, '/');\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizePath.mjs","names":[],"sources":["../../../src/utils/normalizePath.ts"],"sourcesContent":["/**\n * Normalize a path for glob by replacing backslashes with forward slashes\n *\n * Utils for Windows compatibility, as Glob pattern as `**\\\\*.js` is not supported\n *\n * C:\\\\Users\\\\John\\\\Desktop\\\\test.txt -> C:/Users/John/Desktop/test.txt\n *\n * @param path - The path to normalize\n * @returns The normalized path\n */\nexport const normalizePath = (path: string): string => path.replace(/\\\\/g, '/');\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,iBAAiB,SAAyB,KAAK,QAAQ,OAAO,IAAI"}
|
package/dist/types/alias.d.ts
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { IntlayerConfig } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { IntlayerConfig } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/alias.d.ts
|
|
4
|
+
type GetAliasOptions = {
|
|
5
|
+
configuration: IntlayerConfig;
|
|
6
|
+
format?: 'esm' | 'cjs';
|
|
7
|
+
formatter?: (value: string) => string;
|
|
6
8
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
declare const getAlias: ({
|
|
10
|
+
configuration,
|
|
11
|
+
format,
|
|
12
|
+
formatter
|
|
13
|
+
}: GetAliasOptions) => {
|
|
14
|
+
'@intlayer/dictionaries-entry': string;
|
|
15
|
+
'@intlayer/unmerged-dictionaries-entry': string;
|
|
16
|
+
'@intlayer/remote-dictionaries-entry': string;
|
|
17
|
+
'@intlayer/dynamic-dictionaries-entry': string;
|
|
18
|
+
'@intlayer/fetch-dictionaries-entry': string;
|
|
19
|
+
'@intlayer/config/built': string;
|
|
14
20
|
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { GetAliasOptions, getAlias };
|
|
15
23
|
//# sourceMappingURL=alias.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias.d.ts","
|
|
1
|
+
{"version":3,"file":"alias.d.ts","names":[],"sources":["../../src/alias.ts"],"sourcesContent":[],"mappings":";;;KAKY,eAAA;iBACK;EADL,MAAA,CAAA,EAAA,KAAA,GAAA,KAAe;EAMd,SAAA,CAAA,EA+FZ,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,MAAA;CA/FwB;AAAA,cAAZ,QAAY,EAAA,CAAA;EAAA,aAAA;EAAA,MAAA;EAAA;AAAA,CAAA,EAItB,eAJsB,EAAA,GAAA;EAAA,8BAAA,EAAA,MAAA;EAItB,uCAAA,EAAA,MAAA;EAAe,qCAAA,EAAA,MAAA"}
|
package/dist/types/built.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const configuration:
|
|
6
|
-
|
|
1
|
+
import { IntlayerConfig } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/built.d.ts
|
|
4
|
+
|
|
5
|
+
declare const configuration: IntlayerConfig;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { configuration as default };
|
|
7
8
|
//# sourceMappingURL=built.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built.d.ts","
|
|
1
|
+
{"version":3,"file":"built.d.ts","names":[],"sources":["../../src/built.ts"],"sourcesContent":[],"mappings":";;;;cAQM,eAAe"}
|
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
import * as esbuild0 from "esbuild";
|
|
2
|
+
import { BuildOptions } from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/bundleJSFile.d.ts
|
|
5
|
+
declare const bundleJSFile: (buildOptions: BuildOptions) => Promise<esbuild0.BuildResult<{
|
|
6
|
+
bundle: boolean;
|
|
7
|
+
splitting?: boolean;
|
|
8
|
+
preserveSymlinks?: boolean;
|
|
9
|
+
outfile?: string;
|
|
10
|
+
metafile?: boolean;
|
|
11
|
+
outdir?: string;
|
|
12
|
+
outbase?: string;
|
|
13
|
+
external?: string[];
|
|
14
|
+
packages: "bundle" | "external";
|
|
15
|
+
alias?: Record<string, string>;
|
|
16
|
+
loader: {
|
|
17
|
+
readonly '.js': "js";
|
|
18
|
+
readonly '.jsx': "jsx";
|
|
19
|
+
readonly '.mjs': "js";
|
|
20
|
+
readonly '.ts': "ts";
|
|
21
|
+
readonly '.tsx': "tsx";
|
|
22
|
+
readonly '.cjs': "js";
|
|
23
|
+
readonly '.json': "json";
|
|
24
|
+
readonly '.md': "text";
|
|
25
|
+
readonly '.mdx': "text";
|
|
26
|
+
} | {
|
|
27
|
+
[ext: string]: esbuild0.Loader;
|
|
28
|
+
};
|
|
29
|
+
resolveExtensions?: string[];
|
|
30
|
+
mainFields?: string[];
|
|
31
|
+
conditions?: string[];
|
|
32
|
+
write: boolean;
|
|
33
|
+
allowOverwrite?: boolean;
|
|
34
|
+
tsconfig?: string;
|
|
35
|
+
outExtension?: {
|
|
36
|
+
[ext: string]: string;
|
|
37
|
+
};
|
|
38
|
+
publicPath?: string;
|
|
39
|
+
entryNames?: string;
|
|
40
|
+
chunkNames?: string;
|
|
41
|
+
assetNames?: string;
|
|
42
|
+
inject?: string[];
|
|
43
|
+
banner?: {
|
|
44
|
+
[type: string]: string;
|
|
45
|
+
};
|
|
46
|
+
footer?: {
|
|
47
|
+
[type: string]: string;
|
|
48
|
+
};
|
|
49
|
+
entryPoints?: string[] | Record<string, string> | {
|
|
50
|
+
in: string;
|
|
51
|
+
out: string;
|
|
52
|
+
}[];
|
|
53
|
+
stdin?: esbuild0.StdinOptions;
|
|
54
|
+
plugins?: esbuild0.Plugin[];
|
|
55
|
+
absWorkingDir?: string;
|
|
56
|
+
nodePaths?: string[];
|
|
57
|
+
sourcemap: boolean | "linked" | "inline" | "external" | "both";
|
|
58
|
+
legalComments?: "none" | "inline" | "eof" | "linked" | "external";
|
|
59
|
+
sourceRoot?: string;
|
|
60
|
+
sourcesContent?: boolean;
|
|
61
|
+
format: esbuild0.Format;
|
|
62
|
+
globalName?: string;
|
|
63
|
+
target: string | string[];
|
|
64
|
+
supported?: Record<string, boolean>;
|
|
65
|
+
platform: esbuild0.Platform;
|
|
66
|
+
mangleProps?: RegExp;
|
|
67
|
+
reserveProps?: RegExp;
|
|
68
|
+
mangleQuoted?: boolean;
|
|
69
|
+
mangleCache?: Record<string, string | false>;
|
|
70
|
+
drop?: esbuild0.Drop[];
|
|
71
|
+
dropLabels?: string[];
|
|
72
|
+
minify?: boolean;
|
|
73
|
+
minifyWhitespace?: boolean;
|
|
74
|
+
minifyIdentifiers?: boolean;
|
|
75
|
+
minifySyntax?: boolean;
|
|
76
|
+
lineLimit?: number;
|
|
77
|
+
charset?: esbuild0.Charset;
|
|
78
|
+
treeShaking?: boolean;
|
|
79
|
+
ignoreAnnotations?: boolean;
|
|
80
|
+
jsx?: "transform" | "preserve" | "automatic";
|
|
81
|
+
jsxFactory?: string;
|
|
82
|
+
jsxFragment?: string;
|
|
83
|
+
jsxImportSource?: string;
|
|
84
|
+
jsxDev?: boolean;
|
|
85
|
+
jsxSideEffects?: boolean;
|
|
86
|
+
define?: {
|
|
87
|
+
[key: string]: string;
|
|
88
|
+
};
|
|
89
|
+
pure?: string[];
|
|
90
|
+
keepNames?: boolean;
|
|
91
|
+
color?: boolean;
|
|
92
|
+
logLevel: esbuild0.LogLevel;
|
|
93
|
+
logLimit?: number;
|
|
94
|
+
logOverride?: Record<string, esbuild0.LogLevel>;
|
|
95
|
+
tsconfigRaw?: string | esbuild0.TsconfigRaw;
|
|
94
96
|
}>>;
|
|
97
|
+
//#endregion
|
|
98
|
+
export { bundleJSFile };
|
|
95
99
|
//# sourceMappingURL=bundleJSFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleJSFile.d.ts","
|
|
1
|
+
{"version":3,"file":"bundleJSFile.d.ts","names":[],"sources":["../../src/bundleJSFile.ts"],"sourcesContent":[],"mappings":";;;;cAyBa,6BAAoC,iBAAY,iBAAA;;;EAAhD,gBAIT,CAAA,EAAA,OAAA;EAJ6C,OAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;QAAY,EAAA,MAAA,CAAA,iBAAA;EAAA,CAAA;EAAA,iBAAA,CAAA,EAAA,MAAA,EAAA"}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export type { LocalesValues } from './types/locales';
|
|
5
|
-
//# sourceMappingURL=client.d.ts.map
|
|
1
|
+
import { index_d_exports } from "./defaultValues/index.js";
|
|
2
|
+
import { ANSIColors, clock, colon, colorizeKey, colorizeLocales, colorizeNumber, colorizePath, getAppLogger, logger, spinnerFrames, v, x } from "./logger.js";
|
|
3
|
+
export { ANSIColors, index_d_exports as DefaultValues, clock, colon, colorizeKey, colorizeLocales, colorizeNumber, colorizePath, getAppLogger, logger, spinnerFrames, v, x };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CustomIntlayerConfig, IntlayerConfig, LogFunctions } from "@intlayer/types";
|
|
2
|
+
|
|
3
|
+
//#region src/configFile/buildConfigurationFields.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* Build the configuration fields by merging the default values with the custom configuration
|
|
4
7
|
*/
|
|
5
|
-
|
|
8
|
+
declare const buildConfigurationFields: (customConfiguration?: CustomIntlayerConfig, baseDir?: string, logFunctions?: LogFunctions) => IntlayerConfig;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { buildConfigurationFields };
|
|
6
11
|
//# sourceMappingURL=buildConfigurationFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildConfigurationFields.d.ts","
|
|
1
|
+
{"version":3,"file":"buildConfigurationFields.d.ts","names":[],"sources":["../../../src/configFile/buildConfigurationFields.ts"],"sourcesContent":[],"mappings":";;;;;;AA2wBA;AACwB,cADX,wBACW,EAAA,CAAA,mBAAA,CAAA,EAAA,oBAAA,EAAA,OAAA,CAAA,EAAA,MAAA,EAAA,YAAA,CAAA,EAEP,YAFO,EAAA,GAGrB,cAHqB"}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SandBoxContextOptions } from "../loadExternalFile/parseFileContent.js";
|
|
2
|
+
import { CustomIntlayerConfig, IntlayerConfig, LogFunctions } from "@intlayer/types";
|
|
3
|
+
|
|
4
|
+
//#region src/configFile/getConfiguration.d.ts
|
|
5
|
+
type GetConfigurationOptions = {
|
|
6
|
+
baseDir?: string;
|
|
7
|
+
override?: CustomIntlayerConfig;
|
|
8
|
+
env?: string;
|
|
9
|
+
envFile?: string;
|
|
10
|
+
logFunctions?: LogFunctions;
|
|
11
|
+
require?: NodeJS.Require;
|
|
12
|
+
} & Omit<SandBoxContextOptions, 'projectRequire'>;
|
|
13
|
+
type GetConfigurationAndFilePathResult = {
|
|
14
|
+
configuration: IntlayerConfig;
|
|
15
|
+
configurationFilePath: string | undefined;
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
declare const getConfigurationAndFilePath: (options?: GetConfigurationOptions) => GetConfigurationAndFilePathResult;
|
|
19
21
|
/**
|
|
20
22
|
* Get the configuration for the intlayer by reading the configuration file (e.g. intlayer.config.js)
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
declare const getConfiguration: (options?: GetConfigurationOptions) => IntlayerConfig;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { GetConfigurationAndFilePathResult, GetConfigurationOptions, getConfiguration, getConfigurationAndFilePath };
|
|
23
27
|
//# sourceMappingURL=getConfiguration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.d.ts","
|
|
1
|
+
{"version":3,"file":"getConfiguration.d.ts","names":[],"sources":["../../../src/configFile/getConfiguration.ts"],"sourcesContent":[],"mappings":";;;;KAeY,uBAAA;;EAAA,QAAA,CAAA,EAEC,oBAFsB;EAEtB,GAAA,CAAA,EAAA,MAAA;EAKI,OAAA,CAAA,EAAA,MAAA;EAEL,YAAO,CAAA,EAFF,YAEE;EACV,OAAA,CAAA,EADG,MAAA,CAAO,OACV;CAAL,GAAA,IAAA,CAAK,qBAAL,EAAA,gBAAA,CAAA;AAAI,KAEI,iCAAA,GAFJ;EAEI,aAAA,EACK,cADL;EAQC,qBAAA,EAAA,MAAA,GAiFZ,SAAA;AAKD,CAAA;;;;cAtFa,wCACD,4BACT;;;;cAoFU,6BACD,4BACT"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { buildConfigurationFields } from "./buildConfigurationFields.js";
|
|
2
|
+
import { GetConfigurationAndFilePathResult, GetConfigurationOptions, getConfiguration, getConfigurationAndFilePath } from "./getConfiguration.js";
|
|
3
|
+
import { searchConfigurationFile } from "./searchConfigurationFile.js";
|
|
4
|
+
export { GetConfigurationAndFilePathResult, GetConfigurationOptions, buildConfigurationFields, getConfiguration, getConfigurationAndFilePath, searchConfigurationFile };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { LoadExternalFileOptions } from "../loadExternalFile/loadExternalFile.js";
|
|
2
|
+
import { CustomIntlayerConfig } from "@intlayer/types";
|
|
3
|
+
|
|
4
|
+
//#region src/configFile/loadConfigurationFile.d.ts
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* Load the configuration file from the given path
|
|
5
8
|
* Example of configuration file: intlayer.config.js
|
|
6
9
|
*
|
|
7
10
|
* Accepts JSON, JS, MJS and TS files as configuration
|
|
8
11
|
*/
|
|
9
|
-
|
|
12
|
+
declare const loadConfigurationFile: (configFilePath: string, options?: Omit<LoadExternalFileOptions, "configuration">) => CustomIntlayerConfig | undefined;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { loadConfigurationFile };
|
|
10
15
|
//# sourceMappingURL=loadConfigurationFile.d.ts.map
|