intlayer-editor 8.1.2 → 8.1.3
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/bin/intlayer-editor.mjs +1 -1
- package/client/dist/assets/CodeBlockShiki-Dr0jz5py.js +72 -0
- package/client/dist/assets/{bundle-web-Ds5WJwTR.js → bundle-web-B0zAjwpq.js} +1 -1
- package/client/dist/assets/index-DJcBmQRh.js +626 -0
- package/client/dist/assets/{index-DlEB8df_.css → index-DQjIA_ss.css} +34 -51
- package/client/dist/assets/{index--NVtNBE5.js → index-oI9v5Dsg.js} +6047 -15199
- package/client/dist/index.html +2 -2
- package/package.json +11 -11
- package/server/dist/_virtual/_rolldown/runtime.cjs +1 -29
- package/server/dist/controllers/configuration.controller.cjs +1 -32
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.mjs +1 -30
- package/server/dist/controllers/configuration.controller.mjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +1 -108
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.d.ts +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +1 -105
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
- package/server/dist/export.cjs +1 -7
- package/server/dist/export.mjs +1 -4
- package/server/dist/index.cjs +7 -91
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.mjs +7 -82
- package/server/dist/index.mjs.map +1 -1
- package/server/dist/routes/config.routes.cjs +1 -20
- package/server/dist/routes/config.routes.cjs.map +1 -1
- package/server/dist/routes/config.routes.mjs +1 -17
- package/server/dist/routes/config.routes.mjs.map +1 -1
- package/server/dist/routes/dictionary.routes.cjs +1 -28
- package/server/dist/routes/dictionary.routes.cjs.map +1 -1
- package/server/dist/routes/dictionary.routes.mjs +1 -25
- package/server/dist/routes/dictionary.routes.mjs.map +1 -1
- package/server/dist/utils/checkPortAvailability.cjs +1 -23
- package/server/dist/utils/checkPortAvailability.cjs.map +1 -1
- package/server/dist/utils/checkPortAvailability.mjs +1 -20
- package/server/dist/utils/checkPortAvailability.mjs.map +1 -1
- package/server/dist/utils/httpStatusCodes.cjs +1 -401
- package/server/dist/utils/httpStatusCodes.cjs.map +1 -1
- package/server/dist/utils/httpStatusCodes.mjs +1 -399
- package/server/dist/utils/httpStatusCodes.mjs.map +1 -1
- package/server/dist/utils/responseData.cjs +1 -33
- package/server/dist/utils/responseData.cjs.map +1 -1
- package/server/dist/utils/responseData.mjs +1 -31
- package/server/dist/utils/responseData.mjs.map +1 -1
- package/client/dist/assets/CodeBlockShiki-CiqgD86t.js +0 -104
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["__dirname","intlayer","checkPortAvailability","fastifyHelmet","fastifyCors","fastifyCompress","fastifyCookie","fastifyFormbody","dictionaryRouter","configurationRouter","fastifyStatic","ANSIColors"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["__dirname","intlayer","checkPortAvailability","fastifyHelmet","fastifyCors","fastifyCompress","fastifyCookie","fastifyFormbody","dictionaryRouter","configurationRouter","fastifyStatic","ANSIColors"],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { ANSIColors, colorize, colorizePath } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n disableRequestLogging: true, // Optional: Keep logs clean like the original\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n console.error(`\\x1b[1;31mError: Port ${port} is already in use.\\x1b[0m`);\n process.exit(255);\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: '0.0.0.0' });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (err) {\n app.log.error(err);\n process.exit(1);\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":"gvBAmBA,MAAMA,GAAAA,EAAAA,EAAAA,UAAAA,EAAAA,EAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KAAkD,CAAC,CAEnD,EAAiB,CACrB,IAAK,QAAQ,IAAI,SACjB,QAAS,QAAQ,IAAI,SACtB,CAGK,EAAc,KAAK,OAAA,EAAA,EAAA,eAAA,EAAA,EAAA,SACFA,EAAW,qBAAqB,CAAE,OAAO,CAC/D,CAEK,GAAA,EAAA,EAAA,SAA+B,CACnC,sBAAuB,GACxB,CAAC,CAIF,EAAI,SAASC,EAAAA,SAAS,CAEtB,MACM,GAAA,EAAA,EAAA,kBAA0B,EAAe,CACzC,EAAO,EAAO,OAAO,MAAQ,IAE7B,GAAA,EAAA,EAAA,SAAyBD,EAAW,oBAAoB,CAExD,EAAkC,CACtC,OAAQ,IACR,YAAa,GACd,EAEmB,KAAO,IAAyB,CAC1B,MAAME,EAAAA,sBAAsB,EAAK,GAGvD,QAAQ,MAAM,yBAAyB,EAAK,4BAA4B,CACxE,QAAQ,KAAK,IAAI,EAInB,MAAM,EAAI,SAASC,EAAAA,QAAe,CAChC,sBAAuB,GACvB,OAAQ,GACT,CAAC,CAGF,MAAM,EAAI,SAASC,EAAAA,QAAa,EAAY,CAG5C,MAAM,EAAI,SAASC,EAAAA,QAAgB,CAGnC,MAAM,EAAI,SAASC,EAAAA,QAAc,CAGjC,MAAM,EAAI,SAASC,EAAAA,QAAgB,CAGnC,MAAM,EAAI,SAASC,EAAAA,iBAAkB,CAAE,OAAQ,kBAAmB,CAAC,CACnE,MAAM,EAAI,SAASC,EAAAA,oBAAqB,CAAE,OAAQ,cAAe,CAAC,CAGlE,MAAM,EAAI,SAASC,EAAAA,QAAe,CAChC,KAAM,EACN,SAAU,GACX,CAAC,CAGF,EAAI,oBAAoB,EAAK,IAAU,CACrC,IAAM,GAAA,EAAA,EAAA,MAAqB,EAAgB,EAAI,IAAI,KAAO,IAAI,CAE9D,IAAA,EAAA,EAAA,YAAe,EAAc,GAAA,EAAA,EAAA,WAAc,EAAc,CAAC,QAAQ,CAAE,CAClE,IAAM,EACJ,EAAA,QAAK,QAAQ,EAAc,EAAI,2BAEjC,OADA,EAAM,OAAO,eAAgB,EAAS,CAC/B,EAAM,SAAS,EAAI,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,EAAI,aAAa,MAEpE,OAAO,EAAM,SAAS,aAAa,EAErC,CAEF,GAAI,CACF,MAAM,EAAI,OAAO,CAAE,OAAM,KAAM,UAAW,CAAC,CAE3C,IAAM,GAAA,EAAA,EAAA,gBACJ,EAAe,IACf,EAAe,QAChB,CAED,QAAQ,IAAI;oCACQ,WAAYC,EAAAA,WAAW,KAAK,CAAEA,EAAAA,WAAW,UAAU,CAAC,IAAA,EAAA,EAAA,UAAY,IAAI,EAAY,UAAWA,EAAAA,WAAW,UAAU,CAAC;;sDAEzF,oBAAoB,IAAO,CAAC;qBAC7D,IAAKA,EAAAA,WAAW,UAAU,CAAC,8BAA8B,EAAO,OAAO,iBAAmB,GAAK,KAAA,EAAA,EAAA,cAAmB,EAAO,OAAO,eAAe,CAAC;qBAChJ,IAAKA,EAAAA,WAAW,UAAU,CAAC,8BAA8B,EAAO,OAAO,UAAY,IAAI;qBACvF,IAAKA,EAAAA,WAAW,UAAU,CAAC,8BAA8B,GAAkB,IAAI;MACxF,OACK,EAAK,CACZ,EAAI,IAAI,MAAM,EAAI,CAClB,QAAQ,KAAK,EAAE,IAKP,EAAI"}
|
package/server/dist/index.mjs
CHANGED
|
@@ -1,84 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { checkPortAvailability } from "./utils/checkPortAvailability.mjs";
|
|
4
|
-
import { ANSIColors, colorize, colorizePath, getConfiguration, getEnvFilePath } from "@intlayer/config";
|
|
5
|
-
import { intlayer } from "fastify-intlayer";
|
|
6
|
-
import { existsSync, lstatSync, readFileSync } from "node:fs";
|
|
7
|
-
import { dirname, join, resolve } from "node:path";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
-
import fastifyCompress from "@fastify/compress";
|
|
10
|
-
import fastifyCookie from "@fastify/cookie";
|
|
11
|
-
import fastifyCors from "@fastify/cors";
|
|
12
|
-
import fastifyFormbody from "@fastify/formbody";
|
|
13
|
-
import fastifyHelmet from "@fastify/helmet";
|
|
14
|
-
import fastifyStatic from "@fastify/static";
|
|
15
|
-
import Fastify from "fastify";
|
|
16
|
-
import mime from "mime";
|
|
1
|
+
import{configurationRouter as e}from"./routes/config.routes.mjs";import{dictionaryRouter as t}from"./routes/dictionary.routes.mjs";import{checkPortAvailability as n}from"./utils/checkPortAvailability.mjs";import{getConfiguration as r}from"@intlayer/config/node";import{intlayer as i}from"fastify-intlayer";import{existsSync as a,lstatSync as o,readFileSync as s}from"node:fs";import{dirname as c,join as l,resolve as u}from"node:path";import{fileURLToPath as d}from"node:url";import f from"@fastify/compress";import p from"@fastify/cookie";import m from"@fastify/cors";import h from"@fastify/formbody";import g from"@fastify/helmet";import _ from"@fastify/static";import{getEnvFilePath as v}from"@intlayer/config/env";import{ANSIColors as y,colorize as b,colorizePath as x}from"@intlayer/config/logger";import S from"fastify";import C from"mime";const w=c(d(import.meta.url)),T={env:`production`,envFile:process.env.ENV_FILE},E=JSON.parse(s(u(w,`../../package.json`),`utf8`)),D=S({disableRequestLogging:!0});D.register(i);const O=r(T),k=O.editor.port??8e3,A=u(w,`../../client/dist`),j={origin:`*`,credentials:!0};(async r=>{await n(k)||(console.error(`\x1b[1;31mError: Port ${k} is already in use.\x1b[0m`),process.exit(255)),await r.register(g,{contentSecurityPolicy:!1,global:!0}),await r.register(m,j),await r.register(f),await r.register(p),await r.register(h),await r.register(t,{prefix:`/api/dictionary`}),await r.register(e,{prefix:`/api/config`}),await r.register(_,{root:A,wildcard:!1}),r.setNotFoundHandler((e,t)=>{let n=l(A,e.raw.url||`/`);if(a(n)&&o(n).isFile()){let r=C.getType(n)??`application/octet-stream`;return t.header(`Content-Type`,r),t.sendFile(e.raw.url?.split(`/`).pop()||`index.html`)}else return t.sendFile(`index.html`)});try{await r.listen({port:k,host:`0.0.0.0`});let e=v(T.env,T.envFile);console.log(`
|
|
2
|
+
${b(b(`INTLAYER`,y.BOLD),y.GREY_DARK)} ${b(`v${E.version}`,y.GREY_DARK)}
|
|
17
3
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
const packageJson = JSON.parse(readFileSync(resolve(__dirname, "../../package.json"), "utf8"));
|
|
25
|
-
const app = Fastify({ disableRequestLogging: true });
|
|
26
|
-
app.register(intlayer);
|
|
27
|
-
const FALLBACK_PORT = 8e3;
|
|
28
|
-
const config = getConfiguration(envFileOptions);
|
|
29
|
-
const port = config.editor.port ?? FALLBACK_PORT;
|
|
30
|
-
const clientDistPath = resolve(__dirname, "../../client/dist");
|
|
31
|
-
const corsOptions = {
|
|
32
|
-
origin: "*",
|
|
33
|
-
credentials: true
|
|
34
|
-
};
|
|
35
|
-
const startServer = async (app) => {
|
|
36
|
-
if (!await checkPortAvailability(port)) {
|
|
37
|
-
console.error(`\x1b[1;31mError: Port ${port} is already in use.\x1b[0m`);
|
|
38
|
-
process.exit(255);
|
|
39
|
-
}
|
|
40
|
-
await app.register(fastifyHelmet, {
|
|
41
|
-
contentSecurityPolicy: false,
|
|
42
|
-
global: true
|
|
43
|
-
});
|
|
44
|
-
await app.register(fastifyCors, corsOptions);
|
|
45
|
-
await app.register(fastifyCompress);
|
|
46
|
-
await app.register(fastifyCookie);
|
|
47
|
-
await app.register(fastifyFormbody);
|
|
48
|
-
await app.register(dictionaryRouter, { prefix: "/api/dictionary" });
|
|
49
|
-
await app.register(configurationRouter, { prefix: "/api/config" });
|
|
50
|
-
await app.register(fastifyStatic, {
|
|
51
|
-
root: clientDistPath,
|
|
52
|
-
wildcard: false
|
|
53
|
-
});
|
|
54
|
-
app.setNotFoundHandler((req, reply) => {
|
|
55
|
-
const requestedPath = join(clientDistPath, req.raw.url || "/");
|
|
56
|
-
if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {
|
|
57
|
-
const mimeType = mime.getType(requestedPath) ?? "application/octet-stream";
|
|
58
|
-
reply.header("Content-Type", mimeType);
|
|
59
|
-
return reply.sendFile(req.raw.url?.split("/").pop() || "index.html");
|
|
60
|
-
} else return reply.sendFile("index.html");
|
|
61
|
-
});
|
|
62
|
-
try {
|
|
63
|
-
await app.listen({
|
|
64
|
-
port,
|
|
65
|
-
host: "0.0.0.0"
|
|
66
|
-
});
|
|
67
|
-
const dotEnvFilePath = getEnvFilePath(envFileOptions.env, envFileOptions.envFile);
|
|
68
|
-
console.log(`
|
|
69
|
-
${colorize(colorize("INTLAYER", ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}
|
|
70
|
-
|
|
71
|
-
Editor running at: ${colorizePath(`http://localhost:${port}`)}
|
|
72
|
-
${colorize("➜", ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === "" ? "-" : colorizePath(config.editor.applicationURL)}
|
|
73
|
-
${colorize("➜", ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? "-"}
|
|
74
|
-
${colorize("➜", ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? "-"}
|
|
75
|
-
`);
|
|
76
|
-
} catch (err) {
|
|
77
|
-
app.log.error(err);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
startServer(app);
|
|
82
|
-
|
|
83
|
-
//#endregion
|
|
4
|
+
Editor running at: ${x(`http://localhost:${k}`)}
|
|
5
|
+
${b(`➜`,y.GREY_DARK)} Watching application at: ${O.editor.applicationURL===``?`-`:x(O.editor.applicationURL)}
|
|
6
|
+
${b(`➜`,y.GREY_DARK)} Access key: ${O.editor.clientId??`-`}
|
|
7
|
+
${b(`➜`,y.GREY_DARK)} Environment: ${e??`-`}
|
|
8
|
+
`)}catch(e){r.log.error(e),process.exit(1)}})(D);
|
|
84
9
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { existsSync, lstatSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport fastifyCompress from '@fastify/compress';\nimport fastifyCookie from '@fastify/cookie';\nimport fastifyCors, { type FastifyCorsOptions } from '@fastify/cors';\nimport fastifyFormbody from '@fastify/formbody';\nimport fastifyHelmet from '@fastify/helmet';\nimport fastifyStatic from '@fastify/static';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport { ANSIColors, colorize, colorizePath } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { configurationRouter } from '@routes/config.routes';\nimport { dictionaryRouter } from '@routes/dictionary.routes';\nimport { checkPortAvailability } from '@utils/checkPortAvailability';\nimport Fastify, { type FastifyInstance } from 'fastify';\nimport { intlayer } from 'fastify-intlayer';\nimport mime from 'mime';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst envFileOptions = {\n env: process.env.NODE_ENV,\n envFile: process.env.ENV_FILE,\n};\n\n// Load package.json\nconst packageJson = JSON.parse(\n readFileSync(resolve(__dirname, '../../package.json'), 'utf8')\n);\n\nconst app: FastifyInstance = Fastify({\n disableRequestLogging: true, // Optional: Keep logs clean like the original\n});\n\n// Load internationalization plugin\n// Assuming fastify-intlayer is the Fastify equivalent of express-intlayer\napp.register(intlayer);\n\nconst FALLBACK_PORT = 8000;\nconst config = getConfiguration(envFileOptions);\nconst port = config.editor.port ?? FALLBACK_PORT;\n\nconst clientDistPath = resolve(__dirname, '../../client/dist');\n\nconst corsOptions: FastifyCorsOptions = {\n origin: '*',\n credentials: true,\n};\n\nconst startServer = async (app: FastifyInstance) => {\n const isPortAvailable = await checkPortAvailability(port);\n\n if (!isPortAvailable) {\n console.error(`\\x1b[1;31mError: Port ${port} is already in use.\\x1b[0m`);\n process.exit(255);\n }\n\n // Security Headers\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n // CORS\n await app.register(fastifyCors, corsOptions);\n\n // Compression\n await app.register(fastifyCompress);\n\n // Cookie Parser\n await app.register(fastifyCookie);\n\n // Parse application/x-www-form-urlencoded\n await app.register(fastifyFormbody);\n\n // Register Routes\n await app.register(dictionaryRouter, { prefix: '/api/dictionary' });\n await app.register(configurationRouter, { prefix: '/api/config' });\n\n // Serve Static Files\n await app.register(fastifyStatic, {\n root: clientDistPath,\n wildcard: false, // We handle the fallback manually to match SPA logic\n });\n\n // For single-page applications, redirect all unmatched routes to index.html\n app.setNotFoundHandler((req, reply) => {\n const requestedPath = join(clientDistPath, req.raw.url || '/');\n\n if (existsSync(requestedPath) && lstatSync(requestedPath).isFile()) {\n const mimeType =\n mime.getType(requestedPath) ?? 'application/octet-stream';\n reply.header('Content-Type', mimeType);\n return reply.sendFile(req.raw.url?.split('/').pop() || 'index.html');\n } else {\n return reply.sendFile('index.html');\n }\n });\n\n try {\n await app.listen({ port, host: '0.0.0.0' });\n\n const dotEnvFilePath = getEnvFilePath(\n envFileOptions.env,\n envFileOptions.envFile\n );\n\n console.log(`\n ${colorize(colorize('INTLAYER', ANSIColors.BOLD), ANSIColors.GREY_DARK)} ${colorize(`v${packageJson.version}`, ANSIColors.GREY_DARK)}\n\n Editor running at: ${colorizePath(`http://localhost:${port}`)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Watching application at: ${config.editor.applicationURL === '' ? '-' : colorizePath(config.editor.applicationURL)}\n ${colorize('➜', ANSIColors.GREY_DARK)} Access key: ${config.editor.clientId ?? '-'}\n ${colorize('➜', ANSIColors.GREY_DARK)} Environment: ${dotEnvFilePath ?? '-'}\n `);\n } catch (err) {\n app.log.error(err);\n process.exit(1);\n }\n};\n\n// Start it up!\nstartServer(app);\n"],"mappings":"80BAmBA,MAAM,EAAY,EAAQ,EAAc,OAAO,KAAK,IAAI,CAAC,CAEnD,EAAiB,CACrB,IAAA,aACA,QAAS,QAAQ,IAAI,SACtB,CAGK,EAAc,KAAK,MACvB,EAAa,EAAQ,EAAW,qBAAqB,CAAE,OAAO,CAC/D,CAEK,EAAuB,EAAQ,CACnC,sBAAuB,GACxB,CAAC,CAIF,EAAI,SAAS,EAAS,CAEtB,MACM,EAAS,EAAiB,EAAe,CACzC,EAAO,EAAO,OAAO,MAAQ,IAE7B,EAAiB,EAAQ,EAAW,oBAAoB,CAExD,EAAkC,CACtC,OAAQ,IACR,YAAa,GACd,EAEmB,KAAO,IAAyB,CAC1B,MAAM,EAAsB,EAAK,GAGvD,QAAQ,MAAM,yBAAyB,EAAK,4BAA4B,CACxE,QAAQ,KAAK,IAAI,EAInB,MAAM,EAAI,SAAS,EAAe,CAChC,sBAAuB,GACvB,OAAQ,GACT,CAAC,CAGF,MAAM,EAAI,SAAS,EAAa,EAAY,CAG5C,MAAM,EAAI,SAAS,EAAgB,CAGnC,MAAM,EAAI,SAAS,EAAc,CAGjC,MAAM,EAAI,SAAS,EAAgB,CAGnC,MAAM,EAAI,SAAS,EAAkB,CAAE,OAAQ,kBAAmB,CAAC,CACnE,MAAM,EAAI,SAAS,EAAqB,CAAE,OAAQ,cAAe,CAAC,CAGlE,MAAM,EAAI,SAAS,EAAe,CAChC,KAAM,EACN,SAAU,GACX,CAAC,CAGF,EAAI,oBAAoB,EAAK,IAAU,CACrC,IAAM,EAAgB,EAAK,EAAgB,EAAI,IAAI,KAAO,IAAI,CAE9D,GAAI,EAAW,EAAc,EAAI,EAAU,EAAc,CAAC,QAAQ,CAAE,CAClE,IAAM,EACJ,EAAK,QAAQ,EAAc,EAAI,2BAEjC,OADA,EAAM,OAAO,eAAgB,EAAS,CAC/B,EAAM,SAAS,EAAI,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,EAAI,aAAa,MAEpE,OAAO,EAAM,SAAS,aAAa,EAErC,CAEF,GAAI,CACF,MAAM,EAAI,OAAO,CAAE,OAAM,KAAM,UAAW,CAAC,CAE3C,IAAM,EAAiB,EACrB,EAAe,IACf,EAAe,QAChB,CAED,QAAQ,IAAI;MACV,EAAS,EAAS,WAAY,EAAW,KAAK,CAAE,EAAW,UAAU,CAAC,GAAG,EAAS,IAAI,EAAY,UAAW,EAAW,UAAU,CAAC;;mCAEtG,EAAa,oBAAoB,IAAO,CAAC;MACtE,EAAS,IAAK,EAAW,UAAU,CAAC,8BAA8B,EAAO,OAAO,iBAAmB,GAAK,IAAM,EAAa,EAAO,OAAO,eAAe,CAAC;MACzJ,EAAS,IAAK,EAAW,UAAU,CAAC,8BAA8B,EAAO,OAAO,UAAY,IAAI;MAChG,EAAS,IAAK,EAAW,UAAU,CAAC,8BAA8B,GAAkB,IAAI;MACxF,OACK,EAAK,CACZ,EAAI,IAAI,MAAM,EAAI,CAClB,QAAQ,KAAK,EAAE,IAKP,EAAI"}
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_controllers_configuration_controller = require('../controllers/configuration.controller.cjs');
|
|
4
|
-
let _intlayer_config = require("@intlayer/config");
|
|
5
|
-
|
|
6
|
-
//#region src/routes/config.routes.ts
|
|
7
|
-
const { editor } = (0, _intlayer_config.getConfiguration)();
|
|
8
|
-
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
9
|
-
const getConfigurationRoutes = () => ({ getConfiguration: {
|
|
10
|
-
urlModel: "/",
|
|
11
|
-
url: getBaseURL(),
|
|
12
|
-
method: "GET"
|
|
13
|
-
} });
|
|
14
|
-
const configurationRouter = async (fastify) => {
|
|
15
|
-
fastify.get(getConfigurationRoutes().getConfiguration.urlModel, require_controllers_configuration_controller.getConfiguration);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
exports.configurationRouter = configurationRouter;
|
|
20
|
-
exports.getConfigurationRoutes = getConfigurationRoutes;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../controllers/configuration.controller.cjs`),{editor:t}=(0,require(`@intlayer/config/node`).getConfiguration)(),n=()=>`${t.editorURL}/api/dictionary`,r=()=>({getConfiguration:{urlModel:`/`,url:n(),method:`GET`}}),i=async t=>{t.get(r().getConfiguration.urlModel,e.getConfiguration)};exports.configurationRouter=i,exports.getConfigurationRoutes=r;
|
|
21
2
|
//# sourceMappingURL=config.routes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.routes.cjs","names":[],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.routes.cjs","names":[],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":"+KAKM,CAAE,WAAA,mCAAA,mBAA6B,CAE/B,MAAmB,GAAG,EAAO,UAAU,iBAEhC,OACV,CACC,iBAAkB,CAChB,SAAU,IACV,IAAK,GAAY,CACjB,OAAQ,MACT,CACF,EAEU,EAAsB,KAAO,IAA6B,CACrE,EAAQ,IACN,GAAwB,CAAC,iBAAiB,SAAA,EAAA,iBAE3C"}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getConfiguration } from "@intlayer/config";
|
|
3
|
-
|
|
4
|
-
//#region src/routes/config.routes.ts
|
|
5
|
-
const { editor } = getConfiguration();
|
|
6
|
-
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
7
|
-
const getConfigurationRoutes = () => ({ getConfiguration: {
|
|
8
|
-
urlModel: "/",
|
|
9
|
-
url: getBaseURL(),
|
|
10
|
-
method: "GET"
|
|
11
|
-
} });
|
|
12
|
-
const configurationRouter = async (fastify) => {
|
|
13
|
-
fastify.get(getConfigurationRoutes().getConfiguration.urlModel, getConfiguration$1);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { configurationRouter, getConfigurationRoutes };
|
|
1
|
+
import{getConfiguration as e}from"../controllers/configuration.controller.mjs";import{getConfiguration as t}from"@intlayer/config/node";const{editor:n}=t(),r=()=>`${n.editorURL}/api/dictionary`,i=()=>({getConfiguration:{urlModel:`/`,url:r(),method:`GET`}}),a=async t=>{t.get(i().getConfiguration.urlModel,e)};export{a as configurationRouter,i as getConfigurationRoutes};
|
|
18
2
|
//# sourceMappingURL=config.routes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.routes.mjs","names":["configurationController.getConfiguration"],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.routes.mjs","names":["configurationController.getConfiguration"],"sources":["../../src/routes/config.routes.ts"],"sourcesContent":["import * as configurationController from '@controllers/configuration.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getConfigurationRoutes = () =>\n ({\n getConfiguration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n }) satisfies Routes;\n\nexport const configurationRouter = async (fastify: FastifyInstance) => {\n fastify.get(\n getConfigurationRoutes().getConfiguration.urlModel,\n configurationController.getConfiguration\n );\n};\n"],"mappings":"wIAKA,KAAM,CAAE,UAAW,GAAkB,CAE/B,MAAmB,GAAG,EAAO,UAAU,iBAEhC,OACV,CACC,iBAAkB,CAChB,SAAU,IACV,IAAK,GAAY,CACjB,OAAQ,MACT,CACF,EAEU,EAAsB,KAAO,IAA6B,CACrE,EAAQ,IACN,GAAwB,CAAC,iBAAiB,SAC1CA,EACD"}
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_controllers_dictionary_controller = require('../controllers/dictionary.controller.cjs');
|
|
4
|
-
let _intlayer_config = require("@intlayer/config");
|
|
5
|
-
|
|
6
|
-
//#region src/routes/dictionary.routes.ts
|
|
7
|
-
const { editor } = (0, _intlayer_config.getConfiguration)();
|
|
8
|
-
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
9
|
-
const getDictionaryRoutes = () => ({
|
|
10
|
-
getDictionaries: {
|
|
11
|
-
urlModel: "/",
|
|
12
|
-
url: getBaseURL(),
|
|
13
|
-
method: "GET"
|
|
14
|
-
},
|
|
15
|
-
writeContentDeclaration: {
|
|
16
|
-
urlModel: "/",
|
|
17
|
-
url: getBaseURL(),
|
|
18
|
-
method: "POST"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
const dictionaryRouter = async (fastify) => {
|
|
22
|
-
fastify.get(getDictionaryRoutes().getDictionaries.urlModel, require_controllers_dictionary_controller.getDictionaries);
|
|
23
|
-
fastify.post(getDictionaryRoutes().writeContentDeclaration.urlModel, require_controllers_dictionary_controller.writeContentDeclaration);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
exports.dictionaryRouter = dictionaryRouter;
|
|
28
|
-
exports.getDictionaryRoutes = getDictionaryRoutes;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../controllers/dictionary.controller.cjs`),{editor:t}=(0,require(`@intlayer/config/node`).getConfiguration)(),n=()=>`${t.editorURL}/api/dictionary`,r=()=>({getDictionaries:{urlModel:`/`,url:n(),method:`GET`},writeContentDeclaration:{urlModel:`/`,url:n(),method:`POST`}}),i=async t=>{t.get(r().getDictionaries.urlModel,e.getDictionaries),t.post(r().writeContentDeclaration.urlModel,e.writeContentDeclaration)};exports.dictionaryRouter=i,exports.getDictionaryRoutes=r;
|
|
29
2
|
//# sourceMappingURL=dictionary.routes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.routes.cjs","names":["getDictionaries","writeContentDeclaration"],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.routes.cjs","names":["getDictionaries","writeContentDeclaration"],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":"4KAQM,CAAE,WAAA,mCAAA,mBAA6B,CAE/B,MAAmB,GAAG,EAAO,UAAU,iBAEhC,OACV,CACC,gBAAiB,CACf,SAAU,IACV,IAAK,GAAY,CACjB,OAAQ,MACT,CACD,wBAAyB,CACvB,SAAU,IACV,IAAK,GAAY,CACjB,OAAQ,OACT,CACF,EAEU,EAAmB,KAAO,IAA6B,CAClE,EAAQ,IAAI,GAAqB,CAAC,gBAAgB,SAAUA,EAAAA,gBAAgB,CAC5E,EAAQ,KACN,GAAqB,CAAC,wBAAwB,SAC9CC,EAAAA,wBACD"}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getConfiguration } from "@intlayer/config";
|
|
3
|
-
|
|
4
|
-
//#region src/routes/dictionary.routes.ts
|
|
5
|
-
const { editor } = getConfiguration();
|
|
6
|
-
const getBaseURL = () => `${editor.editorURL}/api/dictionary`;
|
|
7
|
-
const getDictionaryRoutes = () => ({
|
|
8
|
-
getDictionaries: {
|
|
9
|
-
urlModel: "/",
|
|
10
|
-
url: getBaseURL(),
|
|
11
|
-
method: "GET"
|
|
12
|
-
},
|
|
13
|
-
writeContentDeclaration: {
|
|
14
|
-
urlModel: "/",
|
|
15
|
-
url: getBaseURL(),
|
|
16
|
-
method: "POST"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const dictionaryRouter = async (fastify) => {
|
|
20
|
-
fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);
|
|
21
|
-
fastify.post(getDictionaryRoutes().writeContentDeclaration.urlModel, writeContentDeclaration);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { dictionaryRouter, getDictionaryRoutes };
|
|
1
|
+
import{getDictionaries as e,writeContentDeclaration as t}from"../controllers/dictionary.controller.mjs";import{getConfiguration as n}from"@intlayer/config/node";const{editor:r}=n(),i=()=>`${r.editorURL}/api/dictionary`,a=()=>({getDictionaries:{urlModel:`/`,url:i(),method:`GET`},writeContentDeclaration:{urlModel:`/`,url:i(),method:`POST`}}),o=async n=>{n.get(a().getDictionaries.urlModel,e),n.post(a().writeContentDeclaration.urlModel,t)};export{o as dictionaryRouter,a as getDictionaryRoutes};
|
|
26
2
|
//# sourceMappingURL=dictionary.routes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.routes.mjs","names":[],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.routes.mjs","names":[],"sources":["../../src/routes/dictionary.routes.ts"],"sourcesContent":["import {\n getDictionaries,\n writeContentDeclaration,\n} from '@controllers/dictionary.controller';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { FastifyInstance } from 'fastify';\nimport type { Routes } from '@/types/Routes';\n\nconst { editor } = getConfiguration();\n\nconst getBaseURL = () => `${editor.editorURL}/api/dictionary`;\n\nexport const getDictionaryRoutes = () =>\n ({\n getDictionaries: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'GET',\n },\n writeContentDeclaration: {\n urlModel: '/',\n url: getBaseURL(),\n method: 'POST',\n },\n }) satisfies Routes;\n\nexport const dictionaryRouter = async (fastify: FastifyInstance) => {\n fastify.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);\n fastify.post(\n getDictionaryRoutes().writeContentDeclaration.urlModel,\n writeContentDeclaration\n );\n};\n"],"mappings":"iKAQA,KAAM,CAAE,UAAW,GAAkB,CAE/B,MAAmB,GAAG,EAAO,UAAU,iBAEhC,OACV,CACC,gBAAiB,CACf,SAAU,IACV,IAAK,GAAY,CACjB,OAAQ,MACT,CACD,wBAAyB,CACvB,SAAU,IACV,IAAK,GAAY,CACjB,OAAQ,OACT,CACF,EAEU,EAAmB,KAAO,IAA6B,CAClE,EAAQ,IAAI,GAAqB,CAAC,gBAAgB,SAAU,EAAgB,CAC5E,EAAQ,KACN,GAAqB,CAAC,wBAAwB,SAC9C,EACD"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let node_net = require("node:net");
|
|
4
|
-
node_net = require_runtime.__toESM(node_net);
|
|
5
|
-
|
|
6
|
-
//#region src/utils/checkPortAvailability.ts
|
|
7
|
-
const checkPortAvailability = (port) => {
|
|
8
|
-
return new Promise((resolve) => {
|
|
9
|
-
const server = node_net.default.createServer();
|
|
10
|
-
server.once("error", (err) => {
|
|
11
|
-
if (err.code === "EADDRINUSE") resolve(false);
|
|
12
|
-
else resolve(true);
|
|
13
|
-
});
|
|
14
|
-
server.once("listening", () => {
|
|
15
|
-
server.close();
|
|
16
|
-
resolve(true);
|
|
17
|
-
});
|
|
18
|
-
server.listen(port);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.checkPortAvailability = checkPortAvailability;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:net`);t=e.__toESM(t);const n=e=>new Promise(n=>{let r=t.default.createServer();r.once(`error`,e=>{e.code===`EADDRINUSE`?n(!1):n(!0)}),r.once(`listening`,()=>{r.close(),n(!0)}),r.listen(e)});exports.checkPortAvailability=n;
|
|
24
2
|
//# sourceMappingURL=checkPortAvailability.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkPortAvailability.cjs","names":["net"],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkPortAvailability.cjs","names":["net"],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":"iKAEA,MAAa,EAAyB,GAC7B,IAAI,QAAS,GAAY,CAC9B,IAAM,EAASA,EAAAA,QAAI,cAAc,CAEjC,EAAO,KAAK,QAAU,GAAa,CAC7B,EAAI,OAAS,aACf,EAAQ,GAAM,CAEd,EAAQ,GAAK,EAEf,CAEF,EAAO,KAAK,gBAAmB,CAC7B,EAAO,OAAO,CACd,EAAQ,GAAK,EACb,CAEF,EAAO,OAAO,EAAK,EACnB"}
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/utils/checkPortAvailability.ts
|
|
4
|
-
const checkPortAvailability = (port) => {
|
|
5
|
-
return new Promise((resolve) => {
|
|
6
|
-
const server = net.createServer();
|
|
7
|
-
server.once("error", (err) => {
|
|
8
|
-
if (err.code === "EADDRINUSE") resolve(false);
|
|
9
|
-
else resolve(true);
|
|
10
|
-
});
|
|
11
|
-
server.once("listening", () => {
|
|
12
|
-
server.close();
|
|
13
|
-
resolve(true);
|
|
14
|
-
});
|
|
15
|
-
server.listen(port);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { checkPortAvailability };
|
|
1
|
+
import e from"node:net";const t=t=>new Promise(n=>{let r=e.createServer();r.once(`error`,e=>{e.code===`EADDRINUSE`?n(!1):n(!0)}),r.once(`listening`,()=>{r.close(),n(!0)}),r.listen(t)});export{t as checkPortAvailability};
|
|
21
2
|
//# sourceMappingURL=checkPortAvailability.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkPortAvailability.mjs","names":[],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkPortAvailability.mjs","names":[],"sources":["../../src/utils/checkPortAvailability.ts"],"sourcesContent":["import net from 'node:net';\n\nexport const checkPortAvailability = (port: number): Promise<boolean> => {\n return new Promise((resolve) => {\n const server = net.createServer();\n\n server.once('error', (err: any) => {\n if (err.code === 'EADDRINUSE') {\n resolve(false); // Port is in use\n } else {\n resolve(true);\n }\n });\n\n server.once('listening', () => {\n server.close();\n resolve(true); // Port is available\n });\n\n server.listen(port);\n });\n};\n"],"mappings":"wBAEA,MAAa,EAAyB,GAC7B,IAAI,QAAS,GAAY,CAC9B,IAAM,EAAS,EAAI,cAAc,CAEjC,EAAO,KAAK,QAAU,GAAa,CAC7B,EAAI,OAAS,aACf,EAAQ,GAAM,CAEd,EAAQ,GAAK,EAEf,CAEF,EAAO,KAAK,gBAAmB,CAC7B,EAAO,OAAO,CACd,EAAQ,GAAK,EACb,CAEF,EAAO,OAAO,EAAK,EACnB"}
|