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
@@ -2807,10 +2807,6 @@
2807
2807
  background-color: var(--color-neutral-50);
2808
2808
  }
2809
2809
 
2810
- .bg-neutral-100 {
2811
- background-color: var(--color-neutral-100);
2812
- }
2813
-
2814
2810
  .bg-neutral-200 {
2815
2811
  background-color: var(--color-neutral-200);
2816
2812
  }
@@ -4166,16 +4162,6 @@
4166
4162
  color: var(--color-text-opposite);
4167
4163
  }
4168
4164
 
4169
- .text-text\/20 {
4170
- color: #12121233;
4171
- }
4172
-
4173
- @supports (color: color-mix(in lab, red, red)) {
4174
- .text-text\/20 {
4175
- color: color-mix(in oklab, var(--color-text) 20%, transparent);
4176
- }
4177
- }
4178
-
4179
4165
  .text-text\/50 {
4180
4166
  color: #12121280;
4181
4167
  }
@@ -4381,11 +4367,6 @@
4381
4367
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
4382
4368
  }
4383
4369
 
4384
- .shadow-xs {
4385
- --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, #0000000d);
4386
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
4387
- }
4388
-
4389
4370
  .ring {
4390
4371
  --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
4391
4372
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -5373,16 +5354,6 @@
5373
5354
  background-color: var(--color-neutral-100);
5374
5355
  }
5375
5356
 
5376
- .hover\:bg-neutral-100\/90:hover {
5377
- background-color: #e7e7e7e6;
5378
- }
5379
-
5380
- @supports (color: color-mix(in lab, red, red)) {
5381
- .hover\:bg-neutral-100\/90:hover {
5382
- background-color: color-mix(in oklab, var(--color-neutral-100) 90%, transparent);
5383
- }
5384
- }
5385
-
5386
5357
  .hover\:bg-neutral-300:hover {
5387
5358
  background-color: var(--color-neutral-300);
5388
5359
  }
@@ -5631,10 +5602,6 @@
5631
5602
  }
5632
5603
  }
5633
5604
 
5634
- .focus\:z-10:focus {
5635
- z-index: 10;
5636
- }
5637
-
5638
5605
  .focus\:grid-rows-\[1fr\]:focus {
5639
5606
  grid-template-rows: 1fr;
5640
5607
  }
@@ -5651,10 +5618,6 @@
5651
5618
  border-color: var(--color-blue-500);
5652
5619
  }
5653
5620
 
5654
- .focus\:border-destructive:focus {
5655
- border-color: var(--color-destructive);
5656
- }
5657
-
5658
5621
  .focus\:border-transparent:focus {
5659
5622
  border-color: #0000;
5660
5623
  }
@@ -5698,11 +5661,6 @@
5698
5661
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
5699
5662
  }
5700
5663
 
5701
- .focus\:ring-\[3px\]:focus {
5702
- --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
5703
- box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
5704
- }
5705
-
5706
5664
  .focus\:\[box-shadow\:none\]:focus {
5707
5665
  box-shadow: none;
5708
5666
  }
@@ -5715,16 +5673,6 @@
5715
5673
  --tw-ring-color: var(--color-blue-500);
5716
5674
  }
5717
5675
 
5718
- .focus\:ring-destructive\/20:focus {
5719
- --tw-ring-color: #fb7d3c33;
5720
- }
5721
-
5722
- @supports (color: color-mix(in lab, red, red)) {
5723
- .focus\:ring-destructive\/20:focus {
5724
- --tw-ring-color: color-mix(in oklab, var(--color-destructive) 20%, transparent);
5725
- }
5726
- }
5727
-
5728
5676
  .focus\:ring-green-300:focus {
5729
5677
  --tw-ring-color: var(--color-green-300);
5730
5678
  }
@@ -6477,26 +6425,6 @@
6477
6425
  :where([data-theme="dark"], [data-theme="dark"] *) .dark\:hover\:bg-neutral-900:hover {
6478
6426
  background-color: var(--color-neutral-900);
6479
6427
  }
6480
-
6481
- :where([data-theme="dark"], [data-theme="dark"] *) .dark\:hover\:bg-neutral-900\/90:hover {
6482
- background-color: #3d3d3de6;
6483
- }
6484
-
6485
- @supports (color: color-mix(in lab, red, red)) {
6486
- :where([data-theme="dark"], [data-theme="dark"] *) .dark\:hover\:bg-neutral-900\/90:hover {
6487
- background-color: color-mix(in oklab, var(--color-neutral-900) 90%, transparent);
6488
- }
6489
- }
6490
- }
6491
-
6492
- :where([data-theme="dark"], [data-theme="dark"] *) .dark\:focus\:ring-destructive\/40:focus {
6493
- --tw-ring-color: #fb7d3c66;
6494
- }
6495
-
6496
- @supports (color: color-mix(in lab, red, red)) {
6497
- :where([data-theme="dark"], [data-theme="dark"] *) .dark\:focus\:ring-destructive\/40:focus {
6498
- --tw-ring-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
6499
- }
6500
6428
  }
6501
6429
 
6502
6430
  :where([data-theme="dark"], [data-theme="dark"] *) .dark\:focus-visible\:ring-neutral-500:focus-visible {
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Intlayer Editor</title>
8
- <script type="module" crossorigin src="/assets/index-DTNRLJtJ.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-C_dK2Oqm.css">
8
+ <script type="module" crossorigin src="/assets/index-CJ2_k-Ny.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-UvWk4YN-.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-editor",
3
- "version": "7.1.3",
3
+ "version": "7.1.5",
4
4
  "private": false,
5
5
  "description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
6
6
  "keywords": [
@@ -85,31 +85,32 @@
85
85
  "typecheck": "tsc --project ./server/tsconfig.types.json --noEmit"
86
86
  },
87
87
  "dependencies": {
88
- "@intlayer/api": "7.1.3",
89
- "@intlayer/config": "7.1.3",
90
- "@intlayer/core": "7.1.3",
91
- "@intlayer/design-system": "7.1.3",
92
- "@intlayer/editor-react": "7.1.3",
93
- "@intlayer/types": "7.1.3",
94
- "@intlayer/unmerged-dictionaries-entry": "7.1.3",
88
+ "@intlayer/api": "7.1.5",
89
+ "@intlayer/chokidar": "7.1.5",
90
+ "@intlayer/config": "7.1.5",
91
+ "@intlayer/core": "7.1.5",
92
+ "@intlayer/design-system": "7.1.5",
93
+ "@intlayer/editor-react": "7.1.5",
94
+ "@intlayer/types": "7.1.5",
95
+ "@intlayer/unmerged-dictionaries-entry": "7.1.5",
95
96
  "@tanstack/react-query": "5.90.10",
96
97
  "compression": "1.8.1",
97
98
  "cookie-parser": "1.4.7",
98
99
  "cors": "2.8.5",
99
100
  "express": "5.1.0",
100
- "express-intlayer": "7.1.3",
101
+ "express-intlayer": "7.1.5",
101
102
  "framer-motion": "12.23.24",
102
103
  "fuse.js": "7.1.0",
103
104
  "helmet": "8.1.0",
104
- "intlayer": "7.1.3",
105
+ "intlayer": "7.1.5",
105
106
  "lucide-react": "0.554.0",
106
107
  "mime": "4.1.0",
107
108
  "react": "19.2.0",
108
109
  "react-dom": "19.2.0",
109
- "react-intlayer": "7.1.3",
110
+ "react-intlayer": "7.1.5",
110
111
  "react-router-dom": "7.9.5",
111
112
  "rimraf": "6.1.0",
112
- "vite-intlayer": "7.1.3"
113
+ "vite-intlayer": "7.1.5"
113
114
  },
114
115
  "devDependencies": {
115
116
  "@tailwindcss/vite": "4.1.16",
@@ -134,13 +135,13 @@
134
135
  "peerDependencies": {
135
136
  "clsx": "2.1.1",
136
137
  "framer-motion": "12.23.24",
137
- "intlayer": "7.1.3",
138
+ "intlayer": "7.1.5",
138
139
  "react": ">=16.0.0",
139
140
  "react-dom": ">=16.0.0",
140
- "react-intlayer": "7.1.3",
141
+ "react-intlayer": "7.1.5",
141
142
  "react-router-dom": ">=6.0.0",
142
143
  "tailwind-merge": "3.4.0",
143
- "vite-intlayer": "7.1.3"
144
+ "vite-intlayer": "7.1.5"
144
145
  },
145
146
  "engines": {
146
147
  "node": ">=14.18"
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __copyProps = (to, from, except, desc) => {
12
9
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
10
  key = keys[i];
@@ -25,5 +22,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
22
 
26
23
  //#endregion
27
24
 
28
- exports.__commonJS = __commonJS;
29
25
  exports.__toESM = __toESM;
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_utils_responseData = require('../utils/responseData.cjs');
3
- const require_writeContentDeclaration = require('../packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs');
4
3
  let __intlayer_config = require("@intlayer/config");
4
+ let __intlayer_chokidar = require("@intlayer/chokidar");
5
5
  let __intlayer_unmerged_dictionaries_entry = require("@intlayer/unmerged-dictionaries-entry");
6
6
  let express_intlayer = require("express-intlayer");
7
7
 
@@ -37,7 +37,7 @@ const getDictionaries = async (_req, res, _next) => {
37
37
  const writeContentDeclaration = async (req, res, _next) => {
38
38
  try {
39
39
  const dictionaryData = req.body.dictionary;
40
- const result = await require_writeContentDeclaration.writeContentDeclaration(dictionaryData, (0, __intlayer_config.getConfiguration)());
40
+ const result = await (0, __intlayer_chokidar.writeContentDeclaration)(dictionaryData, (0, __intlayer_config.getConfiguration)());
41
41
  let description = "";
42
42
  switch (result.status) {
43
43
  case "created":
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.controller.cjs","names":["formatResponse","writeContentDeclarationEditor"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/types';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\nimport { t } from 'express-intlayer';\n\ntype GetDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: Request,\n res: Response<GetDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: Request<any, any, WriteContentDeclarationBody>,\n res: Response<WriteContentDeclarationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,kBAAkB,OAC7B,MACA,KACA,UACkB;AAClB,KAAI;EACF,MAAM,oBAAoBA,0CAAqC,EAC7D,2EAA+B,EAChC,CAAC;AAEF,MAAI,KAAK,kBAAkB;AAC3B;UACO,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyBA,0CAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,MAAI,KAAK,uBAAuB;AAChC;;;;;;AAeJ,MAAa,0BAA0B,OACrC,KACA,KACA,UACkB;AAClB,KAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAIhC,MAAM,SAAS,MAAMC,wDAA8B,yDAFlB,CAEyC;EAE1E,IAAI,cAAc;AAElB,UAAQ,OAAO,QAAf;GACE,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAGF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF;AACE,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;;EAIJ,MAAM,oBAAoBD,0CACxB;GACE,MAAM;GACN,iCAAW;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF;GACD,CACF;AAED,MAAI,KAAK,kBAAkB;AAC3B;UACO,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;AAED,UAAQ,MAAM,aAAa;EAE3B,MAAM,yBACJA,0CAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEJ,MAAI,KAAK,uBAAuB;AAChC"}
1
+ {"version":3,"file":"dictionary.controller.cjs","names":["formatResponse"],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import {\n type DictionaryStatus,\n writeContentDeclaration as writeContentDeclarationEditor,\n} from '@intlayer/chokidar';\nimport { getConfiguration } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/types';\nimport {\n getUnmergedDictionaries,\n type UnmergedDictionaries,\n} from '@intlayer/unmerged-dictionaries-entry';\nimport { formatResponse, type ResponseData } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\nimport { t } from 'express-intlayer';\n\ntype GetDictionariesResult = ResponseData<UnmergedDictionaries>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getDictionaries = async (\n _req: Request,\n res: Response<GetDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const formattedResponse = formatResponse<UnmergedDictionaries>({\n data: getUnmergedDictionaries(),\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<UnmergedDictionaries>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n\nexport type WriteContentDeclarationBody = { dictionary: Dictionary };\ntype WriteContentDeclarationResultData = {\n status: DictionaryStatus;\n path: string;\n};\nexport type WriteContentDeclarationResult =\n ResponseData<WriteContentDeclarationResultData>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const writeContentDeclaration = async (\n req: Request<any, any, WriteContentDeclarationBody>,\n res: Response<WriteContentDeclarationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const dictionaryData = req.body.dictionary;\n\n const config = getConfiguration();\n\n const result = await writeContentDeclarationEditor(dictionaryData, config);\n\n let description = '';\n\n switch (result.status) {\n case 'created': {\n description = t({\n en: 'Content declaration created successfully',\n fr: 'Déclaration de contenu créée avec succès',\n es: 'Declaración de contenido creada con éxito',\n });\n break;\n }\n\n case 'updated': {\n description = t({\n en: 'Content declaration updated successfully',\n fr: 'Déclaration de contenu mise à jour avec succès',\n es: 'Declaración de contenido actualizada con éxito',\n });\n break;\n }\n case 'reimported in JSON': {\n description = t({\n en: 'Content declaration reimported in JSON successfully',\n fr: 'Déclaration de contenu réimportée en JSON avec succès',\n es: 'Declaración de contenido reimportada en JSON con éxito',\n });\n break;\n }\n case 'new content file': {\n description = t({\n en: 'Content declaration new content file successfully',\n fr: 'Déclaration de contenu réimportée dans un nouveau emplacement avec succès',\n es: 'Declaración de contenido reimportada en un nuevo lugar con éxito',\n });\n break;\n }\n default: {\n description = t({\n en: 'Content declaration written successfully',\n fr: 'Déclaration de contenu écrite avec succès',\n es: 'Declaración de contenido escrita con éxito',\n });\n break;\n }\n }\n\n const formattedResponse = formatResponse<WriteContentDeclarationResultData>(\n {\n data: result,\n message: t({\n en: 'Content declaration written',\n fr: 'Déclaration de contenu écrite',\n es: 'Declaración de contenido escrita',\n }),\n description,\n }\n );\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n console.error(errorMessage);\n\n const formattedErrorResponse =\n formatResponse<WriteContentDeclarationResultData>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,kBAAkB,OAC7B,MACA,KACA,UACkB;AAClB,KAAI;EACF,MAAM,oBAAoBA,0CAAqC,EAC7D,2EAA+B,EAChC,CAAC;AAEF,MAAI,KAAK,kBAAkB;AAC3B;UACO,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;EAED,MAAM,yBAAyBA,0CAAqC;GAClE,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEF,MAAI,KAAK,uBAAuB;AAChC;;;;;;AAeJ,MAAa,0BAA0B,OACrC,KACA,KACA,UACkB;AAClB,KAAI;EACF,MAAM,iBAAiB,IAAI,KAAK;EAIhC,MAAM,SAAS,uDAAoC,yDAFlB,CAEyC;EAE1E,IAAI,cAAc;AAElB,UAAQ,OAAO,QAAf;GACE,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAGF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF,KAAK;AACH,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;GAEF;AACE,0CAAgB;KACd,IAAI;KACJ,IAAI;KACJ,IAAI;KACL,CAAC;AACF;;EAIJ,MAAM,oBAAoBA,0CACxB;GACE,MAAM;GACN,iCAAW;IACT,IAAI;IACJ,IAAI;IACJ,IAAI;IACL,CAAC;GACF;GACD,CACF;AAED,MAAI,KAAK,kBAAkB;AAC3B;UACO,KAAK;EACZ,MAAM,eAAgB,OAAiD;GACrE,SAAS;GACT,QAAQ;GACT;AAED,UAAQ,MAAM,aAAa;EAE3B,MAAM,yBACJA,0CAAkD;GAChD,OAAO;IACL,SAAS,aAAa,WAAW;IACjC,MAAM;IACN,OAAO;IACR;GACD,QAAQ,aAAa,UAAU;GAChC,CAAC;AAEJ,MAAI,KAAK,uBAAuB;AAChC"}
@@ -1,6 +1,6 @@
1
1
  import { formatResponse } from "../utils/responseData.mjs";
2
- import { writeContentDeclaration as writeContentDeclaration$1 } from "../packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs";
3
2
  import { getConfiguration } from "@intlayer/config";
3
+ import { writeContentDeclaration as writeContentDeclaration$1 } from "@intlayer/chokidar";
4
4
  import { getUnmergedDictionaries } from "@intlayer/unmerged-dictionaries-entry";
5
5
  import { t } from "express-intlayer";
6
6
 
@@ -3,10 +3,10 @@ const require_routes_config_routes = require('./routes/config.routes.cjs');
3
3
  const require_routes_dictionary_routes = require('./routes/dictionary.routes.cjs');
4
4
  const require_utils_checkPortAvailability = require('./utils/checkPortAvailability.cjs');
5
5
  let __intlayer_config = require("@intlayer/config");
6
+ let express_intlayer = require("express-intlayer");
6
7
  let node_fs = require("node:fs");
7
8
  let node_path = require("node:path");
8
9
  let node_url = require("node:url");
9
- let express_intlayer = require("express-intlayer");
10
10
  let express = require("express");
11
11
  express = require_rolldown_runtime.__toESM(express);
12
12
  let compression = require("compression");
@@ -2,10 +2,10 @@ import { configurationRouter } from "./routes/config.routes.mjs";
2
2
  import { dictionaryRouter } from "./routes/dictionary.routes.mjs";
3
3
  import { checkPortAvailability } from "./utils/checkPortAvailability.mjs";
4
4
  import { ANSIColors, colorize, colorizePath, getConfiguration, getEnvFilePath } from "@intlayer/config";
5
+ import { intlayer } from "express-intlayer";
5
6
  import { existsSync, lstatSync, readFileSync } from "node:fs";
6
7
  import { dirname, join, resolve } from "node:path";
7
8
  import { fileURLToPath } from "node:url";
8
- import { intlayer } from "express-intlayer";
9
9
  import express from "express";
10
10
  import compression from "compression";
11
11
  import cookieParser from "cookie-parser";
@@ -1,31 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
13
- key = keys[i];
14
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
22
- value: mod,
23
- enumerable: true
24
- }) : target, mod));
25
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
26
- if (typeof require !== "undefined") return require.apply(this, arguments);
27
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
28
- });
29
-
30
- //#endregion
31
- export { __commonJS, __require, __toESM };
@@ -1 +0,0 @@
1
- {"version":3,"file":"configuration.controller.d.ts","names":[],"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":[],"mappings":";;;;;KAKY,sBAAA,GAAyB,aAAa;;AAAlD;AAKA;AACQ,cADK,gBACL,EAAA,CAAA,IAAA,EAAA,OAAA,EAAA,GAAA,EACD,QADC,CACQ,sBADR,CAAA,EAAA,KAAA,EAEC,YAFD,EAAA,GAGL,OAHK,CAAA,IAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dictionary.controller.d.ts","names":[],"sources":["../../src/controllers/dictionary.controller.ts"],"sourcesContent":[],"mappings":";;;;;;;KAcK,qBAAA,GAAwB,aAAa;;AAHqB;AAQ/D;AACQ,cADK,eACL,EAAA,CAAA,IAAA,EAAA,OAAA,EAAA,GAAA,EACD,QADC,CACQ,qBADR,CAAA,EAAA,KAAA,EAEC,YAFD,EAAA,GAGL,OAHK,CAAA,IAAA,CAAA;AACQ,KA8BJ,2BAAA,GA9BI;EAAT,UAAA,EA8BiD,UA9BjD;CACE;KA8BJ,iCAAA,GA7BF;EAAO,MAAA,EA8BA,gBA9BA;EA4BE,IAAA,EAAA,MAAA;AAAyD,CAAA;AAKzD,KAAA,6BAAA,GACV,YAAa,CAAA,iCAAb,CAAA;AAKF;;;AAEgB,cAFH,uBAEG,EAAA,CAAA,GAAA,EADT,OACS,CAAA,GAAA,EAAA,GAAA,EADS,2BACT,CAAA,EAAA,GAAA,EAAT,QAAS,CAAA,6BAAA,CAAA,EAAA,KAAA,EACP,YADO,EAAA,GAEb,OAFa,CAAA,IAAA,CAAA"}
@@ -1,99 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.cjs');
2
- let node_fs = require("node:fs");
3
- let node_path = require("node:path");
4
- let node_url = require("node:url");
5
-
6
- //#region ../@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs
7
- const hereDirname = () => {
8
- try {
9
- return (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
10
- } catch {
11
- return typeof __dirname !== "undefined" ? __dirname : process.cwd();
12
- }
13
- };
14
- const findDistRoot = (startDir) => {
15
- let dir = startDir;
16
- for (let i = 0; i < 12; i++) {
17
- if ((0, node_path.basename)(dir) === "dist") return dir;
18
- const parent = (0, node_path.resolve)(dir, "..");
19
- if (parent === dir) break;
20
- dir = parent;
21
- }
22
- return null;
23
- };
24
- const normalizeFrameFile = (file) => {
25
- if (!file) return null;
26
- try {
27
- if (file.startsWith("file://")) return (0, node_url.fileURLToPath)(file);
28
- } catch {}
29
- return file;
30
- };
31
- /**
32
- * Returns the directory of the *caller* module that invoked readAsset.
33
- * Prefers non-virtual frames; falls back to the first real frame.
34
- */
35
- const getCallerDir = () => {
36
- const prev = Error.prepareStackTrace;
37
- try {
38
- Error.prepareStackTrace = (_, structured) => structured;
39
- const err = /* @__PURE__ */ new Error();
40
- Error.captureStackTrace(err, getCallerDir);
41
- /** @type {import('node:vm').CallSite[]} */
42
- const frames = err.stack || [];
43
- const isVirtualPath = (p) => p.includes(`${node_path.sep}_virtual${node_path.sep}`) || p.includes("/_virtual/");
44
- for (const frame of frames) {
45
- const file = normalizeFrameFile(typeof frame.getFileName === "function" ? frame.getFileName() : null);
46
- if (!file) continue;
47
- if (file.includes("node:internal") || file.includes(`${node_path.sep}internal${node_path.sep}modules${node_path.sep}`)) continue;
48
- if (!isVirtualPath(file)) return (0, node_path.dirname)(file);
49
- }
50
- for (const frame of frames) {
51
- const file = normalizeFrameFile(typeof frame.getFileName === "function" ? frame.getFileName() : null);
52
- if (file) return (0, node_path.dirname)(file);
53
- }
54
- } catch {} finally {
55
- Error.prepareStackTrace = prev;
56
- }
57
- return hereDirname();
58
- };
59
- /**
60
- * Read an asset copied from src/** to dist/assets/**.
61
- * - './' or '../' is resolved relative to the *caller module's* emitted directory.
62
- * - otherwise, treat as src-relative.
63
- *
64
- * @param {string} relPath - e.g. './PROMPT.md' or 'utils/AI/askDocQuestion/embeddings/<fileKey>.json'
65
- * @param {BufferEncoding} [encoding='utf8']
66
- */
67
- const readAsset = (relPath, encoding = "utf8") => {
68
- const here = hereDirname();
69
- const distRoot = findDistRoot(here) ?? (0, node_path.resolve)(here, "..", "..", "dist");
70
- const assetsRoot = (0, node_path.join)(distRoot, "assets");
71
- const tried = [];
72
- /**
73
- * Transform dist/(esm|cjs)/... and _virtual/ prefix to clean subpath (Windows-safe)
74
- */
75
- const callerSubpath = (0, node_path.relative)(distRoot, getCallerDir()).split("\\").join("/").replace(/^(?:dist\/)?(?:esm|cjs)\//, "").replace(/^_virtual\//, "");
76
- if (relPath.startsWith("./") || relPath.startsWith("../")) {
77
- const fromCallerAbs = (0, node_path.resolve)(assetsRoot, callerSubpath, relPath);
78
- tried.push(fromCallerAbs);
79
- if ((0, node_fs.existsSync)(fromCallerAbs)) return (0, node_fs.readFileSync)(fromCallerAbs, encoding);
80
- }
81
- const directPath = (0, node_path.join)(assetsRoot, relPath);
82
- tried.push(directPath);
83
- if ((0, node_fs.existsSync)(directPath)) return (0, node_fs.readFileSync)(directPath, encoding);
84
- if (callerSubpath) {
85
- const nested = (0, node_path.join)(assetsRoot, callerSubpath, relPath);
86
- tried.push(nested);
87
- if ((0, node_fs.existsSync)(nested)) return (0, node_fs.readFileSync)(nested, encoding);
88
- }
89
- const msg = [
90
- "readAsset: file not found.",
91
- "Searched:",
92
- ...tried.map((p) => `- ${p}`)
93
- ].join("\n");
94
- throw new Error(msg);
95
- };
96
-
97
- //#endregion
98
- exports.readAsset = readAsset;
99
- //# sourceMappingURL=_utils_asset.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_utils_asset.cjs","names":["sep"],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { basename, dirname, join, relative, resolve, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n//#region \\0utils:asset\nconst hereDirname = () => {\n\ttry {\n\t\treturn dirname(fileURLToPath(import.meta.url));\n\t} catch {\n\t\treturn typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n\t}\n};\nconst findDistRoot = (startDir) => {\n\tlet dir = startDir;\n\tfor (let i = 0; i < 12; i++) {\n\t\tif (basename(dir) === \"dist\") return dir;\n\t\tconst parent = resolve(dir, \"..\");\n\t\tif (parent === dir) break;\n\t\tdir = parent;\n\t}\n\treturn null;\n};\nconst normalizeFrameFile = (file) => {\n\tif (!file) return null;\n\ttry {\n\t\tif (file.startsWith(\"file://\")) return fileURLToPath(file);\n\t} catch {}\n\treturn file;\n};\n/**\n* Returns the directory of the *caller* module that invoked readAsset.\n* Prefers non-virtual frames; falls back to the first real frame.\n*/\nconst getCallerDir = () => {\n\tconst prev = Error.prepareStackTrace;\n\ttry {\n\t\tError.prepareStackTrace = (_, structured) => structured;\n\t\tconst err = /* @__PURE__ */ new Error();\n\t\tError.captureStackTrace(err, getCallerDir);\n\t\t/** @type {import('node:vm').CallSite[]} */\n\t\tconst frames = err.stack || [];\n\t\tconst isVirtualPath = (p) => p.includes(`${sep}_virtual${sep}`) || p.includes(\"/_virtual/\");\n\t\tfor (const frame of frames) {\n\t\t\tconst file = normalizeFrameFile(typeof frame.getFileName === \"function\" ? frame.getFileName() : null);\n\t\t\tif (!file) continue;\n\t\t\tif (file.includes(\"node:internal\") || file.includes(`${sep}internal${sep}modules${sep}`)) continue;\n\t\t\tif (!isVirtualPath(file)) return dirname(file);\n\t\t}\n\t\tfor (const frame of frames) {\n\t\t\tconst file = normalizeFrameFile(typeof frame.getFileName === \"function\" ? frame.getFileName() : null);\n\t\t\tif (file) return dirname(file);\n\t\t}\n\t} catch {} finally {\n\t\tError.prepareStackTrace = prev;\n\t}\n\treturn hereDirname();\n};\n/**\n* Read an asset copied from src/** to dist/assets/**.\n* - './' or '../' is resolved relative to the *caller module's* emitted directory.\n* - otherwise, treat as src-relative.\n*\n* @param {string} relPath - e.g. './PROMPT.md' or 'utils/AI/askDocQuestion/embeddings/<fileKey>.json'\n* @param {BufferEncoding} [encoding='utf8']\n*/\nconst readAsset = (relPath, encoding = \"utf8\") => {\n\tconst here = hereDirname();\n\tconst distRoot = findDistRoot(here) ?? resolve(here, \"..\", \"..\", \"dist\");\n\tconst assetsRoot = join(distRoot, \"assets\");\n\tconst tried = [];\n\t/**\n\t* Transform dist/(esm|cjs)/... and _virtual/ prefix to clean subpath (Windows-safe)\n\t*/\n\tconst callerSubpath = relative(distRoot, getCallerDir()).split(\"\\\\\").join(\"/\").replace(/^(?:dist\\/)?(?:esm|cjs)\\//, \"\").replace(/^_virtual\\//, \"\");\n\tif (relPath.startsWith(\"./\") || relPath.startsWith(\"../\")) {\n\t\tconst fromCallerAbs = resolve(assetsRoot, callerSubpath, relPath);\n\t\ttried.push(fromCallerAbs);\n\t\tif (existsSync(fromCallerAbs)) return readFileSync(fromCallerAbs, encoding);\n\t}\n\tconst directPath = join(assetsRoot, relPath);\n\ttried.push(directPath);\n\tif (existsSync(directPath)) return readFileSync(directPath, encoding);\n\tif (callerSubpath) {\n\t\tconst nested = join(assetsRoot, callerSubpath, relPath);\n\t\ttried.push(nested);\n\t\tif (existsSync(nested)) return readFileSync(nested, encoding);\n\t}\n\tconst msg = [\n\t\t\"readAsset: file not found.\",\n\t\t\"Searched:\",\n\t\t...tried.map((p) => `- ${p}`)\n\t].join(\"\\n\");\n\tthrow new Error(msg);\n};\n\n//#endregion\nexport { readAsset };"],"mappings":";;;;;;AAKA,MAAM,oBAAoB;AACzB,KAAI;AACH,0GAA6C,CAAC;SACvC;AACP,SAAO,OAAO,cAAc,cAAc,YAAY,QAAQ,KAAK;;;AAGrE,MAAM,gBAAgB,aAAa;CAClC,IAAI,MAAM;AACV,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;AAC5B,8BAAa,IAAI,KAAK,OAAQ,QAAO;EACrC,MAAM,gCAAiB,KAAK,KAAK;AACjC,MAAI,WAAW,IAAK;AACpB,QAAM;;AAEP,QAAO;;AAER,MAAM,sBAAsB,SAAS;AACpC,KAAI,CAAC,KAAM,QAAO;AAClB,KAAI;AACH,MAAI,KAAK,WAAW,UAAU,CAAE,oCAAqB,KAAK;SACnD;AACR,QAAO;;;;;;AAMR,MAAM,qBAAqB;CAC1B,MAAM,OAAO,MAAM;AACnB,KAAI;AACH,QAAM,qBAAqB,GAAG,eAAe;EAC7C,MAAM,sBAAsB,IAAI,OAAO;AACvC,QAAM,kBAAkB,KAAK,aAAa;;EAE1C,MAAM,SAAS,IAAI,SAAS,EAAE;EAC9B,MAAM,iBAAiB,MAAM,EAAE,SAAS,GAAGA,cAAI,UAAUA,gBAAM,IAAI,EAAE,SAAS,aAAa;AAC3F,OAAK,MAAM,SAAS,QAAQ;GAC3B,MAAM,OAAO,mBAAmB,OAAO,MAAM,gBAAgB,aAAa,MAAM,aAAa,GAAG,KAAK;AACrG,OAAI,CAAC,KAAM;AACX,OAAI,KAAK,SAAS,gBAAgB,IAAI,KAAK,SAAS,GAAGA,cAAI,UAAUA,cAAI,SAASA,gBAAM,CAAE;AAC1F,OAAI,CAAC,cAAc,KAAK,CAAE,+BAAe,KAAK;;AAE/C,OAAK,MAAM,SAAS,QAAQ;GAC3B,MAAM,OAAO,mBAAmB,OAAO,MAAM,gBAAgB,aAAa,MAAM,aAAa,GAAG,KAAK;AACrG,OAAI,KAAM,+BAAe,KAAK;;SAExB,WAAW;AAClB,QAAM,oBAAoB;;AAE3B,QAAO,aAAa;;;;;;;;;;AAUrB,MAAM,aAAa,SAAS,WAAW,WAAW;CACjD,MAAM,OAAO,aAAa;CAC1B,MAAM,WAAW,aAAa,KAAK,2BAAY,MAAM,MAAM,MAAM,OAAO;CACxE,MAAM,iCAAkB,UAAU,SAAS;CAC3C,MAAM,QAAQ,EAAE;;;;CAIhB,MAAM,wCAAyB,UAAU,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC,KAAK,IAAI,CAAC,QAAQ,6BAA6B,GAAG,CAAC,QAAQ,eAAe,GAAG;AAClJ,KAAI,QAAQ,WAAW,KAAK,IAAI,QAAQ,WAAW,MAAM,EAAE;EAC1D,MAAM,uCAAwB,YAAY,eAAe,QAAQ;AACjE,QAAM,KAAK,cAAc;AACzB,8BAAe,cAAc,CAAE,kCAAoB,eAAe,SAAS;;CAE5E,MAAM,iCAAkB,YAAY,QAAQ;AAC5C,OAAM,KAAK,WAAW;AACtB,6BAAe,WAAW,CAAE,kCAAoB,YAAY,SAAS;AACrE,KAAI,eAAe;EAClB,MAAM,6BAAc,YAAY,eAAe,QAAQ;AACvD,QAAM,KAAK,OAAO;AAClB,8BAAe,OAAO,CAAE,kCAAoB,QAAQ,SAAS;;CAE9D,MAAM,MAAM;EACX;EACA;EACA,GAAG,MAAM,KAAK,MAAM,KAAK,IAAI;EAC7B,CAAC,KAAK,KAAK;AACZ,OAAM,IAAI,MAAM,IAAI"}
@@ -1,98 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { basename, dirname, join, relative, resolve, sep } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- //#region ../@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs
6
- const hereDirname = () => {
7
- try {
8
- return dirname(fileURLToPath(import.meta.url));
9
- } catch {
10
- return typeof __dirname !== "undefined" ? __dirname : process.cwd();
11
- }
12
- };
13
- const findDistRoot = (startDir) => {
14
- let dir = startDir;
15
- for (let i = 0; i < 12; i++) {
16
- if (basename(dir) === "dist") return dir;
17
- const parent = resolve(dir, "..");
18
- if (parent === dir) break;
19
- dir = parent;
20
- }
21
- return null;
22
- };
23
- const normalizeFrameFile = (file) => {
24
- if (!file) return null;
25
- try {
26
- if (file.startsWith("file://")) return fileURLToPath(file);
27
- } catch {}
28
- return file;
29
- };
30
- /**
31
- * Returns the directory of the *caller* module that invoked readAsset.
32
- * Prefers non-virtual frames; falls back to the first real frame.
33
- */
34
- const getCallerDir = () => {
35
- const prev = Error.prepareStackTrace;
36
- try {
37
- Error.prepareStackTrace = (_, structured) => structured;
38
- const err = /* @__PURE__ */ new Error();
39
- Error.captureStackTrace(err, getCallerDir);
40
- /** @type {import('node:vm').CallSite[]} */
41
- const frames = err.stack || [];
42
- const isVirtualPath = (p) => p.includes(`${sep}_virtual${sep}`) || p.includes("/_virtual/");
43
- for (const frame of frames) {
44
- const file = normalizeFrameFile(typeof frame.getFileName === "function" ? frame.getFileName() : null);
45
- if (!file) continue;
46
- if (file.includes("node:internal") || file.includes(`${sep}internal${sep}modules${sep}`)) continue;
47
- if (!isVirtualPath(file)) return dirname(file);
48
- }
49
- for (const frame of frames) {
50
- const file = normalizeFrameFile(typeof frame.getFileName === "function" ? frame.getFileName() : null);
51
- if (file) return dirname(file);
52
- }
53
- } catch {} finally {
54
- Error.prepareStackTrace = prev;
55
- }
56
- return hereDirname();
57
- };
58
- /**
59
- * Read an asset copied from src/** to dist/assets/**.
60
- * - './' or '../' is resolved relative to the *caller module's* emitted directory.
61
- * - otherwise, treat as src-relative.
62
- *
63
- * @param {string} relPath - e.g. './PROMPT.md' or 'utils/AI/askDocQuestion/embeddings/<fileKey>.json'
64
- * @param {BufferEncoding} [encoding='utf8']
65
- */
66
- const readAsset = (relPath, encoding = "utf8") => {
67
- const here = hereDirname();
68
- const distRoot = findDistRoot(here) ?? resolve(here, "..", "..", "dist");
69
- const assetsRoot = join(distRoot, "assets");
70
- const tried = [];
71
- /**
72
- * Transform dist/(esm|cjs)/... and _virtual/ prefix to clean subpath (Windows-safe)
73
- */
74
- const callerSubpath = relative(distRoot, getCallerDir()).split("\\").join("/").replace(/^(?:dist\/)?(?:esm|cjs)\//, "").replace(/^_virtual\//, "");
75
- if (relPath.startsWith("./") || relPath.startsWith("../")) {
76
- const fromCallerAbs = resolve(assetsRoot, callerSubpath, relPath);
77
- tried.push(fromCallerAbs);
78
- if (existsSync(fromCallerAbs)) return readFileSync(fromCallerAbs, encoding);
79
- }
80
- const directPath = join(assetsRoot, relPath);
81
- tried.push(directPath);
82
- if (existsSync(directPath)) return readFileSync(directPath, encoding);
83
- if (callerSubpath) {
84
- const nested = join(assetsRoot, callerSubpath, relPath);
85
- tried.push(nested);
86
- if (existsSync(nested)) return readFileSync(nested, encoding);
87
- }
88
- const msg = [
89
- "readAsset: file not found.",
90
- "Searched:",
91
- ...tried.map((p) => `- ${p}`)
92
- ].join("\n");
93
- throw new Error(msg);
94
- };
95
-
96
- //#endregion
97
- export { readAsset };
98
- //# sourceMappingURL=_utils_asset.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_utils_asset.mjs","names":[],"sources":["../../../../../../../../../@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { basename, dirname, join, relative, resolve, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n//#region \\0utils:asset\nconst hereDirname = () => {\n\ttry {\n\t\treturn dirname(fileURLToPath(import.meta.url));\n\t} catch {\n\t\treturn typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n\t}\n};\nconst findDistRoot = (startDir) => {\n\tlet dir = startDir;\n\tfor (let i = 0; i < 12; i++) {\n\t\tif (basename(dir) === \"dist\") return dir;\n\t\tconst parent = resolve(dir, \"..\");\n\t\tif (parent === dir) break;\n\t\tdir = parent;\n\t}\n\treturn null;\n};\nconst normalizeFrameFile = (file) => {\n\tif (!file) return null;\n\ttry {\n\t\tif (file.startsWith(\"file://\")) return fileURLToPath(file);\n\t} catch {}\n\treturn file;\n};\n/**\n* Returns the directory of the *caller* module that invoked readAsset.\n* Prefers non-virtual frames; falls back to the first real frame.\n*/\nconst getCallerDir = () => {\n\tconst prev = Error.prepareStackTrace;\n\ttry {\n\t\tError.prepareStackTrace = (_, structured) => structured;\n\t\tconst err = /* @__PURE__ */ new Error();\n\t\tError.captureStackTrace(err, getCallerDir);\n\t\t/** @type {import('node:vm').CallSite[]} */\n\t\tconst frames = err.stack || [];\n\t\tconst isVirtualPath = (p) => p.includes(`${sep}_virtual${sep}`) || p.includes(\"/_virtual/\");\n\t\tfor (const frame of frames) {\n\t\t\tconst file = normalizeFrameFile(typeof frame.getFileName === \"function\" ? frame.getFileName() : null);\n\t\t\tif (!file) continue;\n\t\t\tif (file.includes(\"node:internal\") || file.includes(`${sep}internal${sep}modules${sep}`)) continue;\n\t\t\tif (!isVirtualPath(file)) return dirname(file);\n\t\t}\n\t\tfor (const frame of frames) {\n\t\t\tconst file = normalizeFrameFile(typeof frame.getFileName === \"function\" ? frame.getFileName() : null);\n\t\t\tif (file) return dirname(file);\n\t\t}\n\t} catch {} finally {\n\t\tError.prepareStackTrace = prev;\n\t}\n\treturn hereDirname();\n};\n/**\n* Read an asset copied from src/** to dist/assets/**.\n* - './' or '../' is resolved relative to the *caller module's* emitted directory.\n* - otherwise, treat as src-relative.\n*\n* @param {string} relPath - e.g. './PROMPT.md' or 'utils/AI/askDocQuestion/embeddings/<fileKey>.json'\n* @param {BufferEncoding} [encoding='utf8']\n*/\nconst readAsset = (relPath, encoding = \"utf8\") => {\n\tconst here = hereDirname();\n\tconst distRoot = findDistRoot(here) ?? resolve(here, \"..\", \"..\", \"dist\");\n\tconst assetsRoot = join(distRoot, \"assets\");\n\tconst tried = [];\n\t/**\n\t* Transform dist/(esm|cjs)/... and _virtual/ prefix to clean subpath (Windows-safe)\n\t*/\n\tconst callerSubpath = relative(distRoot, getCallerDir()).split(\"\\\\\").join(\"/\").replace(/^(?:dist\\/)?(?:esm|cjs)\\//, \"\").replace(/^_virtual\\//, \"\");\n\tif (relPath.startsWith(\"./\") || relPath.startsWith(\"../\")) {\n\t\tconst fromCallerAbs = resolve(assetsRoot, callerSubpath, relPath);\n\t\ttried.push(fromCallerAbs);\n\t\tif (existsSync(fromCallerAbs)) return readFileSync(fromCallerAbs, encoding);\n\t}\n\tconst directPath = join(assetsRoot, relPath);\n\ttried.push(directPath);\n\tif (existsSync(directPath)) return readFileSync(directPath, encoding);\n\tif (callerSubpath) {\n\t\tconst nested = join(assetsRoot, callerSubpath, relPath);\n\t\ttried.push(nested);\n\t\tif (existsSync(nested)) return readFileSync(nested, encoding);\n\t}\n\tconst msg = [\n\t\t\"readAsset: file not found.\",\n\t\t\"Searched:\",\n\t\t...tried.map((p) => `- ${p}`)\n\t].join(\"\\n\");\n\tthrow new Error(msg);\n};\n\n//#endregion\nexport { readAsset };"],"mappings":";;;;;AAKA,MAAM,oBAAoB;AACzB,KAAI;AACH,SAAO,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;SACvC;AACP,SAAO,OAAO,cAAc,cAAc,YAAY,QAAQ,KAAK;;;AAGrE,MAAM,gBAAgB,aAAa;CAClC,IAAI,MAAM;AACV,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;AAC5B,MAAI,SAAS,IAAI,KAAK,OAAQ,QAAO;EACrC,MAAM,SAAS,QAAQ,KAAK,KAAK;AACjC,MAAI,WAAW,IAAK;AACpB,QAAM;;AAEP,QAAO;;AAER,MAAM,sBAAsB,SAAS;AACpC,KAAI,CAAC,KAAM,QAAO;AAClB,KAAI;AACH,MAAI,KAAK,WAAW,UAAU,CAAE,QAAO,cAAc,KAAK;SACnD;AACR,QAAO;;;;;;AAMR,MAAM,qBAAqB;CAC1B,MAAM,OAAO,MAAM;AACnB,KAAI;AACH,QAAM,qBAAqB,GAAG,eAAe;EAC7C,MAAM,sBAAsB,IAAI,OAAO;AACvC,QAAM,kBAAkB,KAAK,aAAa;;EAE1C,MAAM,SAAS,IAAI,SAAS,EAAE;EAC9B,MAAM,iBAAiB,MAAM,EAAE,SAAS,GAAG,IAAI,UAAU,MAAM,IAAI,EAAE,SAAS,aAAa;AAC3F,OAAK,MAAM,SAAS,QAAQ;GAC3B,MAAM,OAAO,mBAAmB,OAAO,MAAM,gBAAgB,aAAa,MAAM,aAAa,GAAG,KAAK;AACrG,OAAI,CAAC,KAAM;AACX,OAAI,KAAK,SAAS,gBAAgB,IAAI,KAAK,SAAS,GAAG,IAAI,UAAU,IAAI,SAAS,MAAM,CAAE;AAC1F,OAAI,CAAC,cAAc,KAAK,CAAE,QAAO,QAAQ,KAAK;;AAE/C,OAAK,MAAM,SAAS,QAAQ;GAC3B,MAAM,OAAO,mBAAmB,OAAO,MAAM,gBAAgB,aAAa,MAAM,aAAa,GAAG,KAAK;AACrG,OAAI,KAAM,QAAO,QAAQ,KAAK;;SAExB,WAAW;AAClB,QAAM,oBAAoB;;AAE3B,QAAO,aAAa;;;;;;;;;;AAUrB,MAAM,aAAa,SAAS,WAAW,WAAW;CACjD,MAAM,OAAO,aAAa;CAC1B,MAAM,WAAW,aAAa,KAAK,IAAI,QAAQ,MAAM,MAAM,MAAM,OAAO;CACxE,MAAM,aAAa,KAAK,UAAU,SAAS;CAC3C,MAAM,QAAQ,EAAE;;;;CAIhB,MAAM,gBAAgB,SAAS,UAAU,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC,KAAK,IAAI,CAAC,QAAQ,6BAA6B,GAAG,CAAC,QAAQ,eAAe,GAAG;AAClJ,KAAI,QAAQ,WAAW,KAAK,IAAI,QAAQ,WAAW,MAAM,EAAE;EAC1D,MAAM,gBAAgB,QAAQ,YAAY,eAAe,QAAQ;AACjE,QAAM,KAAK,cAAc;AACzB,MAAI,WAAW,cAAc,CAAE,QAAO,aAAa,eAAe,SAAS;;CAE5E,MAAM,aAAa,KAAK,YAAY,QAAQ;AAC5C,OAAM,KAAK,WAAW;AACtB,KAAI,WAAW,WAAW,CAAE,QAAO,aAAa,YAAY,SAAS;AACrE,KAAI,eAAe;EAClB,MAAM,SAAS,KAAK,YAAY,eAAe,QAAQ;AACvD,QAAM,KAAK,OAAO;AAClB,MAAI,WAAW,OAAO,CAAE,QAAO,aAAa,QAAQ,SAAS;;CAE9D,MAAM,MAAM;EACX;EACA;EACA,GAAG,MAAM,KAAK,MAAM,KAAK,IAAI;EAC7B,CAAC,KAAK,KAAK;AACZ,OAAM,IAAI,MAAM,IAAI"}
@@ -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"}