hightjs 0.5.2 → 0.5.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/package.json +1 -1
- package/src/builder.js +8 -8
- package/src/hotReload.ts +4 -7
- package/src/router.ts +14 -26
- package/dist/adapters/express.d.ts +0 -7
- package/dist/adapters/express.js +0 -63
- package/dist/adapters/factory.d.ts +0 -23
- package/dist/adapters/factory.js +0 -122
- package/dist/adapters/fastify.d.ts +0 -25
- package/dist/adapters/fastify.js +0 -61
- package/dist/adapters/native.d.ts +0 -8
- package/dist/adapters/native.js +0 -198
- package/dist/api/console.d.ts +0 -94
- package/dist/api/console.js +0 -294
- package/dist/api/http.d.ts +0 -180
- package/dist/api/http.js +0 -469
- package/dist/bin/hightjs.d.ts +0 -2
- package/dist/bin/hightjs.js +0 -214
- package/dist/builder.d.ts +0 -32
- package/dist/builder.js +0 -581
- package/dist/client/DefaultNotFound.d.ts +0 -1
- package/dist/client/DefaultNotFound.js +0 -79
- package/dist/client/client.d.ts +0 -3
- package/dist/client/client.js +0 -24
- package/dist/client/clientRouter.d.ts +0 -58
- package/dist/client/clientRouter.js +0 -132
- package/dist/client/entry.client.d.ts +0 -1
- package/dist/client/entry.client.js +0 -455
- package/dist/components/Link.d.ts +0 -7
- package/dist/components/Link.js +0 -13
- package/dist/global/global.d.ts +0 -117
- package/dist/global/global.js +0 -17
- package/dist/helpers.d.ts +0 -20
- package/dist/helpers.js +0 -583
- package/dist/hotReload.d.ts +0 -32
- package/dist/hotReload.js +0 -548
- package/dist/index.d.ts +0 -18
- package/dist/index.js +0 -494
- package/dist/loaders.d.ts +0 -1
- package/dist/loaders.js +0 -46
- package/dist/renderer.d.ts +0 -14
- package/dist/renderer.js +0 -380
- package/dist/router.d.ts +0 -101
- package/dist/router.js +0 -667
- package/dist/types/framework.d.ts +0 -37
- package/dist/types/framework.js +0 -2
- package/dist/types.d.ts +0 -192
- package/dist/types.js +0 -2
package/dist/renderer.js
DELETED
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.render = render;
|
|
7
|
-
const router_1 = require("./router");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
// Função para gerar todas as meta tags
|
|
11
|
-
function generateMetaTags(metadata) {
|
|
12
|
-
const tags = [];
|
|
13
|
-
// Charset
|
|
14
|
-
tags.push(`<meta charset="${metadata.charset || 'UTF-8'}">`);
|
|
15
|
-
// Viewport
|
|
16
|
-
tags.push(`<meta name="viewport" content="${metadata.viewport || 'width=device-width, initial-scale=1.0'}">`);
|
|
17
|
-
// Description
|
|
18
|
-
if (metadata.description) {
|
|
19
|
-
tags.push(`<meta name="description" content="${metadata.description}">`);
|
|
20
|
-
}
|
|
21
|
-
// Keywords
|
|
22
|
-
if (metadata.keywords) {
|
|
23
|
-
const keywordsStr = Array.isArray(metadata.keywords)
|
|
24
|
-
? metadata.keywords.join(', ')
|
|
25
|
-
: metadata.keywords;
|
|
26
|
-
tags.push(`<meta name="keywords" content="${keywordsStr}">`);
|
|
27
|
-
}
|
|
28
|
-
// Author
|
|
29
|
-
if (metadata.author) {
|
|
30
|
-
tags.push(`<meta name="author" content="${metadata.author}">`);
|
|
31
|
-
}
|
|
32
|
-
// Theme color
|
|
33
|
-
if (metadata.themeColor) {
|
|
34
|
-
tags.push(`<meta name="theme-color" content="${metadata.themeColor}">`);
|
|
35
|
-
}
|
|
36
|
-
// Robots
|
|
37
|
-
if (metadata.robots) {
|
|
38
|
-
tags.push(`<meta name="robots" content="${metadata.robots}">`);
|
|
39
|
-
}
|
|
40
|
-
// Canonical
|
|
41
|
-
if (metadata.canonical) {
|
|
42
|
-
tags.push(`<link rel="canonical" href="${metadata.canonical}">`);
|
|
43
|
-
}
|
|
44
|
-
// Favicon
|
|
45
|
-
if (metadata.favicon) {
|
|
46
|
-
tags.push(`<link rel="icon" href="${metadata.favicon}">`);
|
|
47
|
-
}
|
|
48
|
-
// Apple Touch Icon
|
|
49
|
-
if (metadata.appleTouchIcon) {
|
|
50
|
-
tags.push(`<link rel="apple-touch-icon" href="${metadata.appleTouchIcon}">`);
|
|
51
|
-
}
|
|
52
|
-
// Manifest
|
|
53
|
-
if (metadata.manifest) {
|
|
54
|
-
tags.push(`<link rel="manifest" href="${metadata.manifest}">`);
|
|
55
|
-
}
|
|
56
|
-
// Open Graph
|
|
57
|
-
if (metadata.openGraph) {
|
|
58
|
-
const og = metadata.openGraph;
|
|
59
|
-
if (og.title)
|
|
60
|
-
tags.push(`<meta property="og:title" content="${og.title}">`);
|
|
61
|
-
if (og.description)
|
|
62
|
-
tags.push(`<meta property="og:description" content="${og.description}">`);
|
|
63
|
-
if (og.type)
|
|
64
|
-
tags.push(`<meta property="og:type" content="${og.type}">`);
|
|
65
|
-
if (og.url)
|
|
66
|
-
tags.push(`<meta property="og:url" content="${og.url}">`);
|
|
67
|
-
if (og.siteName)
|
|
68
|
-
tags.push(`<meta property="og:site_name" content="${og.siteName}">`);
|
|
69
|
-
if (og.locale)
|
|
70
|
-
tags.push(`<meta property="og:locale" content="${og.locale}">`);
|
|
71
|
-
if (og.image) {
|
|
72
|
-
if (typeof og.image === 'string') {
|
|
73
|
-
tags.push(`<meta property="og:image" content="${og.image}">`);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
tags.push(`<meta property="og:image" content="${og.image.url}">`);
|
|
77
|
-
if (og.image.width)
|
|
78
|
-
tags.push(`<meta property="og:image:width" content="${og.image.width}">`);
|
|
79
|
-
if (og.image.height)
|
|
80
|
-
tags.push(`<meta property="og:image:height" content="${og.image.height}">`);
|
|
81
|
-
if (og.image.alt)
|
|
82
|
-
tags.push(`<meta property="og:image:alt" content="${og.image.alt}">`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// Twitter Card
|
|
87
|
-
if (metadata.twitter) {
|
|
88
|
-
const tw = metadata.twitter;
|
|
89
|
-
if (tw.card)
|
|
90
|
-
tags.push(`<meta name="twitter:card" content="${tw.card}">`);
|
|
91
|
-
if (tw.site)
|
|
92
|
-
tags.push(`<meta name="twitter:site" content="${tw.site}">`);
|
|
93
|
-
if (tw.creator)
|
|
94
|
-
tags.push(`<meta name="twitter:creator" content="${tw.creator}">`);
|
|
95
|
-
if (tw.title)
|
|
96
|
-
tags.push(`<meta name="twitter:title" content="${tw.title}">`);
|
|
97
|
-
if (tw.description)
|
|
98
|
-
tags.push(`<meta name="twitter:description" content="${tw.description}">`);
|
|
99
|
-
if (tw.image)
|
|
100
|
-
tags.push(`<meta name="twitter:image" content="${tw.image}">`);
|
|
101
|
-
if (tw.imageAlt)
|
|
102
|
-
tags.push(`<meta name="twitter:image:alt" content="${tw.imageAlt}">`);
|
|
103
|
-
}
|
|
104
|
-
// Custom meta tags
|
|
105
|
-
if (metadata.other) {
|
|
106
|
-
for (const [key, value] of Object.entries(metadata.other)) {
|
|
107
|
-
tags.push(`<meta name="${key}" content="${value}">`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return tags.join('\n');
|
|
111
|
-
}
|
|
112
|
-
// Função para ofuscar dados (não é criptografia, apenas ofuscação)
|
|
113
|
-
function obfuscateData(data) {
|
|
114
|
-
// 1. Serializa para JSON minificado
|
|
115
|
-
const jsonStr = JSON.stringify(data);
|
|
116
|
-
// 2. Converte para base64
|
|
117
|
-
const base64 = Buffer.from(jsonStr).toString('base64');
|
|
118
|
-
// 3. Adiciona um hash fake no início para parecer um token
|
|
119
|
-
const hash = Buffer.from(Date.now().toString()).toString('base64').substring(0, 8);
|
|
120
|
-
return `${hash}.${base64}`;
|
|
121
|
-
}
|
|
122
|
-
// Função para criar script ofuscado
|
|
123
|
-
function createInitialDataScript(data) {
|
|
124
|
-
const obfuscated = obfuscateData(data);
|
|
125
|
-
// Usa um atributo data-* ao invés de JSON visível
|
|
126
|
-
return `<script id="__hight_data__" type="text/plain" data-h="${obfuscated}"></script>`;
|
|
127
|
-
}
|
|
128
|
-
async function render({ req, route, params, allRoutes }) {
|
|
129
|
-
const { generateMetadata } = route;
|
|
130
|
-
// Pega a opção dev e hot reload manager do req
|
|
131
|
-
const isProduction = !req.hwebDev;
|
|
132
|
-
const hotReloadManager = req.hotReloadManager;
|
|
133
|
-
// Pega o layout se existir
|
|
134
|
-
const layout = (0, router_1.getLayout)();
|
|
135
|
-
let metadata = { title: 'App hweb' };
|
|
136
|
-
// Primeiro usa o metadata do layout se existir
|
|
137
|
-
if (layout && layout.metadata) {
|
|
138
|
-
metadata = { ...metadata, ...layout.metadata };
|
|
139
|
-
}
|
|
140
|
-
// Depois sobrescreve com metadata específico da rota se existir
|
|
141
|
-
if (generateMetadata) {
|
|
142
|
-
const routeMetadata = await Promise.resolve(generateMetadata(params, req));
|
|
143
|
-
metadata = { ...metadata, ...routeMetadata };
|
|
144
|
-
}
|
|
145
|
-
// Prepara os dados para injetar na janela do navegador
|
|
146
|
-
const initialData = {
|
|
147
|
-
routes: allRoutes.map(r => ({ pattern: r.pattern, componentPath: r.componentPath })),
|
|
148
|
-
initialComponentPath: route.componentPath,
|
|
149
|
-
initialParams: params,
|
|
150
|
-
};
|
|
151
|
-
// Cria script JSON limpo
|
|
152
|
-
const initialDataScript = createInitialDataScript(initialData);
|
|
153
|
-
// Script de hot reload apenas em desenvolvimento
|
|
154
|
-
const hotReloadScript = !isProduction && hotReloadManager
|
|
155
|
-
? hotReloadManager.getClientScript()
|
|
156
|
-
: '';
|
|
157
|
-
// Gera todas as meta tags
|
|
158
|
-
const metaTags = generateMetaTags(metadata);
|
|
159
|
-
// Determina quais arquivos JavaScript carregar
|
|
160
|
-
const jsFiles = getJavaScriptFiles(req);
|
|
161
|
-
const htmlLang = metadata.language || 'pt-BR';
|
|
162
|
-
// HTML base sem SSR - apenas o container e scripts para client-side rendering
|
|
163
|
-
return `<!DOCTYPE html>
|
|
164
|
-
<html lang="${htmlLang}">
|
|
165
|
-
<head>
|
|
166
|
-
${metaTags}
|
|
167
|
-
<title>${metadata.title || 'App hweb'}</title>
|
|
168
|
-
</head>
|
|
169
|
-
<body>
|
|
170
|
-
<div id="root"></div>
|
|
171
|
-
${initialDataScript}
|
|
172
|
-
${jsFiles}
|
|
173
|
-
${hotReloadScript}
|
|
174
|
-
</body>
|
|
175
|
-
</html>`;
|
|
176
|
-
}
|
|
177
|
-
// Função para determinar quais arquivos JavaScript carregar
|
|
178
|
-
function getJavaScriptFiles(req) {
|
|
179
|
-
const projectDir = process.cwd();
|
|
180
|
-
const distDir = path_1.default.join(projectDir, '.hight');
|
|
181
|
-
// Verifica se o diretório de build existe
|
|
182
|
-
if (!fs_1.default.existsSync(distDir)) {
|
|
183
|
-
// Diretório não existe - build ainda não foi executado
|
|
184
|
-
return getBuildingHTML();
|
|
185
|
-
}
|
|
186
|
-
try {
|
|
187
|
-
// Verifica se existe um manifesto de chunks (gerado pelo ESBuild com splitting)
|
|
188
|
-
const manifestPath = path_1.default.join(distDir, 'manifest.json');
|
|
189
|
-
if (fs_1.default.existsSync(manifestPath)) {
|
|
190
|
-
// Modo chunks - carrega todos os arquivos necessários
|
|
191
|
-
const manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf8'));
|
|
192
|
-
const scripts = Object.values(manifest)
|
|
193
|
-
.filter((file) => file.endsWith('.js'))
|
|
194
|
-
.map((file) => `<script src="/_hight/${file}"></script>`)
|
|
195
|
-
.join('');
|
|
196
|
-
// Se não há arquivos JS no manifesto, build em andamento
|
|
197
|
-
if (!scripts) {
|
|
198
|
-
return getBuildingHTML();
|
|
199
|
-
}
|
|
200
|
-
return scripts;
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
// Verifica se existem múltiplos arquivos JS (chunks sem manifesto)
|
|
204
|
-
const jsFiles = fs_1.default.readdirSync(distDir)
|
|
205
|
-
.filter(file => file.endsWith('.js') && !file.endsWith('.map'))
|
|
206
|
-
.sort((a, b) => {
|
|
207
|
-
// Ordena para carregar arquivos principais primeiro
|
|
208
|
-
if (a.includes('main'))
|
|
209
|
-
return -1;
|
|
210
|
-
if (b.includes('main'))
|
|
211
|
-
return 1;
|
|
212
|
-
if (a.includes('vendor') || a.includes('react'))
|
|
213
|
-
return -1;
|
|
214
|
-
if (b.includes('vendor') || b.includes('react'))
|
|
215
|
-
return 1;
|
|
216
|
-
return a.localeCompare(b);
|
|
217
|
-
});
|
|
218
|
-
// @ts-ignore
|
|
219
|
-
if (jsFiles.length >= 1) {
|
|
220
|
-
// Modo chunks sem manifesto
|
|
221
|
-
return jsFiles
|
|
222
|
-
.map(file => `<script src="/_hight/${file}"></script>`)
|
|
223
|
-
.join('');
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
// Nenhum arquivo JS encontrado - build em andamento ou erro
|
|
227
|
-
return getBuildingHTML();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
catch (error) {
|
|
232
|
-
// Erro ao ler diretório - build em andamento ou erro
|
|
233
|
-
return getBuildingHTML();
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
// Função para retornar HTML de "Build em andamento" com auto-refresh
|
|
237
|
-
function getBuildingHTML() {
|
|
238
|
-
return `
|
|
239
|
-
<style>
|
|
240
|
-
/*
|
|
241
|
-
* Estilo combinado:
|
|
242
|
-
* - Tema (light/dark) adaptativo como o Next.js
|
|
243
|
-
* - Ícone personalizado
|
|
244
|
-
* - Efeito Glassmorphism para o card
|
|
245
|
-
*/
|
|
246
|
-
|
|
247
|
-
html, body {
|
|
248
|
-
margin: 0;
|
|
249
|
-
padding: 0;
|
|
250
|
-
width: 100%;
|
|
251
|
-
height: 100%;
|
|
252
|
-
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
|
253
|
-
-webkit-font-smoothing: antialiased;
|
|
254
|
-
-moz-osx-font-smoothing: grayscale;
|
|
255
|
-
box-sizing: border-box;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
*, *:before, *:after {
|
|
259
|
-
box-sizing: inherit;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/* Tema Claro (Default) */
|
|
263
|
-
body {
|
|
264
|
-
color: #000;
|
|
265
|
-
background: linear-gradient(to bottom, #e9e9e9, #ffffff);
|
|
266
|
-
background-attachment: fixed;
|
|
267
|
-
|
|
268
|
-
display: flex;
|
|
269
|
-
align-items: center;
|
|
270
|
-
justify-content: center;
|
|
271
|
-
min-height: 100vh;
|
|
272
|
-
text-align: center;
|
|
273
|
-
padding: 20px;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/* Contêiner com Glassmorphism */
|
|
277
|
-
.building-container {
|
|
278
|
-
width: 100%;
|
|
279
|
-
max-width: 500px;
|
|
280
|
-
padding: 40px 50px;
|
|
281
|
-
|
|
282
|
-
/* Efeito de vidro */
|
|
283
|
-
background: rgba(255, 255, 255, 0.15); /* Mais transparente no modo claro */
|
|
284
|
-
backdrop-filter: blur(12px); /* Um pouco mais de blur */
|
|
285
|
-
-webkit-backdrop-filter: blur(12px);
|
|
286
|
-
|
|
287
|
-
border-radius: 16px;
|
|
288
|
-
border: 1px solid rgba(255, 255, 255, 0.3); /* Borda mais visível no claro */
|
|
289
|
-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* Sombra mais leve no claro */
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/* Ícone */
|
|
293
|
-
.building-icon {
|
|
294
|
-
width: 70px; /* Tamanho do ícone */
|
|
295
|
-
height: 70px;
|
|
296
|
-
margin-bottom: 20px; /* Espaço abaixo do ícone */
|
|
297
|
-
vertical-align: middle;
|
|
298
|
-
filter: drop-shadow(0 0 5px rgba(0,0,0,0.1)); /* Leve sombra para destacar */
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/* Título */
|
|
302
|
-
.building-title {
|
|
303
|
-
font-size: 2.8rem;
|
|
304
|
-
font-weight: 700;
|
|
305
|
-
margin-top: 0; /* Ajusta a margem superior após o ícone */
|
|
306
|
-
margin-bottom: 20px;
|
|
307
|
-
text-shadow: 0 0 10px rgba(0, 0, 0, 0.05); /* Sombra de texto sutil */
|
|
308
|
-
color: inherit; /* Garante que a cor se adapta ao tema */
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/* Texto de apoio */
|
|
312
|
-
.building-text {
|
|
313
|
-
font-size: 1.15rem;
|
|
314
|
-
margin-bottom: 35px;
|
|
315
|
-
font-weight: 400;
|
|
316
|
-
opacity: 0.9;
|
|
317
|
-
color: inherit; /* Garante que a cor se adapta ao tema */
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/* Spinner adaptado para light/dark */
|
|
321
|
-
.spinner {
|
|
322
|
-
width: 50px;
|
|
323
|
-
height: 50px;
|
|
324
|
-
margin: 0 auto;
|
|
325
|
-
border-radius: 50%;
|
|
326
|
-
|
|
327
|
-
/* Estilo para Modo Claro */
|
|
328
|
-
border: 5px solid rgba(0, 0, 0, 0.1);
|
|
329
|
-
border-top-color: #000;
|
|
330
|
-
|
|
331
|
-
animation: spin 1s linear infinite;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/* Animação de rotação */
|
|
335
|
-
@keyframes spin {
|
|
336
|
-
0% { transform: rotate(0deg); }
|
|
337
|
-
100% { transform: rotate(360deg); }
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/* Tema Escuro (via @media query) */
|
|
341
|
-
@media (prefers-color-scheme: dark) {
|
|
342
|
-
body {
|
|
343
|
-
color: #fff;
|
|
344
|
-
background: linear-gradient(to bottom, #222, #000);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.building-container {
|
|
348
|
-
background: rgba(255, 255, 255, 0.05); /* Mais opaco no modo escuro */
|
|
349
|
-
border: 1px solid rgba(255, 255, 255, 0.1); /* Borda mais sutil no escuro */
|
|
350
|
-
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Sombra mais forte no escuro */
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.building-title {
|
|
354
|
-
text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.building-icon {
|
|
358
|
-
filter: drop-shadow(0 0 5px rgba(255,255,255,0.1));
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.spinner {
|
|
362
|
-
border: 5px solid rgba(255, 255, 255, 0.1);
|
|
363
|
-
border-top-color: #fff;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
</style>
|
|
367
|
-
<div class="building-container">
|
|
368
|
-
<!-- Ícone da imagem --><img src="https://repository-images.githubusercontent.com/1069175740/e5c59d3a-e1fd-446c-a89f-785ed08f6a16" alt="HightJS Logo" class="building-icon">
|
|
369
|
-
|
|
370
|
-
<div class="building-title">HightJS</div>
|
|
371
|
-
<div class="building-text">Build in progress...</div>
|
|
372
|
-
<div class="spinner"></div>
|
|
373
|
-
</div>
|
|
374
|
-
<script>
|
|
375
|
-
// Auto-refresh a cada 2 segundos para verificar se o build terminou
|
|
376
|
-
setTimeout(() => {
|
|
377
|
-
window.location.reload();
|
|
378
|
-
}, 2000);
|
|
379
|
-
</script>`;
|
|
380
|
-
}
|
package/dist/router.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { RouteConfig, BackendRouteConfig, HightMiddleware, WebSocketHandler } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Limpa todo o cache de rotas carregadas
|
|
4
|
-
*/
|
|
5
|
-
export declare function clearAllRouteCache(): void;
|
|
6
|
-
/**
|
|
7
|
-
* Limpa o cache de um arquivo específico e recarrega as rotas se necessário
|
|
8
|
-
* @param changedFilePath Caminho do arquivo que foi alterado
|
|
9
|
-
*/
|
|
10
|
-
export declare function clearFileCache(changedFilePath: string): void;
|
|
11
|
-
/**
|
|
12
|
-
* Carrega o layout.tsx se existir no diretório web
|
|
13
|
-
* @param webDir O diretório web onde procurar o layout
|
|
14
|
-
* @returns O layout carregado ou null se não existir
|
|
15
|
-
*/
|
|
16
|
-
export declare function loadLayout(webDir: string): {
|
|
17
|
-
componentPath: string;
|
|
18
|
-
metadata?: any;
|
|
19
|
-
} | null;
|
|
20
|
-
/**
|
|
21
|
-
* Retorna o layout atual se carregado
|
|
22
|
-
*/
|
|
23
|
-
export declare function getLayout(): {
|
|
24
|
-
componentPath: string;
|
|
25
|
-
metadata?: any;
|
|
26
|
-
} | null;
|
|
27
|
-
/**
|
|
28
|
-
* Carrega dinamicamente todas as rotas de frontend do diretório do usuário.
|
|
29
|
-
* @param routesDir O diretório onde as rotas de página estão localizadas.
|
|
30
|
-
* @returns A lista de rotas de página que foram carregadas.
|
|
31
|
-
*/
|
|
32
|
-
export declare function loadRoutes(routesDir: string): (RouteConfig & {
|
|
33
|
-
componentPath: string;
|
|
34
|
-
})[];
|
|
35
|
-
/**
|
|
36
|
-
* Encontra a rota de página correspondente para uma URL.
|
|
37
|
-
* @param pathname O caminho da URL (ex: "/users/123").
|
|
38
|
-
* @returns Um objeto com a rota e os parâmetros, ou null se não encontrar.
|
|
39
|
-
*/
|
|
40
|
-
export declare function findMatchingRoute(pathname: string): {
|
|
41
|
-
route: RouteConfig & {
|
|
42
|
-
componentPath: string;
|
|
43
|
-
};
|
|
44
|
-
params: {
|
|
45
|
-
[key: string]: string;
|
|
46
|
-
};
|
|
47
|
-
} | null;
|
|
48
|
-
/**
|
|
49
|
-
* Carrega dinamicamente todas as rotas de API do diretório de backend.
|
|
50
|
-
* @param backendRoutesDir O diretório onde as rotas de API estão localizadas.
|
|
51
|
-
*/
|
|
52
|
-
export declare function loadBackendRoutes(backendRoutesDir: string): void;
|
|
53
|
-
/**
|
|
54
|
-
* Encontra a rota de API correspondente para uma URL e método HTTP.
|
|
55
|
-
* @param pathname O caminho da URL (ex: "/api/users/123").
|
|
56
|
-
* @param method O método HTTP da requisição (GET, POST, etc.).
|
|
57
|
-
* @returns Um objeto com a rota e os parâmetros, ou null se não encontrar.
|
|
58
|
-
*/
|
|
59
|
-
export declare function findMatchingBackendRoute(pathname: string, method: string): {
|
|
60
|
-
route: BackendRouteConfig;
|
|
61
|
-
params: {
|
|
62
|
-
[key: string]: string;
|
|
63
|
-
};
|
|
64
|
-
} | null;
|
|
65
|
-
/**
|
|
66
|
-
* Carrega o notFound.tsx se existir no diretório web
|
|
67
|
-
* @param webDir O diretório web onde procurar o notFound
|
|
68
|
-
* @returns O notFound carregado ou null se não existir
|
|
69
|
-
*/
|
|
70
|
-
export declare function loadNotFound(webDir: string): {
|
|
71
|
-
componentPath: string;
|
|
72
|
-
} | null;
|
|
73
|
-
/**
|
|
74
|
-
* Retorna o componente 404 atual se carregado
|
|
75
|
-
*/
|
|
76
|
-
export declare function getNotFound(): {
|
|
77
|
-
componentPath: string;
|
|
78
|
-
} | null;
|
|
79
|
-
/**
|
|
80
|
-
* Processa e registra rotas WebSocket encontradas nas rotas backend
|
|
81
|
-
*/
|
|
82
|
-
export declare function processWebSocketRoutes(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Encontra a rota WebSocket correspondente para uma URL
|
|
85
|
-
*/
|
|
86
|
-
export declare function findMatchingWebSocketRoute(pathname: string): {
|
|
87
|
-
route: {
|
|
88
|
-
pattern: string;
|
|
89
|
-
handler: WebSocketHandler;
|
|
90
|
-
middleware?: HightMiddleware[];
|
|
91
|
-
};
|
|
92
|
-
params: {
|
|
93
|
-
[key: string]: string;
|
|
94
|
-
};
|
|
95
|
-
} | null;
|
|
96
|
-
/**
|
|
97
|
-
* Configura WebSocket upgrade no servidor HTTP existente
|
|
98
|
-
* @param server Servidor HTTP (Express, Fastify ou Native)
|
|
99
|
-
* @param hotReloadManager Instância do gerenciador de hot-reload para coordenação
|
|
100
|
-
*/
|
|
101
|
-
export declare function setupWebSocketUpgrade(server: any, hotReloadManager?: any): void;
|