vatts 2.0.2 → 2.1.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE +12 -12
  2. package/README.md +63 -63
  3. package/dist/api/console.d.ts +28 -5
  4. package/dist/api/console.js +305 -137
  5. package/dist/api/native-server.js +25 -4
  6. package/dist/bin/vatts.js +192 -4
  7. package/dist/builder.js +70 -69
  8. package/dist/core-go/core-linux-arm64.node +0 -0
  9. package/dist/core-go/core-linux-x64.node +0 -0
  10. package/dist/core-go/core-win-x64.node +0 -0
  11. package/dist/global/global.d.ts +176 -176
  12. package/dist/helpers.d.ts +2 -2
  13. package/dist/helpers.js +20 -41
  14. package/dist/hotReload.js +205 -205
  15. package/dist/index.d.ts +2 -1
  16. package/dist/index.js +104 -19
  17. package/dist/loaders.js +15 -15
  18. package/dist/react/BuildingPage.js +202 -202
  19. package/dist/react/DefaultNotFound.js +16 -16
  20. package/dist/react/DevIndicator.js +101 -101
  21. package/dist/react/entry.client.js +7 -8
  22. package/dist/react/image/Image.js +1 -1
  23. package/dist/react/renderer-react.js +270 -33
  24. package/dist/react/server-error.d.ts +8 -0
  25. package/dist/react/server-error.js +346 -0
  26. package/dist/router.js +1 -65
  27. package/dist/types.d.ts +1 -5
  28. package/dist/utils/utils.d.ts +1 -0
  29. package/dist/utils/utils.js +68 -0
  30. package/dist/vue/App.vue +191 -191
  31. package/dist/vue/BuildingPage.vue +280 -280
  32. package/dist/vue/DefaultNotFound.vue +328 -328
  33. package/dist/vue/DevIndicator.vue +225 -225
  34. package/dist/vue/ErrorModal.vue +316 -316
  35. package/dist/vue/Link.vue +38 -38
  36. package/dist/vue/entry.client.js +7 -7
  37. package/dist/vue/image/Image.vue +106 -106
  38. package/dist/vue/renderer.vue.js +266 -46
  39. package/dist/vue/server-error.vue +351 -0
  40. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,13 +1,13 @@
1
- Copyright 2026 mfraz
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
1
+ Copyright 2026 mfraz
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
13
  limitations under the License.
package/README.md CHANGED
@@ -1,63 +1,63 @@
1
- <div align="center">
2
- <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mfrazlab/vatts.js/docs/public/logo.png">
4
- <img alt="Vatts.js logo" src="https://raw.githubusercontent.com/mfrazlab/vatts.js/docs/public/logo.png" width="128">
5
- </picture>
6
- <h1>Vatts.js</h1>
7
-
8
- [![NPM](https://img.shields.io/npm/v/vatts.svg?style=for-the-badge&labelColor=000000)](https://www.npmjs.com/package/vatts)
9
- [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge&labelColor=000000)](./LICENSE)
10
- [![GitHub](https://img.shields.io/badge/GitHub-mfrazlab/vatts.js-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/mfrazlab/vatts.js)
11
-
12
- [![HTTP/3 Supported](https://img.shields.io/badge/SUPPORTED-HTTP/3-brightgreen?style=for-the-badge&labelColor=000000)](#)
13
- </div>
14
-
15
- ---
16
-
17
-
18
-
19
-
20
- ## Getting Started
21
-
22
- **Vatts.js** is a modern, full-featured web framework for **Node.js** with first-class support for **React and Vue**.
23
-
24
- It is the first framework to offer native HTTP/3 support out of the box, powered by a Go-based HTTP server with built-in SSL termination. Applications run directly on the latest web transport protocol, without proxies or external layers.
25
-
26
- Vatts.js is a **multi-framework platform**, allowing you to build applications using **either React or Vue per project** — not both at the same time.
27
- This keeps the ecosystem clean, predictable, and optimized for performance and tooling.
28
-
29
- Vatts removes unnecessary configuration and complex abstractions, allowing you to focus on what truly matters: **building fast, secure, and scalable applications**.
30
-
31
- ### Why choose Vatts.js?
32
- - **Native HTTP** — modern, secure, and high-performance networking with **HTTP/3 support**
33
- - Extremely fast — architecture optimized for low overhead
34
- - Intuitive API — easy to learn and pleasant to use
35
- - Productivity from the first minute — zero unnecessary boilerplate
36
- - Multi-framework — choose **React or Vue per project**
37
- - Full integration between backend and frontend
38
- - Built for modern projects — TypeScript-friendly, modular, and extensible
39
-
40
- ___
41
-
42
- ## Documentation
43
-
44
- Visit [https://vatts.mfraz.ovh](https://vatts.mfraz.ovh) to view the full documentation.
45
-
46
- ___
47
-
48
- ## Community
49
-
50
- The Vatts.js community can be found on [GitHub Discussions](https://github.com/mfraz/vatts.js), where you can ask questions, share ideas, and showcase your projects with others.
51
-
52
- ___
53
-
54
-
55
- ## Security
56
-
57
- Vatts.js is engineered with a security-first architecture centered around an internal proxy layer that mediates all application traffic. This proxy is designed to support modern transports such as native HTTP/3 when SSL is enabled, while consistently enforcing built-in security guarantees at the protocol and application boundaries. Even in local or non-TLS environments, the proxy remains active, preserving request isolation, and secure handling by default.
58
-
59
- If you believe you have found a security vulnerability in Vatts.js, we encourage you to **responsibly disclose it and NOT open a public issue**.
60
-
61
- To participate in our vulnerability disclosure program, please email [helpers@mfraz.ovh](mailto:help@mfraz.ovh). We will add you to the program and provide further instructions for submitting your report.
62
-
63
- ___
1
+ <div align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mfrazlab/vatts.js/docs/public/logo.png">
4
+ <img alt="Vatts.js logo" src="https://raw.githubusercontent.com/mfrazlab/vatts.js/docs/public/logo.png" width="128">
5
+ </picture>
6
+ <h1>Vatts.js</h1>
7
+
8
+ [![NPM](https://img.shields.io/npm/v/vatts.svg?style=for-the-badge&labelColor=000000)](https://www.npmjs.com/package/vatts)
9
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge&labelColor=000000)](./LICENSE)
10
+ [![GitHub](https://img.shields.io/badge/GitHub-mfrazlab/vatts.js-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/mfrazlab/vatts.js)
11
+
12
+ [![HTTP/3 Supported](https://img.shields.io/badge/SUPPORTED-HTTP/3-brightgreen?style=for-the-badge&labelColor=000000)](#)
13
+ </div>
14
+
15
+ ---
16
+
17
+
18
+
19
+
20
+ ## Getting Started
21
+
22
+ **Vatts.js** is a modern, full-featured web framework for **Node.js** with first-class support for **React and Vue**.
23
+
24
+ It is the first framework to offer native HTTP/3 support out of the box, powered by a Go-based HTTP server with built-in SSL termination. Applications run directly on the latest web transport protocol, without proxies or external layers.
25
+
26
+ Vatts.js is a **multi-framework platform**, allowing you to build applications using **either React or Vue per project** — not both at the same time.
27
+ This keeps the ecosystem clean, predictable, and optimized for performance and tooling.
28
+
29
+ Vatts removes unnecessary configuration and complex abstractions, allowing you to focus on what truly matters: **building fast, secure, and scalable applications**.
30
+
31
+ ### Why choose Vatts.js?
32
+ - **Native HTTP** — modern, secure, and high-performance networking with **HTTP/3 support**
33
+ - Extremely fast — architecture optimized for low overhead
34
+ - Intuitive API — easy to learn and pleasant to use
35
+ - Productivity from the first minute — zero unnecessary boilerplate
36
+ - Multi-framework — choose **React or Vue per project**
37
+ - Full integration between backend and frontend
38
+ - Built for modern projects — TypeScript-friendly, modular, and extensible
39
+
40
+ ___
41
+
42
+ ## Documentation
43
+
44
+ Visit [https://vatts.mfraz.ovh](https://vatts.mfraz.ovh) to view the full documentation.
45
+
46
+ ___
47
+
48
+ ## Community
49
+
50
+ The Vatts.js community can be found on [GitHub Discussions](https://github.com/mfraz/vatts.js), where you can ask questions, share ideas, and showcase your projects with others.
51
+
52
+ ___
53
+
54
+
55
+ ## Security
56
+
57
+ Vatts.js is engineered with a security-first architecture centered around an internal proxy layer that mediates all application traffic. This proxy is designed to support modern transports such as native HTTP/3 when SSL is enabled, while consistently enforcing built-in security guarantees at the protocol and application boundaries. Even in local or non-TLS environments, the proxy remains active, preserving request isolation, and secure handling by default.
58
+
59
+ If you believe you have found a security vulnerability in Vatts.js, we encourage you to **responsibly disclose it and NOT open a public issue**.
60
+
61
+ To participate in our vulnerability disclosure program, please email [helpers@mfraz.ovh](mailto:help@mfraz.ovh). We will add you to the program and provide further instructions for submitting your report.
62
+
63
+ ___
@@ -44,14 +44,36 @@ export declare enum Levels {
44
44
  }
45
45
  export default class Console {
46
46
  private static activeLines;
47
- private static lastRenderedLines;
48
- private static redrawDynamicLines;
47
+ private static originalStdoutWrite;
48
+ private static isHooked;
49
+ private static isWriting;
50
+ private static ANSI_REGEX;
51
+ private static stripAnsi;
52
+ private static fg;
53
+ private static bg;
54
+ private static padCenter;
55
+ private static padRight;
56
+ private static getTime;
57
+ private static normalizeLevelName;
58
+ private static isKnownLevel;
59
+ /**
60
+ * Converte uma cor ANSI (Colors.FgX) em um background 24-bit escuro combinando.
61
+ * Isso faz teu methodColor virar um badge bonitinho (fg + bg).
62
+ */
63
+ private static bgForFgColor;
64
+ private static levelStyle;
65
+ /**
66
+ * Agora aceita override de cor pro badge (pra custom levels tipo GET/POST).
67
+ */
68
+ private static renderBadge;
69
+ private static indentMultiline;
70
+ private static countRowsAdded;
71
+ private static hook;
49
72
  private static writeStatic;
50
- private static formatLog;
51
73
  /**
52
- * Menu de seleção interativo usando setas do teclado.
53
- * @param options Objeto no formato { "valor_retornado": "Label Exibida" }
74
+ * IMPORTANT: o `color` aqui (quando custom level) agora pinta o BADGE também.
54
75
  */
76
+ private static formatLog;
55
77
  static selection<T = string>(question: string, options: Record<string, T>): Promise<string>;
56
78
  static error(...args: any[]): void;
57
79
  static warn(...args: any[]): void;
@@ -72,4 +94,5 @@ export default class Console {
72
94
  private static registerDynamicLine;
73
95
  private static updateDynamicLine;
74
96
  private static endDynamicLine;
97
+ private static editLine;
75
98
  }