intlayer-editor 7.1.3 → 7.1.5

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.
Files changed (53) hide show
  1. package/client/dist/assets/{CodeBlockShiki-DjZrDqS2.js → CodeBlockShiki-BJmmGo3n.js} +3 -3
  2. package/client/dist/assets/{bundle-web-ByW6N4oT.js → bundle-web-BGkKvp4k.js} +1 -1
  3. package/client/dist/assets/{index-DTNRLJtJ.js → index-CJ2_k-Ny.js} +34766 -25348
  4. package/client/dist/assets/{index-C_dK2Oqm.css → index-UvWk4YN-.css} +0 -72
  5. package/client/dist/index.html +2 -2
  6. package/package.json +16 -15
  7. package/server/dist/_virtual/rolldown_runtime.cjs +0 -4
  8. package/server/dist/controllers/dictionary.controller.cjs +2 -2
  9. package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
  10. package/server/dist/controllers/dictionary.controller.mjs +1 -1
  11. package/server/dist/index.cjs +1 -1
  12. package/server/dist/index.mjs +1 -1
  13. package/server/dist/_virtual/rolldown_runtime.mjs +0 -31
  14. package/server/dist/controllers/configuration.controller.d.ts.map +0 -1
  15. package/server/dist/controllers/dictionary.controller.d.ts.map +0 -1
  16. package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.cjs +0 -99
  17. package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.cjs.map +0 -1
  18. package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs +0 -98
  19. package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs.map +0 -1
  20. package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +0 -36
  21. package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +0 -1
  22. package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +0 -35
  23. package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +0 -1
  24. package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs +0 -18
  25. package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs.map +0 -1
  26. package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs +0 -17
  27. package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs.map +0 -1
  28. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.cjs +0 -25
  29. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.cjs.map +0 -1
  30. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +0 -24
  31. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +0 -1
  32. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.cjs +0 -72
  33. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.cjs.map +0 -1
  34. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +0 -71
  35. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +0 -1
  36. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.cjs +0 -1744
  37. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.cjs.map +0 -1
  38. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.mjs +0 -1744
  39. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +0 -1
  40. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs +0 -116
  41. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs.map +0 -1
  42. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +0 -116
  43. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +0 -1
  44. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.cjs +0 -66
  45. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.cjs.map +0 -1
  46. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.mjs +0 -65
  47. package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +0 -1
  48. package/server/dist/routes/config.routes.d.ts.map +0 -1
  49. package/server/dist/routes/dictionary.routes.d.ts.map +0 -1
  50. package/server/dist/types/Routes.d.ts.map +0 -1
  51. package/server/dist/utils/checkPortAvailability.d.ts.map +0 -1
  52. package/server/dist/utils/httpStatusCodes.d.ts.map +0 -1
  53. package/server/dist/utils/responseData.d.ts.map +0 -1
@@ -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
@@ -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
@@ -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"}