intlayer-editor 7.1.4 → 7.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/{CodeBlockShiki-DKhht_eB.js → CodeBlockShiki-0jwM_dRT.js} +8 -8
- package/client/dist/assets/{angular-html-CqDu7dYI.js → angular-html-ChYFFmg7.js} +1 -1
- package/client/dist/assets/{angular-ts-JUgYMaAO.js → angular-ts-CpuGw9DZ.js} +3 -3
- package/client/dist/assets/{astro-DgRPb09x.js → astro-B0lt4qz0.js} +2 -2
- package/client/dist/assets/{blade-BNo76U2i.js → blade-DtOFwYfC.js} +3 -3
- package/client/dist/assets/{bundle-web-Cw-fHx1Z.js → bundle-web-DGfBFzL-.js} +91 -54
- package/client/dist/assets/catppuccin-frappe-C21OPQfC.js +4 -0
- package/client/dist/assets/catppuccin-latte-0ZtXlsrX.js +4 -0
- package/client/dist/assets/catppuccin-macchiato-BD_FR4sl.js +4 -0
- package/client/dist/assets/catppuccin-mocha-C653csR5.js +4 -0
- package/client/dist/assets/{coffee-DRmm8L99.js → coffee-DJkIX6_2.js} +1 -1
- package/client/dist/assets/csv-Ba84L8e5.js +7 -0
- package/client/dist/assets/{dark-plus-DmZ1Dzd4.js → dark-plus-D1BtfNxb.js} +1 -1
- package/client/dist/assets/{graphql-BRx9mrhY.js → graphql-oNSp8dGZ.js} +2 -2
- package/client/dist/assets/{gruvbox-dark-hard-C89wZ4s3.js → gruvbox-dark-hard-DVsRsETr.js} +1 -1
- package/client/dist/assets/{gruvbox-dark-medium-swz85q_b.js → gruvbox-dark-medium-B5JBrQdg.js} +1 -1
- package/client/dist/assets/{gruvbox-dark-soft-BYHBHQJW.js → gruvbox-dark-soft-Db-YOqRx.js} +1 -1
- package/client/dist/assets/{gruvbox-light-hard-DEF_ZxYZ.js → gruvbox-light-hard-CXzJt7DI.js} +1 -1
- package/client/dist/assets/{gruvbox-light-medium-ziUMnHJx.js → gruvbox-light-medium-B89RAI1Y.js} +1 -1
- package/client/dist/assets/{gruvbox-light-soft-Cuwp0tsB.js → gruvbox-light-soft-Cs0hTZYv.js} +1 -1
- package/client/dist/assets/{haml-O037W7a8.js → haml-BJ44RGT2.js} +1 -1
- package/client/dist/assets/{handlebars-kwM0CYPJ.js → handlebars-DTnHNTeU.js} +2 -2
- package/client/dist/assets/{html-Dkr1GMsP.js → html-BOjX3v2Q.js} +1 -1
- package/client/dist/assets/{html-derivative-9rfoponC.js → html-derivative-Cswrtqyq.js} +2 -2
- package/client/dist/assets/{http-CB4Cm8yY.js → http-B1QlEqj7.js} +3 -3
- package/client/dist/assets/hurl-Br_hZn4E.js +18 -0
- package/client/dist/assets/{index-wlmXkWJe.js → index-BscemyLr.js} +3188 -12455
- package/client/dist/assets/{index-HnG5A4Ve.css → index-UvWk4YN-.css} +0 -42
- package/client/dist/assets/{javascript-BXO33K-2.js → javascript-DLs729Nk.js} +1 -1
- package/client/dist/assets/{jinja-DX5epABU.js → jinja-BAZ4h1JD.js} +2 -2
- package/client/dist/assets/{jison-5-r4c8L1.js → jison-Bwp1bXaL.js} +1 -1
- package/client/dist/assets/{julia-CSYRDJn0.js → julia-D0f5tMoo.js} +1 -1
- package/client/dist/assets/{marko-D6KBFqYp.js → marko-rwefYVra.js} +1 -1
- package/client/dist/assets/{mdc-N73HqDUD.js → mdc-ucHOH9Vl.js} +3 -3
- package/client/dist/assets/{php-D0sxH1LE.js → php-CI-6KGJr.js} +2 -2
- package/client/dist/assets/{pug-HL4PJmfE.js → pug-C-LeC0-n.js} +2 -2
- package/client/dist/assets/{svelte-zeq24KqG.js → svelte-CYSO_rLN.js} +2 -2
- package/client/dist/assets/{ts-tags-CINmazHI.js → ts-tags-DCkNjov3.js} +3 -3
- package/client/dist/assets/{typescript-j4TNaYMi.js → typescript-Cju7JbYj.js} +1 -1
- package/client/dist/assets/{vue-CV5z08t_.js → vue-M1-XqLgv.js} +4 -4
- package/client/dist/assets/{vue-html-k04GfWOW.js → vue-html-BzXE5pTE.js} +5 -5
- package/client/dist/assets/{vue-vine-BL_nHMoY.js → vue-vine-BT_ihGGO.js} +5 -5
- package/client/dist/index.html +2 -2
- package/package.json +17 -16
- package/server/dist/_virtual/rolldown_runtime.cjs +0 -4
- package/server/dist/controllers/dictionary.controller.cjs +2 -2
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +1 -1
- package/server/dist/index.cjs +1 -1
- package/server/dist/index.mjs +1 -1
- package/client/dist/assets/catppuccin-frappe-CHwQEOgD.js +0 -4
- package/client/dist/assets/catppuccin-latte-CmwvB_4H.js +0 -4
- package/client/dist/assets/catppuccin-macchiato-CnXZ85T9.js +0 -4
- package/client/dist/assets/catppuccin-mocha-CSstQplL.js +0 -4
- package/server/dist/_virtual/rolldown_runtime.mjs +0 -31
- package/server/dist/controllers/configuration.controller.d.ts.map +0 -1
- package/server/dist/controllers/dictionary.controller.d.ts.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.cjs +0 -99
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs +0 -98
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +0 -36
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +0 -35
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs +0 -18
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs +0 -17
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.cjs +0 -25
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +0 -24
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.cjs +0 -72
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +0 -71
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.cjs +0 -1744
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.mjs +0 -1743
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs +0 -115
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +0 -114
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.cjs +0 -66
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.cjs.map +0 -1
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.mjs +0 -65
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +0 -1
- package/server/dist/routes/config.routes.d.ts.map +0 -1
- package/server/dist/routes/dictionary.routes.d.ts.map +0 -1
- package/server/dist/types/Routes.d.ts.map +0 -1
- package/server/dist/utils/checkPortAvailability.d.ts.map +0 -1
- package/server/dist/utils/httpStatusCodes.d.ts.map +0 -1
- package/server/dist/utils/responseData.d.ts.map +0 -1
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require__utils_asset = require('../_virtual/_utils_asset.cjs');
|
|
3
|
-
let __intlayer_config = require("@intlayer/config");
|
|
4
|
-
|
|
5
|
-
//#region ../@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs
|
|
6
|
-
const getContentDeclarationFileTemplate = async (key, format, fileParams = {}) => {
|
|
7
|
-
let fileTemplate;
|
|
8
|
-
switch (format) {
|
|
9
|
-
case "ts":
|
|
10
|
-
fileTemplate = "./tsTemplate.txt";
|
|
11
|
-
break;
|
|
12
|
-
case "cjs":
|
|
13
|
-
fileTemplate = "./cjsTemplate.txt";
|
|
14
|
-
break;
|
|
15
|
-
case "json":
|
|
16
|
-
fileTemplate = "./jsonTemplate.txt";
|
|
17
|
-
break;
|
|
18
|
-
default:
|
|
19
|
-
fileTemplate = "./esmTemplate.txt";
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
const fileContent = require__utils_asset.readAsset(fileTemplate);
|
|
23
|
-
const camelCaseKey = (0, __intlayer_config.kebabCaseToCamelCase)(key);
|
|
24
|
-
const nonCapitalizedCamelCaseKey = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);
|
|
25
|
-
const fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([key$1, value]) => {
|
|
26
|
-
if (typeof value === "object") return `\n '${key$1}': ${JSON.stringify(value)},`;
|
|
27
|
-
if (typeof value === "boolean" || typeof value === "number") return `\n '${key$1}': ${value},`;
|
|
28
|
-
if (typeof value === "string") return `\n '${key$1}': '${value}',`;
|
|
29
|
-
return `\n '${key$1}': ${value},`;
|
|
30
|
-
}).join("");
|
|
31
|
-
return fileContent.replace("{{key}}", key).replaceAll("{{name}}", nonCapitalizedCamelCaseKey).replace("{{fileParams}}", fileParamsString);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.getContentDeclarationFileTemplate = getContentDeclarationFileTemplate;
|
|
36
|
-
//# sourceMappingURL=getContentDeclarationFileTemplate.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getContentDeclarationFileTemplate.cjs","names":["readAsset"],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs"],"sourcesContent":["import { readAsset } from \"../_virtual/_utils_asset.mjs\";\nimport { kebabCaseToCamelCase } from \"@intlayer/config\";\n\n//#region src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts\nconst getContentDeclarationFileTemplate = async (key, format, fileParams = {}) => {\n\tlet fileTemplate;\n\tswitch (format) {\n\t\tcase \"ts\":\n\t\t\tfileTemplate = \"./tsTemplate.txt\";\n\t\t\tbreak;\n\t\tcase \"cjs\":\n\t\t\tfileTemplate = \"./cjsTemplate.txt\";\n\t\t\tbreak;\n\t\tcase \"json\":\n\t\t\tfileTemplate = \"./jsonTemplate.txt\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfileTemplate = \"./esmTemplate.txt\";\n\t\t\tbreak;\n\t}\n\tconst fileContent = readAsset(fileTemplate);\n\tconst camelCaseKey = kebabCaseToCamelCase(key);\n\tconst nonCapitalizedCamelCaseKey = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\tconst fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([key$1, value]) => {\n\t\tif (typeof value === \"object\") return `\\n '${key$1}': ${JSON.stringify(value)},`;\n\t\tif (typeof value === \"boolean\" || typeof value === \"number\") return `\\n '${key$1}': ${value},`;\n\t\tif (typeof value === \"string\") return `\\n '${key$1}': '${value}',`;\n\t\treturn `\\n '${key$1}': ${value},`;\n\t}).join(\"\");\n\treturn fileContent.replace(\"{{key}}\", key).replaceAll(\"{{name}}\", nonCapitalizedCamelCaseKey).replace(\"{{fileParams}}\", fileParamsString);\n};\n\n//#endregion\nexport { getContentDeclarationFileTemplate };\n//# sourceMappingURL=getContentDeclarationFileTemplate.mjs.map"],"mappings":";;;;;AAIA,MAAM,oCAAoC,OAAO,KAAK,QAAQ,aAAa,EAAE,KAAK;CACjF,IAAI;AACJ,SAAQ,QAAR;EACC,KAAK;AACJ,kBAAe;AACf;EACD,KAAK;AACJ,kBAAe;AACf;EACD,KAAK;AACJ,kBAAe;AACf;EACD;AACC,kBAAe;AACf;;CAEF,MAAM,cAAcA,+BAAU,aAAa;CAC3C,MAAM,2DAAoC,IAAI;CAC9C,MAAM,6BAA6B,aAAa,OAAO,EAAE,CAAC,aAAa,GAAG,aAAa,MAAM,EAAE;CAC/F,MAAM,mBAAmB,OAAO,QAAQ,WAAW,CAAC,QAAQ,GAAG,WAAW,UAAU,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,WAAW;AACnH,MAAI,OAAO,UAAU,SAAU,QAAO,QAAQ,MAAM,KAAK,KAAK,UAAU,MAAM,CAAC;AAC/E,MAAI,OAAO,UAAU,aAAa,OAAO,UAAU,SAAU,QAAO,QAAQ,MAAM,KAAK,MAAM;AAC7F,MAAI,OAAO,UAAU,SAAU,QAAO,QAAQ,MAAM,MAAM,MAAM;AAChE,SAAO,QAAQ,MAAM,KAAK,MAAM;GAC/B,CAAC,KAAK,GAAG;AACX,QAAO,YAAY,QAAQ,WAAW,IAAI,CAAC,WAAW,YAAY,2BAA2B,CAAC,QAAQ,kBAAkB,iBAAiB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { readAsset } from "../_virtual/_utils_asset.mjs";
|
|
2
|
-
import { kebabCaseToCamelCase } from "@intlayer/config";
|
|
3
|
-
|
|
4
|
-
//#region ../@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs
|
|
5
|
-
const getContentDeclarationFileTemplate = async (key, format, fileParams = {}) => {
|
|
6
|
-
let fileTemplate;
|
|
7
|
-
switch (format) {
|
|
8
|
-
case "ts":
|
|
9
|
-
fileTemplate = "./tsTemplate.txt";
|
|
10
|
-
break;
|
|
11
|
-
case "cjs":
|
|
12
|
-
fileTemplate = "./cjsTemplate.txt";
|
|
13
|
-
break;
|
|
14
|
-
case "json":
|
|
15
|
-
fileTemplate = "./jsonTemplate.txt";
|
|
16
|
-
break;
|
|
17
|
-
default:
|
|
18
|
-
fileTemplate = "./esmTemplate.txt";
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
const fileContent = readAsset(fileTemplate);
|
|
22
|
-
const camelCaseKey = kebabCaseToCamelCase(key);
|
|
23
|
-
const nonCapitalizedCamelCaseKey = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);
|
|
24
|
-
const fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([key$1, value]) => {
|
|
25
|
-
if (typeof value === "object") return `\n '${key$1}': ${JSON.stringify(value)},`;
|
|
26
|
-
if (typeof value === "boolean" || typeof value === "number") return `\n '${key$1}': ${value},`;
|
|
27
|
-
if (typeof value === "string") return `\n '${key$1}': '${value}',`;
|
|
28
|
-
return `\n '${key$1}': ${value},`;
|
|
29
|
-
}).join("");
|
|
30
|
-
return fileContent.replace("{{key}}", key).replaceAll("{{name}}", nonCapitalizedCamelCaseKey).replace("{{fileParams}}", fileParamsString);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
|
-
export { getContentDeclarationFileTemplate };
|
|
35
|
-
//# sourceMappingURL=getContentDeclarationFileTemplate.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getContentDeclarationFileTemplate.mjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs"],"sourcesContent":["import { readAsset } from \"../_virtual/_utils_asset.mjs\";\nimport { kebabCaseToCamelCase } from \"@intlayer/config\";\n\n//#region src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts\nconst getContentDeclarationFileTemplate = async (key, format, fileParams = {}) => {\n\tlet fileTemplate;\n\tswitch (format) {\n\t\tcase \"ts\":\n\t\t\tfileTemplate = \"./tsTemplate.txt\";\n\t\t\tbreak;\n\t\tcase \"cjs\":\n\t\t\tfileTemplate = \"./cjsTemplate.txt\";\n\t\t\tbreak;\n\t\tcase \"json\":\n\t\t\tfileTemplate = \"./jsonTemplate.txt\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfileTemplate = \"./esmTemplate.txt\";\n\t\t\tbreak;\n\t}\n\tconst fileContent = readAsset(fileTemplate);\n\tconst camelCaseKey = kebabCaseToCamelCase(key);\n\tconst nonCapitalizedCamelCaseKey = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\tconst fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([key$1, value]) => {\n\t\tif (typeof value === \"object\") return `\\n '${key$1}': ${JSON.stringify(value)},`;\n\t\tif (typeof value === \"boolean\" || typeof value === \"number\") return `\\n '${key$1}': ${value},`;\n\t\tif (typeof value === \"string\") return `\\n '${key$1}': '${value}',`;\n\t\treturn `\\n '${key$1}': ${value},`;\n\t}).join(\"\");\n\treturn fileContent.replace(\"{{key}}\", key).replaceAll(\"{{name}}\", nonCapitalizedCamelCaseKey).replace(\"{{fileParams}}\", fileParamsString);\n};\n\n//#endregion\nexport { getContentDeclarationFileTemplate };\n//# sourceMappingURL=getContentDeclarationFileTemplate.mjs.map"],"mappings":";;;;AAIA,MAAM,oCAAoC,OAAO,KAAK,QAAQ,aAAa,EAAE,KAAK;CACjF,IAAI;AACJ,SAAQ,QAAR;EACC,KAAK;AACJ,kBAAe;AACf;EACD,KAAK;AACJ,kBAAe;AACf;EACD,KAAK;AACJ,kBAAe;AACf;EACD;AACC,kBAAe;AACf;;CAEF,MAAM,cAAc,UAAU,aAAa;CAC3C,MAAM,eAAe,qBAAqB,IAAI;CAC9C,MAAM,6BAA6B,aAAa,OAAO,EAAE,CAAC,aAAa,GAAG,aAAa,MAAM,EAAE;CAC/F,MAAM,mBAAmB,OAAO,QAAQ,WAAW,CAAC,QAAQ,GAAG,WAAW,UAAU,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,WAAW;AACnH,MAAI,OAAO,UAAU,SAAU,QAAO,QAAQ,MAAM,KAAK,KAAK,UAAU,MAAM,CAAC;AAC/E,MAAI,OAAO,UAAU,aAAa,OAAO,UAAU,SAAU,QAAO,QAAQ,MAAM,KAAK,MAAM;AAC7F,MAAI,OAAO,UAAU,SAAU,QAAO,QAAQ,MAAM,MAAM,MAAM;AAChE,SAAO,QAAQ,MAAM,KAAK,MAAM;GAC/B,CAAC,KAAK,GAAG;AACX,QAAO,YAAY,QAAQ,WAAW,IAAI,CAAC,WAAW,YAAY,2BAA2B,CAAC,QAAQ,kBAAkB,iBAAiB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs
|
|
3
|
-
const getFormatFromExtension = (extension) => {
|
|
4
|
-
switch (extension) {
|
|
5
|
-
case ".ts":
|
|
6
|
-
case ".tsx": return "ts";
|
|
7
|
-
case ".cjs":
|
|
8
|
-
case ".cjsx": return "cjs";
|
|
9
|
-
case ".mjs": return "esm";
|
|
10
|
-
case ".json":
|
|
11
|
-
case ".json5": return "json";
|
|
12
|
-
}
|
|
13
|
-
return "esm";
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
exports.getFormatFromExtension = getFormatFromExtension;
|
|
18
|
-
//# sourceMappingURL=getFormatFromExtension.cjs.map
|
package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFormatFromExtension.cjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs"],"sourcesContent":["//#region src/utils/getFormatFromExtension.ts\nconst getFormatFromExtension = (extension) => {\n\tswitch (extension) {\n\t\tcase \".ts\":\n\t\tcase \".tsx\": return \"ts\";\n\t\tcase \".cjs\":\n\t\tcase \".cjsx\": return \"cjs\";\n\t\tcase \".mjs\": return \"esm\";\n\t\tcase \".json\":\n\t\tcase \".json5\": return \"json\";\n\t}\n\treturn \"esm\";\n};\nconst getExtensionFromFormat = (format) => {\n\tswitch (format) {\n\t\tcase \"ts\": return \".ts\";\n\t\tcase \"cjs\": return \".cjs\";\n\t\tcase \"json\": return \".json\";\n\t\tcase \"esm\": return \".mjs\";\n\t}\n\treturn \".mjs\";\n};\n\n//#endregion\nexport { getExtensionFromFormat, getFormatFromExtension };\n//# sourceMappingURL=getFormatFromExtension.mjs.map"],"mappings":";;AACA,MAAM,0BAA0B,cAAc;AAC7C,SAAQ,WAAR;EACC,KAAK;EACL,KAAK,OAAQ,QAAO;EACpB,KAAK;EACL,KAAK,QAAS,QAAO;EACrB,KAAK,OAAQ,QAAO;EACpB,KAAK;EACL,KAAK,SAAU,QAAO;;AAEvB,QAAO"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region ../@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs
|
|
2
|
-
const getFormatFromExtension = (extension) => {
|
|
3
|
-
switch (extension) {
|
|
4
|
-
case ".ts":
|
|
5
|
-
case ".tsx": return "ts";
|
|
6
|
-
case ".cjs":
|
|
7
|
-
case ".cjsx": return "cjs";
|
|
8
|
-
case ".mjs": return "esm";
|
|
9
|
-
case ".json":
|
|
10
|
-
case ".json5": return "json";
|
|
11
|
-
}
|
|
12
|
-
return "esm";
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { getFormatFromExtension };
|
|
17
|
-
//# sourceMappingURL=getFormatFromExtension.mjs.map
|
package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFormatFromExtension.mjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs"],"sourcesContent":["//#region src/utils/getFormatFromExtension.ts\nconst getFormatFromExtension = (extension) => {\n\tswitch (extension) {\n\t\tcase \".ts\":\n\t\tcase \".tsx\": return \"ts\";\n\t\tcase \".cjs\":\n\t\tcase \".cjsx\": return \"cjs\";\n\t\tcase \".mjs\": return \"esm\";\n\t\tcase \".json\":\n\t\tcase \".json5\": return \"json\";\n\t}\n\treturn \"esm\";\n};\nconst getExtensionFromFormat = (format) => {\n\tswitch (format) {\n\t\tcase \"ts\": return \".ts\";\n\t\tcase \"cjs\": return \".cjs\";\n\t\tcase \"json\": return \".json\";\n\t\tcase \"esm\": return \".mjs\";\n\t}\n\treturn \".mjs\";\n};\n\n//#endregion\nexport { getExtensionFromFormat, getFormatFromExtension };\n//# sourceMappingURL=getFormatFromExtension.mjs.map"],"mappings":";AACA,MAAM,0BAA0B,cAAc;AAC7C,SAAQ,WAAR;EACC,KAAK;EACL,KAAK,OAAQ,QAAO;EACpB,KAAK;EACL,KAAK,QAAS,QAAO;EACrB,KAAK,OAAQ,QAAO;EACpB,KAAK;EACL,KAAK,SAAU,QAAO;;AAEvB,QAAO"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __intlayer_config = require("@intlayer/config");
|
|
3
|
-
|
|
4
|
-
//#region ../@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs
|
|
5
|
-
const detectFormatCommand = (configuration) => {
|
|
6
|
-
const { formatCommand } = configuration.content;
|
|
7
|
-
const projectRequire = (0, __intlayer_config.getProjectRequire)();
|
|
8
|
-
if (formatCommand) return formatCommand;
|
|
9
|
-
try {
|
|
10
|
-
projectRequire.resolve("prettier");
|
|
11
|
-
return "prettier --write \"{{file}}\" --log-level silent";
|
|
12
|
-
} catch (_error) {}
|
|
13
|
-
try {
|
|
14
|
-
projectRequire.resolve("biome");
|
|
15
|
-
return "biome format \"{{file}}\" --write --log-level none";
|
|
16
|
-
} catch (_error) {}
|
|
17
|
-
try {
|
|
18
|
-
projectRequire.resolve("eslint");
|
|
19
|
-
return "eslint --fix \"{{file}}\" --quiet";
|
|
20
|
-
} catch (_error) {}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.detectFormatCommand = detectFormatCommand;
|
|
25
|
-
//# sourceMappingURL=detectFormatCommand.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detectFormatCommand.cjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs"],"sourcesContent":["import { getProjectRequire } from \"@intlayer/config\";\n\n//#region src/writeContentDeclaration/detectFormatCommand.ts\nconst detectFormatCommand = (configuration) => {\n\tconst { formatCommand } = configuration.content;\n\tconst projectRequire = getProjectRequire();\n\tif (formatCommand) return formatCommand;\n\ttry {\n\t\tprojectRequire.resolve(\"prettier\");\n\t\treturn \"prettier --write \\\"{{file}}\\\" --log-level silent\";\n\t} catch (_error) {}\n\ttry {\n\t\tprojectRequire.resolve(\"biome\");\n\t\treturn \"biome format \\\"{{file}}\\\" --write --log-level none\";\n\t} catch (_error) {}\n\ttry {\n\t\tprojectRequire.resolve(\"eslint\");\n\t\treturn \"eslint --fix \\\"{{file}}\\\" --quiet\";\n\t} catch (_error) {}\n};\n\n//#endregion\nexport { detectFormatCommand };\n//# sourceMappingURL=detectFormatCommand.mjs.map"],"mappings":";;;;AAGA,MAAM,uBAAuB,kBAAkB;CAC9C,MAAM,EAAE,kBAAkB,cAAc;CACxC,MAAM,2DAAoC;AAC1C,KAAI,cAAe,QAAO;AAC1B,KAAI;AACH,iBAAe,QAAQ,WAAW;AAClC,SAAO;UACC,QAAQ;AACjB,KAAI;AACH,iBAAe,QAAQ,QAAQ;AAC/B,SAAO;UACC,QAAQ;AACjB,KAAI;AACH,iBAAe,QAAQ,SAAS;AAChC,SAAO;UACC,QAAQ"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getProjectRequire } from "@intlayer/config";
|
|
2
|
-
|
|
3
|
-
//#region ../@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs
|
|
4
|
-
const detectFormatCommand = (configuration) => {
|
|
5
|
-
const { formatCommand } = configuration.content;
|
|
6
|
-
const projectRequire = getProjectRequire();
|
|
7
|
-
if (formatCommand) return formatCommand;
|
|
8
|
-
try {
|
|
9
|
-
projectRequire.resolve("prettier");
|
|
10
|
-
return "prettier --write \"{{file}}\" --log-level silent";
|
|
11
|
-
} catch (_error) {}
|
|
12
|
-
try {
|
|
13
|
-
projectRequire.resolve("biome");
|
|
14
|
-
return "biome format \"{{file}}\" --write --log-level none";
|
|
15
|
-
} catch (_error) {}
|
|
16
|
-
try {
|
|
17
|
-
projectRequire.resolve("eslint");
|
|
18
|
-
return "eslint --fix \"{{file}}\" --quiet";
|
|
19
|
-
} catch (_error) {}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { detectFormatCommand };
|
|
24
|
-
//# sourceMappingURL=detectFormatCommand.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detectFormatCommand.mjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs"],"sourcesContent":["import { getProjectRequire } from \"@intlayer/config\";\n\n//#region src/writeContentDeclaration/detectFormatCommand.ts\nconst detectFormatCommand = (configuration) => {\n\tconst { formatCommand } = configuration.content;\n\tconst projectRequire = getProjectRequire();\n\tif (formatCommand) return formatCommand;\n\ttry {\n\t\tprojectRequire.resolve(\"prettier\");\n\t\treturn \"prettier --write \\\"{{file}}\\\" --log-level silent\";\n\t} catch (_error) {}\n\ttry {\n\t\tprojectRequire.resolve(\"biome\");\n\t\treturn \"biome format \\\"{{file}}\\\" --write --log-level none\";\n\t} catch (_error) {}\n\ttry {\n\t\tprojectRequire.resolve(\"eslint\");\n\t\treturn \"eslint --fix \\\"{{file}}\\\" --quiet\";\n\t} catch (_error) {}\n};\n\n//#endregion\nexport { detectFormatCommand };\n//# sourceMappingURL=detectFormatCommand.mjs.map"],"mappings":";;;AAGA,MAAM,uBAAuB,kBAAkB;CAC9C,MAAM,EAAE,kBAAkB,cAAc;CACxC,MAAM,iBAAiB,mBAAmB;AAC1C,KAAI,cAAe,QAAO;AAC1B,KAAI;AACH,iBAAe,QAAQ,WAAW;AAClC,SAAO;UACC,QAAQ;AACjB,KAAI;AACH,iBAAe,QAAQ,QAAQ;AAC/B,SAAO;UACC,QAAQ;AACjB,KAAI;AACH,iBAAe,QAAQ,SAAS;AAChC,SAAO;UACC,QAAQ"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __intlayer_config = require("@intlayer/config");
|
|
3
|
-
let node_fs = require("node:fs");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let __intlayer_core = require("@intlayer/core");
|
|
6
|
-
let __intlayer_types = require("@intlayer/types");
|
|
7
|
-
|
|
8
|
-
//#region ../@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs
|
|
9
|
-
/**
|
|
10
|
-
* Write file plugin
|
|
11
|
-
*/
|
|
12
|
-
const writeFilePlugin = {
|
|
13
|
-
id: "write-file-plugin",
|
|
14
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === __intlayer_types.NodeType.File,
|
|
15
|
-
transform: (node) => {
|
|
16
|
-
const fileContent = node.content;
|
|
17
|
-
const filePath = node.fixedPath;
|
|
18
|
-
if (typeof fileContent !== "string") throw new Error("File content must be a string");
|
|
19
|
-
if (typeof filePath !== "string") throw new Error("File path must be a string");
|
|
20
|
-
try {
|
|
21
|
-
const absoluteFilePath = (0, node_path.join)(process.cwd(), filePath);
|
|
22
|
-
const fileDirectory = (0, node_path.dirname)(absoluteFilePath);
|
|
23
|
-
if (!(0, node_fs.existsSync)(fileDirectory)) (0, node_fs.mkdirSync)(fileDirectory, { recursive: true });
|
|
24
|
-
(0, node_fs.writeFileSync)(absoluteFilePath, fileContent);
|
|
25
|
-
} catch (error) {
|
|
26
|
-
throw new Error(`${__intlayer_config.x} Error writing file to ${(0, __intlayer_config.colorizePath)(filePath)}: ${error}`);
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
nodeType: __intlayer_types.NodeType.File,
|
|
30
|
-
[__intlayer_types.NodeType.File]: node.file
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Markdown file plugin
|
|
36
|
-
*/
|
|
37
|
-
const markdownFilePlugin = {
|
|
38
|
-
id: "markdown-file-plugin",
|
|
39
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === __intlayer_types.NodeType.Markdown,
|
|
40
|
-
transform: (node, props, deepTransformNode$1) => {
|
|
41
|
-
return {
|
|
42
|
-
nodeType: __intlayer_types.NodeType.Markdown,
|
|
43
|
-
[__intlayer_types.NodeType.Markdown]: deepTransformNode$1(node.markdown, props)
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Insertion file plugin
|
|
49
|
-
*/
|
|
50
|
-
const insertionFilePlugin = {
|
|
51
|
-
id: "insertion-file-plugin",
|
|
52
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === __intlayer_types.NodeType.Insertion,
|
|
53
|
-
transform: (node, props, deepTransformNode$1) => {
|
|
54
|
-
return {
|
|
55
|
-
nodeType: __intlayer_types.NodeType.Insertion,
|
|
56
|
-
[__intlayer_types.NodeType.Insertion]: deepTransformNode$1(node.insertion, props)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const processContentDeclarationContent = async (dictionary) => (0, __intlayer_core.deepTransformNode)(dictionary, {
|
|
61
|
-
dictionaryKey: dictionary.key,
|
|
62
|
-
keyPath: [],
|
|
63
|
-
plugins: [
|
|
64
|
-
writeFilePlugin,
|
|
65
|
-
markdownFilePlugin,
|
|
66
|
-
insertionFilePlugin
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
//#endregion
|
|
71
|
-
exports.processContentDeclarationContent = processContentDeclarationContent;
|
|
72
|
-
//# sourceMappingURL=processContentDeclarationContent.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processContentDeclarationContent.cjs","names":["NodeType","x"],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { colorizePath, x } from \"@intlayer/config\";\nimport { dirname, join } from \"node:path\";\nimport { deepTransformNode } from \"@intlayer/core\";\nimport { NodeType } from \"@intlayer/types\";\n\n//#region src/writeContentDeclaration/processContentDeclarationContent.ts\n/**\n* Write file plugin\n*/\nconst writeFilePlugin = {\n\tid: \"write-file-plugin\",\n\tcanHandle: (node) => typeof node === \"object\" && node?.nodeType === NodeType.File,\n\ttransform: (node) => {\n\t\tconst fileContent = node.content;\n\t\tconst filePath = node.fixedPath;\n\t\tif (typeof fileContent !== \"string\") throw new Error(\"File content must be a string\");\n\t\tif (typeof filePath !== \"string\") throw new Error(\"File path must be a string\");\n\t\ttry {\n\t\t\tconst absoluteFilePath = join(process.cwd(), filePath);\n\t\t\tconst fileDirectory = dirname(absoluteFilePath);\n\t\t\tif (!existsSync(fileDirectory)) mkdirSync(fileDirectory, { recursive: true });\n\t\t\twriteFileSync(absoluteFilePath, fileContent);\n\t\t} catch (error) {\n\t\t\tthrow new Error(`${x} Error writing file to ${colorizePath(filePath)}: ${error}`);\n\t\t}\n\t\treturn {\n\t\t\tnodeType: NodeType.File,\n\t\t\t[NodeType.File]: node.file\n\t\t};\n\t}\n};\n/**\n* Markdown file plugin\n*/\nconst markdownFilePlugin = {\n\tid: \"markdown-file-plugin\",\n\tcanHandle: (node) => typeof node === \"object\" && node?.nodeType === NodeType.Markdown,\n\ttransform: (node, props, deepTransformNode$1) => {\n\t\treturn {\n\t\t\tnodeType: NodeType.Markdown,\n\t\t\t[NodeType.Markdown]: deepTransformNode$1(node.markdown, props)\n\t\t};\n\t}\n};\n/**\n* Insertion file plugin\n*/\nconst insertionFilePlugin = {\n\tid: \"insertion-file-plugin\",\n\tcanHandle: (node) => typeof node === \"object\" && node?.nodeType === NodeType.Insertion,\n\ttransform: (node, props, deepTransformNode$1) => {\n\t\treturn {\n\t\t\tnodeType: NodeType.Insertion,\n\t\t\t[NodeType.Insertion]: deepTransformNode$1(node.insertion, props)\n\t\t};\n\t}\n};\nconst processContentDeclarationContent = async (dictionary) => deepTransformNode(dictionary, {\n\tdictionaryKey: dictionary.key,\n\tkeyPath: [],\n\tplugins: [\n\t\twriteFilePlugin,\n\t\tmarkdownFilePlugin,\n\t\tinsertionFilePlugin\n\t]\n});\n\n//#endregion\nexport { processContentDeclarationContent };\n//# sourceMappingURL=processContentDeclarationContent.mjs.map"],"mappings":";;;;;;;;;;;AAUA,MAAM,kBAAkB;CACvB,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,MAAM,aAAaA,0BAAS;CAC7E,YAAY,SAAS;EACpB,MAAM,cAAc,KAAK;EACzB,MAAM,WAAW,KAAK;AACtB,MAAI,OAAO,gBAAgB,SAAU,OAAM,IAAI,MAAM,gCAAgC;AACrF,MAAI,OAAO,aAAa,SAAU,OAAM,IAAI,MAAM,6BAA6B;AAC/E,MAAI;GACH,MAAM,uCAAwB,QAAQ,KAAK,EAAE,SAAS;GACtD,MAAM,uCAAwB,iBAAiB;AAC/C,OAAI,yBAAY,cAAc,CAAE,wBAAU,eAAe,EAAE,WAAW,MAAM,CAAC;AAC7E,8BAAc,kBAAkB,YAAY;WACpC,OAAO;AACf,SAAM,IAAI,MAAM,GAAGC,oBAAE,6DAAsC,SAAS,CAAC,IAAI,QAAQ;;AAElF,SAAO;GACN,UAAUD,0BAAS;IAClBA,0BAAS,OAAO,KAAK;GACtB;;CAEF;;;;AAID,MAAM,qBAAqB;CAC1B,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,MAAM,aAAaA,0BAAS;CAC7E,YAAY,MAAM,OAAO,wBAAwB;AAChD,SAAO;GACN,UAAUA,0BAAS;IAClBA,0BAAS,WAAW,oBAAoB,KAAK,UAAU,MAAM;GAC9D;;CAEF;;;;AAID,MAAM,sBAAsB;CAC3B,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,MAAM,aAAaA,0BAAS;CAC7E,YAAY,MAAM,OAAO,wBAAwB;AAChD,SAAO;GACN,UAAUA,0BAAS;IAClBA,0BAAS,YAAY,oBAAoB,KAAK,WAAW,MAAM;GAChE;;CAEF;AACD,MAAM,mCAAmC,OAAO,sDAAiC,YAAY;CAC5F,eAAe,WAAW;CAC1B,SAAS,EAAE;CACX,SAAS;EACR;EACA;EACA;EACA;CACD,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { colorizePath, x } from "@intlayer/config";
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
|
-
import { deepTransformNode } from "@intlayer/core";
|
|
5
|
-
import { NodeType } from "@intlayer/types";
|
|
6
|
-
|
|
7
|
-
//#region ../@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs
|
|
8
|
-
/**
|
|
9
|
-
* Write file plugin
|
|
10
|
-
*/
|
|
11
|
-
const writeFilePlugin = {
|
|
12
|
-
id: "write-file-plugin",
|
|
13
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.File,
|
|
14
|
-
transform: (node) => {
|
|
15
|
-
const fileContent = node.content;
|
|
16
|
-
const filePath = node.fixedPath;
|
|
17
|
-
if (typeof fileContent !== "string") throw new Error("File content must be a string");
|
|
18
|
-
if (typeof filePath !== "string") throw new Error("File path must be a string");
|
|
19
|
-
try {
|
|
20
|
-
const absoluteFilePath = join(process.cwd(), filePath);
|
|
21
|
-
const fileDirectory = dirname(absoluteFilePath);
|
|
22
|
-
if (!existsSync(fileDirectory)) mkdirSync(fileDirectory, { recursive: true });
|
|
23
|
-
writeFileSync(absoluteFilePath, fileContent);
|
|
24
|
-
} catch (error) {
|
|
25
|
-
throw new Error(`${x} Error writing file to ${colorizePath(filePath)}: ${error}`);
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
nodeType: NodeType.File,
|
|
29
|
-
[NodeType.File]: node.file
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Markdown file plugin
|
|
35
|
-
*/
|
|
36
|
-
const markdownFilePlugin = {
|
|
37
|
-
id: "markdown-file-plugin",
|
|
38
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Markdown,
|
|
39
|
-
transform: (node, props, deepTransformNode$1) => {
|
|
40
|
-
return {
|
|
41
|
-
nodeType: NodeType.Markdown,
|
|
42
|
-
[NodeType.Markdown]: deepTransformNode$1(node.markdown, props)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Insertion file plugin
|
|
48
|
-
*/
|
|
49
|
-
const insertionFilePlugin = {
|
|
50
|
-
id: "insertion-file-plugin",
|
|
51
|
-
canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Insertion,
|
|
52
|
-
transform: (node, props, deepTransformNode$1) => {
|
|
53
|
-
return {
|
|
54
|
-
nodeType: NodeType.Insertion,
|
|
55
|
-
[NodeType.Insertion]: deepTransformNode$1(node.insertion, props)
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const processContentDeclarationContent = async (dictionary) => deepTransformNode(dictionary, {
|
|
60
|
-
dictionaryKey: dictionary.key,
|
|
61
|
-
keyPath: [],
|
|
62
|
-
plugins: [
|
|
63
|
-
writeFilePlugin,
|
|
64
|
-
markdownFilePlugin,
|
|
65
|
-
insertionFilePlugin
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
//#endregion
|
|
70
|
-
export { processContentDeclarationContent };
|
|
71
|
-
//# sourceMappingURL=processContentDeclarationContent.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processContentDeclarationContent.mjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { colorizePath, x } from \"@intlayer/config\";\nimport { dirname, join } from \"node:path\";\nimport { deepTransformNode } from \"@intlayer/core\";\nimport { NodeType } from \"@intlayer/types\";\n\n//#region src/writeContentDeclaration/processContentDeclarationContent.ts\n/**\n* Write file plugin\n*/\nconst writeFilePlugin = {\n\tid: \"write-file-plugin\",\n\tcanHandle: (node) => typeof node === \"object\" && node?.nodeType === NodeType.File,\n\ttransform: (node) => {\n\t\tconst fileContent = node.content;\n\t\tconst filePath = node.fixedPath;\n\t\tif (typeof fileContent !== \"string\") throw new Error(\"File content must be a string\");\n\t\tif (typeof filePath !== \"string\") throw new Error(\"File path must be a string\");\n\t\ttry {\n\t\t\tconst absoluteFilePath = join(process.cwd(), filePath);\n\t\t\tconst fileDirectory = dirname(absoluteFilePath);\n\t\t\tif (!existsSync(fileDirectory)) mkdirSync(fileDirectory, { recursive: true });\n\t\t\twriteFileSync(absoluteFilePath, fileContent);\n\t\t} catch (error) {\n\t\t\tthrow new Error(`${x} Error writing file to ${colorizePath(filePath)}: ${error}`);\n\t\t}\n\t\treturn {\n\t\t\tnodeType: NodeType.File,\n\t\t\t[NodeType.File]: node.file\n\t\t};\n\t}\n};\n/**\n* Markdown file plugin\n*/\nconst markdownFilePlugin = {\n\tid: \"markdown-file-plugin\",\n\tcanHandle: (node) => typeof node === \"object\" && node?.nodeType === NodeType.Markdown,\n\ttransform: (node, props, deepTransformNode$1) => {\n\t\treturn {\n\t\t\tnodeType: NodeType.Markdown,\n\t\t\t[NodeType.Markdown]: deepTransformNode$1(node.markdown, props)\n\t\t};\n\t}\n};\n/**\n* Insertion file plugin\n*/\nconst insertionFilePlugin = {\n\tid: \"insertion-file-plugin\",\n\tcanHandle: (node) => typeof node === \"object\" && node?.nodeType === NodeType.Insertion,\n\ttransform: (node, props, deepTransformNode$1) => {\n\t\treturn {\n\t\t\tnodeType: NodeType.Insertion,\n\t\t\t[NodeType.Insertion]: deepTransformNode$1(node.insertion, props)\n\t\t};\n\t}\n};\nconst processContentDeclarationContent = async (dictionary) => deepTransformNode(dictionary, {\n\tdictionaryKey: dictionary.key,\n\tkeyPath: [],\n\tplugins: [\n\t\twriteFilePlugin,\n\t\tmarkdownFilePlugin,\n\t\tinsertionFilePlugin\n\t]\n});\n\n//#endregion\nexport { processContentDeclarationContent };\n//# sourceMappingURL=processContentDeclarationContent.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,kBAAkB;CACvB,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;CAC7E,YAAY,SAAS;EACpB,MAAM,cAAc,KAAK;EACzB,MAAM,WAAW,KAAK;AACtB,MAAI,OAAO,gBAAgB,SAAU,OAAM,IAAI,MAAM,gCAAgC;AACrF,MAAI,OAAO,aAAa,SAAU,OAAM,IAAI,MAAM,6BAA6B;AAC/E,MAAI;GACH,MAAM,mBAAmB,KAAK,QAAQ,KAAK,EAAE,SAAS;GACtD,MAAM,gBAAgB,QAAQ,iBAAiB;AAC/C,OAAI,CAAC,WAAW,cAAc,CAAE,WAAU,eAAe,EAAE,WAAW,MAAM,CAAC;AAC7E,iBAAc,kBAAkB,YAAY;WACpC,OAAO;AACf,SAAM,IAAI,MAAM,GAAG,EAAE,yBAAyB,aAAa,SAAS,CAAC,IAAI,QAAQ;;AAElF,SAAO;GACN,UAAU,SAAS;IAClB,SAAS,OAAO,KAAK;GACtB;;CAEF;;;;AAID,MAAM,qBAAqB;CAC1B,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;CAC7E,YAAY,MAAM,OAAO,wBAAwB;AAChD,SAAO;GACN,UAAU,SAAS;IAClB,SAAS,WAAW,oBAAoB,KAAK,UAAU,MAAM;GAC9D;;CAEF;;;;AAID,MAAM,sBAAsB;CAC3B,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;CAC7E,YAAY,MAAM,OAAO,wBAAwB;AAChD,SAAO;GACN,UAAU,SAAS;IAClB,SAAS,YAAY,oBAAoB,KAAK,WAAW,MAAM;GAChE;;CAEF;AACD,MAAM,mCAAmC,OAAO,eAAe,kBAAkB,YAAY;CAC5F,eAAe,WAAW;CAC1B,SAAS,EAAE;CACX,SAAS;EACR;EACA;EACA;EACA;CACD,CAAC"}
|