vatts 2.1.0-canary.8 → 2.1.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.
@@ -172,7 +172,7 @@ class Console {
172
172
  case Levels.WARN:
173
173
  return { icon: "▲", badgeFg: C.yellow.fg, badgeBg: C.yellow.bg, msgFg: Colors.FgAlmostWhite };
174
174
  case Levels.INFO:
175
- return { icon: "", badgeFg: C.cyan.fg, badgeBg: C.cyan.bg, msgFg: Colors.FgAlmostWhite };
175
+ return { icon: "", badgeFg: C.cyan.fg, badgeBg: C.cyan.bg, msgFg: Colors.FgAlmostWhite };
176
176
  case Levels.SUCCESS:
177
177
  return { icon: "✓", badgeFg: C.green.fg, badgeBg: C.green.bg, msgFg: Colors.FgAlmostWhite };
178
178
  case Levels.DEBUG:
package/dist/bin/vatts.js CHANGED
@@ -218,7 +218,7 @@ program
218
218
  const cmd = bright + Colors.FgCyan;
219
219
  const reset = Colors.Reset;
220
220
  const line = `${dim}${"━".repeat(70)}${reset}`;
221
- Console.logCustomLevel("", false, undefined, `${err}✖ No valid production build found!${reset}`, `${label}It looks like there is no build output to run in production.${reset}`, " ", `${label}Build the application first:${reset}`, ` ${cmd}vatts build${reset}`, " ", `${label}Or build and start in one command:${reset}`, ` ${cmd}vatts start --build${reset}`);
221
+ Console.logCustomLevel("", false, undefined, `${err}✖ No valid production build found!${reset}`, `${label}It looks like there is no build output to run in production.${reset}`, " ", `${label}Build the application first:${reset}`, ` ${cmd}vatts build${reset}`, " ", `${label}Or build and start in one command:${reset}`, ` ${cmd}vatts start --build${reset}`);
222
222
  process.exitCode = 0;
223
223
  return;
224
224
  }
Binary file
Binary file
Binary file
package/dist/index.js CHANGED
@@ -351,7 +351,6 @@ function vatts(options) {
351
351
  };
352
352
  const updateBuilderOptions = () => {
353
353
  const newFrontendRoutes = (0, router_1.loadRoutes)(userWebRoutesDir);
354
- console.log(newFrontendRoutes);
355
354
  const newLayout = (0, router_1.loadLayout)(userWebDir);
356
355
  const newNotFound = (0, router_1.loadNotFound)(userWebDir);
357
356
  const oldKey = frontendRoutes.map(r => `${r.pattern ?? ''}:${r.componentPath}`).join('|');
@@ -203,27 +203,32 @@ function App({ componentMap, routes, initialComponentPath, initialParams, layout
203
203
  const NotFoundComponent = window.__VATTS_NOT_FOUND__;
204
204
  if (NotFoundComponent) {
205
205
  const NotFoundContent = react_1.default.createElement(NotFoundComponent, null);
206
- resolvedContent = layoutComponent
206
+ const hasLayout = typeof layoutComponent === "function";
207
+ resolvedContent = hasLayout
207
208
  ? react_1.default.createElement(layoutComponent, { children: NotFoundContent })
208
209
  : NotFoundContent;
209
210
  }
210
211
  else {
211
212
  const DefaultNotFound = window.__VATTS_DEFAULT_NOT_FOUND__;
212
213
  const NotFoundContent = react_1.default.createElement(DefaultNotFound, null);
213
- resolvedContent = layoutComponent
214
+ const hasLayout = typeof layoutComponent === "function";
215
+ resolvedContent = hasLayout
214
216
  ? react_1.default.createElement(layoutComponent, { children: NotFoundContent })
215
217
  : NotFoundContent;
216
218
  }
217
219
  }
218
220
  else {
219
221
  const PageContent = react_1.default.createElement(CurrentPageComponent, { key: `page-${hmrTimestamp}`, params: params });
220
- resolvedContent = layoutComponent
222
+ const hasLayout = typeof layoutComponent === "function";
223
+ resolvedContent = hasLayout
221
224
  ? react_1.default.createElement(layoutComponent, { children: PageContent })
222
225
  : react_1.default.createElement("div", null, PageContent);
223
226
  }
227
+ console.log("__VATTS_LAYOUT__", layoutComponent, typeof layoutComponent);
228
+ console.log("NODE_ENV", process.env.NODE_ENV);
224
229
  return (react_1.default.createElement(react_1.default.Fragment, null,
225
230
  resolvedContent,
226
- process.env.NODE_ENV !== 'production' && (react_1.default.createElement(DevIndicator_1.default, { hasBuildError: !!buildError, onClickBuildError: () => setIsErrorOpen(true) })),
231
+ process.env.NODE_ENV !== 'production' ? (react_1.default.createElement(DevIndicator_1.default, { hasBuildError: !!buildError, onClickBuildError: () => setIsErrorOpen(true) })) : null,
227
232
  react_1.default.createElement(ErrorModal_1.ErrorModal, { error: buildError, isOpen: isErrorOpen, onClose: () => setIsErrorOpen(false), onCopy: copyBuildError })));
228
233
  }
229
234
  // --- Inicialização do Cliente (CSR - Client-Side Rendering) ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vatts",
3
- "version": "2.1.0-canary.8",
3
+ "version": "2.1.0",
4
4
  "description": "Vatts.js 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
  "types": "dist/index.d.ts",
6
6
  "author": "mfraz",