intlayer-editor 7.1.0 → 7.1.1-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/{CodeBlockShiki-BSALDQ1I.js → CodeBlockShiki-DjZrDqS2.js} +3 -3
- package/client/dist/assets/{bundle-web-CDKQVXX6.js → bundle-web-ByW6N4oT.js} +1 -1
- package/client/dist/assets/{index-BVgTO6SK.css → index-C_dK2Oqm.css} +35 -8
- package/client/dist/assets/{index-RhJD8Pnc.js → index-DTNRLJtJ.js} +13 -14
- package/client/dist/index.html +2 -2
- package/package.json +22 -30
- package/server/dist/_virtual/rolldown_runtime.cjs +4 -0
- package/server/dist/_virtual/rolldown_runtime.mjs +31 -0
- 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/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.cjs +99 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs +98 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/_virtual/_utils_asset.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +36 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +35 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs +18 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs +17 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/utils/getFormatFromExtension.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.cjs +25 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +24 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.cjs +72 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +71 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.cjs +1744 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.mjs +1744 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs +116 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +116 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.cjs +66 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.cjs.map +1 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.mjs +65 -0
- package/server/dist/packages/@intlayer/chokidar/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue-CV5z08t_.js","assets/css-BtVcDqlU.js","assets/javascript-BXO33K-2.js","assets/typescript-j4TNaYMi.js","assets/json-D07AUpjp.js","assets/html-derivative-9rfoponC.js","assets/html-Dkr1GMsP.js","assets/bundle-web-
|
|
2
|
-
import { r as reactExports, j as jsxRuntimeExports, C as CodeDefault, _ as __vitePreload } from "./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue-CV5z08t_.js","assets/css-BtVcDqlU.js","assets/javascript-BXO33K-2.js","assets/typescript-j4TNaYMi.js","assets/json-D07AUpjp.js","assets/html-derivative-9rfoponC.js","assets/html-Dkr1GMsP.js","assets/bundle-web-ByW6N4oT.js","assets/index-DTNRLJtJ.js","assets/index-C_dK2Oqm.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { r as reactExports, j as jsxRuntimeExports, C as CodeDefault, _ as __vitePreload } from "./index-DTNRLJtJ.js";
|
|
3
3
|
const languageCache = /* @__PURE__ */ new Map();
|
|
4
4
|
const themeCache = /* @__PURE__ */ new Map();
|
|
5
5
|
const loadLanguage = async (lang) => {
|
|
@@ -60,7 +60,7 @@ const loadTheme = async (themeName) => {
|
|
|
60
60
|
const highlightCode = async (code, lang, isDarkMode) => {
|
|
61
61
|
const themeName = isDarkMode ? "github-dark" : "github-light";
|
|
62
62
|
const [{ codeToHtml }, languageModule, themeModule] = await Promise.all([
|
|
63
|
-
__vitePreload(() => import("./bundle-web-
|
|
63
|
+
__vitePreload(() => import("./bundle-web-ByW6N4oT.js"), true ? __vite__mapDeps([7,8,9]) : void 0),
|
|
64
64
|
loadLanguage(lang),
|
|
65
65
|
loadTheme(themeName)
|
|
66
66
|
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CqDu7dYI.js","assets/html-Dkr1GMsP.js","assets/javascript-BXO33K-2.js","assets/css-BtVcDqlU.js","assets/angular-ts-JUgYMaAO.js","assets/scss-Dq-LbI_c.js","assets/astro-DgRPb09x.js","assets/json-D07AUpjp.js","assets/typescript-j4TNaYMi.js","assets/postcss-kj1IbjVd.js","assets/tsx-B9RA6cgQ.js","assets/blade-BNo76U2i.js","assets/html-derivative-9rfoponC.js","assets/xml-BMzZeaqs.js","assets/java-BfXh-0uJ.js","assets/sql-DzUuSofg.js","assets/coffee-DRmm8L99.js","assets/cpp-zh2ePAE_.js","assets/regexp-BxWeO75u.js","assets/glsl-CGsiYPcu.js","assets/c-C4VtT7JA.js","assets/graphql-BRx9mrhY.js","assets/jsx-BPmvoin2.js","assets/haml-O037W7a8.js","assets/handlebars-kwM0CYPJ.js","assets/yaml-B_vW5iTY.js","assets/http-CB4Cm8yY.js","assets/bash-Bz2gZrDc.js","assets/jinja-DX5epABU.js","assets/jison-5-r4c8L1.js","assets/julia-CSYRDJn0.js","assets/python-CrdIx4PZ.js","assets/r-oprfD2-9.js","assets/marko-D6KBFqYp.js","assets/less-BAzLMJNR.js","assets/mdc-N73HqDUD.js","assets/markdown-F_EULe_G.js","assets/php-D0sxH1LE.js","assets/pug-HL4PJmfE.js","assets/svelte-zeq24KqG.js","assets/ts-tags-CINmazHI.js","assets/vue-CV5z08t_.js","assets/vue-html-k04GfWOW.js","assets/vue-vine-BL_nHMoY.js","assets/stylus-DXFa_2Jl.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import { _ as __vitePreload } from "./index-
|
|
2
|
+
import { _ as __vitePreload } from "./index-DTNRLJtJ.js";
|
|
3
3
|
let ShikiError$2 = class ShikiError extends Error {
|
|
4
4
|
constructor(message) {
|
|
5
5
|
super(message);
|
|
@@ -3039,6 +3039,16 @@
|
|
|
3039
3039
|
}
|
|
3040
3040
|
}
|
|
3041
3041
|
|
|
3042
|
+
.bg-text\/20 {
|
|
3043
|
+
background-color: #12121233;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3047
|
+
.bg-text\/20 {
|
|
3048
|
+
background-color: color-mix(in oklab, var(--color-text) 20%, transparent);
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3042
3052
|
.bg-transparent {
|
|
3043
3053
|
background-color: #0000;
|
|
3044
3054
|
}
|
|
@@ -4156,6 +4166,16 @@
|
|
|
4156
4166
|
color: var(--color-text-opposite);
|
|
4157
4167
|
}
|
|
4158
4168
|
|
|
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
|
+
|
|
4159
4179
|
.text-text\/50 {
|
|
4160
4180
|
color: #12121280;
|
|
4161
4181
|
}
|
|
@@ -4492,6 +4512,16 @@
|
|
|
4492
4512
|
}
|
|
4493
4513
|
}
|
|
4494
4514
|
|
|
4515
|
+
.ring-text\/20 {
|
|
4516
|
+
--tw-ring-color: #12121233;
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
4520
|
+
.ring-text\/20 {
|
|
4521
|
+
--tw-ring-color: color-mix(in oklab, var(--color-text) 20%, transparent);
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4495
4525
|
.ring-white\/20 {
|
|
4496
4526
|
--tw-ring-color: #fff3;
|
|
4497
4527
|
}
|
|
@@ -4506,10 +4536,6 @@
|
|
|
4506
4536
|
--tw-ring-offset-color: currentcolor;
|
|
4507
4537
|
}
|
|
4508
4538
|
|
|
4509
|
-
.ring-offset-neutral-100 {
|
|
4510
|
-
--tw-ring-offset-color: var(--color-neutral-100);
|
|
4511
|
-
}
|
|
4512
|
-
|
|
4513
4539
|
.outline-hidden {
|
|
4514
4540
|
--tw-outline-style: none;
|
|
4515
4541
|
outline-style: none;
|
|
@@ -5789,6 +5815,11 @@
|
|
|
5789
5815
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
5790
5816
|
}
|
|
5791
5817
|
|
|
5818
|
+
.focus-visible\:ring-4:focus-visible {
|
|
5819
|
+
--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
5820
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
5821
|
+
}
|
|
5822
|
+
|
|
5792
5823
|
.focus-visible\:ring-6:focus-visible {
|
|
5793
5824
|
--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(6px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
5794
5825
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -6417,10 +6448,6 @@
|
|
|
6417
6448
|
--tw-ring-color: var(--color-neutral-700);
|
|
6418
6449
|
}
|
|
6419
6450
|
|
|
6420
|
-
:where([data-theme="dark"], [data-theme="dark"] *) .dark\:ring-offset-neutral-700 {
|
|
6421
|
-
--tw-ring-offset-color: var(--color-neutral-700);
|
|
6422
|
-
}
|
|
6423
|
-
|
|
6424
6451
|
:where([data-theme="dark"], [data-theme="dark"] *) .dark\:before\:bg-neutral-950:before, :where([data-theme="dark"], [data-theme="dark"] *) .dark\:after\:bg-neutral-950:after {
|
|
6425
6452
|
content: var(--tw-content);
|
|
6426
6453
|
background-color: var(--color-neutral-950);
|
|
@@ -20913,7 +20913,7 @@ const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
|
20913
20913
|
}
|
|
20914
20914
|
},
|
|
20915
20915
|
defaultVariants: {
|
|
20916
|
-
roundedSize: "
|
|
20916
|
+
roundedSize: "lg",
|
|
20917
20917
|
border: "none",
|
|
20918
20918
|
borderColor: "text",
|
|
20919
20919
|
transparency: "md",
|
|
@@ -20942,9 +20942,8 @@ const Container = ({ children, roundedSize, padding, transparency, separator, cl
|
|
|
20942
20942
|
border: typeof border === "boolean" ? border ? "with" : "none" : void 0,
|
|
20943
20943
|
background,
|
|
20944
20944
|
borderColor,
|
|
20945
|
-
gap
|
|
20946
|
-
|
|
20947
|
-
})),
|
|
20945
|
+
gap
|
|
20946
|
+
}), className),
|
|
20948
20947
|
...props,
|
|
20949
20948
|
children
|
|
20950
20949
|
});
|
|
@@ -31956,7 +31955,7 @@ const Checkbox = (props) => {
|
|
|
31956
31955
|
const cn$1 = (...classes) => classes.filter(Boolean).join(" ");
|
|
31957
31956
|
const inputVariants = cva([
|
|
31958
31957
|
"w-full select-text resize-none text-base shadow-none outline-none",
|
|
31959
|
-
"transition-
|
|
31958
|
+
"transition-all duration-300 md:text-sm",
|
|
31960
31959
|
"ring-0",
|
|
31961
31960
|
"disabled:opacity-50",
|
|
31962
31961
|
"rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl"
|
|
@@ -31966,15 +31965,14 @@ const inputVariants = cva([
|
|
|
31966
31965
|
default: [
|
|
31967
31966
|
"text-text",
|
|
31968
31967
|
"bg-neutral-50 dark:bg-neutral-950",
|
|
31969
|
-
"ring-
|
|
31970
|
-
"ring-offset-neutral-100 dark:ring-offset-neutral-700",
|
|
31971
|
-
"focus-visible:outline-none",
|
|
31968
|
+
"ring-text/20",
|
|
31972
31969
|
"disabled:ring-0",
|
|
31973
|
-
"
|
|
31970
|
+
"hover:ring-3",
|
|
31971
|
+
"focus-visible:outline-none focus-visible:ring-4",
|
|
31974
31972
|
"[box-shadow:none] focus:[box-shadow:none]",
|
|
31975
31973
|
"aria-invalid:border-error"
|
|
31976
31974
|
].join(" "),
|
|
31977
|
-
invisible:
|
|
31975
|
+
invisible: "border-none bg-inherit text-inherit outline-none ring-0"
|
|
31978
31976
|
},
|
|
31979
31977
|
size: {
|
|
31980
31978
|
md: "px-2 py-3 md:py-2",
|
|
@@ -32020,6 +32018,7 @@ const InputPassword = (props) => {
|
|
|
32020
32018
|
type: isPasswordRevealed ? "text" : "password"
|
|
32021
32019
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx("button", {
|
|
32022
32020
|
"data-testid": "eye-icon",
|
|
32021
|
+
type: "button",
|
|
32023
32022
|
className: "absolute right-2 h-full flex-row items-center",
|
|
32024
32023
|
onClick: handlePasswordReveal,
|
|
32025
32024
|
"aria-label": isPasswordRevealed ? "Hide password" : "Show password",
|
|
@@ -32479,13 +32478,13 @@ const InputOTPSlot = ({ index: index2, className, onClick, onKeyDown, ...props }
|
|
|
32479
32478
|
};
|
|
32480
32479
|
const InputOTPSeparator = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32481
32480
|
"aria-hidden": true,
|
|
32482
|
-
className: "z-0 table h-0.5 w-3 rounded-full bg-border text-
|
|
32481
|
+
className: "z-0 table h-0.5 w-3 rounded-full bg-border text-text/20",
|
|
32483
32482
|
...props,
|
|
32484
32483
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Minus, {})
|
|
32485
32484
|
});
|
|
32486
32485
|
const InputIndicator = ({ ref, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32487
32486
|
"data-indicator": true,
|
|
32488
|
-
className: "absolute top-0 z-0 h-
|
|
32487
|
+
className: "absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/20 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none",
|
|
32489
32488
|
ref,
|
|
32490
32489
|
...props
|
|
32491
32490
|
});
|
|
@@ -34494,7 +34493,7 @@ const AutoSizedTextArea = ({ className, autoSize = true, onChange, maxRows = 999
|
|
|
34494
34493
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TextArea, {
|
|
34495
34494
|
ref: setRef2,
|
|
34496
34495
|
onChange: handleChange,
|
|
34497
|
-
className: cn$2("overflow-y-auto", autoSize
|
|
34496
|
+
className: cn$2("overflow-y-auto", autoSize && "resize-none", className),
|
|
34498
34497
|
...props
|
|
34499
34498
|
});
|
|
34500
34499
|
};
|
|
@@ -49661,7 +49660,7 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
|
|
|
49661
49660
|
}, `line-${index2}-${line.slice(0, 10)}`)) })
|
|
49662
49661
|
})
|
|
49663
49662
|
});
|
|
49664
|
-
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
49663
|
+
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-DjZrDqS2.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
|
|
49665
49664
|
const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
49666
49665
|
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
49667
49666
|
...props,
|
package/client/dist/index.html
CHANGED
|
@@ -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-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DTNRLJtJ.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C_dK2Oqm.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
|
+
"version": "7.1.1-canary.1",
|
|
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": [
|
|
@@ -74,42 +74,42 @@
|
|
|
74
74
|
"lint": "biome lint .",
|
|
75
75
|
"lint:fix": "biome lint --write .",
|
|
76
76
|
"preview": "vite preview --config ./client/vite.config.ts",
|
|
77
|
-
"start": "bun server/dist/esm/index.mjs",
|
|
78
|
-
"start:client": "vite preview --config ./client/vite.config.ts",
|
|
79
|
-
"start:server": "bun --watch --hot ./server/dist/esm/index.mjs",
|
|
80
77
|
"publish": "bun publish || true",
|
|
81
78
|
"publish:canary": "bun publish --tag canary || true",
|
|
82
79
|
"publish:latest": "bun publish --tag latest || true",
|
|
80
|
+
"start": "bun server/dist/esm/index.mjs",
|
|
81
|
+
"start:client": "vite preview --config ./client/vite.config.ts",
|
|
82
|
+
"start:server": "bun --watch --hot ./server/dist/esm/index.mjs",
|
|
83
83
|
"test": "vitest run",
|
|
84
84
|
"test:watch": "vitest",
|
|
85
85
|
"typecheck": "tsc --project ./server/tsconfig.types.json --noEmit"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@intlayer/api": "7.1.
|
|
89
|
-
"@intlayer/config": "7.1.
|
|
90
|
-
"@intlayer/core": "7.1.
|
|
91
|
-
"@intlayer/design-system": "7.1.
|
|
92
|
-
"@intlayer/editor-react": "7.1.
|
|
93
|
-
"@intlayer/types": "7.1.
|
|
94
|
-
"@intlayer/unmerged-dictionaries-entry": "7.1.
|
|
95
|
-
"@tanstack/react-query": "5.90.
|
|
88
|
+
"@intlayer/api": "7.1.1-canary.1",
|
|
89
|
+
"@intlayer/config": "7.1.1-canary.1",
|
|
90
|
+
"@intlayer/core": "7.1.1-canary.1",
|
|
91
|
+
"@intlayer/design-system": "7.1.1-canary.1",
|
|
92
|
+
"@intlayer/editor-react": "7.1.1-canary.1",
|
|
93
|
+
"@intlayer/types": "7.1.1-canary.1",
|
|
94
|
+
"@intlayer/unmerged-dictionaries-entry": "7.1.1-canary.1",
|
|
95
|
+
"@tanstack/react-query": "5.90.10",
|
|
96
96
|
"compression": "1.8.1",
|
|
97
97
|
"cookie-parser": "1.4.7",
|
|
98
98
|
"cors": "2.8.5",
|
|
99
99
|
"express": "5.1.0",
|
|
100
|
-
"express-intlayer": "7.1.
|
|
100
|
+
"express-intlayer": "7.1.1-canary.1",
|
|
101
101
|
"framer-motion": "12.23.24",
|
|
102
102
|
"fuse.js": "7.1.0",
|
|
103
103
|
"helmet": "8.1.0",
|
|
104
|
-
"intlayer": "7.1.
|
|
105
|
-
"lucide-react": "0.
|
|
104
|
+
"intlayer": "7.1.1-canary.1",
|
|
105
|
+
"lucide-react": "0.554.0",
|
|
106
106
|
"mime": "4.1.0",
|
|
107
107
|
"react": "19.2.0",
|
|
108
108
|
"react-dom": "19.2.0",
|
|
109
|
-
"react-intlayer": "7.1.
|
|
109
|
+
"react-intlayer": "7.1.1-canary.1",
|
|
110
110
|
"react-router-dom": "7.9.5",
|
|
111
111
|
"rimraf": "6.1.0",
|
|
112
|
-
"vite-intlayer": "7.1.
|
|
112
|
+
"vite-intlayer": "7.1.1-canary.1"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@tailwindcss/vite": "4.1.16",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@types/cors": "2.8.19",
|
|
119
119
|
"@types/express": "5.0.5",
|
|
120
120
|
"@types/node": "24.10.1",
|
|
121
|
-
"@types/react": "19.2.
|
|
121
|
+
"@types/react": "19.2.5",
|
|
122
122
|
"@types/react-dom": "19.2.3",
|
|
123
123
|
"@utils/ts-config": "1.0.4",
|
|
124
124
|
"@vitejs/plugin-react": "^5.1.0",
|
|
@@ -126,29 +126,21 @@
|
|
|
126
126
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
127
127
|
"globals": "16.5.0",
|
|
128
128
|
"tailwindcss": "4.1.17",
|
|
129
|
-
"tsdown": "0.16.
|
|
129
|
+
"tsdown": "0.16.5",
|
|
130
130
|
"typescript": "5.9.3",
|
|
131
131
|
"vite": "7.2.0",
|
|
132
132
|
"vitest": "4.0.8"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
|
-
"@intlayer/chokidar": "7.1.0",
|
|
136
|
-
"@intlayer/config": "7.1.0",
|
|
137
|
-
"@intlayer/core": "7.1.0",
|
|
138
|
-
"@intlayer/design-system": "7.1.0",
|
|
139
|
-
"@intlayer/dictionaries-entry": "7.1.0",
|
|
140
|
-
"@intlayer/editor-react": "7.1.0",
|
|
141
|
-
"@intlayer/types": "7.1.0",
|
|
142
|
-
"@intlayer/unmerged-dictionaries-entry": "7.1.0",
|
|
143
135
|
"clsx": "2.1.1",
|
|
144
136
|
"framer-motion": "12.23.24",
|
|
145
|
-
"intlayer": "7.1.
|
|
137
|
+
"intlayer": "7.1.1-canary.1",
|
|
146
138
|
"react": ">=16.0.0",
|
|
147
139
|
"react-dom": ">=16.0.0",
|
|
148
|
-
"react-intlayer": "7.1.
|
|
140
|
+
"react-intlayer": "7.1.1-canary.1",
|
|
149
141
|
"react-router-dom": ">=6.0.0",
|
|
150
142
|
"tailwind-merge": "3.4.0",
|
|
151
|
-
"vite-intlayer": "7.1.
|
|
143
|
+
"vite-intlayer": "7.1.1-canary.1"
|
|
152
144
|
},
|
|
153
145
|
"engines": {
|
|
154
146
|
"node": ">=14.18"
|
|
@@ -5,6 +5,9 @@ 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
|
+
};
|
|
8
11
|
var __copyProps = (to, from, except, desc) => {
|
|
9
12
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
13
|
key = keys[i];
|
|
@@ -22,4 +25,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
25
|
|
|
23
26
|
//#endregion
|
|
24
27
|
|
|
28
|
+
exports.__commonJS = __commonJS;
|
|
25
29
|
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,31 @@
|
|
|
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,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');
|
|
3
4
|
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
|
|
40
|
+
const result = await require_writeContentDeclaration.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"],"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,
|
|
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,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";
|
|
2
3
|
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
|
|
package/server/dist/index.cjs
CHANGED
|
@@ -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");
|
|
7
6
|
let node_fs = require("node:fs");
|
|
8
7
|
let node_path = require("node:path");
|
|
9
8
|
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");
|
package/server/dist/index.mjs
CHANGED
|
@@ -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";
|
|
6
5
|
import { existsSync, lstatSync, readFileSync } from "node:fs";
|
|
7
6
|
import { dirname, join, resolve } from "node:path";
|
|
8
7
|
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";
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|