hightjs 0.3.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +48 -116
  2. package/dist/bin/hightjs.js +51 -23
  3. package/dist/builder.js +198 -8
  4. package/dist/client/DefaultNotFound.d.ts +1 -1
  5. package/dist/client/DefaultNotFound.js +72 -46
  6. package/dist/client/client.d.ts +3 -0
  7. package/dist/{client.js → client/client.js} +4 -4
  8. package/dist/client/entry.client.js +77 -9
  9. package/dist/global/global.d.ts +117 -0
  10. package/dist/{auth/types.js → global/global.js} +0 -1
  11. package/dist/helpers.js +80 -2
  12. package/dist/hotReload.js +84 -4
  13. package/dist/index.js +72 -61
  14. package/dist/loaders.d.ts +1 -0
  15. package/dist/loaders.js +46 -0
  16. package/dist/renderer.js +158 -4
  17. package/dist/types.d.ts +44 -0
  18. package/package.json +37 -30
  19. package/.idea/HightJS.iml +0 -9
  20. package/.idea/copilot.data.migration.agent.xml +0 -6
  21. package/.idea/copilot.data.migration.ask.xml +0 -6
  22. package/.idea/copilot.data.migration.ask2agent.xml +0 -6
  23. package/.idea/copilot.data.migration.edit.xml +0 -6
  24. package/.idea/copilotDiffState.xml +0 -67
  25. package/.idea/inspectionProfiles/Project_Default.xml +0 -13
  26. package/.idea/libraries/test_package.xml +0 -9
  27. package/.idea/libraries/ts_commonjs_default_export.xml +0 -9
  28. package/.idea/misc.xml +0 -7
  29. package/.idea/modules.xml +0 -8
  30. package/.idea/vcs.xml +0 -6
  31. package/dist/auth/client.d.ts +0 -24
  32. package/dist/auth/client.js +0 -146
  33. package/dist/auth/components.d.ts +0 -29
  34. package/dist/auth/components.js +0 -100
  35. package/dist/auth/core.d.ts +0 -55
  36. package/dist/auth/core.js +0 -189
  37. package/dist/auth/index.d.ts +0 -7
  38. package/dist/auth/index.js +0 -45
  39. package/dist/auth/jwt.d.ts +0 -41
  40. package/dist/auth/jwt.js +0 -185
  41. package/dist/auth/providers/credentials.d.ts +0 -60
  42. package/dist/auth/providers/credentials.js +0 -97
  43. package/dist/auth/providers/discord.d.ts +0 -63
  44. package/dist/auth/providers/discord.js +0 -190
  45. package/dist/auth/providers/google.d.ts +0 -63
  46. package/dist/auth/providers/google.js +0 -186
  47. package/dist/auth/providers/index.d.ts +0 -2
  48. package/dist/auth/providers/index.js +0 -35
  49. package/dist/auth/providers.d.ts +0 -3
  50. package/dist/auth/providers.js +0 -26
  51. package/dist/auth/react/index.d.ts +0 -6
  52. package/dist/auth/react/index.js +0 -48
  53. package/dist/auth/react.d.ts +0 -22
  54. package/dist/auth/react.js +0 -199
  55. package/dist/auth/routes.d.ts +0 -16
  56. package/dist/auth/routes.js +0 -152
  57. package/dist/auth/types.d.ts +0 -76
  58. package/dist/client.d.ts +0 -3
  59. package/docs/README.md +0 -58
  60. package/docs/arquivos-especiais.md +0 -10
  61. package/docs/autenticacao.md +0 -212
  62. package/docs/checklist.md +0 -9
  63. package/docs/cli.md +0 -72
  64. package/docs/config.md +0 -216
  65. package/docs/estrutura.md +0 -20
  66. package/docs/faq.md +0 -10
  67. package/docs/hot-reload.md +0 -5
  68. package/docs/integracoes.md +0 -240
  69. package/docs/middlewares.md +0 -73
  70. package/docs/rotas-backend.md +0 -45
  71. package/docs/rotas-frontend.md +0 -66
  72. package/docs/seguranca.md +0 -8
  73. package/docs/websocket.md +0 -45
  74. package/example/certs/cert.pem +0 -20
  75. package/example/certs/key.pem +0 -27
  76. package/example/hightjs.config.ts +0 -87
  77. package/example/package-lock.json +0 -1174
  78. package/example/package.json +0 -26
  79. package/example/postcss.config.js +0 -8
  80. package/example/src/auth.ts +0 -42
  81. package/example/src/web/backend/routes/auth.ts +0 -3
  82. package/example/src/web/backend/routes/version.ts +0 -13
  83. package/example/src/web/globals.css +0 -5
  84. package/example/src/web/layout.tsx +0 -100
  85. package/example/src/web/routes/index.tsx +0 -153
  86. package/example/src/web/routes/login.tsx +0 -175
  87. package/example/tailwind.config.js +0 -12
  88. package/example/tsconfig.json +0 -15
  89. package/src/adapters/express.ts +0 -87
  90. package/src/adapters/factory.ts +0 -112
  91. package/src/adapters/fastify.ts +0 -104
  92. package/src/adapters/native.ts +0 -234
  93. package/src/api/console.ts +0 -305
  94. package/src/api/http.ts +0 -535
  95. package/src/auth/client.ts +0 -171
  96. package/src/auth/components.tsx +0 -125
  97. package/src/auth/core.ts +0 -215
  98. package/src/auth/index.ts +0 -25
  99. package/src/auth/jwt.ts +0 -210
  100. package/src/auth/providers/credentials.ts +0 -139
  101. package/src/auth/providers/discord.ts +0 -239
  102. package/src/auth/providers/google.ts +0 -234
  103. package/src/auth/providers/index.ts +0 -20
  104. package/src/auth/providers.ts +0 -20
  105. package/src/auth/react/index.ts +0 -25
  106. package/src/auth/react.tsx +0 -234
  107. package/src/auth/routes.ts +0 -183
  108. package/src/auth/types.ts +0 -108
  109. package/src/bin/hightjs.js +0 -222
  110. package/src/builder.js +0 -411
  111. package/src/client/DefaultNotFound.tsx +0 -84
  112. package/src/client/clientRouter.ts +0 -153
  113. package/src/client/entry.client.tsx +0 -444
  114. package/src/client.ts +0 -24
  115. package/src/components/Link.tsx +0 -38
  116. package/src/helpers.ts +0 -542
  117. package/src/hotReload.ts +0 -489
  118. package/src/index.ts +0 -546
  119. package/src/renderer.tsx +0 -263
  120. package/src/router.ts +0 -730
  121. package/src/types/framework.ts +0 -58
  122. package/src/types.ts +0 -207
  123. package/tsconfig.json +0 -17
package/dist/index.js CHANGED
@@ -1,4 +1,20 @@
1
1
  "use strict";
2
+ /*
3
+ * This file is part of the HightJS Project.
4
+ * Copyright (c) 2025 itsmuzin
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
2
18
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
19
  if (k2 === undefined) k2 = k;
4
20
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -38,22 +54,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
54
  Object.defineProperty(exports, "__esModule", { value: true });
39
55
  exports.app = exports.FrameworkAdapterFactory = exports.FastifyAdapter = exports.ExpressAdapter = exports.HightJSResponse = exports.HightJSRequest = void 0;
40
56
  exports.default = hweb;
41
- /*
42
- * This file is part of the HightJS Project.
43
- * Copyright (c) 2025 itsmuzin
44
- *
45
- * Licensed under the Apache License, Version 2.0 (the "License");
46
- * you may not use this file except in compliance with the License.
47
- * You may obtain a copy of the License at
48
- *
49
- * http://www.apache.org/licenses/LICENSE-2.0
50
- *
51
- * Unless required by applicable law or agreed to in writing, software
52
- * distributed under the License is distributed on an "AS IS" BASIS,
53
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
- * See the License for the specific language governing permissions and
55
- * limitations under the License.
56
- */
57
57
  const path_1 = __importDefault(require("path"));
58
58
  const fs_1 = __importDefault(require("fs"));
59
59
  const express_1 = require("./adapters/express");
@@ -110,48 +110,49 @@ function isLargeProject(projectDir) {
110
110
  }
111
111
  // Função para gerar o arquivo de entrada para o esbuild
112
112
  function createEntryFile(projectDir, routes) {
113
- const tempDir = path_1.default.join(projectDir, '.hweb');
114
- fs_1.default.mkdirSync(tempDir, { recursive: true });
115
- const entryFilePath = path_1.default.join(tempDir, 'entry.client.js');
116
- // Verifica se layout
117
- const layout = (0, router_1.getLayout)();
118
- // Verifica se notFound personalizado
119
- const notFound = (0, router_1.getNotFound)();
120
- // Gera imports dinâmicos para cada componente
121
- const imports = routes
122
- .map((route, index) => {
123
- const relativePath = path_1.default.relative(tempDir, route.componentPath).replace(/\\/g, '/');
124
- return `import route${index} from '${relativePath}';`;
125
- })
126
- .join('\n');
127
- // Import do layout se existir
128
- const layoutImport = layout
129
- ? `import LayoutComponent from '${path_1.default.relative(tempDir, layout.componentPath).replace(/\\/g, '/')}';`
130
- : '';
131
- // Import do notFound se existir
132
- const notFoundImport = notFound
133
- ? `import NotFoundComponent from '${path_1.default.relative(tempDir, notFound.componentPath).replace(/\\/g, '/')}';`
134
- : '';
135
- // Registra os componentes no window para o cliente acessar
136
- const componentRegistration = routes
137
- .map((route, index) => ` '${route.componentPath}': route${index}.component || route${index}.default?.component,`)
138
- .join('\n');
139
- // Registra o layout se existir
140
- const layoutRegistration = layout
141
- ? `window.__HWEB_LAYOUT__ = LayoutComponent.default || LayoutComponent;`
142
- : `window.__HWEB_LAYOUT__ = null;`;
143
- // Registra o notFound se existir
144
- const notFoundRegistration = notFound
145
- ? `window.__HWEB_NOT_FOUND__ = NotFoundComponent.default || NotFoundComponent;`
146
- : `window.__HWEB_NOT_FOUND__ = null;`;
147
- // Caminho correto para o entry.client.tsx
148
- const sdkDir = path_1.default.dirname(__dirname); // Vai para a pasta pai de src (onde está o hweb-sdk)
149
- const entryClientPath = path_1.default.join(sdkDir, 'src', 'client', 'entry.client.tsx');
150
- const relativeEntryPath = path_1.default.relative(tempDir, entryClientPath).replace(/\\/g, '/');
151
- // Import do DefaultNotFound do SDK
152
- const defaultNotFoundPath = path_1.default.join(sdkDir, 'src', 'client', 'DefaultNotFound.tsx');
153
- const relativeDefaultNotFoundPath = path_1.default.relative(tempDir, defaultNotFoundPath).replace(/\\/g, '/');
154
- const entryContent = `// Arquivo gerado automaticamente pelo hweb
113
+ try {
114
+ const tempDir = path_1.default.join(projectDir, '.hight', 'temp');
115
+ fs_1.default.mkdirSync(tempDir, { recursive: true });
116
+ const entryFilePath = path_1.default.join(tempDir, 'entry.client.js');
117
+ // Verifica se layout
118
+ const layout = (0, router_1.getLayout)();
119
+ // Verifica se notFound personalizado
120
+ const notFound = (0, router_1.getNotFound)();
121
+ // Gera imports dinâmicos para cada componente
122
+ const imports = routes
123
+ .map((route, index) => {
124
+ const relativePath = path_1.default.relative(tempDir, route.componentPath).replace(/\\/g, '/');
125
+ return `import route${index} from '${relativePath}';`;
126
+ })
127
+ .join('\n');
128
+ // Import do layout se existir
129
+ const layoutImport = layout
130
+ ? `import LayoutComponent from '${path_1.default.relative(tempDir, layout.componentPath).replace(/\\/g, '/')}';`
131
+ : '';
132
+ // Import do notFound se existir
133
+ const notFoundImport = notFound
134
+ ? `import NotFoundComponent from '${path_1.default.relative(tempDir, notFound.componentPath).replace(/\\/g, '/')}';`
135
+ : '';
136
+ // Registra os componentes no window para o cliente acessar
137
+ const componentRegistration = routes
138
+ .map((route, index) => ` '${route.componentPath}': route${index}.component || route${index}.default?.component,`)
139
+ .join('\n');
140
+ // Registra o layout se existir
141
+ const layoutRegistration = layout
142
+ ? `window.__HWEB_LAYOUT__ = LayoutComponent.default || LayoutComponent;`
143
+ : `window.__HWEB_LAYOUT__ = null;`;
144
+ // Registra o notFound se existir
145
+ const notFoundRegistration = notFound
146
+ ? `window.__HWEB_NOT_FOUND__ = NotFoundComponent.default || NotFoundComponent;`
147
+ : `window.__HWEB_NOT_FOUND__ = null;`;
148
+ // Caminho correto para o entry.client.tsx
149
+ const sdkDir = path_1.default.dirname(__dirname); // Vai para a pasta pai de src (onde está o hweb-sdk)
150
+ const entryClientPath = path_1.default.join(sdkDir, 'src', 'client', 'entry.client.tsx');
151
+ const relativeEntryPath = path_1.default.relative(tempDir, entryClientPath).replace(/\\/g, '/');
152
+ // Import do DefaultNotFound do SDK
153
+ const defaultNotFoundPath = path_1.default.join(sdkDir, 'src', 'client', 'DefaultNotFound.tsx');
154
+ const relativeDefaultNotFoundPath = path_1.default.relative(tempDir, defaultNotFoundPath).replace(/\\/g, '/');
155
+ const entryContent = `// Arquivo gerado automaticamente pelo hweb
155
156
  ${imports}
156
157
  ${layoutImport}
157
158
  ${notFoundImport}
@@ -174,8 +175,18 @@ window.__HWEB_DEFAULT_NOT_FOUND__ = DefaultNotFound;
174
175
  // Importa e executa o entry.client.tsx
175
176
  import '${relativeEntryPath}';
176
177
  `;
177
- fs_1.default.writeFileSync(entryFilePath, entryContent);
178
- return entryFilePath;
178
+ try {
179
+ fs_1.default.writeFileSync(entryFilePath, entryContent);
180
+ }
181
+ catch (e) {
182
+ console.error("sdfijnsdfnijfsdijnfsdnijsdfnijfsdnijfsdnijfsdn", e);
183
+ }
184
+ return entryFilePath;
185
+ }
186
+ catch (e) {
187
+ console_1.default.error("Error creating entry file:", e);
188
+ throw e;
189
+ }
179
190
  }
180
191
  function hweb(options) {
181
192
  const { dev = true, dir = process.cwd(), port = 3000 } = options;
@@ -183,7 +194,7 @@ function hweb(options) {
183
194
  process.hight = options;
184
195
  const userWebDir = path_1.default.join(dir, 'src', 'web');
185
196
  const userWebRoutesDir = path_1.default.join(userWebDir, 'routes');
186
- const userBackendRoutesDir = path_1.default.join(userWebDir, 'backend', 'routes');
197
+ const userBackendRoutesDir = path_1.default.join(dir, 'src', 'backend', 'routes');
187
198
  /**
188
199
  * Executa middlewares sequencialmente e depois o handler final
189
200
  * @param middlewares Array de middlewares para executar
@@ -0,0 +1 @@
1
+ export = filename;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /*
3
+ * This file is part of the HightJS Project.
4
+ * Copyright (c) 2025 itsmuzin
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ const fs = require('fs');
19
+ /**
20
+ * Registra loaders customizados para Node.js
21
+ * Permite importar arquivos não-JS diretamente no servidor
22
+ */
23
+ function registerLoaders() {
24
+ // Loader para arquivos Markdown (.md)
25
+ require.extensions['.md'] = function (module, filename) {
26
+ const content = fs.readFileSync(filename, 'utf8');
27
+ module.exports = content;
28
+ };
29
+ // Loader para arquivos de texto (.txt)
30
+ require.extensions['.txt'] = function (module, filename) {
31
+ const content = fs.readFileSync(filename, 'utf8');
32
+ module.exports = content;
33
+ };
34
+ // Loader para arquivos JSON (já existe nativamente, mas garantimos consistência)
35
+ // require.extensions['.json'] já existe
36
+ // Loader para imagens - retorna o caminho do arquivo
37
+ const imageExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.avif', '.ico', '.bmp', '.svg'];
38
+ imageExtensions.forEach(ext => {
39
+ require.extensions[ext] = function (module, filename) {
40
+ // No servidor, retornamos o caminho do arquivo
41
+ // O frontend usará o plugin do esbuild para converter em base64
42
+ module.exports = filename;
43
+ };
44
+ });
45
+ }
46
+ module.exports = { registerLoaders };
package/dist/renderer.js CHANGED
@@ -178,6 +178,11 @@ ${hotReloadScript}
178
178
  function getJavaScriptFiles(req) {
179
179
  const projectDir = process.cwd();
180
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
+ }
181
186
  try {
182
187
  // Verifica se existe um manifesto de chunks (gerado pelo ESBuild com splitting)
183
188
  const manifestPath = path_1.default.join(distDir, 'manifest.json');
@@ -188,6 +193,10 @@ function getJavaScriptFiles(req) {
188
193
  .filter((file) => file.endsWith('.js'))
189
194
  .map((file) => `<script src="/_hight/${file}"></script>`)
190
195
  .join('');
196
+ // Se não há arquivos JS no manifesto, build em andamento
197
+ if (!scripts) {
198
+ return getBuildingHTML();
199
+ }
191
200
  return scripts;
192
201
  }
193
202
  else {
@@ -214,13 +223,158 @@ function getJavaScriptFiles(req) {
214
223
  .join('');
215
224
  }
216
225
  else {
217
- // Modo tradicional - único arquivo
218
- return '<script src="/_hight/main.js"></script>';
226
+ // Nenhum arquivo JS encontrado - build em andamento ou erro
227
+ return getBuildingHTML();
219
228
  }
220
229
  }
221
230
  }
222
231
  catch (error) {
223
- // Fallback para o modo tradicional
224
- return '<script src="/_hight/main.js"></script>';
232
+ // Erro ao ler diretório - build em andamento ou erro
233
+ return getBuildingHTML();
225
234
  }
226
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/types.d.ts CHANGED
@@ -67,6 +67,50 @@ export interface HightConfig {
67
67
  * Padrão: false
68
68
  */
69
69
  accessLogging?: boolean;
70
+ /**
71
+ * Configurações de CORS (Cross-Origin Resource Sharing).
72
+ * Define quais origens podem acessar seus recursos.
73
+ */
74
+ cors?: {
75
+ /**
76
+ * Origens permitidas. Pode ser:
77
+ * - Uma string específica: 'https://exemplo.com'
78
+ * - Um array de strings: ['https://exemplo.com', 'https://outro.com']
79
+ * - Um wildcard: '*' (permite todas as origens - não recomendado em produção)
80
+ * - Uma função que retorna boolean: (origin) => origin.endsWith('.exemplo.com')
81
+ */
82
+ origin?: string | string[] | ((origin: string) => boolean);
83
+ /**
84
+ * Métodos HTTP permitidos.
85
+ * Padrão: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS']
86
+ */
87
+ methods?: string[];
88
+ /**
89
+ * Headers permitidos nas requisições.
90
+ * Padrão: ['Content-Type', 'Authorization']
91
+ */
92
+ allowedHeaders?: string[];
93
+ /**
94
+ * Headers que serão expostos ao cliente.
95
+ * Padrão: []
96
+ */
97
+ exposedHeaders?: string[];
98
+ /**
99
+ * Permite o envio de credenciais (cookies, headers de autenticação).
100
+ * Padrão: false
101
+ */
102
+ credentials?: boolean;
103
+ /**
104
+ * Tempo em segundos que o navegador deve cachear a resposta preflight.
105
+ * Padrão: 86400 (24 horas)
106
+ */
107
+ maxAge?: number;
108
+ /**
109
+ * Habilita ou desabilita completamente o CORS.
110
+ * Padrão: false
111
+ */
112
+ enabled?: boolean;
113
+ };
70
114
  }
71
115
  /**
72
116
  * Tipo da função de configuração que pode ser exportada no hightjs.config.js
package/package.json CHANGED
@@ -1,14 +1,23 @@
1
1
  {
2
2
  "name": "hightjs",
3
- "version": "0.3.5",
3
+ "version": "0.5.0",
4
4
  "description": "HightJS is a high-level framework for building web applications with ease and speed. It provides a robust set of tools and features to streamline development and enhance productivity.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "author": "itsmuzin",
8
8
  "license": "Apache-2.0",
9
- "scripts": {
10
- "build": "tsc"
11
- },
9
+ "keywords": [
10
+ "hightjs",
11
+ "framework",
12
+ "web",
13
+ "typescript",
14
+ "react"
15
+ ],
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "dist/global/global.d.ts"
20
+ ],
12
21
  "bin": {
13
22
  "hight": "./dist/bin/hightjs.js"
14
23
  },
@@ -18,25 +27,18 @@
18
27
  "import": "./dist/index.js",
19
28
  "require": "./dist/index.js"
20
29
  },
21
- "./client": {
22
- "types": "./dist/client.d.ts",
23
- "import": "./dist/client.js",
24
- "require": "./dist/client.js"
30
+ "./react": {
31
+ "types": "./dist/client/client.d.ts",
32
+ "import": "./dist/client/client.js",
33
+ "require": "./dist/client/client.js"
25
34
  },
26
35
  "./helpers": {
27
36
  "types": "./dist/helpers.d.ts",
28
37
  "import": "./dist/helpers.js",
29
38
  "require": "./dist/helpers.js"
30
39
  },
31
- "./auth": {
32
- "types": "./dist/auth/index.d.ts",
33
- "import": "./dist/auth/index.js",
34
- "require": "./dist/auth/index.js"
35
- },
36
- "./auth/react": {
37
- "types": "./dist/auth/react/index.d.ts",
38
- "import": "./dist/auth/react/index.js",
39
- "require": "./dist/auth/react/index.js"
40
+ "./global": {
41
+ "types": "./dist/global/global.d.ts"
40
42
  },
41
43
  "./eslint": {
42
44
  "types": "./dist/eslint/index.d.ts",
@@ -44,15 +46,9 @@
44
46
  "require": "./dist/eslint/index.js"
45
47
  }
46
48
  },
47
- "devDependencies": {
48
- "@types/express": "^4.17.21",
49
- "@types/node": "^20.11.24",
50
- "@types/react": "^19.2.0",
51
- "@types/react-dom": "^19.2.0",
52
- "@types/ws": "^8.18.1",
53
- "ts-loader": "^9.5.4",
54
- "ts-node": "^10.9.2",
55
- "typescript": "^5.9.3"
49
+ "peerDependencies": {
50
+ "react": "^19.2.0",
51
+ "react-dom": "^19.2.0"
56
52
  },
57
53
  "dependencies": {
58
54
  "@fastify/cookie": "^11.0.2",
@@ -65,10 +61,21 @@
65
61
  "express": "^4.0.0",
66
62
  "fastify": "^5.6.1",
67
63
  "framer-motion": "^12.23.22",
64
+ "fs-extra": "^11.3.2",
68
65
  "ws": "^8.18.1"
69
66
  },
70
- "peerDependency": {
71
- "react": "^19.2.0",
72
- "react-dom": "^19.2.0"
67
+ "devDependencies": {
68
+ "@types/express": "^4.17.21",
69
+ "@types/fs-extra": "^11.0.4",
70
+ "@types/node": "^20.11.24",
71
+ "@types/react": "^19.2.0",
72
+ "@types/react-dom": "^19.2.0",
73
+ "@types/ws": "^8.18.1",
74
+ "ts-loader": "^9.5.4",
75
+ "ts-node": "^10.9.2",
76
+ "typescript": "^5.9.3"
77
+ },
78
+ "scripts": {
79
+ "build": "tsc"
73
80
  }
74
- }
81
+ }
package/.idea/HightJS.iml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AgentMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AskMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Ask2AgentMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="EditMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>